/AWS1/CL_STG=>ATTACHVOLUME()
¶
About AttachVolume¶
Connects a volume to an iSCSI connection and then attaches the volume to the specified gateway. Detaching and attaching a volume enables you to recover your data from one gateway to a different gateway without creating a snapshot. It also makes it easier to move your volumes from an on-premises gateway to a gateway hosted on an Amazon EC2 instance.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_gatewayarn
TYPE /AWS1/STGGATEWAYARN
/AWS1/STGGATEWAYARN
¶
The Amazon Resource Name (ARN) of the gateway that you want to attach the volume to.
iv_volumearn
TYPE /AWS1/STGVOLUMEARN
/AWS1/STGVOLUMEARN
¶
The Amazon Resource Name (ARN) of the volume to attach to the specified gateway.
iv_networkinterfaceid
TYPE /AWS1/STGNETWORKINTERFACEID
/AWS1/STGNETWORKINTERFACEID
¶
The network interface of the gateway on which to expose the iSCSI target. Only IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.
Valid Values: A valid IP address.
Optional arguments:¶
iv_targetname
TYPE /AWS1/STGTARGETNAME
/AWS1/STGTARGETNAME
¶
The name of the iSCSI target used by an initiator to connect to a volume and used as a suffix for the target ARN. For example, specifying
TargetName
as myvolume results in the target ARN ofarn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume
. The target name must be unique across all volumes on a gateway.If you don't specify a value, Storage Gateway uses the value that was previously used for this volume as the new target name.
iv_diskid
TYPE /AWS1/STGDISKID
/AWS1/STGDISKID
¶
The unique device ID or other distinguishing data that identifies the local disk used to create the volume. This value is only required when you are attaching a stored volume.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_stgattachvolumeoutput
/AWS1/CL_STGATTACHVOLUMEOUTPUT
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
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->/aws1/if_stg~attachvolume(
iv_diskid = |string|
iv_gatewayarn = |string|
iv_networkinterfaceid = |string|
iv_targetname = |string|
iv_volumearn = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_volumearn = lo_result->get_volumearn( ).
lv_targetarn = lo_result->get_targetarn( ).
ENDIF.