/AWS1/IF_ECS=>REGISTERCONTAINERINSTANCE()¶
About RegisterContainerInstance¶
This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.
Registers an EC2 instance into the specified cluster. This instance becomes available to place containers on.
Method Signature¶
METHODS /AWS1/IF_ECS~REGISTERCONTAINERINSTANCE
IMPORTING
!IV_CLUSTER TYPE /AWS1/ECSSTRING OPTIONAL
!IV_INSTANCEIDENTITYDOCUMENT TYPE /AWS1/ECSSTRING OPTIONAL
!IV_INSTANCEIDENTITYDOCSIG TYPE /AWS1/ECSSTRING OPTIONAL
!IT_TOTALRESOURCES TYPE /AWS1/CL_ECSRESOURCE=>TT_RESOURCES OPTIONAL
!IO_VERSIONINFO TYPE REF TO /AWS1/CL_ECSVERSIONINFO OPTIONAL
!IV_CONTAINERINSTANCEARN TYPE /AWS1/ECSSTRING OPTIONAL
!IT_ATTRIBUTES TYPE /AWS1/CL_ECSATTRIBUTE=>TT_ATTRIBUTES OPTIONAL
!IT_PLATFORMDEVICES TYPE /AWS1/CL_ECSPLATFORMDEVICE=>TT_PLATFORMDEVICES OPTIONAL
!IT_TAGS TYPE /AWS1/CL_ECSTAG=>TT_TAGS OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecsregcontainerinst01
RAISING
/AWS1/CX_ECSCLIENTEXCEPTION
/AWS1/CX_ECSINVALIDPARAMETEREX
/AWS1/CX_ECSSERVEREXCEPTION
/AWS1/CX_ECSCLIENTEXC
/AWS1/CX_ECSSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Optional arguments:¶
iv_cluster TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING¶
The short name or full Amazon Resource Name (ARN) of the cluster to register your container instance with. If you do not specify a cluster, the default cluster is assumed.
iv_instanceidentitydocument TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING¶
The instance identity document for the EC2 instance to register. This document can be found by running the following command from the instance:
curl http://169.254.169.254/latest/dynamic/instance-identity/document/
iv_instanceidentitydocsig TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING¶
The instance identity document signature for the EC2 instance to register. This signature can be found by running the following command from the instance:
curl http://169.254.169.254/latest/dynamic/instance-identity/signature/
it_totalresources TYPE /AWS1/CL_ECSRESOURCE=>TT_RESOURCES TT_RESOURCES¶
The resources available on the instance.
io_versioninfo TYPE REF TO /AWS1/CL_ECSVERSIONINFO /AWS1/CL_ECSVERSIONINFO¶
The version information for the Amazon ECS container agent and Docker daemon that runs on the container instance.
iv_containerinstancearn TYPE /AWS1/ECSSTRING /AWS1/ECSSTRING¶
The ARN of the container instance (if it was previously registered).
it_attributes TYPE /AWS1/CL_ECSATTRIBUTE=>TT_ATTRIBUTES TT_ATTRIBUTES¶
The container instance attributes that this container instance supports.
it_platformdevices TYPE /AWS1/CL_ECSPLATFORMDEVICE=>TT_PLATFORMDEVICES TT_PLATFORMDEVICES¶
The devices that are available on the container instance. The only supported device type is a GPU.
it_tags TYPE /AWS1/CL_ECSTAG=>TT_TAGS TT_TAGS¶
The metadata that you apply to the container instance to help you categorize and organize them. Each tag consists of a key and an optional value. You define both.
The following basic restrictions apply to tags:
Maximum number of tags per resource - 50
For each resource, each tag key must be unique, and each tag key can have only one value.
Maximum key length - 128 Unicode characters in UTF-8
Maximum value length - 256 Unicode characters in UTF-8
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
Tag keys and values are case-sensitive.
Do not use
aws:,AWS:, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ecsregcontainerinst01 /AWS1/CL_ECSREGCONTAINERINST01¶
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->registercontainerinstance(
io_versioninfo = new /aws1/cl_ecsversioninfo(
iv_agenthash = |string|
iv_agentversion = |string|
iv_dockerversion = |string|
)
it_attributes = VALUE /aws1/cl_ecsattribute=>tt_attributes(
(
new /aws1/cl_ecsattribute(
iv_name = |string|
iv_targetid = |string|
iv_targettype = |string|
iv_value = |string|
)
)
)
it_platformdevices = VALUE /aws1/cl_ecsplatformdevice=>tt_platformdevices(
(
new /aws1/cl_ecsplatformdevice(
iv_id = |string|
iv_type = |string|
)
)
)
it_tags = VALUE /aws1/cl_ecstag=>tt_tags(
(
new /aws1/cl_ecstag(
iv_key = |string|
iv_value = |string|
)
)
)
it_totalresources = VALUE /aws1/cl_ecsresource=>tt_resources(
(
new /aws1/cl_ecsresource(
it_stringsetvalue = VALUE /aws1/cl_ecsstringlist_w=>tt_stringlist(
( new /aws1/cl_ecsstringlist_w( |string| ) )
)
iv_doublevalue = '0.1'
iv_integervalue = 123
iv_longvalue = 123
iv_name = |string|
iv_type = |string|
)
)
)
iv_cluster = |string|
iv_containerinstancearn = |string|
iv_instanceidentitydocsig = |string|
iv_instanceidentitydocument = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_containerinstance = lo_result->get_containerinstance( ).
IF lo_containerinstance IS NOT INITIAL.
lv_string = lo_containerinstance->get_containerinstancearn( ).
lv_string = lo_containerinstance->get_ec2instanceid( ).
lv_string = lo_containerinstance->get_capacityprovidername( ).
lv_long = lo_containerinstance->get_version( ).
lo_versioninfo = lo_containerinstance->get_versioninfo( ).
IF lo_versioninfo IS NOT INITIAL.
lv_string = lo_versioninfo->get_agentversion( ).
lv_string = lo_versioninfo->get_agenthash( ).
lv_string = lo_versioninfo->get_dockerversion( ).
ENDIF.
LOOP AT lo_containerinstance->get_remainingresources( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_string = lo_row_1->get_name( ).
lv_string = lo_row_1->get_type( ).
lv_double = lo_row_1->get_doublevalue( ).
lv_long = lo_row_1->get_longvalue( ).
lv_integer = lo_row_1->get_integervalue( ).
LOOP AT lo_row_1->get_stringsetvalue( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
LOOP AT lo_containerinstance->get_registeredresources( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_string = lo_row_1->get_name( ).
lv_string = lo_row_1->get_type( ).
lv_double = lo_row_1->get_doublevalue( ).
lv_long = lo_row_1->get_longvalue( ).
lv_integer = lo_row_1->get_integervalue( ).
LOOP AT lo_row_1->get_stringsetvalue( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
lv_string = lo_containerinstance->get_status( ).
lv_string = lo_containerinstance->get_statusreason( ).
lv_boolean = lo_containerinstance->get_agentconnected( ).
lv_integer = lo_containerinstance->get_runningtaskscount( ).
lv_integer = lo_containerinstance->get_pendingtaskscount( ).
lv_agentupdatestatus = lo_containerinstance->get_agentupdatestatus( ).
LOOP AT lo_containerinstance->get_attributes( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_string = lo_row_5->get_name( ).
lv_string = lo_row_5->get_value( ).
lv_targettype = lo_row_5->get_targettype( ).
lv_string = lo_row_5->get_targetid( ).
ENDIF.
ENDLOOP.
lv_timestamp = lo_containerinstance->get_registeredat( ).
LOOP AT lo_containerinstance->get_attachments( ) into lo_row_6.
lo_row_7 = lo_row_6.
IF lo_row_7 IS NOT INITIAL.
lv_string = lo_row_7->get_id( ).
lv_string = lo_row_7->get_type( ).
lv_string = lo_row_7->get_status( ).
LOOP AT lo_row_7->get_details( ) into lo_row_8.
lo_row_9 = lo_row_8.
IF lo_row_9 IS NOT INITIAL.
lv_string = lo_row_9->get_name( ).
lv_string = lo_row_9->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
LOOP AT lo_containerinstance->get_tags( ) into lo_row_10.
lo_row_11 = lo_row_10.
IF lo_row_11 IS NOT INITIAL.
lv_tagkey = lo_row_11->get_key( ).
lv_tagvalue = lo_row_11->get_value( ).
ENDIF.
ENDLOOP.
lo_containerinstancehealth = lo_containerinstance->get_healthstatus( ).
IF lo_containerinstancehealth IS NOT INITIAL.
lv_instancehealthcheckstat = lo_containerinstancehealth->get_overallstatus( ).
LOOP AT lo_containerinstancehealth->get_details( ) into lo_row_12.
lo_row_13 = lo_row_12.
IF lo_row_13 IS NOT INITIAL.
lv_instancehealthchecktype = lo_row_13->get_type( ).
lv_instancehealthcheckstat = lo_row_13->get_status( ).
lv_timestamp = lo_row_13->get_lastupdated( ).
lv_timestamp = lo_row_13->get_laststatuschange( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.