Class: OCI::KeyManagement::KmsManagementClient
- Inherits:
-
Object
- Object
- OCI::KeyManagement::KmsManagementClient
- Defined in:
- lib/oci/key_management/kms_management_client.rb
Overview
API for managing and performing operations with keys and vaults.
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#backup_key(key_id, opts = {}) ⇒ Response
Backs up an encrypted file that contains all key versions and metadata of the specified key so that you can restore the key later.
-
#cancel_key_deletion(key_id, opts = {}) ⇒ Response
Cancels the scheduled deletion of the specified key.
-
#cancel_key_version_deletion(key_id, key_version_id, opts = {}) ⇒ Response
Cancels the scheduled deletion of the specified key version.
-
#change_key_compartment(key_id, change_key_compartment_details, opts = {}) ⇒ Response
Moves a key into a different compartment within the same tenancy.
-
#create_key(create_key_details, opts = {}) ⇒ Response
Creates a new master encryption key.
-
#create_key_version(key_id, opts = {}) ⇒ Response
Generates a new [KeyVersion](docs.cloud.oracle.com/api/#/en/key/release/KeyVersion/) resource that provides new cryptographic material for a master encryption key.
-
#disable_key(key_id, opts = {}) ⇒ Response
Disables a master encryption key so it can no longer be used for encryption, decryption, or generating new data encryption keys.
-
#enable_key(key_id, opts = {}) ⇒ Response
Enables a master encryption key so it can be used for encryption, decryption, or generating new data encryption keys.
-
#get_key(key_id, opts = {}) ⇒ Response
Gets information about the specified master encryption key.
-
#get_key_version(key_id, key_version_id, opts = {}) ⇒ Response
Gets information about the specified key version.
-
#get_wrapping_key(opts = {}) ⇒ Response
Gets details about the public RSA wrapping key associated with the vault in the endpoint.
-
#import_key(import_key_details, opts = {}) ⇒ Response
Imports AES key material to create a new key with.
-
#import_key_version(key_id, import_key_version_details, opts = {}) ⇒ Response
Imports AES key material to create a new key version with, and then rotates the key to begin using the new key version.
-
#initialize(config: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ KmsManagementClient
constructor
Creates a new KmsManagementClient.
-
#list_key_versions(key_id, opts = {}) ⇒ Response
Lists all [KeyVersion](docs.cloud.oracle.com/api/#/en/key/release/KeyVersion/) resources for the specified master encryption key.
-
#list_keys(compartment_id, opts = {}) ⇒ Response
Lists the master encryption keys in the specified vault and compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#restore_key_from_file(restore_key_from_file_details, opts = {}) ⇒ Response
Restores the specified key to the specified vault, based on information in the backup file provided.
-
#restore_key_from_object_store(opts = {}) ⇒ Response
Restores the specified key to the specified vault from an Oracle Cloud Infrastructure Object Storage location.
-
#schedule_key_deletion(key_id, schedule_key_deletion_details, opts = {}) ⇒ Response
Schedules the deletion of the specified key.
-
#schedule_key_version_deletion(key_id, key_version_id, schedule_key_version_deletion_details, opts = {}) ⇒ Response
Schedules the deletion of the specified key version.
-
#update_key(key_id, update_key_details, opts = {}) ⇒ Response
Updates the properties of a master encryption key.
Constructor Details
#initialize(config: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ KmsManagementClient
Creates a new KmsManagementClient. Notes:
If a config is not specified, then the global OCI.config will be used.
This client is not thread-safe
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/oci/key_management/kms_management_client.rb', line 43 def initialize(config: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) raise 'A fully qualified endpoint URL must be defined' unless endpoint @endpoint = endpoint + '/' # 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) if signer.nil? signer = OCI::Signer.new( config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content ) end @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config logger.info "KmsManagementClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
13 14 15 |
# File 'lib/oci/key_management/kms_management_client.rb', line 13 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
17 18 19 |
# File 'lib/oci/key_management/kms_management_client.rb', line 17 def endpoint @endpoint 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
23 24 25 |
# File 'lib/oci/key_management/kms_management_client.rb', line 23 def retry_config @retry_config end |
Instance Method Details
#backup_key(key_id, opts = {}) ⇒ Response
Backs up an encrypted file that contains all key versions and metadata of the specified key so that you can restore the key later. The file also contains the metadata of the vault that the key belonged to.
110 111 112 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 149 |
# File 'lib/oci/key_management/kms_management_client.rb', line 110 def backup_key(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#backup_key.' if logger raise "Missing the required parameter 'key_id' when calling backup_key." if key_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/actions/backup'.sub('{keyId}', key_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] 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(opts[:backup_key_details]) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#backup_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#cancel_key_deletion(key_id, opts = {}) ⇒ Response
Cancels the scheduled deletion of the specified key. Canceling a scheduled deletion restores the key’s lifecycle state to what it was before its scheduled deletion.
As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/oci/key_management/kms_management_client.rb', line 190 def cancel_key_deletion(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#cancel_key_deletion.' if logger raise "Missing the required parameter 'key_id' when calling cancel_key_deletion." if key_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/actions/cancelDeletion'.sub('{keyId}', key_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] 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 = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#cancel_key_deletion') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#cancel_key_version_deletion(key_id, key_version_id, opts = {}) ⇒ Response
Cancels the scheduled deletion of the specified key version. Canceling a scheduled deletion restores the key version to its lifecycle state from before its scheduled deletion.
As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy.
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/oci/key_management/kms_management_client.rb', line 271 def cancel_key_version_deletion(key_id, key_version_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#cancel_key_version_deletion.' if logger raise "Missing the required parameter 'key_id' when calling cancel_key_version_deletion." if key_id.nil? raise "Missing the required parameter 'key_version_id' when calling cancel_key_version_deletion." if key_version_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) raise "Parameter value for 'key_version_id' must not be blank" if OCI::Internal::Util.blank_string?(key_version_id) path = '/20180608/keys/{keyId}/keyVersions/{keyVersionId}/actions/cancelDeletion'.sub('{keyId}', key_id.to_s).sub('{keyVersionId}', key_version_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] 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 = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#cancel_key_version_deletion') 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::KeyManagement::Models::KeyVersion' ) end # rubocop:enable Metrics/BlockLength end |
#change_key_compartment(key_id, change_key_compartment_details, opts = {}) ⇒ Response
Moves a key into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
When provided, if-match is checked against the ETag values of the key.
As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy.
355 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 393 394 |
# File 'lib/oci/key_management/kms_management_client.rb', line 355 def change_key_compartment(key_id, change_key_compartment_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#change_key_compartment.' if logger raise "Missing the required parameter 'key_id' when calling change_key_compartment." if key_id.nil? raise "Missing the required parameter 'change_key_compartment_details' when calling change_key_compartment." if change_key_compartment_details.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/actions/changeCompartment'.sub('{keyId}', key_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] 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(change_key_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#change_key_compartment') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#create_key(create_key_details, opts = {}) ⇒ Response
Creates a new master encryption key.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management write operations exceeds 10 requests per second for a given tenancy.
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 462 463 464 |
# File 'lib/oci/key_management/kms_management_client.rb', line 427 def create_key(create_key_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#create_key.' if logger raise "Missing the required parameter 'create_key_details' when calling create_key." if create_key_details.nil? path = '/20180608/keys' 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_key_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#create_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#create_key_version(key_id, opts = {}) ⇒ Response
Generates a new [KeyVersion](docs.cloud.oracle.com/api/#/en/key/release/KeyVersion/) resource that provides new cryptographic material for a master encryption key. The key must be in an ‘ENABLED` state to be rotated.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management write operations exceeds 10 requests per second for a given tenancy.
498 499 500 501 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 |
# File 'lib/oci/key_management/kms_management_client.rb', line 498 def create_key_version(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#create_key_version.' if logger raise "Missing the required parameter 'key_id' when calling create_key_version." if key_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/keyVersions'.sub('{keyId}', key_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#create_key_version') 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::KeyManagement::Models::KeyVersion' ) end # rubocop:enable Metrics/BlockLength end |
#disable_key(key_id, opts = {}) ⇒ Response
Disables a master encryption key so it can no longer be used for encryption, decryption, or generating new data encryption keys.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management write operations exceeds 10 requests per second for a given tenancy.
576 577 578 579 580 581 582 583 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 |
# File 'lib/oci/key_management/kms_management_client.rb', line 576 def disable_key(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#disable_key.' if logger raise "Missing the required parameter 'key_id' when calling disable_key." if key_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/actions/disable'.sub('{keyId}', key_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] 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 = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#disable_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#enable_key(key_id, opts = {}) ⇒ Response
Enables a master encryption key so it can be used for encryption, decryption, or generating new data encryption keys.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management write operations exceeds 10 requests per second for a given tenancy.
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 |
# File 'lib/oci/key_management/kms_management_client.rb', line 655 def enable_key(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#enable_key.' if logger raise "Missing the required parameter 'key_id' when calling enable_key." if key_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/actions/enable'.sub('{keyId}', key_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] 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 = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#enable_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#get_key(key_id, opts = {}) ⇒ Response
Gets information about the specified master encryption key.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management read operations exceeds 10 requests per second for a given tenancy.
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 756 |
# File 'lib/oci/key_management/kms_management_client.rb', line 720 def get_key(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#get_key.' if logger raise "Missing the required parameter 'key_id' when calling get_key." if key_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}'.sub('{keyId}', key_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: 'KmsManagementClient#get_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#get_key_version(key_id, key_version_id, opts = {}) ⇒ Response
Gets information about the specified key version.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management read operations exceeds 10 requests per second for a given tenancy.
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 |
# File 'lib/oci/key_management/kms_management_client.rb', line 783 def get_key_version(key_id, key_version_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#get_key_version.' if logger raise "Missing the required parameter 'key_id' when calling get_key_version." if key_id.nil? raise "Missing the required parameter 'key_version_id' when calling get_key_version." if key_version_id.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) raise "Parameter value for 'key_version_id' must not be blank" if OCI::Internal::Util.blank_string?(key_version_id) path = '/20180608/keys/{keyId}/keyVersions/{keyVersionId}'.sub('{keyId}', key_id.to_s).sub('{keyVersionId}', key_version_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: 'KmsManagementClient#get_key_version') 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::KeyManagement::Models::KeyVersion' ) end # rubocop:enable Metrics/BlockLength end |
#get_wrapping_key(opts = {}) ⇒ Response
Gets details about the public RSA wrapping key associated with the vault in the endpoint. Each vault has an RSA key-pair that wraps and unwraps AES key material for import into Key Management.
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 |
# File 'lib/oci/key_management/kms_management_client.rb', line 842 def get_wrapping_key(opts = {}) logger.debug 'Calling operation KmsManagementClient#get_wrapping_key.' if logger path = '/20180608/wrappingKeys' 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: 'KmsManagementClient#get_wrapping_key') 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::KeyManagement::Models::WrappingKey' ) end # rubocop:enable Metrics/BlockLength end |
#import_key(import_key_details, opts = {}) ⇒ Response
Imports AES key material to create a new key with. The key material must be base64-encoded and wrapped by the vault’s public RSA wrapping key before you can import it. Key Management supports AES symmetric keys that are exactly 16, 24, or 32 bytes. Furthermore, the key length must match what you specify at the time of import.
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 |
# File 'lib/oci/key_management/kms_management_client.rb', line 906 def import_key(import_key_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#import_key.' if logger raise "Missing the required parameter 'import_key_details' when calling import_key." if import_key_details.nil? path = '/20180608/keys/import' 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(import_key_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#import_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#import_key_version(key_id, import_key_version_details, opts = {}) ⇒ Response
Imports AES key material to create a new key version with, and then rotates the key to begin using the new key version. The key material must be base64-encoded and wrapped by the vault’s public RSA wrapping key before you can import it. Key Management supports AES symmetric keys that are exactly 16, 24, or 32 bytes. Furthermore, the key length must match the length of the specified key and what you specify as the length at the time of import.
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 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 |
# File 'lib/oci/key_management/kms_management_client.rb', line 976 def import_key_version(key_id, import_key_version_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#import_key_version.' if logger raise "Missing the required parameter 'key_id' when calling import_key_version." if key_id.nil? raise "Missing the required parameter 'import_key_version_details' when calling import_key_version." if import_key_version_details.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/keyVersions/import'.sub('{keyId}', key_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(import_key_version_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#import_key_version') 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::KeyManagement::Models::KeyVersion' ) end # rubocop:enable Metrics/BlockLength end |
#list_key_versions(key_id, opts = {}) ⇒ Response
Lists all [KeyVersion](docs.cloud.oracle.com/api/#/en/key/release/KeyVersion/) resources for the specified master encryption key.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management read operations exceeds 10 requests per second for a given tenancy.
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 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1055 def list_key_versions(key_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#list_key_versions.' if logger raise "Missing the required parameter 'key_id' when calling list_key_versions." if key_id.nil? if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' 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 raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/keyVersions'.sub('{keyId}', key_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[: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: 'KmsManagementClient#list_key_versions') 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: 'Array<OCI::KeyManagement::Models::KeyVersionSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_keys(compartment_id, opts = {}) ⇒ Response
Lists the master encryption keys in the specified vault and compartment.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management read operations exceeds 10 requests per second for a given tenancy.
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 1188 1189 1190 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1142 def list_keys(compartment_id, opts = {}) logger.debug 'Calling operation KmsManagementClient#list_keys.' if logger raise "Missing the required parameter 'compartment_id' when calling list_keys." if compartment_id.nil? if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' 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 path = '/20180608/keys' 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[: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: 'KmsManagementClient#list_keys') 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: 'Array<OCI::KeyManagement::Models::KeySummary>' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
75 76 77 |
# File 'lib/oci/key_management/kms_management_client.rb', line 75 def logger @api_client.config.logger end |
#restore_key_from_file(restore_key_from_file_details, opts = {}) ⇒ Response
Restores the specified key to the specified vault, based on information in the backup file provided. If the vault doesn’t exist, the operation returns a response with a 404 HTTP status error code. You need to first restore the vault associated with the key.
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 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 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1233 def restore_key_from_file(restore_key_from_file_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#restore_key_from_file.' if logger raise "Missing the required parameter 'restore_key_from_file_details' when calling restore_key_from_file." if restore_key_from_file_details.nil? path = '/20180608/keys/actions/restoreFromFile' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-length'] = opts[:content_length] if opts[:content_length] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] header_params[:'content-md5'] = opts[:content_md5] if opts[:content_md5] 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[:'content-type'] ||= 'application/octet-stream' header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(restore_key_from_file_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#restore_key_from_file') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#restore_key_from_object_store(opts = {}) ⇒ Response
Restores the specified key to the specified vault from an Oracle Cloud Infrastructure Object Storage location. If the vault doesn’t exist, the operation returns a response with a 404 HTTP status error code. You need to first restore the vault associated with the key.
1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1309 def restore_key_from_object_store(opts = {}) logger.debug 'Calling operation KmsManagementClient#restore_key_from_object_store.' if logger path = '/20180608/keys/actions/restoreFromObjectStore' 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] 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(opts[:restore_key_from_object_store_details]) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#restore_key_from_object_store') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#schedule_key_deletion(key_id, schedule_key_deletion_details, opts = {}) ⇒ Response
Schedules the deletion of the specified key. This sets the lifecycle state of the key to ‘PENDING_DELETION` and then deletes it after the specified retention period ends.
As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy.
1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1387 def schedule_key_deletion(key_id, schedule_key_deletion_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#schedule_key_deletion.' if logger raise "Missing the required parameter 'key_id' when calling schedule_key_deletion." if key_id.nil? raise "Missing the required parameter 'schedule_key_deletion_details' when calling schedule_key_deletion." if schedule_key_deletion_details.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}/actions/scheduleDeletion'.sub('{keyId}', key_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] 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(schedule_key_deletion_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#schedule_key_deletion') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |
#schedule_key_version_deletion(key_id, key_version_id, schedule_key_version_deletion_details, opts = {}) ⇒ Response
Schedules the deletion of the specified key version. This sets the lifecycle state of the key version to ‘PENDING_DELETION` and then deletes it after the specified retention period ends.
As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy.
1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1469 def schedule_key_version_deletion(key_id, key_version_id, schedule_key_version_deletion_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#schedule_key_version_deletion.' if logger raise "Missing the required parameter 'key_id' when calling schedule_key_version_deletion." if key_id.nil? raise "Missing the required parameter 'key_version_id' when calling schedule_key_version_deletion." if key_version_id.nil? raise "Missing the required parameter 'schedule_key_version_deletion_details' when calling schedule_key_version_deletion." if schedule_key_version_deletion_details.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) raise "Parameter value for 'key_version_id' must not be blank" if OCI::Internal::Util.blank_string?(key_version_id) path = '/20180608/keys/{keyId}/keyVersions/{keyVersionId}/actions/scheduleDeletion'.sub('{keyId}', key_id.to_s).sub('{keyVersionId}', key_version_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] 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(schedule_key_version_deletion_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#schedule_key_version_deletion') 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::KeyManagement::Models::KeyVersion' ) end # rubocop:enable Metrics/BlockLength end |
#update_key(key_id, update_key_details, opts = {}) ⇒ Response
Updates the properties of a master encryption key. Specifically, you can update the ‘displayName`, `freeformTags`, and `definedTags` properties. Furthermore, the key must in an ENABLED or CREATING state to be updated.
As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management write operations exceeds 10 requests per second for a given tenancy.
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 |
# File 'lib/oci/key_management/kms_management_client.rb', line 1546 def update_key(key_id, update_key_details, opts = {}) logger.debug 'Calling operation KmsManagementClient#update_key.' if logger raise "Missing the required parameter 'key_id' when calling update_key." if key_id.nil? raise "Missing the required parameter 'update_key_details' when calling update_key." if update_key_details.nil? raise "Parameter value for 'key_id' must not be blank" if OCI::Internal::Util.blank_string?(key_id) path = '/20180608/keys/{keyId}'.sub('{keyId}', key_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_key_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'KmsManagementClient#update_key') 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::KeyManagement::Models::Key' ) end # rubocop:enable Metrics/BlockLength end |