lib/oci/key_management/kms_management_client.rb
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
# 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.
#
# @param [String] key_id The OCID of the key.
# @param [OCI::KeyManagement::Models::ImportKeyVersionDetails] import_key_version_details ImportKeyVersionDetails
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config 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
# @option opts [String] :opc_request_id 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.
#
# @option opts [String] :opc_retry_token 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).
#
# @return [Response] A Response object with data of type {OCI::KeyManagement::Models::KeyVersion KeyVersion}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/keymanagement/import_key_version.rb.html) to see an example of how to use import_key_version API.
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.
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 .
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
      query_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]
      header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
      post_body = @api_client.object_to_http_body(import_key_version_details)
      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
    end
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 query_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 ] header_params [ :' opc-retry-token ' ] ||= OCI :: Retry . generate_opc_retry_token post_body = @api_client . object_to_http_body ( import_key_version_details ) 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 end
Imports AES key material to create a new key version with, and then rotates the key to begin using the new
key version.
Imports AES key material to create a new key version with and then rotates the key to begin using the new key version .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type {OCI::KeyManagement::Models::KeyVersion KeyVersion}
A Response object with data of type { OCI :: KeyManagement :: Models :: KeyVersion KeyVersion }
Response
key_id
import_key_version_details
opts
:opc_retry_token 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 .
: opc_retry_token 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 .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use import_key_version API.
Click [ here ] to see an example of how to use import_key_version API .