Sha256: e852a08a40d470667c1dedaff3cc24aae818fa5351fc4b5dcbe1033ec50ed7fe
Contents?: true
Size: 986 Bytes
Versions: 38
Compression:
Stored size: 986 Bytes
Contents
module Fog module Rackspace class AutoScale class Real def create_policy(group_id, options) data = [options] request( :method => 'POST', :body => Fog::JSON.encode(data), :path => "groups/#{group_id}/policies", :expects => 201 ) end end class Mock def create_policy(group_id, options) group = self.data[:autoscale_groups][group_id] if group.nil? raise Fog::Rackspace::AutoScale::NotFound end policy = { "id" => Fog::Rackspace::MockData.uuid, "name" => "set group to 5 servers", "desiredCapacity" => 5, "cooldown" => 1800, "type" => "webhook" } group['scalingPolicies'] << policy body = [policy] response(:body => body) end end end end end
Version data entries
38 entries across 38 versions & 2 rubygems