Sha256: 7cb05a0b0cba3da21d6e6660d6e8ee967bac400ab41edac862721de15a184999

Contents?: true

Size: 952 Bytes

Versions: 12

Compression:

Stored size: 952 Bytes

Contents

require 'fog/aws/models/auto_scaling/policy'

module Fog
  module AWS
    class AutoScaling
      class Policies < Fog::Collection
        model Fog::AWS::AutoScaling::Policy

        # Creates a new scaling policy.
        def initialize(attributes={})
          super
        end

        def all
          data = []
          next_token = nil
          loop do
            result = connection.describe_policies('NextToken' => next_token).body['DescribePoliciesResult']
            data += result['ScalingPolicies']
            next_token = result['NextToken']
            break if next_token.nil?
          end
          load(data)
        end

        def get(identity, auto_scaling_group = nil)
          data = connection.describe_policies('PolicyNames' => identity, 'AutoScalingGroupName' => auto_scaling_group).body['DescribePoliciesResult']['ScalingPolicies'].first
          new(data) unless data.nil?
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/aws/models/auto_scaling/policies.rb
fog-nirvanix-1.8.1 lib/fog/aws/models/auto_scaling/policies.rb
fog-parser-fix-1.6.1 lib/fog/aws/models/auto_scaling/policies.rb
fog-test-again-1.6.0 lib/fog/aws/models/auto_scaling/policies.rb
fog-parser-fix-1.6.0 lib/fog/aws/models/auto_scaling/policies.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/aws/models/auto_scaling/policies.rb
fog-sgonyea-1.8.1 lib/fog/aws/models/auto_scaling/policies.rb
fog-1.8.0 lib/fog/aws/models/auto_scaling/policies.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/models/auto_scaling/policies.rb
fog-1.7.0 lib/fog/aws/models/auto_scaling/policies.rb
fog-1.6.0 lib/fog/aws/models/auto_scaling/policies.rb
fog-1.5.0 lib/fog/aws/models/auto_scaling/policies.rb