Sha256: edd903e60fd1289bbfcde9347410002a170bd3cbf04dd97541f2916ad4ca8464

Contents?: true

Size: 860 Bytes

Versions: 20

Compression:

Stored size: 860 Bytes

Contents

module Fog
  module OpenStack
    class Compute
      class Real
        def create_server_group(name, policy)
          Fog::OpenStack::Compute::ServerGroup.validate_server_group_policy policy

          body = {'server_group' => {
            'name'     => name,
            'policies' => [policy]
          }}
          request(
            :body    => Fog::JSON.encode(body),
            :expects => 200,
            :method  => 'POST',
            :path    => 'os-server-groups'
          )
        end
      end

      class Mock
        def create_server_group(name, policy)
          Fog::OpenStack::Compute::ServerGroup.validate_server_group_policy policy
          id = SecureRandom.uuid
          data[:server_groups][id] = {:name => name, :policies => [policy], :members => []}
          get_server_group id
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
fog-openstack-1.1.3 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.1.2 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-fork-99 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.1.0 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.1.0.pre lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.11 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.10 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.9 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.8 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.7 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.6 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.5 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.4 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.3 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.2 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.1 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-1.0.0 lib/fog/openstack/compute/requests/create_server_group.rb
fog-openstack-0.3.1 lib/fog/openstack/compute/requests/create_server_group.rb