diff --git a/lib/aptible/api/service.rb b/lib/aptible/api/service.rb index e418527..4162097 100644 --- a/lib/aptible/api/service.rb +++ b/lib/aptible/api/service.rb @@ -22,6 +22,21 @@ class Service < Resource field :instance_class field :created_at, type: Time field :updated_at, type: Time + + def create_policy!(params) + params = { token: token }.merge(params) + + # First create a link object so we know where to go + link = HyperResource::Link.new( + self, + 'href' => "#{self.href}/service_sizing_policies" + ) + + # Now create the policy + link.create( + self.class.normalize_params(params) + ) + end end end end