Sha256: 6749880f9e83e338b68d8f33c8bbab9640220a182f24c77d182636f8c066ae8d

Contents?: true

Size: 1.33 KB

Versions: 39

Compression:

Stored size: 1.33 KB

Contents

class Ey::Core::Client
  class Real
    def destroy_database_server_snapshot(params={})
      (url = params["url"]) || (id = params.fetch("id"))

      request(
        :method => :delete,
        :url    => url,
        :path   => "/database-server-snapshots/#{id}",
      )
    end
  end # Real

  class Mock
    def destroy_database_server_snapshot(params={})
      request_id = self.uuid
      url        = params.delete("url")

      database_server_snapshot_id = resource_identity(url) || params.fetch("id")

      database_server_snapshot = self.data[:database_server_snapshots][database_server_snapshot_id].dup
      database_server_snapshot["deleted_at"] = Time.now
      database_server_snapshot["resource_url"] = url_for("/database_server_snapshots/#{database_server_snapshot_id}")

      # @todo use a procedure to deprovision clusters as well

      self.data[:requests][request_id] = {
        "id"          => request_id,
        "finished_at" => nil,
        "successful"  => "true",
        "started_at"  => Time.now,
        "resource"    => [:database_server_snapshots, database_server_snapshot_id, database_server_snapshot],
        "type"        => "deprovision_database_server_snapshot",
      }

      response(
        :body   => {"request" => {id: request_id}},
        :status => 201,
      )
    end
  end # Mock
end # Ey::Core::Client

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
ey-core-3.2.0 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.11 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.10 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.9 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.8 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.7 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.6 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.5 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.4 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.3 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.2 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.1 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.1.0 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.0.5 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.0.4 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.0.3 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.0.2 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.0.1 lib/ey-core/requests/destroy_database_server_snapshot.rb
ey-core-3.0.0 lib/ey-core/requests/destroy_database_server_snapshot.rb