Sha256: b04c6b61abc71a8a2e21e27914dce4724f4e6a60f53076ec1dbc7d5bea7e25e7

Contents?: true

Size: 1.01 KB

Versions: 53

Compression:

Stored size: 1.01 KB

Contents

class Ey::Core::Client
  class Real
    def destroy_database_server(params={})
      id  = params["id"]
      url = params.delete("url")

      request(
        :path   => "/database_servers/#{id}",
        :url    => url,
        :method => :delete,
      )
    end
  end

  class Mock
    def destroy_database_server(params={})
      extract_url_params!(params)
      request_id = self.uuid

      database_server_id = params["id"] || params["database_server"]

      database_server = self.find(:database_servers, database_server_id)

      request = {
        "resource"    => [:database_servers, database_server_id, database_server.merge("deleted_at" => Time.now)],
        "type"        => "deprovision_database_server",
        "started_at"  => Time.now,
        "finished_at" => nil,
        "successful"  => "true",
        "id"          => request_id,
      }

      self.data[:requests][request_id] = request

      response(
        :body   => {"request" => {id: request_id}},
        :status => 201,
      )
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

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