/AWS1/IF_EC2=>ENABLEFASTLAUNCH()
¶
About EnableFastLaunch¶
When you enable Windows fast launch for a Windows AMI, images are pre-provisioned, using snapshots to launch instances up to 65% faster. To create the optimized Windows image, Amazon EC2 launches an instance and runs through Sysprep steps, rebooting as required. Then it creates a set of reserved snapshots that are used for subsequent launches. The reserved snapshots are automatically replenished as they are used, depending on your settings for launch frequency.
You can only change these settings for Windows AMIs that you own or that have been shared with you.
Method Signature¶
METHODS /AWS1/IF_EC2~ENABLEFASTLAUNCH
IMPORTING
!IV_IMAGEID TYPE /AWS1/EC2IMAGEID OPTIONAL
!IV_RESOURCETYPE TYPE /AWS1/EC2STRING OPTIONAL
!IO_SNAPSHOTCONFIGURATION TYPE REF TO /AWS1/CL_EC2FASTLAUNCHSNAPCO01 OPTIONAL
!IO_LAUNCHTEMPLATE TYPE REF TO /AWS1/CL_EC2FASTLAUNCHLAUNCH01 OPTIONAL
!IV_MAXPARALLELLAUNCHES TYPE /AWS1/EC2INTEGER OPTIONAL
!IV_DRYRUN TYPE /AWS1/EC2BOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ec2enbfastlaunchrslt
RAISING
/AWS1/CX_EC2CLIENTEXC
/AWS1/CX_EC2SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_imageid
TYPE /AWS1/EC2IMAGEID
/AWS1/EC2IMAGEID
¶
Specify the ID of the image for which to enable Windows fast launch.
Optional arguments:¶
iv_resourcetype
TYPE /AWS1/EC2STRING
/AWS1/EC2STRING
¶
The type of resource to use for pre-provisioning the AMI for Windows fast launch. Supported values include:
snapshot
, which is the default value.
io_snapshotconfiguration
TYPE REF TO /AWS1/CL_EC2FASTLAUNCHSNAPCO01
/AWS1/CL_EC2FASTLAUNCHSNAPCO01
¶
Configuration settings for creating and managing the snapshots that are used for pre-provisioning the AMI for Windows fast launch. The associated
ResourceType
must besnapshot
.
io_launchtemplate
TYPE REF TO /AWS1/CL_EC2FASTLAUNCHLAUNCH01
/AWS1/CL_EC2FASTLAUNCHLAUNCH01
¶
The launch template to use when launching Windows instances from pre-provisioned snapshots. Launch template parameters can include either the name or ID of the launch template, but not both.
iv_maxparallellaunches
TYPE /AWS1/EC2INTEGER
/AWS1/EC2INTEGER
¶
The maximum number of instances that Amazon EC2 can launch at the same time to create pre-provisioned snapshots for Windows fast launch. Value must be
6
or greater.
iv_dryrun
TYPE /AWS1/EC2BOOLEAN
/AWS1/EC2BOOLEAN
¶
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation
. Otherwise, it isUnauthorizedOperation
.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_ec2enbfastlaunchrslt
/AWS1/CL_EC2ENBFASTLAUNCHRSLT
¶
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->enablefastlaunch(
io_launchtemplate = new /aws1/cl_ec2fastlaunchlaunch01(
iv_launchtemplateid = |string|
iv_launchtemplatename = |string|
iv_version = |string|
)
io_snapshotconfiguration = new /aws1/cl_ec2fastlaunchsnapco01( 123 )
iv_dryrun = ABAP_TRUE
iv_imageid = |string|
iv_maxparallellaunches = 123
iv_resourcetype = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_imageid = lo_result->get_imageid( ).
lv_fastlaunchresourcetype = lo_result->get_resourcetype( ).
lo_fastlaunchsnapshotconfi = lo_result->get_snapshotconfiguration( ).
IF lo_fastlaunchsnapshotconfi IS NOT INITIAL.
lv_integer = lo_fastlaunchsnapshotconfi->get_targetresourcecount( ).
ENDIF.
lo_fastlaunchlaunchtemplat = lo_result->get_launchtemplate( ).
IF lo_fastlaunchlaunchtemplat IS NOT INITIAL.
lv_launchtemplateid = lo_fastlaunchlaunchtemplat->get_launchtemplateid( ).
lv_string = lo_fastlaunchlaunchtemplat->get_launchtemplatename( ).
lv_string = lo_fastlaunchlaunchtemplat->get_version( ).
ENDIF.
lv_integer = lo_result->get_maxparallellaunches( ).
lv_string = lo_result->get_ownerid( ).
lv_fastlaunchstatecode = lo_result->get_state( ).
lv_string = lo_result->get_statetransitionreason( ).
lv_milliseconddatetime = lo_result->get_statetransitiontime( ).
ENDIF.