Sha256: 6de783a03bd0abc2a96a62f0d185b665689dfe2b13766d2b4a512883e1bf888a

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

require 'rackspace-fog/core/collection'
require 'rackspace-fog/brightbox/models/compute/server_group'

module Fog
  module Compute
    class Brightbox

      class ServerGroups < Fog::Collection

        model Fog::Compute::Brightbox::ServerGroup

        def all
          data = connection.list_server_groups
          load(data)
        end

        def get(identifier)
          return nil if identifier.nil? || identifier == ""
          data = connection.get_server_group(identifier)
          new(data)
        rescue Excon::Errors::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rackspace-fog-1.4.2 lib/rackspace-fog/brightbox/models/compute/server_groups.rb