Sha256: fd333bf8a7aa713969bbff88427f3609df47341321111b0381a286fe236c582c

Contents?: true

Size: 963 Bytes

Versions: 7

Compression:

Stored size: 963 Bytes

Contents

module Fog
  module Identity
    class OpenStack
      class Real
        def create_tenant(attributes)
          request(
            :expects => [200],
            :method  => 'POST',
            :path    => "tenants",
            :body    => {
              'tenant' => attributes
            }.to_json
          )
        end # def create_tenant
      end # class Real

      class Mock
        def create_tenant(attributes)
          response = Excon::Response.new
          response.status = [200, 204][rand(1)]
          response.body = {
            'tenant' => {
              'id' => "df9a815161eba9b76cc748fd5c5af73e",
              'description' => attributes['description'] || 'normal tenant',
              'enabled' => true,
              'name' => attributes['name'] || 'default'
            }
          }
          response
        end # def create_tenant
      end # class Mock
    end # class OpenStack
  end # module Identity
end # module Fog

Version data entries

7 entries across 7 versions & 5 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/openstack/requests/identity/create_tenant.rb
fog-nirvanix-1.8.1 lib/fog/openstack/requests/identity/create_tenant.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/openstack/requests/identity/create_tenant.rb
fog-sgonyea-1.8.1 lib/fog/openstack/requests/identity/create_tenant.rb
fog-1.8.0 lib/fog/openstack/requests/identity/create_tenant.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/openstack/requests/identity/create_tenant.rb
fog-1.7.0 lib/fog/openstack/requests/identity/create_tenant.rb