Method: LinodeOpenapiClient::DatabasesApi#get_databases_mysql_instance_backups_with_http_info

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

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

List managed MySQL database backups __This operation is currently only available for customers who already have an active Managed Database.__ Display all backups for an accessible Managed MySQL Database. The Database must not be provisioning to perform this operation. Database &#x60;auto&#x60; type backups are created every 24 hours at 0:00 UTC. Each &#x60;auto&#x60; backup is retained for 7 days. Database &#x60;snapshot&#x60; type backups are created by accessing the [Create a managed MySQL database backup snapshot](techdocs.akamai.com/linode-api/reference/post-databases-mysql-instance-backup) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli databases mysql-backups-list 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

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/linode_openapi_client/api/databases_api.rb', line 769

def get_databases_mysql_instance_backups_with_http_info(api_version, instance_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DatabasesApi.get_databases_mysql_instance_backups ...'
  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.get_databases_mysql_instance_backups"
  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.get_databases_mysql_instance_backups"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DatabasesApi.get_databases_mysql_instance_backups, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DatabasesApi.get_databases_mysql_instance_backups, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DatabasesApi.get_databases_mysql_instance_backups, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/databases/mysql/instances/{instanceId}/backups'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'instanceId' + '}', CGI.escape(instance_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # 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] || 'GetDatabasesMysqlInstanceBackups200Response'

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

  new_options = opts.merge(
    :operation => :"DatabasesApi.get_databases_mysql_instance_backups",
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DatabasesApi#get_databases_mysql_instance_backups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end