Skip to content

/AWS1/IF_TRN=>IMPORTHOSTKEY()

About ImportHostKey

Adds a host key to the server that's specified by the ServerId parameter.

Method Signature

METHODS /AWS1/IF_TRN~IMPORTHOSTKEY
  IMPORTING
    !IV_SERVERID TYPE /AWS1/TRNSERVERID OPTIONAL
    !IV_HOSTKEYBODY TYPE /AWS1/TRNHOSTKEY OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/TRNHOSTKEYDESCRIPTION OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_TRNTAG=>TT_TAGS OPTIONAL
    !IV_STORAGETYPE TYPE /AWS1/TRNHOSTKEYSTORAGETYPE OPTIONAL
    !IV_KMSKEY TYPE /AWS1/TRNKMSKEY OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_trnimporthostkeyrsp
  RAISING
    /AWS1/CX_TRNINTERNALSVCERROR
    /AWS1/CX_TRNINVALIDREQUESTEX
    /AWS1/CX_TRNRESOURCEEXISTSEX
    /AWS1/CX_TRNRESOURCENOTFOUNDEX
    /AWS1/CX_TRNSERVICEUNAVAILEX
    /AWS1/CX_TRNTHROTTLINGEX
    /AWS1/CX_TRNCLIENTEXC
    /AWS1/CX_TRNSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_serverid TYPE /AWS1/TRNSERVERID /AWS1/TRNSERVERID

The identifier of the server that contains the host key that you are importing.

iv_hostkeybody TYPE /AWS1/TRNHOSTKEY /AWS1/TRNHOSTKEY

The private key portion of an SSH key pair.

Transfer Family accepts RSA, ECDSA, and ED25519 keys.

Optional arguments:

iv_description TYPE /AWS1/TRNHOSTKEYDESCRIPTION /AWS1/TRNHOSTKEYDESCRIPTION

The text description that identifies this host key.

it_tags TYPE /AWS1/CL_TRNTAG=>TT_TAGS TT_TAGS

Key-value pairs that can be used to group and search for host keys.

iv_storagetype TYPE /AWS1/TRNHOSTKEYSTORAGETYPE /AWS1/TRNHOSTKEYSTORAGETYPE

Specifies whether the host key is stored by Transfer Family (SERVICE_MANAGED) or in Secrets Manager (SECRETS_MANAGER). When you specify SECRETS_MANAGER, Transfer Family stores the private host key material in an Secrets Manager secret.

iv_kmskey TYPE /AWS1/TRNKMSKEY /AWS1/TRNKMSKEY

The Amazon Resource Name (ARN) of the KMS key used to encrypt the Secrets Manager secret that stores the host key. If you specify a customer managed key, its key policy must allow the AWSServiceRoleForTransfer service-linked role to decrypt the secret. If you don't specify a value, Transfer Family uses the Amazon Web Services managed key for Secrets Manager.

RETURNING

oo_output TYPE REF TO /aws1/cl_trnimporthostkeyrsp /AWS1/CL_TRNIMPORTHOSTKEYRSP

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->importhostkey(
  it_tags = VALUE /aws1/cl_trntag=>tt_tags(
    (
      new /aws1/cl_trntag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_description = |string|
  iv_hostkeybody = |string|
  iv_kmskey = |string|
  iv_serverid = |string|
  iv_storagetype = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_serverid = lo_result->get_serverid( ).
  lv_hostkeyid = lo_result->get_hostkeyid( ).
ENDIF.