/AWS1/IF_IMG=>CREATECOMPONENT()¶
About CreateComponent¶
Creates a new component that can be used to build, validate, test, and assess your image. The component is based on a YAML document that you specify using exactly one of the following methods:
-
Inline, using the
dataproperty in the request body. -
A URL that points to a YAML document file stored in Amazon S3, using the
uriproperty in the request body.
Method Signature¶
METHODS /AWS1/IF_IMG~CREATECOMPONENT
IMPORTING
!IV_NAME TYPE /AWS1/IMGRESOURCENAME OPTIONAL
!IV_SEMANTICVERSION TYPE /AWS1/IMGVERSIONNUMBER OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/IMGNONEMPTYSTRING OPTIONAL
!IV_CHANGEDESCRIPTION TYPE /AWS1/IMGNONEMPTYSTRING OPTIONAL
!IV_PLATFORM TYPE /AWS1/IMGPLATFORM OPTIONAL
!IT_SUPPORTEDOSVERSIONS TYPE /AWS1/CL_IMGOSVERSIONLIST_W=>TT_OSVERSIONLIST OPTIONAL
!IV_DATA TYPE /AWS1/IMGINLINECOMPONENTDATA OPTIONAL
!IV_URI TYPE /AWS1/IMGURI OPTIONAL
!IV_KMSKEYID TYPE /AWS1/IMGNONEMPTYSTRING OPTIONAL
!IT_TAGS TYPE /AWS1/CL_IMGTAGMAP_W=>TT_TAGMAP OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/IMGCLIENTTOKEN OPTIONAL
!IV_DRYRUN TYPE /AWS1/IMGBOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_imgcreatecomponentrsp
RAISING
/AWS1/CX_IMGCALLRLIMEXCEEDEDEX
/AWS1/CX_IMGCLIENTEXCEPTION
/AWS1/CX_IMGDRYRUNOPERATIONEX
/AWS1/CX_IMGFORBIDDENEXCEPTION
/AWS1/CX_IMGIDEMPOTENTPRMMIS00
/AWS1/CX_IMGINVPRMCOMBINATIO00
/AWS1/CX_IMGINVALIDREQUESTEX
/AWS1/CX_IMGINVALIDVRSNUMBEREX
/AWS1/CX_IMGRESOURCEINUSEEX
/AWS1/CX_IMGSERVICEEXCEPTION
/AWS1/CX_IMGSERVICEQUOTAEXCDEX
/AWS1/CX_IMGSERVICEUNAVAILEX
/AWS1/CX_IMGCLIENTEXC
/AWS1/CX_IMGSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/IMGRESOURCENAME /AWS1/IMGRESOURCENAME¶
The name of the component.
iv_semanticversion TYPE /AWS1/IMGVERSIONNUMBER /AWS1/IMGVERSIONNUMBER¶
The semantic version of the component. This version follows the semantic version syntax.
The semantic version has four nodes:
. . / . You can assign values for the first three, and can filter on all of them. Assignment: For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.
Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.
iv_platform TYPE /AWS1/IMGPLATFORM /AWS1/IMGPLATFORM¶
The operating system platform of the component.
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_description TYPE /AWS1/IMGNONEMPTYSTRING /AWS1/IMGNONEMPTYSTRING¶
Describes the contents of the component.
iv_changedescription TYPE /AWS1/IMGNONEMPTYSTRING /AWS1/IMGNONEMPTYSTRING¶
The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of the component.
it_supportedosversions TYPE /AWS1/CL_IMGOSVERSIONLIST_W=>TT_OSVERSIONLIST TT_OSVERSIONLIST¶
The operating system (OS) version supported by the component. If the OS information is available, a prefix match is performed against the base image OS version during image recipe creation.
iv_data TYPE /AWS1/IMGINLINECOMPONENTDATA /AWS1/IMGINLINECOMPONENTDATA¶
Component
datacontains inline YAML document content for the component. Alternatively, you can specify theuriof a YAML document file stored in Amazon S3. However, you cannot specify both properties.
iv_uri TYPE /AWS1/IMGURI /AWS1/IMGURI¶
The
uriof a YAML component document file. This must be an S3 URL (s3://bucket/key), and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can specify component content up to your service quota.Alternatively, you can specify the YAML document inline, using the component
dataproperty. You cannot specify both properties.
iv_kmskeyid TYPE /AWS1/IMGNONEMPTYSTRING /AWS1/IMGNONEMPTYSTRING¶
The Amazon Resource Name (ARN) that uniquely identifies the KMS key used to encrypt this component. This can be either the Key ARN or the Alias ARN. For more information, see Key identifiers (KeyId) in the Key Management Service Developer Guide.
it_tags TYPE /AWS1/CL_IMGTAGMAP_W=>TT_TAGMAP TT_TAGMAP¶
The tags that apply to the component.
iv_dryrun TYPE /AWS1/IMGBOOLEAN /AWS1/IMGBOOLEAN¶
Validates the required permissions for the operation and the request parameters, without actually making the request, and provides an error response. Upon a successful request, the error response is
DryRunOperationException.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_imgcreatecomponentrsp /AWS1/CL_IMGCREATECOMPONENTRSP¶
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->createcomponent(
it_supportedosversions = VALUE /aws1/cl_imgosversionlist_w=>tt_osversionlist(
( new /aws1/cl_imgosversionlist_w( |string| ) )
)
it_tags = VALUE /aws1/cl_imgtagmap_w=>tt_tagmap(
(
VALUE /aws1/cl_imgtagmap_w=>ts_tagmap_maprow(
value = new /aws1/cl_imgtagmap_w( |string| )
key = |string|
)
)
)
iv_changedescription = |string|
iv_clienttoken = |string|
iv_data = |string|
iv_description = |string|
iv_dryrun = ABAP_TRUE
iv_kmskeyid = |string|
iv_name = |string|
iv_platform = |string|
iv_semanticversion = |string|
iv_uri = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_nonemptystring = lo_result->get_requestid( ).
lv_clienttoken = lo_result->get_clienttoken( ).
lv_componentbuildversionar = lo_result->get_componentbuildversionarn( ).
lo_latestversionreferences = lo_result->get_latestversionreferences( ).
IF lo_latestversionreferences IS NOT INITIAL.
lv_imagebuilderarn = lo_latestversionreferences->get_latestversionarn( ).
lv_imagebuilderarn = lo_latestversionreferences->get_latestmajorversionarn( ).
lv_imagebuilderarn = lo_latestversionreferences->get_latestminorversionarn( ).
lv_imagebuilderarn = lo_latestversionreferences->get_latestpatchversionarn( ).
ENDIF.
ENDIF.