Method: LinodeOpenapiClient::DatabasesApi#delete_databases_mysql_instance_with_http_info

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

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

Delete a managed MySQL database __This operation is currently only available for customers who already have an active Managed Database.__ Remove a Managed MySQL 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 mysql-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



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/linode_openapi_client/api/databases_api.rb', line 199

def delete_databases_mysql_instance_with_http_info(api_version, instance_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DatabasesApi.delete_databases_mysql_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_mysql_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_mysql_instance"
  end
  # resource path
  local_var_path = '/{apiVersion}/databases/mysql/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_mysql_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_mysql_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end