Class: OCI::LicenseManager::LicenseManagerClient
- Inherits:
-
Object
- Object
- OCI::LicenseManager::LicenseManagerClient
- Defined in:
- lib/oci/license_manager/license_manager_client.rb
Overview
Use the License Manager API to manage product licenses and license records. For more information, see License Manager Overview.
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
-
#bulk_upload_license_records(bulk_upload_license_records_details, opts = {}) ⇒ Response
Bulk upload the product licenses and license records for a given compartment.
-
#create_license_record(create_license_record_details, product_license_id, opts = {}) ⇒ Response
Creates a new license record for the given product license ID.
-
#create_product_license(create_product_license_details, opts = {}) ⇒ Response
Creates a new product license.
-
#delete_license_record(license_record_id, opts = {}) ⇒ Response
Removes a license record.
-
#delete_product_license(product_license_id, opts = {}) ⇒ Response
Removes a product license.
-
#get_bulk_upload_template(opts = {}) ⇒ Response
Provides the bulk upload file template.
-
#get_configuration(compartment_id, opts = {}) ⇒ Response
Retrieves configuration for a compartment.
-
#get_license_metric(compartment_id, opts = {}) ⇒ Response
Retrieves the license metrics for a given compartment.
-
#get_license_record(license_record_id, opts = {}) ⇒ Response
Retrieves license record details by the license record ID in a given compartment.
-
#get_product_license(product_license_id, opts = {}) ⇒ Response
Retrieves product license details by product license ID in a given compartment.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ LicenseManagerClient
constructor
Creates a new LicenseManagerClient.
-
#list_license_records(product_license_id, opts = {}) ⇒ Response
Retrieves all license records for a given product license ID.
-
#list_product_license_consumers(product_license_id, compartment_id, opts = {}) ⇒ Response
Retrieves the product license consumers for a particular product license ID.
-
#list_product_licenses(compartment_id, opts = {}) ⇒ Response
Retrieves all the product licenses from a given compartment.
-
#list_top_utilized_product_licenses(compartment_id, opts = {}) ⇒ Response
Retrieves the top utilized product licenses for a given compartment.
-
#list_top_utilized_resources(compartment_id, opts = {}) ⇒ Response
Retrieves the top utilized resources for a given compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#update_configuration(compartment_id, update_configuration_details, opts = {}) ⇒ Response
Updates the configuration for the compartment.
-
#update_license_record(license_record_id, update_license_record_details, opts = {}) ⇒ Response
Updates license record entity details.
-
#update_product_license(product_license_id, update_product_license_details, opts = {}) ⇒ Response
Updates the list of images for a product license.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ LicenseManagerClient
Creates a new LicenseManagerClient. 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/license_manager/license_manager_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 + '/20220430' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "LicenseManagerClient 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/license_manager/license_manager_client.rb', line 15 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
19 20 21 |
# File 'lib/oci/license_manager/license_manager_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/license_manager/license_manager_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/license_manager/license_manager_client.rb', line 25 def retry_config @retry_config end |
Instance Method Details
#bulk_upload_license_records(bulk_upload_license_records_details, opts = {}) ⇒ Response
Click here to see an example of how to use bulk_upload_license_records API.
Bulk upload the product licenses and license records for a given compartment.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 113 def bulk_upload_license_records(bulk_upload_license_records_details, opts = {}) logger.debug 'Calling operation LicenseManagerClient#bulk_upload_license_records.' if logger raise "Missing the required parameter 'bulk_upload_license_records_details' when calling bulk_upload_license_records." if bulk_upload_license_records_details.nil? path = '/licenses/actions/bulkUpload' 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 = @api_client.object_to_http_body(bulk_upload_license_records_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#bulk_upload_license_records') 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::LicenseManager::Models::BulkUploadResponse' ) end # rubocop:enable Metrics/BlockLength end |
#create_license_record(create_license_record_details, product_license_id, opts = {}) ⇒ Response
Click here to see an example of how to use create_license_record API.
Creates a new license record for the given product license ID.
174 175 176 177 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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 174 def create_license_record(create_license_record_details, product_license_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#create_license_record.' if logger raise "Missing the required parameter 'create_license_record_details' when calling create_license_record." if create_license_record_details.nil? raise "Missing the required parameter 'product_license_id' when calling create_license_record." if product_license_id.nil? path = '/licenseRecords' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:productLicenseId] = product_license_id # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_license_record_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#create_license_record') 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::LicenseManager::Models::LicenseRecord' ) end # rubocop:enable Metrics/BlockLength end |
#create_product_license(create_product_license_details, opts = {}) ⇒ Response
Click here to see an example of how to use create_product_license API.
Creates a new product license.
238 239 240 241 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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 238 def create_product_license(create_product_license_details, opts = {}) logger.debug 'Calling operation LicenseManagerClient#create_product_license.' if logger raise "Missing the required parameter 'create_product_license_details' when calling create_product_license." if create_product_license_details.nil? path = '/productLicenses' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_product_license_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#create_product_license') 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::LicenseManager::Models::ProductLicense' ) end # rubocop:enable Metrics/BlockLength end |
#delete_license_record(license_record_id, opts = {}) ⇒ Response
Click here to see an example of how to use delete_license_record API.
Removes a license record.
299 300 301 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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 299 def delete_license_record(license_record_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#delete_license_record.' if logger raise "Missing the required parameter 'license_record_id' when calling delete_license_record." if license_record_id.nil? raise "Parameter value for 'license_record_id' must not be blank" if OCI::Internal::Util.blank_string?(license_record_id) path = '/licenseRecords/{licenseRecordId}'.sub('{licenseRecordId}', license_record_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#delete_license_record') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#delete_product_license(product_license_id, opts = {}) ⇒ Response
Click here to see an example of how to use delete_product_license API.
Removes a product license.
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 393 394 395 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 359 def delete_product_license(product_license_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#delete_product_license.' if logger raise "Missing the required parameter 'product_license_id' when calling delete_product_license." if product_license_id.nil? raise "Parameter value for 'product_license_id' must not be blank" if OCI::Internal::Util.blank_string?(product_license_id) path = '/productLicenses/{productLicenseId}'.sub('{productLicenseId}', product_license_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#delete_product_license') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#get_bulk_upload_template(opts = {}) ⇒ Response
Click here to see an example of how to use get_bulk_upload_template API.
Provides the bulk upload file template.
414 415 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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 414 def get_bulk_upload_template(opts = {}) logger.debug 'Calling operation LicenseManagerClient#get_bulk_upload_template.' if logger path = '/licenses/actions/bulkUploadTemplate' 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: 'LicenseManagerClient#get_bulk_upload_template') 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::LicenseManager::Models::BulkUploadTemplate' ) end # rubocop:enable Metrics/BlockLength end |
#get_configuration(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_configuration API.
Retrieves configuration for a compartment.
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 469 def get_configuration(compartment_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#get_configuration.' if logger raise "Missing the required parameter 'compartment_id' when calling get_configuration." if compartment_id.nil? path = '/configuration' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#get_configuration') 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::LicenseManager::Models::Configuration' ) end # rubocop:enable Metrics/BlockLength end |
#get_license_metric(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_license_metric API.
Retrieves the license metrics for a given compartment.
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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 527 def get_license_metric(compartment_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#get_license_metric.' if logger raise "Missing the required parameter 'compartment_id' when calling get_license_metric." if compartment_id.nil? path = '/licenseMetrics' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:isCompartmentIdInSubtree] = opts[:is_compartment_id_in_subtree] if !opts[:is_compartment_id_in_subtree].nil? # 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: 'LicenseManagerClient#get_license_metric') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::LicenseManager::Models::LicenseMetric' ) end # rubocop:enable Metrics/BlockLength end |
#get_license_record(license_record_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_license_record API.
Retrieves license record details by the license record ID in a given compartment.
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 584 def get_license_record(license_record_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#get_license_record.' if logger raise "Missing the required parameter 'license_record_id' when calling get_license_record." if license_record_id.nil? raise "Parameter value for 'license_record_id' must not be blank" if OCI::Internal::Util.blank_string?(license_record_id) path = '/licenseRecords/{licenseRecordId}'.sub('{licenseRecordId}', license_record_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: 'LicenseManagerClient#get_license_record') 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::LicenseManager::Models::LicenseRecord' ) end # rubocop:enable Metrics/BlockLength end |
#get_product_license(product_license_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_product_license API.
Retrieves product license details by product license ID in a given compartment.
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 640 def get_product_license(product_license_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#get_product_license.' if logger raise "Missing the required parameter 'product_license_id' when calling get_product_license." if product_license_id.nil? raise "Parameter value for 'product_license_id' must not be blank" if OCI::Internal::Util.blank_string?(product_license_id) path = '/productLicenses/{productLicenseId}'.sub('{productLicenseId}', product_license_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: 'LicenseManagerClient#get_product_license') 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::LicenseManager::Models::ProductLicense' ) end # rubocop:enable Metrics/BlockLength end |
#list_license_records(product_license_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_license_records API.
Retrieves all license records for a given product license ID.
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 744 745 746 747 748 749 750 751 752 753 754 755 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 707 def list_license_records(product_license_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#list_license_records.' if logger raise "Missing the required parameter 'product_license_id' when calling list_license_records." if product_license_id.nil? if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[expirationDate].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of expirationDate.' end path = '/licenseRecords' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:productLicenseId] = product_license_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] # 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: 'LicenseManagerClient#list_license_records') 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::LicenseManager::Models::LicenseRecordCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_product_license_consumers(product_license_id, compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_product_license_consumers API.
Retrieves the product license consumers for a particular product license ID.
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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 789 def list_product_license_consumers(product_license_id, compartment_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#list_product_license_consumers.' if logger raise "Missing the required parameter 'product_license_id' when calling list_product_license_consumers." if product_license_id.nil? raise "Missing the required parameter 'compartment_id' when calling list_product_license_consumers." if compartment_id.nil? if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[licenseUnitsRequired].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of licenseUnitsRequired.' end path = '/productLicenseConsumers' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:productLicenseId] = product_license_id query_params[:compartmentId] = compartment_id query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:isCompartmentIdInSubtree] = opts[:is_compartment_id_in_subtree] if !opts[:is_compartment_id_in_subtree].nil? 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: 'LicenseManagerClient#list_product_license_consumers') 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::LicenseManager::Models::ProductLicenseConsumerCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_product_licenses(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_product_licenses API.
Retrieves all the product licenses from a given compartment.
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 873 def list_product_licenses(compartment_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#list_product_licenses.' if logger raise "Missing the required parameter 'compartment_id' when calling list_product_licenses." if compartment_id.nil? if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[totalLicenseUnitsConsumed].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of totalLicenseUnitsConsumed.' end path = '/productLicenses' 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[:isCompartmentIdInSubtree] = opts[:is_compartment_id_in_subtree] if !opts[:is_compartment_id_in_subtree].nil? 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: 'LicenseManagerClient#list_product_licenses') 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::LicenseManager::Models::ProductLicenseCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_top_utilized_product_licenses(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_top_utilized_product_licenses API.
Retrieves the top utilized product licenses for a given compartment.
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 955 def list_top_utilized_product_licenses(compartment_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#list_top_utilized_product_licenses.' if logger raise "Missing the required parameter 'compartment_id' when calling list_top_utilized_product_licenses." if compartment_id.nil? if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[totalLicenseUnitsConsumed].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of totalLicenseUnitsConsumed.' end path = '/topUtilizedProductLicenses' 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[:isCompartmentIdInSubtree] = opts[:is_compartment_id_in_subtree] if !opts[:is_compartment_id_in_subtree].nil? 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: 'LicenseManagerClient#list_top_utilized_product_licenses') 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::LicenseManager::Models::TopUtilizedProductLicenseCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_top_utilized_resources(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_top_utilized_resources API.
Retrieves the top utilized resources for a given compartment.
1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 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 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 1038 def list_top_utilized_resources(compartment_id, opts = {}) logger.debug 'Calling operation LicenseManagerClient#list_top_utilized_resources.' if logger raise "Missing the required parameter 'compartment_id' when calling list_top_utilized_resources." if compartment_id.nil? if opts[:resource_unit_type] && !OCI::LicenseManager::Models::RESOURCE_UNIT_ENUM.include?(opts[:resource_unit_type]) raise 'Invalid value for "resource_unit_type", must be one of the values in OCI::LicenseManager::Models::RESOURCE_UNIT_ENUM.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:sort_by] && !%w[totalUnits].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of totalUnits.' end path = '/topUtilizedResources' 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[:isCompartmentIdInSubtree] = opts[:is_compartment_id_in_subtree] if !opts[:is_compartment_id_in_subtree].nil? query_params[:resourceUnitType] = opts[:resource_unit_type] if opts[:resource_unit_type] 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: 'LicenseManagerClient#list_top_utilized_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::LicenseManager::Models::TopUtilizedResourceCollection' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
94 95 96 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 94 def logger @api_client.config.logger end |
#update_configuration(compartment_id, update_configuration_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_configuration API.
Updates the configuration for the compartment.
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 1118 def update_configuration(compartment_id, update_configuration_details, opts = {}) logger.debug 'Calling operation LicenseManagerClient#update_configuration.' if logger raise "Missing the required parameter 'compartment_id' when calling update_configuration." if compartment_id.nil? raise "Missing the required parameter 'update_configuration_details' when calling update_configuration." if update_configuration_details.nil? path = '/configuration' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_configuration_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#update_configuration') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::LicenseManager::Models::Configuration' ) end # rubocop:enable Metrics/BlockLength end |
#update_license_record(license_record_id, update_license_record_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_license_record API.
Updates license record entity details.
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 1181 def update_license_record(license_record_id, update_license_record_details, opts = {}) logger.debug 'Calling operation LicenseManagerClient#update_license_record.' if logger raise "Missing the required parameter 'license_record_id' when calling update_license_record." if license_record_id.nil? raise "Missing the required parameter 'update_license_record_details' when calling update_license_record." if update_license_record_details.nil? raise "Parameter value for 'license_record_id' must not be blank" if OCI::Internal::Util.blank_string?(license_record_id) path = '/licenseRecords/{licenseRecordId}'.sub('{licenseRecordId}', license_record_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[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_license_record_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#update_license_record') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::LicenseManager::Models::LicenseRecord' ) end # rubocop:enable Metrics/BlockLength end |
#update_product_license(product_license_id, update_product_license_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_product_license API.
Updates the list of images for a product license.
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 |
# File 'lib/oci/license_manager/license_manager_client.rb', line 1244 def update_product_license(product_license_id, update_product_license_details, opts = {}) logger.debug 'Calling operation LicenseManagerClient#update_product_license.' if logger raise "Missing the required parameter 'product_license_id' when calling update_product_license." if product_license_id.nil? raise "Missing the required parameter 'update_product_license_details' when calling update_product_license." if update_product_license_details.nil? raise "Parameter value for 'product_license_id' must not be blank" if OCI::Internal::Util.blank_string?(product_license_id) path = '/productLicenses/{productLicenseId}'.sub('{productLicenseId}', product_license_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[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_product_license_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'LicenseManagerClient#update_product_license') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::LicenseManager::Models::ProductLicense' ) end # rubocop:enable Metrics/BlockLength end |