Class: OCI::DatabaseManagement::SqlTuningClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/sql_tuning_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) ⇒ SqlTuningClient

Creates a new SqlTuningClient. 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/sql_tuning_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 "SqlTuningClient 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/sql_tuning_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/sql_tuning_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/sql_tuning_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/sql_tuning_client.rb', line 27

def retry_config
  @retry_config
end

Instance Method Details

#clone_sql_tuning_task(managed_database_id, clone_sql_tuning_task_details, opts = {}) ⇒ Response

Note:

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

Clones and runs a SQL tuning task in the database.

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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



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
151
152
153
154
155
156
157
158
159
160
# File 'lib/oci/database_management/sql_tuning_client.rb', line 121

def clone_sql_tuning_task(managed_database_id, clone_sql_tuning_task_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#clone_sql_tuning_task.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/actions/cloneSqlTuningTask'.sub('{managedDatabaseId}', managed_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(clone_sql_tuning_task_details)

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

#create_sql_tuning_set(managed_database_id, create_sql_tuning_set_details, opts = {}) ⇒ Response

Note:

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

Creates an empty Sql tuning set within the Managed Database specified by managedDatabaseId.

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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



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
# File 'lib/oci/database_management/sql_tuning_client.rb', line 186

def create_sql_tuning_set(managed_database_id, create_sql_tuning_set_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#create_sql_tuning_set.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets'.sub('{managedDatabaseId}', managed_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_sql_tuning_set_details)

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

#drop_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sql_tuning_set_details, opts = {}) ⇒ Response

Note:

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

Drops the Sql tuning set specified by sqlTuningSet within the Managed Database specified by managedDatabaseId.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_set_id (Integer)

    The unique identifier of the Sql tuning set. This is not OCID.

  • drop_sql_tuning_set_details (OCI::DatabaseManagement::Models::DropSqlTuningSetDetails)

    The details required to drop a Sql tuning set.

  • 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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



252
253
254
255
256
257
258
259
260
261
262
263
264
265
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
# File 'lib/oci/database_management/sql_tuning_client.rb', line 252

def drop_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sql_tuning_set_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#drop_sql_tuning_set.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/dropSqlTuningSet'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(drop_sql_tuning_set_details)

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

#drop_sql_tuning_task(managed_database_id, drop_sql_tuning_task_details, opts = {}) ⇒ Response

Note:

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

Drops a SQL tuning task and its related results from the database.

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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/oci/database_management/sql_tuning_client.rb', line 319

def drop_sql_tuning_task(managed_database_id, drop_sql_tuning_task_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#drop_sql_tuning_task.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/actions/dropSqlTuningTask'.sub('{managedDatabaseId}', managed_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(drop_sql_tuning_task_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'SqlTuningClient#drop_sql_tuning_task') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#drop_sqls_in_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sqls_in_sql_tuning_set_details, opts = {}) ⇒ Response

Note:

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

Deletes the Sqls in the specified Sql tuning set that matches the filter criteria provided in the basicFilter. If basicFilter criteria is not provided, then entire Sqls in the Sql tuning set is deleted.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_set_id (Integer)

    The unique identifier of the Sql tuning set. This is not OCID.

  • drop_sqls_in_sql_tuning_set_details (OCI::DatabaseManagement::Models::DropSqlsInSqlTuningSetDetails)

    Drops the selected list of Sql statements from the current Sql tuning set.

  • 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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



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
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/oci/database_management/sql_tuning_client.rb', line 385

def drop_sqls_in_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sqls_in_sql_tuning_set_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#drop_sqls_in_sql_tuning_set.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/dropSqlsInSqlTuningSet'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(drop_sqls_in_sql_tuning_set_details)

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

#fetch_sql_tuning_set(managed_database_id, sql_tuning_set_id, fetch_sql_tuning_set_details, opts = {}) ⇒ Response

Note:

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

Fetch the details of Sql statements in the Sql tuning set specified by name, owner and optional filter parameters.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_set_id (Integer)

    The unique identifier of the Sql tuning set. This is not OCID.

  • fetch_sql_tuning_set_details (OCI::DatabaseManagement::Models::FetchSqlTuningSetDetails)

    The details required to fetch the Sql tuning set details.

  • 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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



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
493
494
# File 'lib/oci/database_management/sql_tuning_client.rb', line 453

def fetch_sql_tuning_set(managed_database_id, sql_tuning_set_id, fetch_sql_tuning_set_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#fetch_sql_tuning_set.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(fetch_sql_tuning_set_details)

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

#get_execution_plan_stats_comparision(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) ⇒ Response

Note:

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

Retrieves a comparison of the existing SQL execution plan and a new plan. A SQL tuning task may suggest a new execution plan for a SQL, and this API retrieves the comparison report of the statistics of the two plans.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (Integer)

    The SQL tuning task identifier. This is not the OCID.

  • sql_object_id (Integer)

    The SQL object ID for the SQL tuning task. This is not the OCID.

  • execution_id (Integer)

    The execution ID for an execution of a SQL tuning task. This is not the OCID.

  • 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:



519
520
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
# File 'lib/oci/database_management/sql_tuning_client.rb', line 519

def get_execution_plan_stats_comparision(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {})
  logger.debug 'Calling operation SqlTuningClient#get_execution_plan_stats_comparision.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling get_execution_plan_stats_comparision." if managed_database_id.nil?
  raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling get_execution_plan_stats_comparision." if sql_tuning_advisor_task_id.nil?
  raise "Missing the required parameter 'sql_object_id' when calling get_execution_plan_stats_comparision." if sql_object_id.nil?
  raise "Missing the required parameter 'execution_id' when calling get_execution_plan_stats_comparision." if execution_id.nil?
  raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)
  raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/executionPlanStatsComparision'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:sqlObjectId] = sql_object_id
  query_params[:executionId] = execution_id

  # 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: 'SqlTuningClient#get_execution_plan_stats_comparision') 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::ExecutionPlanStatsComparision'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_sql_execution_plan(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, attribute, opts = {}) ⇒ Response

Note:

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

Retrieves a SQL execution plan for the SQL being tuned.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (Integer)

    The SQL tuning task identifier. This is not the OCID.

  • sql_object_id (Integer)

    The SQL object ID for the SQL tuning task. This is not the OCID.

  • attribute (String)

    The attribute of the SQL execution plan. Allowed values are: ORIGINAL, ORIGINAL_WITH_ADJUSTED_COST, USING_SQL_PROFILE, USING_NEW_INDICES, USING_PARALLEL_EXECUTION

  • 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:



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/oci/database_management/sql_tuning_client.rb', line 584

def get_sql_execution_plan(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, attribute, opts = {})
  logger.debug 'Calling operation SqlTuningClient#get_sql_execution_plan.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling get_sql_execution_plan." if managed_database_id.nil?
  raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling get_sql_execution_plan." if sql_tuning_advisor_task_id.nil?
  raise "Missing the required parameter 'sql_object_id' when calling get_sql_execution_plan." if sql_object_id.nil?
  raise "Missing the required parameter 'attribute' when calling get_sql_execution_plan." if attribute.nil?
  unless %w[ORIGINAL ORIGINAL_WITH_ADJUSTED_COST USING_SQL_PROFILE USING_NEW_INDICES USING_PARALLEL_EXECUTION].include?(attribute)
    raise "Invalid value for 'attribute', must be one of ORIGINAL, ORIGINAL_WITH_ADJUSTED_COST, USING_SQL_PROFILE, USING_NEW_INDICES, USING_PARALLEL_EXECUTION."
  end
  raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)
  raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/sqlExecutionPlan'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:sqlObjectId] = sql_object_id
  query_params[:attribute] = attribute

  # 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: 'SqlTuningClient#get_sql_execution_plan') 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::SqlTuningAdvisorTaskSqlExecutionPlan'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_sql_tuning_advisor_task_summary_report(managed_database_id, sql_tuning_advisor_task_id, opts = {}) ⇒ Response

Note:

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

Gets the summary report for the specified SQL Tuning Advisor task.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (Integer)

    The SQL tuning task identifier. This is not the OCID.

  • 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

  • :search_period (String)

    How far back the API will search for begin and end exec id. Unused if neither exec ids nor time filter query params are supplied. This is applicable only for Auto SQL Tuning tasks. (default to ALL) Allowed values are: LAST_24HR, LAST_7DAY, LAST_31DAY, SINCE_LAST, ALL

  • :time_greater_than_or_equal_to (DateTime)

    The optional greater than or equal to query parameter to filter the timestamp. This is applicable only for Auto SQL Tuning tasks.

  • :time_less_than_or_equal_to (DateTime)

    The optional less than or equal to query parameter to filter the timestamp. This is applicable only for Auto SQL Tuning tasks.

  • :begin_exec_id_greater_than_or_equal_to (Integer)

    The optional greater than or equal to filter on the execution ID related to a specific SQL Tuning Advisor task. This is applicable only for Auto SQL Tuning tasks.

  • :end_exec_id_less_than_or_equal_to (Integer)

    The optional less than or equal to query parameter to filter on the execution ID related to a specific SQL Tuning Advisor task. This is applicable only for Auto SQL Tuning tasks.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
# File 'lib/oci/database_management/sql_tuning_client.rb', line 655

def get_sql_tuning_advisor_task_summary_report(managed_database_id, sql_tuning_advisor_task_id, opts = {})
  logger.debug 'Calling operation SqlTuningClient#get_sql_tuning_advisor_task_summary_report.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling get_sql_tuning_advisor_task_summary_report." if managed_database_id.nil?
  raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling get_sql_tuning_advisor_task_summary_report." if sql_tuning_advisor_task_id.nil?

  if opts[:search_period] && !%w[LAST_24HR LAST_7DAY LAST_31DAY SINCE_LAST ALL].include?(opts[:search_period])
    raise 'Invalid value for "search_period", must be one of LAST_24HR, LAST_7DAY, LAST_31DAY, SINCE_LAST, ALL.'
  end
  raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)
  raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/summaryReport'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:searchPeriod] = opts[:search_period] if opts[:search_period]
  query_params[:timeGreaterThanOrEqualTo] = opts[:time_greater_than_or_equal_to] if opts[:time_greater_than_or_equal_to]
  query_params[:timeLessThanOrEqualTo] = opts[:time_less_than_or_equal_to] if opts[:time_less_than_or_equal_to]
  query_params[:beginExecIdGreaterThanOrEqualTo] = opts[:begin_exec_id_greater_than_or_equal_to] if opts[:begin_exec_id_greater_than_or_equal_to]
  query_params[:endExecIdLessThanOrEqualTo] = opts[:end_exec_id_less_than_or_equal_to] if opts[:end_exec_id_less_than_or_equal_to]

  # 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: 'SqlTuningClient#get_sql_tuning_advisor_task_summary_report') 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::SqlTuningAdvisorTaskSummaryReport'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_sql_tuning_advisor_task_findings(managed_database_id, sql_tuning_advisor_task_id, opts = {}) ⇒ Response

Note:

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

Gets an array of the details of the findings that match specific filters.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (Integer)

    The SQL tuning task identifier. This is not the OCID.

  • 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

  • :begin_exec_id (Integer)

    The optional greater than or equal to filter on the execution ID related to a specific SQL Tuning Advisor task.

  • :end_exec_id (Integer)

    The optional less than or equal to query parameter to filter on the execution ID related to a specific SQL Tuning Advisor task.

  • :search_period (String)

    The search period during which the API will search for begin and end exec id, if not supplied. Unused if beginExecId and endExecId optional query params are both supplied. (default to ALL) Allowed values are: LAST_24HR, LAST_7DAY, LAST_31DAY, SINCE_LAST, ALL

  • :finding_filter (String)

    The filter used to display specific findings in the report. (default to none) Allowed values are: none, FINDINGS, NOFINDINGS, ERRORS, PROFILES, INDICES, STATS, RESTRUCTURE, ALTERNATIVE, AUTO_PROFILES, OTHER_PROFILES

  • :stats_hash_filter (String)

    The hash value of the object for the statistic finding search.

  • :index_hash_filter (String)

    The hash value of the index table name.

  • :sort_by (String)

    The possible sortBy values of an object's recommendations. (default to DBTIME_BENEFIT) Allowed values are: DBTIME_BENEFIT, PARSING_SCHEMA, SQL_ID, STATS, PROFILES, SQL_BENEFIT, DATE, INDICES, RESTRUCTURE, ALTERNATIVE, MISC, ERROR, TIMEOUTS

  • :sort_order (String)

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

  • :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)

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
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
# File 'lib/oci/database_management/sql_tuning_client.rb', line 739

def list_sql_tuning_advisor_task_findings(managed_database_id, sql_tuning_advisor_task_id, opts = {})
  logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_advisor_task_findings.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_advisor_task_findings." if managed_database_id.nil?
  raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling list_sql_tuning_advisor_task_findings." if sql_tuning_advisor_task_id.nil?

  if opts[:search_period] && !%w[LAST_24HR LAST_7DAY LAST_31DAY SINCE_LAST ALL].include?(opts[:search_period])
    raise 'Invalid value for "search_period", must be one of LAST_24HR, LAST_7DAY, LAST_31DAY, SINCE_LAST, ALL.'
  end

  if opts[:finding_filter] && !%w[none FINDINGS NOFINDINGS ERRORS PROFILES INDICES STATS RESTRUCTURE ALTERNATIVE AUTO_PROFILES OTHER_PROFILES].include?(opts[:finding_filter])
    raise 'Invalid value for "finding_filter", must be one of none, FINDINGS, NOFINDINGS, ERRORS, PROFILES, INDICES, STATS, RESTRUCTURE, ALTERNATIVE, AUTO_PROFILES, OTHER_PROFILES.'
  end

  if opts[:sort_by] && !%w[DBTIME_BENEFIT PARSING_SCHEMA SQL_ID STATS PROFILES SQL_BENEFIT DATE INDICES RESTRUCTURE ALTERNATIVE MISC ERROR TIMEOUTS].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of DBTIME_BENEFIT, PARSING_SCHEMA, SQL_ID, STATS, PROFILES, SQL_BENEFIT, DATE, INDICES, RESTRUCTURE, ALTERNATIVE, MISC, ERROR, TIMEOUTS.'
  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_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)
  raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/findings'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:beginExecId] = opts[:begin_exec_id] if opts[:begin_exec_id]
  query_params[:endExecId] = opts[:end_exec_id] if opts[:end_exec_id]
  query_params[:searchPeriod] = opts[:search_period] if opts[:search_period]
  query_params[:findingFilter] = opts[:finding_filter] if opts[:finding_filter]
  query_params[:statsHashFilter] = opts[:stats_hash_filter] if opts[:stats_hash_filter]
  query_params[:indexHashFilter] = opts[:index_hash_filter] if opts[:index_hash_filter]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  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: 'SqlTuningClient#list_sql_tuning_advisor_task_findings') 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::SqlTuningAdvisorTaskFindingCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_sql_tuning_advisor_task_recommendations(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) ⇒ Response

Note:

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

Gets the findings and possible actions for a given object in a SQL tuning task. The task ID and object ID are used to retrieve the findings and recommendations.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (Integer)

    The SQL tuning task identifier. This is not the OCID.

  • sql_object_id (Integer)

    The SQL object ID for the SQL tuning task. This is not the OCID.

  • execution_id (Integer)

    The execution ID for an execution of a SQL tuning task. This is not the OCID.

  • 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

  • :sort_by (String)

    The possible sortBy values of an object's recommendations. (default to RECOMMENDATION_TYPE) Allowed values are: RECOMMENDATION_TYPE, BENEFIT

  • :sort_order (String)

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

  • :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)

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
# File 'lib/oci/database_management/sql_tuning_client.rb', line 834

def list_sql_tuning_advisor_task_recommendations(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {})
  logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_advisor_task_recommendations.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_advisor_task_recommendations." if managed_database_id.nil?
  raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling list_sql_tuning_advisor_task_recommendations." if sql_tuning_advisor_task_id.nil?
  raise "Missing the required parameter 'sql_object_id' when calling list_sql_tuning_advisor_task_recommendations." if sql_object_id.nil?
  raise "Missing the required parameter 'execution_id' when calling list_sql_tuning_advisor_task_recommendations." if execution_id.nil?

  if opts[:sort_by] && !%w[RECOMMENDATION_TYPE BENEFIT].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of RECOMMENDATION_TYPE, BENEFIT.'
  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_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)
  raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/recommendations'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:sqlObjectId] = sql_object_id
  query_params[:executionId] = execution_id
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  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: 'SqlTuningClient#list_sql_tuning_advisor_task_recommendations') 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::SqlTuningAdvisorTaskRecommendationCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_sql_tuning_advisor_tasks(managed_database_id, opts = {}) ⇒ Response

Note:

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

Lists the SQL Tuning Advisor tasks for the specified Managed Database.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed 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

  • :name (String)

    The optional query parameter to filter the SQL Tuning Advisor task list by name.

  • :status (String)

    The optional query parameter to filter the SQL Tuning Advisor task list by status. Allowed values are: INITIAL, EXECUTING, INTERRUPTED, COMPLETED, ERROR

  • :time_greater_than_or_equal_to (DateTime)

    The optional greater than or equal to query parameter to filter the timestamp.

  • :time_less_than_or_equal_to (DateTime)

    The optional less than or equal to query parameter to filter the timestamp.

  • :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 option to sort the SQL Tuning Advisor task summary data. (default to START_TIME) Allowed values are: NAME, START_TIME

  • :sort_order (String)

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

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
# File 'lib/oci/database_management/sql_tuning_client.rb', line 919

def list_sql_tuning_advisor_tasks(managed_database_id, opts = {})
  logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_advisor_tasks.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_advisor_tasks." if managed_database_id.nil?

  if opts[:status] && !%w[INITIAL EXECUTING INTERRUPTED COMPLETED ERROR].include?(opts[:status])
    raise 'Invalid value for "status", must be one of INITIAL, EXECUTING, INTERRUPTED, COMPLETED, ERROR.'
  end

  if opts[:sort_by] && !%w[NAME START_TIME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of NAME, START_TIME.'
  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_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks'.sub('{managedDatabaseId}', managed_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:name] = opts[:name] if opts[:name]
  query_params[:status] = opts[:status] if opts[:status]
  query_params[:timeGreaterThanOrEqualTo] = opts[:time_greater_than_or_equal_to] if opts[:time_greater_than_or_equal_to]
  query_params[:timeLessThanOrEqualTo] = opts[:time_less_than_or_equal_to] if opts[:time_less_than_or_equal_to]
  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: 'SqlTuningClient#list_sql_tuning_advisor_tasks') 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::SqlTuningAdvisorTaskCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_sql_tuning_sets(managed_database_id, opts = {}) ⇒ Response

Note:

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

Lists the SQL tuning sets for the specified Managed Database.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed 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

  • :owner (String)

    The owner of the SQL tuning set.

  • :name_contains (String)

    Allow searching the name of the SQL tuning set by partial matching. The search is case insensitive.

  • :sort_by (String)

    The option to sort the SQL tuning set summary data. (default to NAME) Allowed values are: 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)

  • :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)

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1003

def list_sql_tuning_sets(managed_database_id, opts = {})
  logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_sets.' if logger

  raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_sets." if managed_database_id.nil?

  if opts[:sort_by] && !%w[NAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of 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_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id)

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets'.sub('{managedDatabaseId}', managed_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:owner] = opts[:owner] if opts[:owner]
  query_params[:nameContains] = opts[:name_contains] if opts[:name_contains]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  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: 'SqlTuningClient#list_sql_tuning_sets') 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::SqlTuningSetCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#load_sql_tuning_set(managed_database_id, sql_tuning_set_id, load_sql_tuning_set_details, opts = {}) ⇒ Response

Note:

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

Load Sql statements into the Sql tuning set specified by name and optional filter parameters within the Managed Database specified by managedDatabaseId.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_set_id (Integer)

    The unique identifier of the Sql tuning set. This is not OCID.

  • load_sql_tuning_set_details (OCI::DatabaseManagement::Models::LoadSqlTuningSetDetails)

    The details required to load Sql statements into the Sql tuning set.

  • 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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1080

def load_sql_tuning_set(managed_database_id, sql_tuning_set_id, load_sql_tuning_set_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#load_sql_tuning_set.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/loadSqlTuningSet'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(load_sql_tuning_set_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'SqlTuningClient#load_sql_tuning_set') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus'
    )
  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/sql_tuning_client.rb', line 96

def logger
  @api_client.config.logger
end

#save_sql_tuning_set_as(managed_database_id, sql_tuning_set_id, save_sql_tuning_set_as_details, opts = {}) ⇒ Response

Note:

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

Saves the specified list of Sqls statements into another new Sql tuning set or loads into an existing Sql tuning set'.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_set_id (Integer)

    The unique identifier of the Sql tuning set. This is not OCID.

  • save_sql_tuning_set_as_details (OCI::DatabaseManagement::Models::SaveSqlTuningSetAsDetails)

    The details required to save a Sql tuning set into another Sql tuning set.

  • 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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1148

def save_sql_tuning_set_as(managed_database_id, sql_tuning_set_id, save_sql_tuning_set_as_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#save_sql_tuning_set_as.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/saveAs'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(save_sql_tuning_set_as_details)

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

#start_sql_tuning_task(managed_database_id, start_sql_tuning_task_details, opts = {}) ⇒ Response

Note:

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

Starts a SQL tuning task for a given set of SQL statements from the active session history top SQL statements.

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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1215

def start_sql_tuning_task(managed_database_id, start_sql_tuning_task_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#start_sql_tuning_task.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/actions/startSqlTuningTask'.sub('{managedDatabaseId}', managed_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(start_sql_tuning_task_details)

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

#validate_basic_filter(managed_database_id, sql_tuning_set_id, validate_basic_filter_details, opts = {}) ⇒ Response

Note:

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

Executes a SQL query to check whether user entered basic filter criteria is valid or not.

Parameters:

  • managed_database_id (String)

    The OCID of the Managed Database.

  • sql_tuning_set_id (Integer)

    The unique identifier of the Sql tuning set. This is not OCID.

  • validate_basic_filter_details (OCI::DatabaseManagement::Models::ValidateBasicFilterDetails)

    Validate the basic filter criteria provided by the user.

  • 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.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1281

def validate_basic_filter(managed_database_id, sql_tuning_set_id, validate_basic_filter_details, opts = {})
  logger.debug 'Calling operation SqlTuningClient#validate_basic_filter.' if logger

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

  path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/validateBasicFilter'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(validate_basic_filter_details)

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