Sha256: 2f3ee2f8d59f134df568c96d9eb1028cdc19b6e24de7c3f2011a15c71626f690

Contents?: true

Size: 974 Bytes

Versions: 54

Compression:

Stored size: 974 Bytes

Contents

class Ey::Core::Client
  class Real
    def create_untracked_server(params={})
      request(
        :body   => params,
        :method => :post,
        :path   => "/untracked-servers",
        :url    => params.delete("url"),
      )
    end
  end # Real

  class Mock
    def create_untracked_server(params={})
      resource_id = self.serial_id
      url         = params["url"]

      provider_id ||= params["provider"] || (url && path_params(url)["providers"])

      find(:providers, provider_id)

      resource = params["untracked_server"].dup

      require_parameters(resource, "location", "provisioned_id", "provisioner_id")

      resource.merge!(
        "provider" => url_for("/providers/#{provider_id}"),
        "id"       => resource_id,
      )

      self.data[:untracked_servers][resource_id] = resource

      response(
        :body   => { "untracked_server" => resource },
        :status => 201,
      )
    end
  end # Mock
end # Ey::Core::Client

Version data entries

54 entries across 54 versions & 3 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.6.4 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.6.3 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.6.1 lib/ey-core/requests/create_untracked_server.rb
groove-ey-core-3.6.3 lib/ey-core/requests/create_untracked_server.rb
groove-ey-core-3.6.2 lib/ey-core/requests/create_untracked_server.rb
groove-ey-core-3.6.1 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.5.0 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.4.4 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.4.2 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.4.1 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.4.0 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.3.1 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.3.0 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.2.6 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.2.5 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.2.4 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.2.3 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.2.2 lib/ey-core/requests/create_untracked_server.rb
ey-core-3.2.1 lib/ey-core/requests/create_untracked_server.rb