Sha256: 4af0b53a2a9ec7a9b6785d4d91dfaff5eaccac75419721cfcfeca9afed5fdc9a
Contents?: true
Size: 1.48 KB
Versions: 21
Compression:
Stored size: 1.48 KB
Contents
module Fog module Brightbox class Compute class Real # Requests a snapshot of the database server to be made for restoring back to when it was made. The identifier of the new snapshot is returned by the response in a Link header # # @param [String] identifier Unique reference to identify the resource # @param [Hash] options # @option options [Boolean] :return_link Return the Link header as a second return value # @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded. # # @return [Hash] if successful Hash version of JSON object # # @see https://api.gb1.brightbox.com/1.0/#database_server_snapshot_database_server # def snapshot_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" method = "POST" path = "/1.0/database_servers/#{identifier}/snapshot" expected = [202] if options[:return_link] request_parameters = { :method => method, :path => path, :expects => expected } response = request(request_parameters) data = Fog::JSON.decode(response.body) image_id = Fog::Brightbox::LinkHelper.new(response.headers["Link"]).identifier return data, image_id else wrapped_request(method, path, expected) end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems