Skip to content

/AWS1/IF_IMG=>STARTRESOURCESTATEUPDATE()

About StartResourceStateUpdate

Begin asynchronous resource state update for lifecycle changes to the specified image resources.

Method Signature

METHODS /AWS1/IF_IMG~STARTRESOURCESTATEUPDATE
  IMPORTING
    !IV_RESOURCEARN TYPE /AWS1/IMGIMAGEBUILDVERSIONARN OPTIONAL
    !IO_STATE TYPE REF TO /AWS1/CL_IMGRESOURCESTATE OPTIONAL
    !IV_EXECUTIONROLE TYPE /AWS1/IMGROLENAMEORARN OPTIONAL
    !IO_INCLUDERESOURCES TYPE REF TO /AWS1/CL_IMGRESRCSTATEUPINCR00 OPTIONAL
    !IO_EXCLUSIONRULES TYPE REF TO /AWS1/CL_IMGRESRCSTATEUPEXCL00 OPTIONAL
    !IV_UPDATEAT TYPE /AWS1/IMGDATETIMETIMESTAMP OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/IMGCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_imgstrtresrcstateup01
  RAISING
    /AWS1/CX_IMGCALLRLIMEXCEEDEDEX
    /AWS1/CX_IMGCLIENTEXCEPTION
    /AWS1/CX_IMGFORBIDDENEXCEPTION
    /AWS1/CX_IMGIDEMPOTENTPRMMIS00
    /AWS1/CX_IMGINVALIDREQUESTEX
    /AWS1/CX_IMGRESOURCEINUSEEX
    /AWS1/CX_IMGRESOURCENOTFOUNDEX
    /AWS1/CX_IMGSERVICEEXCEPTION
    /AWS1/CX_IMGSERVICEUNAVAILEX
    /AWS1/CX_IMGCLIENTEXC
    /AWS1/CX_IMGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_resourcearn TYPE /AWS1/IMGIMAGEBUILDVERSIONARN /AWS1/IMGIMAGEBUILDVERSIONARN

The Amazon Resource Name (ARN) of the image build version to update. The image must be in one of these terminal states: AVAILABLE, DEPRECATED, DISABLED, FAILED, or CANCELLED. Images with FAILED or CANCELLED status can transition only to DELETED.

io_state TYPE REF TO /AWS1/CL_IMGRESOURCESTATE /AWS1/CL_IMGRESOURCESTATE

Specifies the lifecycle action to take for this request. For AMI-based images, valid values are AVAILABLE, DEPRECATED, DISABLED, and DELETED. For container-based images, only DELETED is supported.

iv_clienttoken TYPE /AWS1/IMGCLIENTTOKEN /AWS1/IMGCLIENTTOKEN

Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

Optional arguments:

iv_executionrole TYPE /AWS1/IMGROLENAMEORARN /AWS1/IMGROLENAMEORARN

The name or Amazon Resource Name (ARN) of the IAM role that’s used to update image state.

io_includeresources TYPE REF TO /AWS1/CL_IMGRESRCSTATEUPINCR00 /AWS1/CL_IMGRESRCSTATEUPINCR00

Specifies which image resources to include in the state update. When specified, the lifecycle action applies to underlying resources. These resources include AMIs, snapshots, and containers in addition to the Image Builder image resource. Requires executionRole to also be specified. To delete an image and its underlying resources, you must specify includeResources. To delete only the Image Builder image record without affecting underlying resources, use the DeleteImage API instead.

io_exclusionrules TYPE REF TO /AWS1/CL_IMGRESRCSTATEUPEXCL00 /AWS1/CL_IMGRESRCSTATEUPEXCL00

Skip action on the image resource and associated resources if specified exclusion rules are met.

iv_updateat TYPE /AWS1/IMGDATETIMETIMESTAMP /AWS1/IMGDATETIMETIMESTAMP

Specifies the timestamp when the state transition takes effect. Use this parameter only when the target status is DEPRECATED. The value must be a future time.

RETURNING

oo_output TYPE REF TO /aws1/cl_imgstrtresrcstateup01 /AWS1/CL_IMGSTRTRESRCSTATEUP01

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->startresourcestateupdate(
  io_exclusionrules = new /aws1/cl_imgresrcstateupexcl00(
    io_amis = new /aws1/cl_imglcplydetexclusio01(
      io_lastlaunched = new /aws1/cl_imglcplydetexclusio02(
        iv_unit = |string|
        iv_value = 123
      )
      it_regions = VALUE /aws1/cl_imgstringlist_w=>tt_stringlist(
        ( new /aws1/cl_imgstringlist_w( |string| ) )
      )
      it_sharedaccounts = VALUE /aws1/cl_imgaccountlist_w=>tt_accountlist(
        ( new /aws1/cl_imgaccountlist_w( |string| ) )
      )
      it_tagmap = VALUE /aws1/cl_imgtagmap_w=>tt_tagmap(
        (
          VALUE /aws1/cl_imgtagmap_w=>ts_tagmap_maprow(
            key = |string|
            value = new /aws1/cl_imgtagmap_w( |string| )
          )
        )
      )
      iv_ispublic = ABAP_TRUE
    )
  )
  io_includeresources = new /aws1/cl_imgresrcstateupincr00(
    iv_amis = ABAP_TRUE
    iv_containers = ABAP_TRUE
    iv_snapshots = ABAP_TRUE
  )
  io_state = new /aws1/cl_imgresourcestate( |string| )
  iv_clienttoken = |string|
  iv_executionrole = |string|
  iv_resourcearn = |string|
  iv_updateat = '20150101000000.0000000'
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_lifecycleexecutionid = lo_result->get_lifecycleexecutionid( ).
  lv_imagebuildversionarn = lo_result->get_resourcearn( ).
ENDIF.