Sha256: 42785f2fa955c6b4267fde58fcfac4aad9fc3dad1516b3efb346bfecbe5c59eb

Contents?: true

Size: 808 Bytes

Versions: 14

Compression:

Stored size: 808 Bytes

Contents

require 'fog/openstack/models/collection'
require 'fog/compute/openstack/models/server_group'

module Fog
  module Compute
    class OpenStack
      class ServerGroups < Fog::OpenStack::Collection
        model Fog::Compute::OpenStack::ServerGroup

        def all(options = {})
          load_response(service.list_server_groups(options), 'server_groups')
        end

        def get(server_group_id)
          if server_group_id
            new(service.get_server_group(server_group_id).body['server_group'])
          end
        rescue Fog::Compute::OpenStack::NotFound
          nil
        end

        def create(*args)
          new(service.create_server_group(*args).body['server_group'])
        end
      end # class ServerGroups
    end # class OpenStack
  end # module Compute
end # module Fog

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-openstack-0.1.25 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.24 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.23 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.22 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.21 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.20 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.19 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.18 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.17 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.15 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.14 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.13 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.12 lib/fog/compute/openstack/models/server_groups.rb
fog-openstack-0.1.11 lib/fog/compute/openstack/models/server_groups.rb