Class: OCI::KeyManagement::KmsManagementClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/key_management/kms_management_client.rb

Overview

Use the Key Management API to manage vaults and keys. For more information, see Managing Vaults and Managing Keys.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/oci/key_management/kms_management_client.rb', line 45

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)

  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
  logger.info "KmsManagementClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/key_management/kms_management_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/key_management/kms_management_client.rb', line 19

def endpoint
  @endpoint
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



25
26
27
# File 'lib/oci/key_management/kms_management_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#backup_key(key_id, opts = {}) ⇒ Response

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

  • :backup_key_details (OCI::KeyManagement::Models::BackupKeyDetails)

    BackupKeyDetails

Returns:

  • (Response)

    A Response object with data of type Key



104
105
106
107
108
109
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
# File 'lib/oci/key_management/kms_management_client.rb', line 104

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



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
223
224
# File 'lib/oci/key_management/kms_management_client.rb', line 185

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • key_version_id (String)

    The OCID of the key version.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/oci/key_management/kms_management_client.rb', line 267

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.make_retrying_call(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

Note:

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

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.

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.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



352
353
354
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
# File 'lib/oci/key_management/kms_management_client.rb', line 352

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.make_retrying_call(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

Note:

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

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.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



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
462
# File 'lib/oci/key_management/kms_management_client.rb', line 425

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.make_retrying_call(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

Note:

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

Generates a new 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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

  • :create_key_metadata_details (OCI::KeyManagement::Models::ExternalKeyVersionReference)

    CreateKeyMetadataDetails

Returns:



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 = @api_client.object_to_http_body(opts[:create_key_metadata_details])

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(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

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



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
616
# File 'lib/oci/key_management/kms_management_client.rb', line 577

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



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

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

Returns:

  • (Response)

    A Response object with data of type Key



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
757
758
759
# File 'lib/oci/key_management/kms_management_client.rb', line 723

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • key_version_id (String)

    The OCID of the key version.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

Returns:



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
# File 'lib/oci/key_management/kms_management_client.rb', line 787

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.make_retrying_call(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_replication_status(replication_id, opts = {}) ⇒ Response

Note:

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

When a vault has a replica, each operation on the vault or its resources, such as keys, is replicated and has an associated replicationId. Replication status provides details about whether the operation associated with the given replicationId has been successfully applied across replicas.

Parameters:

  • replication_id (String)

    replicationId associated with an operation on a resource

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

Returns:



851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/oci/key_management/kms_management_client.rb', line 851

def get_replication_status(replication_id, opts = {})
  logger.debug 'Calling operation KmsManagementClient#get_replication_status.' if logger

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

  path = '/20180608/replicaOperations/{replicationId}/status'.sub('{replicationId}', replication_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'KmsManagementClient#get_replication_status') 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::ReplicationStatusDetails'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_wrapping_key(opts = {}) ⇒ Response

Note:

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

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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

Returns:



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 909

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.make_retrying_call(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

Note:

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

Imports AES and RSA keys to create a new key. 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 both RSA and AES keys. The AES keys are symmetric keys of length 128 bits (16 bytes), 192 bits (24 bytes), or 256 bits (32 bytes), and the RSA keys are asymmetric keys of length 2048 bits (256 bytes), 3072 bits (384 bytes), and 4096 bits (512 bytes). Furthermore, the key length must match what you specify at the time of import. When importing an asymmetric key, only private key must be wrapped in PKCS8 format while the corresponding public key is generated internally by KMS.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



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
# File 'lib/oci/key_management/kms_management_client.rb', line 977

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.make_retrying_call(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

Note:

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

Imports AES key material to create a new key version and then rotate 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. When importing an asymmetric key, only the private key must be wrapped in PKCS8 format while the corresponding public key is generated internally by KMS.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:



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
# File 'lib/oci/key_management/kms_management_client.rb', line 1049

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.make_retrying_call(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

Note:

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

Lists all 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.

Parameters:

  • key_id (String)

    The OCID of the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

  • :page (String)

    The value of the opc-next-page response header from the previous "List" call.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :sort_by (String)

    The field to sort by. You can specify only one sort order. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending.

    Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: ASC, DESC

Returns:



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
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
# File 'lib/oci/key_management/kms_management_client.rb', line 1129

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :limit (Integer)

    The maximum number of items to return in a paginated "List" call.

  • :page (String)

    The value of the opc-next-page response header from the previous "List" call.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :sort_by (String)

    The field to sort by. You can specify only one sort order. The default order for TIMECREATED is descending. The default order for DISPLAYNAME is ascending.

    Allowed values are: TIMECREATED, DISPLAYNAME

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC).

    Allowed values are: ASC, DESC

  • :protection_mode (String)

    A key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of HSM means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of SOFTWARE means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of SOFTWARE are performed on the server. A protection mode of EXTERNAL mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of EXTERNAL are performed by external key manager. (default to HSM) Allowed values are: HSM, SOFTWARE, EXTERNAL

  • :algorithm (String)

    The algorithm used by a key's key versions to encrypt or decrypt data. Currently, support includes AES, RSA, and ECDSA algorithms.

    Allowed values are: AES, RSA, ECDSA

  • :length (Integer)

    The length of the key in bytes, expressed as an integer. Supported values include 16, 24, or 32.

  • :curve_id (String)

    The curve ID of the keys. (This pertains only to ECDSA keys.)

    Allowed values are: NIST_P256, NIST_P384, NIST_P521

Returns:



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
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
# File 'lib/oci/key_management/kms_management_client.rb', line 1234

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

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

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

  if opts[:curve_id] && !%w[NIST_P256 NIST_P384 NIST_P521].include?(opts[:curve_id])
    raise 'Invalid value for "curve_id", must be one of NIST_P256, NIST_P384, NIST_P521.'
  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]
  query_params[:protectionMode] = opts[:protection_mode] if opts[:protection_mode]
  query_params[:algorithm] = opts[:algorithm] if opts[:algorithm]
  query_params[:length] = opts[:length] if opts[:length]
  query_params[:curveId] = opts[:curve_id] if opts[:curve_id]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: '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

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



68
69
70
# File 'lib/oci/key_management/kms_management_client.rb', line 68

def logger
  @api_client.config.logger
end

#restore_key_from_file(restore_key_from_file_details, opts = {}) ⇒ Response

Note:

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

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.

Parameters:

  • restore_key_from_file_details (String, IO)

    The encrypted backup file to upload to restore the key.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :content_length (Integer)

    The content length of the body.

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :content_md5 (String)

    The base64-encoded MD5 hash value of the body, as described in RFC 2616, section 14.15. If the Content-MD5 header is present, Key Management performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. If the two hashes don't match, the object is rejected and a response with 400 Unmatched Content MD5 error is returned, along with the message: "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)."

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
# File 'lib/oci/key_management/kms_management_client.rb', line 1342

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.make_retrying_call(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

Note:

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

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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

  • :restore_key_from_object_store_details (OCI::KeyManagement::Models::RestoreKeyFromObjectStoreDetails)

    Location to restore the backup from

Returns:

  • (Response)

    A Response object with data of type Key



1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
# File 'lib/oci/key_management/kms_management_client.rb', line 1419

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.make_retrying_call(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

Note:

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

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.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type Key



1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
# File 'lib/oci/key_management/kms_management_client.rb', line 1498

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.make_retrying_call(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

Note:

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

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.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

  • :opc_retry_token (String)

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

Returns:



1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
# File 'lib/oci/key_management/kms_management_client.rb', line 1581

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.make_retrying_call(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

Note:

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

Updates the properties of a master encryption key. Specifically, you can update the displayName, freeformTags, and definedTags properties. Furthermore, the key must be 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.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.

Returns:

  • (Response)

    A Response object with data of type Key



1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
# File 'lib/oci/key_management/kms_management_client.rb', line 1659

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.make_retrying_call(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