Sha256: 2e252e4925616977caa73e9ec4a1b07848577ba7dce1efbbd5f18a43c95afa00

Contents?: true

Size: 1.65 KB

Versions: 39

Compression:

Stored size: 1.65 KB

Contents

require 'fog/core/collection'
require 'fog/rackspace/models/auto_scale/group'

module Fog
  module Rackspace
    class AutoScale
      class Groups < Fog::Collection
        model Fog::Rackspace::AutoScale::Group

        # Returns list of autoscale groups
        #
        # @return [Fog::Rackspace::AutoScale::Groups] Retrieves a list groups.
        #
        # @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
        # @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
        # @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
        # @raise [Fog::Rackspace::AutoScale:::ServiceError]
        #
        # @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroups_v1.0__tenantId__groups_Groups.html
        def all
          data = service.list_groups.body['groups']
          load(data)
        end

        # Returns an individual autoscale group
        #
        # @return [Fog::Rackspace::AutoScale::Group] Retrieves a list groups.
        # @return nil if not found
        #
        # @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
        # @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
        # @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
        # @raise [Fog::Rackspace::AutoScale:::ServiceError]
        #
        # @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroupManifest_v1.0__tenantId__groups__groupId__Groups.html
        def get(group_id)
          data = service.get_group(group_id).body['group']
          new(data)
        rescue Fog::Rackspace::AutoScale::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

39 entries across 37 versions & 6 rubygems

Version Path
fog-rackspace-0.1.6 lib/fog/rackspace/models/auto_scale/groups.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/auto_scale/groups.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/auto_scale/groups.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/auto_scale/groups.rb
fog-rackspace-0.1.5 lib/fog/rackspace/models/auto_scale/groups.rb
fog-rackspace-0.1.4 lib/fog/rackspace/models/auto_scale/groups.rb
fog-rackspace-0.1.3 lib/fog/rackspace/models/auto_scale/groups.rb
fog-rackspace-0.1.2 lib/fog/rackspace/models/auto_scale/groups.rb
fog-rackspace-0.1.1 lib/fog/rackspace/models/auto_scale/groups.rb
fog-rackspace-0.1.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.37.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.36.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.35.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-2.0.0.pre.0 lib/fog/rackspace/models/auto_scale/groups.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.34.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.33.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.32.0 lib/fog/rackspace/models/auto_scale/groups.rb
fog-1.31.0 lib/fog/rackspace/models/auto_scale/groups.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/rackspace/models/auto_scale/groups.rb