Method: LinodeOpenapiClient::DatabasesApi#delete_databases_postgre_sql_instance_with_http_info

Defined in:
lib/linode_openapi_client/api/databases_api.rb

#delete_databases_postgre_sql_instance_with_http_info(api_version, instance_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete a managed PostgreSQL database __This operation is currently only available for customers who already have an active Managed Database.__ Remove a Managed PostgreSQL Database from your Account. Requires &#x60;read_write&#x60; access to the Database. The Database must have an &#x60;active&#x60;, &#x60;failed&#x60;, or &#x60;degraded&#x60; status to perform this operation. Only unrestricted Users can access this operation, and have access regardless of the acting token&#39;s OAuth scopes. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli databases postgresql-delete 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; databases:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • instance_id (Integer)

    The ID of the Managed PostgreSQL Database.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/linode_openapi_client/api/databases_api.rb', line 273

def delete_databases_postgre_sql_instance_with_http_info(api_version, instance_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DatabasesApi.delete_databases_postgre_sql_instance ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling DatabasesApi.delete_databases_postgre_sql_instance"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'instance_id' is set
  if @api_client.config.client_side_validation && instance_id.nil?
    fail ArgumentError, "Missing the required parameter 'instance_id' when calling DatabasesApi.delete_databases_postgre_sql_instance"
  end
  # resource path
  local_var_path = '/{apiVersion}/databases/postgresql/instances/{instanceId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'instanceId' + '}', CGI.escape(instance_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"DatabasesApi.delete_databases_postgre_sql_instance",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DatabasesApi#delete_databases_postgre_sql_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end