Class: OCI::Dblm::DbLifeCycleManagementClient
- Inherits:
-
Object
- Object
- OCI::Dblm::DbLifeCycleManagementClient
- Defined in:
- lib/oci/dblm/db_life_cycle_management_client.rb
Overview
A description of the Dblm API
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#create_vulnerability_scan(create_vulnerability_scan_details, opts = {}) ⇒ Response
Creates a VulnerabilityScan.
-
#get_patch_management(compartment_id, opts = {}) ⇒ Response
Overview of Patch Management.
-
#get_vulnerability(compartment_id, opts = {}) ⇒ Response
Gets a Vulnerability.
-
#get_vulnerability_scan(vulnerability_scan_id, opts = {}) ⇒ Response
Gets information about a VulnerabilityScan.
-
#get_work_request(work_request_id, opts = {}) ⇒ Response
Gets details of the work request with the given ID.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DbLifeCycleManagementClient
constructor
Creates a new DbLifeCycleManagementClient.
-
#list_aggregated_vulnerability_data(opts = {}) ⇒ Response
Gets an AggregatedVulnerabilityData.
-
#list_databases(opts = {}) ⇒ Response
Gets the list of databases.
-
#list_notifications(compartment_id, opts = {}) ⇒ Response
List of notifications.
-
#list_vulnerabilities(opts = {}) ⇒ Response
Gets the vulnerabilities summary list Allowed values are: cveId, vulnerableResources.
-
#list_vulnerability_resources(compartment_id, opts = {}) ⇒ Response
Lists the summary of vulnerable and clean resourcees Allowed values are: timeCreated, displayName, vulnerabilityCount.
-
#list_vulnerability_scans(opts = {}) ⇒ Response
Gets a list of VulnerabilityScans.
-
#list_work_request_errors(work_request_id, opts = {}) ⇒ Response
Returns a (paginated) list of errors for the work request with the given ID.
-
#list_work_request_logs(work_request_id, opts = {}) ⇒ Response
Returns a (paginated) list of logs for the work request with the given ID.
-
#list_work_requests(opts = {}) ⇒ Response
Lists the work requests in a compartment.
-
#logger ⇒ Logger
The logger for this client.
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.
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_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
15 16 17 |
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 15 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
19 20 21 |
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 19 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
29 30 31 |
# File 'lib/oci/dblm/db_life_cycle_management_client.rb', line 29 def region @region end |
#retry_config ⇒ OCI::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
Click here to see an example of how to use create_vulnerability_scan API.
Creates a VulnerabilityScan.
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.(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
Click here to see an example of how to use get_patch_management API.
Overview of Patch Management.
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.(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
Click here to see an example of how to use get_vulnerability API.
Gets a Vulnerability
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.(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
Click here to see an example of how to use get_vulnerability_scan API.
Gets information about a VulnerabilityScan.
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.(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
Click here to see an example of how to use get_work_request API.
Gets details of the work request with the given ID.
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.(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
Click here to see an example of how to use list_aggregated_vulnerability_data API.
Gets an AggregatedVulnerabilityData
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.(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
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
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.(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
Click here to see an example of how to use list_notifications API.
List of notifications
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.(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
Click here to see an example of how to use list_vulnerabilities API.
Gets the vulnerabilities summary list Allowed values are: cveId, vulnerableResources
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.(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
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
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.(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
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
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.(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
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
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.(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
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
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.(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
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
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.(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 |
#logger ⇒ Logger
Returns 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 |