Sha256: b2d08f6738ef8fe52d464a02f3def381c0ae1c9654b5aab510a5f234e1d7a40f

Contents?: true

Size: 696 Bytes

Versions: 11

Compression:

Stored size: 696 Bytes

Contents

require 'fog/openstack/models/model'

module Fog
  module Compute
    class OpenStack
      class ServerGroup < Fog::OpenStack::Model
        identity  :id
        attribute :name
        attribute :policies, :type => :array
        attribute :members

        VALID_SERVER_GROUP_POLICIES = ['affinity', 'anti-affinity'].freeze

        def self.validate_server_group_policy(policy)
          raise ArgumentError, "#{policy} is an invalid policy... must use one of #{VALID_SERVER_GROUP_POLICIES.join(', ')}" \
            unless VALID_SERVER_GROUP_POLICIES.include? policy
          true
        end
      end # class ServerGroup
    end # class OpenStack
  end # module Compute
end # module Fog

Version data entries

11 entries across 11 versions & 1 rubygems

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