Class: OCI::DatabaseManagement::ManagedMySqlDatabasesClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/managed_my_sql_databases_client.rb

Overview

Use the Database Management API to perform tasks such as obtaining performance and resource usage metrics for a fleet of Managed Databases or a specific Managed Database, creating Managed Database Groups, and running a SQL job on a Managed Database or Managed Database Group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ManagedMySqlDatabasesClient

Creates a new ManagedMySqlDatabasesClient. Notes: If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 57

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config = OCI::Config.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20201101'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "ManagedMySqlDatabasesClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



17
18
19
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 17

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


21
22
23
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 21

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


31
32
33
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 31

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



27
28
29
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 27

def retry_config
  @retry_config
end

Instance Method Details

#get_managed_my_sql_database(managed_my_sql_database_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_managed_my_sql_database API.

Retrieves the general information for a specific MySQL Database.

Parameters:

  • managed_my_sql_database_id (String)

    The OCID of the Managed MySQL Database.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 114

def get_managed_my_sql_database(managed_my_sql_database_id, opts = {})
  logger.debug 'Calling operation ManagedMySqlDatabasesClient#get_managed_my_sql_database.' if logger

  raise "Missing the required parameter 'managed_my_sql_database_id' when calling get_managed_my_sql_database." if managed_my_sql_database_id.nil?
  raise "Parameter value for 'managed_my_sql_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_my_sql_database_id)

  path = '/managedMySqlDatabases/{managedMySqlDatabaseId}'.sub('{managedMySqlDatabaseId}', managed_my_sql_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ManagedMySqlDatabasesClient#get_managed_my_sql_database') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::ManagedMySqlDatabase'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_my_sql_fleet_metric(compartment_id, start_time, end_time, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_my_sql_fleet_metric API.

Gets the health metrics for a fleet of MySQL Databases in a compartment.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

  • start_time (String)

    The start time of the time range to retrieve the health metrics of a Managed Database in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'".

  • end_time (String)

    The end time of the time range to retrieve the health metrics of a Managed Database in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'".

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :filter_by_metric_names (String)

    The filter used to retrieve a specific set of metrics by passing the desired metric names with a comma separator. Note that, by default, the service returns all supported metrics.

  • :filter_by_my_sql_deployment_type_param (String)

    The parameter to filter by MySQL deployment type.

  • :filter_by_mds_deployment_type (String)

    The parameter to filter by MySQL Database System type.

  • :filter_by_my_sql_status (String)

    The parameter to filter by MySQL Database status.

  • :filter_by_my_sql_database_version (String)

    The parameter to filter by MySQL database version.

Returns:



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 180

def get_my_sql_fleet_metric(compartment_id, start_time, end_time, opts = {})
  logger.debug 'Calling operation ManagedMySqlDatabasesClient#get_my_sql_fleet_metric.' if logger

  raise "Missing the required parameter 'compartment_id' when calling get_my_sql_fleet_metric." if compartment_id.nil?
  raise "Missing the required parameter 'start_time' when calling get_my_sql_fleet_metric." if start_time.nil?
  raise "Missing the required parameter 'end_time' when calling get_my_sql_fleet_metric." if end_time.nil?

  if opts[:filter_by_my_sql_deployment_type_param] && !OCI::DatabaseManagement::Models::MY_SQL_DEPLOYMENT_TYPE_ENUM.include?(opts[:filter_by_my_sql_deployment_type_param])
    raise 'Invalid value for "filter_by_my_sql_deployment_type_param", must be one of the values in OCI::DatabaseManagement::Models::MY_SQL_DEPLOYMENT_TYPE_ENUM.'
  end

  if opts[:filter_by_mds_deployment_type] && !OCI::DatabaseManagement::Models::MDS_TYPE_ENUM.include?(opts[:filter_by_mds_deployment_type])
    raise 'Invalid value for "filter_by_mds_deployment_type", must be one of the values in OCI::DatabaseManagement::Models::MDS_TYPE_ENUM.'
  end

  if opts[:filter_by_my_sql_status] && !OCI::DatabaseManagement::Models::DATABASE_STATUS_ENUM.include?(opts[:filter_by_my_sql_status])
    raise 'Invalid value for "filter_by_my_sql_status", must be one of the values in OCI::DatabaseManagement::Models::DATABASE_STATUS_ENUM.'
  end

  path = '/mysqlFleetMetrics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:startTime] = start_time
  query_params[:endTime] = end_time
  query_params[:filterByMetricNames] = opts[:filter_by_metric_names] if opts[:filter_by_metric_names]
  query_params[:filterByMySqlDeploymentTypeParam] = opts[:filter_by_my_sql_deployment_type_param] if opts[:filter_by_my_sql_deployment_type_param]
  query_params[:filterByMdsDeploymentType] = opts[:filter_by_mds_deployment_type] if opts[:filter_by_mds_deployment_type]
  query_params[:filterByMySqlStatus] = opts[:filter_by_my_sql_status] if opts[:filter_by_my_sql_status]
  query_params[:filterByMySqlDatabaseVersion] = opts[:filter_by_my_sql_database_version] if opts[:filter_by_my_sql_database_version]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ManagedMySqlDatabasesClient#get_my_sql_fleet_metric') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::MySqlFleetMetrics'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_managed_my_sql_database_configuration_data(managed_my_sql_database_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_managed_my_sql_database_configuration_data API.

Retrieves configuration data for a specific MySQL database.

Parameters:

  • managed_my_sql_database_id (String)

    The OCID of the Managed MySQL Database.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :limit (Integer)

    The maximum number of records returned in the paginated response. (default to 10)

  • :page (String)

    The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The option to sort information in ascending (u2018ASCu2019) or descending (u2018DESCu2019) order. Descending order is the default order. (default to DESC)

  • :sort_by (String)

    The field to sort information by. Only one sortOrder can be used. The default sort order for u2018TIMECREATEDu2019 is descending and the default sort order for u2018NAMEu2019 is ascending. The u2018NAMEu2019 sort order is case-sensitive. (default to TIMECREATED) Allowed values are: TIMECREATED, NAME

Returns:



266
267
268
269
270
271
272
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
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 266

def list_managed_my_sql_database_configuration_data(managed_my_sql_database_id, opts = {})
  logger.debug 'Calling operation ManagedMySqlDatabasesClient#list_managed_my_sql_database_configuration_data.' if logger

  raise "Missing the required parameter 'managed_my_sql_database_id' when calling list_managed_my_sql_database_configuration_data." if managed_my_sql_database_id.nil?

  if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[TIMECREATED NAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.'
  end
  raise "Parameter value for 'managed_my_sql_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_my_sql_database_id)

  path = '/managedMySqlDatabases/{managedMySqlDatabaseId}/configurationData'.sub('{managedMySqlDatabaseId}', managed_my_sql_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ManagedMySqlDatabasesClient#list_managed_my_sql_database_configuration_data') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::MySqlConfigurationDataCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_managed_my_sql_database_sql_data(managed_my_sql_database_id, start_time, end_time, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_managed_my_sql_database_sql_data API.

Retrieves the SQL performance data for a specific MySQL database.

Parameters:

  • managed_my_sql_database_id (String)

    The OCID of the Managed MySQL Database.

  • start_time (String)

    The start time of the time range to retrieve the health metrics of a Managed Database in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'".

  • end_time (String)

    The end time of the time range to retrieve the health metrics of a Managed Database in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'".

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :filter_column (String)

    The parameter to filter results by key criteria which include : - SUM_TIMER_WAIT - COUNT_STAR - SUM_ERRORS - SUM_ROWS_AFFECTED - SUM_ROWS_SENT - SUM_ROWS_EXAMINED - SUM_CREATED_TMP_TABLES - SUM_NO_INDEX_USED - SUM_NO_GOOD_INDEX_USED - FIRST_SEEN - LAST_SEEN

  • :opc_request_id (String)

    The client request ID for tracing.

  • :limit (Integer)

    The maximum number of records returned in the paginated response. (default to 10)

  • :page (String)

    The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.

  • :sort_by (String)

    The field to sort information by. Only one sortOrder can be used. The default sort order for u2018TIMECREATEDu2019 is descending and the default sort order for u2018NAMEu2019 is ascending. The u2018NAMEu2019 sort order is case-sensitive. (default to TIMECREATED) Allowed values are: TIMECREATED, NAME

  • :sort_order (String)

    The option to sort information in ascending (u2018ASCu2019) or descending (u2018DESCu2019) order. Ascending order is the default order. (default to ASC)

Returns:



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 362

def list_managed_my_sql_database_sql_data(managed_my_sql_database_id, start_time, end_time, opts = {})
  logger.debug 'Calling operation ManagedMySqlDatabasesClient#list_managed_my_sql_database_sql_data.' if logger

  raise "Missing the required parameter 'managed_my_sql_database_id' when calling list_managed_my_sql_database_sql_data." if managed_my_sql_database_id.nil?
  raise "Missing the required parameter 'start_time' when calling list_managed_my_sql_database_sql_data." if start_time.nil?
  raise "Missing the required parameter 'end_time' when calling list_managed_my_sql_database_sql_data." if end_time.nil?

  if opts[:sort_by] && !%w[TIMECREATED NAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.'
  end

  if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.'
  end
  raise "Parameter value for 'managed_my_sql_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_my_sql_database_id)

  path = '/managedMySqlDatabases/{managedMySqlDatabaseId}/sqlData'.sub('{managedMySqlDatabaseId}', managed_my_sql_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:startTime] = start_time
  query_params[:endTime] = end_time
  query_params[:filterColumn] = opts[:filter_column] if opts[:filter_column]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ManagedMySqlDatabasesClient#list_managed_my_sql_database_sql_data') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::MySqlDataCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_managed_my_sql_databases(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_managed_my_sql_databases API.

Gets the list of Managed MySQL Databases in a specific compartment.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

    The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.

  • :limit (Integer)

    The maximum number of records returned in the paginated response. (default to 10)

  • :sort_by (String)

    The field to sort information by. Only one sortOrder can be used. The default sort order for u2018TIMECREATEDu2019 is descending and the default sort order for u2018NAMEu2019 is ascending. The u2018NAMEu2019 sort order is case-sensitive. (default to TIMECREATED) Allowed values are: TIMECREATED, NAME

  • :sort_order (String)

    The option to sort information in ascending (u2018ASCu2019) or descending (u2018DESCu2019) order. Ascending order is the default order. (default to ASC)

Returns:



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 444

def list_managed_my_sql_databases(compartment_id, opts = {})
  logger.debug 'Calling operation ManagedMySqlDatabasesClient#list_managed_my_sql_databases.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_managed_my_sql_databases." if compartment_id.nil?

  if opts[:sort_by] && !%w[TIMECREATED NAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.'
  end

  if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.'
  end

  path = '/managedMySqlDatabases'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ManagedMySqlDatabasesClient#list_managed_my_sql_databases') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::ManagedMySqlDatabaseCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



96
97
98
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 96

def logger
  @api_client.config.logger
end

#summarize_managed_my_sql_database_availability_metrics(managed_my_sql_database_id, start_time, end_time, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use summarize_managed_my_sql_database_availability_metrics API.

Gets the availability metrics for the MySQL Database specified by managedMySqlDatabaseId.

Parameters:

  • managed_my_sql_database_id (String)

    The OCID of the Managed MySQL Database.

  • start_time (String)

    The start time of the time range to retrieve the health metrics of a Managed Database in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'".

  • end_time (String)

    The end time of the time range to retrieve the health metrics of a Managed Database in UTC in ISO-8601 format, which is "yyyy-MM-dd'T'hh:mm:ss.sss'Z'".

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

    The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.

  • :limit (Integer)

    The maximum number of records returned in the paginated response. (default to 10)

Returns:



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/oci/database_management/managed_my_sql_databases_client.rb', line 521

def summarize_managed_my_sql_database_availability_metrics(managed_my_sql_database_id, start_time, end_time, opts = {})
  logger.debug 'Calling operation ManagedMySqlDatabasesClient#summarize_managed_my_sql_database_availability_metrics.' if logger

  raise "Missing the required parameter 'managed_my_sql_database_id' when calling summarize_managed_my_sql_database_availability_metrics." if managed_my_sql_database_id.nil?
  raise "Missing the required parameter 'start_time' when calling summarize_managed_my_sql_database_availability_metrics." if start_time.nil?
  raise "Missing the required parameter 'end_time' when calling summarize_managed_my_sql_database_availability_metrics." if end_time.nil?
  raise "Parameter value for 'managed_my_sql_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_my_sql_database_id)

  path = '/managedMySqlDatabases/{managedMySqlDatabaseId}/availabilityMetrics'.sub('{managedMySqlDatabaseId}', managed_my_sql_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:startTime] = start_time
  query_params[:endTime] = end_time
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ManagedMySqlDatabasesClient#summarize_managed_my_sql_database_availability_metrics') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::MetricsAggregationRangeCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end