Class: OCI::Dblm::DbLifeCycleManagementClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/dblm/db_life_cycle_management_client.rb

Overview

A description of the Dblm API

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) ⇒ DbLifeCycleManagementClient

Creates a new DbLifeCycleManagementClient. 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



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

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 + '/20240102'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "DbLifeCycleManagementClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 19

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


29
30
31
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 29

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



25
26
27
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#create_vulnerability_scan(create_vulnerability_scan_details, opts = {}) ⇒ Response

Note:

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

Creates a VulnerabilityScan.

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

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



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
151
152
153
154
155
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 118

def create_vulnerability_scan(create_vulnerability_scan_details, opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#create_vulnerability_scan.' if logger

  raise "Missing the required parameter 'create_vulnerability_scan_details' when calling create_vulnerability_scan." if create_vulnerability_scan_details.nil?

  path = '/vulnerabilityScans'
  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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_vulnerability_scan_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DbLifeCycleManagementClient#create_vulnerability_scan') 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::Dblm::Models::VulnerabilityScan'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Overview of Patch Management.

Parameters:

  • compartment_id (String)

    The required ID of the compartment in which to list resources.

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

  • :database_release (String)

    A filter to return only database that match the given release version.

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

  • :time_started_greater_than_or_equal_to (DateTime)

    A filter to return only resources whose timeStarted is greater than or equal to the given date-time.

  • :time_started_less_than (DateTime)

    A filter to return only resources whose timeStarted is less than the given date-time.

Returns:



178
179
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 178

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

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

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

  path = '/patchManagement'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:databaseRelease] = opts[:database_release] if opts[:database_release]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:timeStartedGreaterThanOrEqualTo] = opts[:time_started_greater_than_or_equal_to] if opts[:time_started_greater_than_or_equal_to]
  query_params[:timeStartedLessThan] = opts[:time_started_less_than] if opts[:time_started_less_than]

  # 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: 'DbLifeCycleManagementClient#get_patch_management') 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::Dblm::Models::DblmPatchManagement'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Gets a Vulnerability

Parameters:

  • compartment_id (String)

    The required ID of the compartment in which to list resources.

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

  • :database_release (String)

    A filter to return only database that match the given release version.

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

Returns:



242
243
244
245
246
247
248
249
250
251
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 242

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

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

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

  path = '/vulnerability'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:databaseRelease] = opts[:database_release] if opts[:database_release]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

  # 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: 'DbLifeCycleManagementClient#get_vulnerability') 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::Dblm::Models::DblmVulnerability'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_vulnerability_scan(vulnerability_scan_id, opts = {}) ⇒ Response

Note:

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

Gets information about a VulnerabilityScan.

Parameters:

  • vulnerability_scan_id (String)

    The OCID of the VulnerabilityScan.

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



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 302

def get_vulnerability_scan(vulnerability_scan_id, opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#get_vulnerability_scan.' if logger

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

  path = '/vulnerabilityScans/{vulnerabilityScanId}'.sub('{vulnerabilityScanId}', vulnerability_scan_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: 'DbLifeCycleManagementClient#get_vulnerability_scan') 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::Dblm::Models::VulnerabilityScan'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_work_request(work_request_id, opts = {}) ⇒ Response

Note:

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

Gets details of the work request with the given ID.

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

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



356
357
358
359
360
361
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 356

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#get_work_request.' if logger

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

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_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: 'DbLifeCycleManagementClient#get_work_request') 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::Dblm::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_aggregated_vulnerability_data(opts = {}) ⇒ Response

Note:

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

Gets an AggregatedVulnerabilityData

Parameters:

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

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :time_created_greater_than (DateTime)

    The created greater than.

  • :time_ended_less_than (DateTime)

    The time ended less than.

  • :database_release (String)

    A filter to return only database that match the given release version.

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

Returns:



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 416

def list_aggregated_vulnerability_data(opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_aggregated_vulnerability_data.' if logger


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

  path = '/vulnerability/aggregatedVulnerabilityData'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:timeCreatedGreaterThan] = opts[:time_created_greater_than] if opts[:time_created_greater_than]
  query_params[:timeEndedLessThan] = opts[:time_ended_less_than] if opts[:time_ended_less_than]
  query_params[:databaseRelease] = opts[:database_release] if opts[:database_release]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # 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: 'DbLifeCycleManagementClient#list_aggregated_vulnerability_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::Dblm::Models::AggregatedVulnerabilityCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_databases(opts = {}) ⇒ Response

Note:

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

Gets the list of databases

Allowed values are: timeCreated, name, resourceType, release, subscribedImage, patchCompliance Allowed values are: NOT_SUBSCRIBED, NOT_COMPLIANT_WITH_IMAGES, ALL_DATABASES

Parameters:

  • 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

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

  • :database_release (String)

    A filter to return only database that match the given release version.

  • :database_type (String)

    Filter by database type. Possible values Single Instance or RAC.

    Allowed values are: SI, RAC

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. (default to timeCreated)

  • :image_id (String)

    Subscribed image

  • :opc_request_id (String)

    The client request ID for tracing.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :drifter_patch_id (Integer)

    A filter to return only database that have given patchId as additional patch (drifter from image version).

  • :image_compliance (String)

    Filter databases by image compliance status. (default to ALL_DATABASES)

  • :severity_type (Array<String>)

    Filter by one or more severity types. Possible values are critical, high, medium, low, info and none. (default to []) Allowed values are: CRITICAL, HIGH, MEDIUM, LOW, INFO, NONE

Returns:



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
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
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 502

def list_databases(opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_databases.' if logger


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

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

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

  if opts[:sort_by] && !%w[timeCreated name resourceType release subscribedImage patchCompliance].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, name, resourceType, release, subscribedImage, patchCompliance.'
  end

  if opts[:image_compliance] && !%w[NOT_SUBSCRIBED NOT_COMPLIANT_WITH_IMAGES ALL_DATABASES].include?(opts[:image_compliance])
    raise 'Invalid value for "image_compliance", must be one of NOT_SUBSCRIBED, NOT_COMPLIANT_WITH_IMAGES, ALL_DATABASES.'
  end


  severity_type_allowable_values = %w[CRITICAL HIGH MEDIUM LOW INFO NONE]
  if opts[:severity_type] && !opts[:severity_type].empty?
    opts[:severity_type].each do |val_to_check|
      unless severity_type_allowable_values.include?(val_to_check)
        raise 'Invalid value for "severity_type", must be one of CRITICAL, HIGH, MEDIUM, LOW, INFO, NONE.'
      end
    end
  end

  path = '/patchManagement/databases'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:databaseRelease] = opts[:database_release] if opts[:database_release]
  query_params[:databaseType] = opts[:database_type] if opts[:database_type]
  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]
  query_params[:imageId] = opts[:image_id] if opts[:image_id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:drifterPatchId] = opts[:drifter_patch_id] if opts[:drifter_patch_id]
  query_params[:imageCompliance] = opts[:image_compliance] if opts[:image_compliance]
  query_params[:severityType] = OCI::ApiClient.build_collection_params(opts[:severity_type], :multi) if opts[:severity_type] && !opts[:severity_type].empty?

  # 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: 'DbLifeCycleManagementClient#list_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::Dblm::Models::PatchDatabasesCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

List of notifications

Parameters:

  • compartment_id (String)

    The required ID of the compartment in which to list resources.

  • 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 items to return. (default to 10)

Returns:



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
630
631
632
633
634
635
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 598

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

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

  path = '/vulnerability/notifications'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  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: 'DbLifeCycleManagementClient#list_notifications') 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::Dblm::Models::NotificationCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_vulnerabilities(opts = {}) ⇒ Response

Note:

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

Gets the vulnerabilities summary list Allowed values are: cveId, vulnerableResources

Parameters:

  • 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

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for vulnerableResources is descending. Default order for cveId is descending. (default to vulnerableResources)

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

  • :opc_request_id (String)

    The client request ID for tracing.

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

  • :database_release (String)

    A filter to return only database that match the given release version.

  • :resource_id (String)

    A filter to return only resources that match the given resource id.

  • :severity_type (Array<String>)

    Filter by one or more severity types. Possible values are critical, high, medium, low, info. (default to []) Allowed values are: CRITICAL, HIGH, MEDIUM, LOW, INFO

  • :search_by (String)

    The search input for filter cve id and cve description.

Returns:



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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 674

def list_vulnerabilities(opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_vulnerabilities.' if logger


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

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

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


  severity_type_allowable_values = %w[CRITICAL HIGH MEDIUM LOW INFO]
  if opts[:severity_type] && !opts[:severity_type].empty?
    opts[:severity_type].each do |val_to_check|
      unless severity_type_allowable_values.include?(val_to_check)
        raise 'Invalid value for "severity_type", must be one of CRITICAL, HIGH, MEDIUM, LOW, INFO.'
      end
    end
  end

  path = '/vulnerability/vulnerabilities'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:databaseRelease] = opts[:database_release] if opts[:database_release]
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  query_params[:severityType] = OCI::ApiClient.build_collection_params(opts[:severity_type], :multi) if opts[:severity_type] && !opts[:severity_type].empty?
  query_params[:searchBy] = opts[:search_by] if opts[:search_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DbLifeCycleManagementClient#list_vulnerabilities') 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::Dblm::Models::VulnerabilityCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Lists the summary of vulnerable and clean resourcees Allowed values are: timeCreated, displayName, vulnerabilityCount

Parameters:

  • compartment_id (String)

    The required ID of the compartment in which to list resources.

  • 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

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. (default to timeCreated)

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

  • :database_release (String)

    A filter to return only database that match the given release version.

  • :cve_id (String)

    The id of a CVE.

  • :severity_type (Array<String>)

    Filter by one or more severity types. Possible values are critical, high, medium, low, info and none. (default to []) Allowed values are: CRITICAL, HIGH, MEDIUM, LOW, INFO, NONE

  • :patch_recommendation (Array<String>)

    Filter by one or more severity types. Possible values are upToDate, patchAvailable (default to []) Allowed values are: upToDate, patchAvailable

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 779

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

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

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

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

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


  severity_type_allowable_values = %w[CRITICAL HIGH MEDIUM LOW INFO NONE]
  if opts[:severity_type] && !opts[:severity_type].empty?
    opts[:severity_type].each do |val_to_check|
      unless severity_type_allowable_values.include?(val_to_check)
        raise 'Invalid value for "severity_type", must be one of CRITICAL, HIGH, MEDIUM, LOW, INFO, NONE.'
      end
    end
  end


  patch_recommendation_allowable_values = %w[upToDate patchAvailable]
  if opts[:patch_recommendation] && !opts[:patch_recommendation].empty?
    opts[:patch_recommendation].each do |val_to_check|
      unless patch_recommendation_allowable_values.include?(val_to_check)
        raise 'Invalid value for "patch_recommendation", must be one of upToDate, patchAvailable.'
      end
    end
  end

  path = '/vulnerability/resources'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  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]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:databaseRelease] = opts[:database_release] if opts[:database_release]
  query_params[:cveId] = opts[:cve_id] if opts[:cve_id]
  query_params[:severityType] = OCI::ApiClient.build_collection_params(opts[:severity_type], :multi) if opts[:severity_type] && !opts[:severity_type].empty?
  query_params[:patchRecommendation] = OCI::ApiClient.build_collection_params(opts[:patch_recommendation], :multi) if opts[:patch_recommendation] && !opts[:patch_recommendation].empty?

  # 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: 'DbLifeCycleManagementClient#list_vulnerability_resources') 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::Dblm::Models::VulnerabilityResourceCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_vulnerability_scans(opts = {}) ⇒ Response

Note:

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

Gets a list of VulnerabilityScans.

Allowed values are: id, displayName, timeCreated, timeEnded

Parameters:

  • 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

  • :vulnerability_scan_id (String)

    The ID of the vulnerability scan.

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order is descending. (default to timeCreated)

  • :opc_request_id (String)

    The client request ID for tracing.

  • :time_created_greater_than (DateTime)

    The created greater than.

  • :time_ended_less_than (DateTime)

    The time ended less than.

  • :vulnerability_scan_status (Array<String>)

    Filter by one or more vulnerability scan status. Possible values are completed, running, completed with error, aborted. (default to []) Allowed values are: COMPLETED, ERROR, RUNNING, ABORTED

  • :vulnerability_scan_type (String)

    The scan type to use is 'CVE', 'PATCH' or 'IMAGE_PATCH'. Allowed values are: CVE, PATCH, IMAGE_PATCH

Returns:



892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 892

def list_vulnerability_scans(opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_vulnerability_scans.' if logger


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

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


  vulnerability_scan_status_allowable_values = %w[COMPLETED ERROR RUNNING ABORTED]
  if opts[:vulnerability_scan_status] && !opts[:vulnerability_scan_status].empty?
    opts[:vulnerability_scan_status].each do |val_to_check|
      unless vulnerability_scan_status_allowable_values.include?(val_to_check)
        raise 'Invalid value for "vulnerability_scan_status", must be one of COMPLETED, ERROR, RUNNING, ABORTED.'
      end
    end
  end

  if opts[:vulnerability_scan_type] && !%w[CVE PATCH IMAGE_PATCH].include?(opts[:vulnerability_scan_type])
    raise 'Invalid value for "vulnerability_scan_type", must be one of CVE, PATCH, IMAGE_PATCH.'
  end

  path = '/vulnerabilityScans'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:vulnerabilityScanId] = opts[:vulnerability_scan_id] if opts[:vulnerability_scan_id]
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  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]
  query_params[:timeCreatedGreaterThan] = opts[:time_created_greater_than] if opts[:time_created_greater_than]
  query_params[:timeEndedLessThan] = opts[:time_ended_less_than] if opts[:time_ended_less_than]
  query_params[:vulnerabilityScanStatus] = OCI::ApiClient.build_collection_params(opts[:vulnerability_scan_status], :multi) if opts[:vulnerability_scan_status] && !opts[:vulnerability_scan_status].empty?
  query_params[:vulnerabilityScanType] = opts[:vulnerability_scan_type] if opts[:vulnerability_scan_type]

  # 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: 'DbLifeCycleManagementClient#list_vulnerability_scans') 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::Dblm::Models::VulnerabilityScanCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_errors(work_request_id, opts = {}) ⇒ Response

Note:

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

Returns a (paginated) list of errors for the work request with the given ID.

Allowed values are: timestamp

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

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

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. (default to timestamp)

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

Returns:



984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 984

def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_work_request_errors.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil?

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

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

  path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  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: 'DbLifeCycleManagementClient#list_work_request_errors') 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::Dblm::Models::WorkRequestErrorCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_logs(work_request_id, opts = {}) ⇒ Response

Note:

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

Returns a (paginated) list of logs for the work request with the given ID.

Allowed values are: timestamp

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

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

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timestamp is descending. (default to timestamp)

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

Returns:



1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 1057

def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_work_request_logs.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil?

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

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

  path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  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: 'DbLifeCycleManagementClient#list_work_request_logs') 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::Dblm::Models::WorkRequestLogEntryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_requests(opts = {}) ⇒ Response

Note:

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

Lists the work requests in a compartment.

Allowed values are: timeAccepted

Parameters:

  • 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

  • :compartment_id (String)

    The ID of the compartment in which to list resources.

  • :work_request_id (String)

    The ID of the asynchronous work request.

  • :status (String)

    A filter to return only resources their lifecycleState matches the given OperationStatus.

  • :resource_id (String)

    The ID of the resource affected by the work request.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

    A token representing the position at which to start retrieving results. This must come from the opc-next-page header field of a previous response.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :sort_order (String)

    The sort order to use, either 'ASC' or 'DESC'.

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. (default to timeAccepted)

Returns:



1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
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
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 1133

def list_work_requests(opts = {})
  logger.debug 'Calling operation DbLifeCycleManagementClient#list_work_requests.' if logger


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

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

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

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:workRequestId] = opts[:work_request_id] if opts[:work_request_id]
  query_params[:status] = opts[:status] if opts[:status]
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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: 'DbLifeCycleManagementClient#list_work_requests') 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::Dblm::Models::WorkRequestSummaryCollection'
    )
  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.



94
95
96
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 94

def logger
  @api_client.config.logger
end