/AWS1/IF_SCG=>CREATESERVICEACTION()¶
About CreateServiceAction¶
Creates a self-service action.
Method Signature¶
METHODS /AWS1/IF_SCG~CREATESERVICEACTION
  IMPORTING
    !IV_NAME TYPE /AWS1/SCGSERVICEACTIONNAME OPTIONAL
    !IV_DEFINITIONTYPE TYPE /AWS1/SCGSERVICEACTIONDEFNTYPE OPTIONAL
    !IT_DEFINITION TYPE /AWS1/CL_SCGSVCACTIONDEFNMAP_W=>TT_SERVICEACTIONDEFINITIONMAP OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/SCGSERVICEACTIONDESC OPTIONAL
    !IV_ACCEPTLANGUAGE TYPE /AWS1/SCGACCEPTLANGUAGE OPTIONAL
    !IV_IDEMPOTENCYTOKEN TYPE /AWS1/SCGIDEMPOTENCYTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_scgcreatesvcactionout
  RAISING
    /AWS1/CX_SCGINVALIDPARAMSEX
    /AWS1/CX_SCGLIMITEXCEEDEDEX
    /AWS1/CX_SCGCLIENTEXC
    /AWS1/CX_SCGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/SCGSERVICEACTIONNAME /AWS1/SCGSERVICEACTIONNAME¶
The self-service action name.
iv_definitiontype TYPE /AWS1/SCGSERVICEACTIONDEFNTYPE /AWS1/SCGSERVICEACTIONDEFNTYPE¶
The service action definition type. For example,
SSM_AUTOMATION.
it_definition TYPE /AWS1/CL_SCGSVCACTIONDEFNMAP_W=>TT_SERVICEACTIONDEFINITIONMAP TT_SERVICEACTIONDEFINITIONMAP¶
The self-service action definition. Can be one of the following:
- Name
The name of the Amazon Web Services Systems Manager document (SSM document). For example,
AWS-RestartEC2Instance.If you are using a shared SSM document, you must provide the ARN instead of the name.
- Version
The Amazon Web Services Systems Manager automation document version. For example,
"Version": "1"- AssumeRole
The Amazon Resource Name (ARN) of the role that performs the self-service actions on your behalf. For example,
"AssumeRole": "arn:aws:iam::12345678910:role/ActionRole".To reuse the provisioned product launch role, set to
"AssumeRole": "LAUNCH_ROLE".- Parameters
The list of parameters in JSON format.
For example:
[{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}]or[{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}].
iv_idempotencytoken TYPE /AWS1/SCGIDEMPOTENCYTOKEN /AWS1/SCGIDEMPOTENCYTOKEN¶
A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.
Optional arguments:¶
iv_description TYPE /AWS1/SCGSERVICEACTIONDESC /AWS1/SCGSERVICEACTIONDESC¶
The self-service action description.
iv_acceptlanguage TYPE /AWS1/SCGACCEPTLANGUAGE /AWS1/SCGACCEPTLANGUAGE¶
The language code.
jp- Japanese
zh- Chinese
RETURNING¶
oo_output TYPE REF TO /aws1/cl_scgcreatesvcactionout /AWS1/CL_SCGCREATESVCACTIONOUT¶
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->createserviceaction(
  it_definition = VALUE /aws1/cl_scgsvcactiondefnmap_w=>tt_serviceactiondefinitionmap(
    (
      VALUE /aws1/cl_scgsvcactiondefnmap_w=>ts_serviceactiondefnmap_maprow(
        key = |string|
        value = new /aws1/cl_scgsvcactiondefnmap_w( |string| )
      )
    )
  )
  iv_acceptlanguage = |string|
  iv_definitiontype = |string|
  iv_description = |string|
  iv_idempotencytoken = |string|
  iv_name = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_serviceactiondetail = lo_result->get_serviceactiondetail( ).
  IF lo_serviceactiondetail IS NOT INITIAL.
    lo_serviceactionsummary = lo_serviceactiondetail->get_serviceactionsummary( ).
    IF lo_serviceactionsummary IS NOT INITIAL.
      lv_id = lo_serviceactionsummary->get_id( ).
      lv_serviceactionname = lo_serviceactionsummary->get_name( ).
      lv_serviceactiondescriptio = lo_serviceactionsummary->get_description( ).
      lv_serviceactiondefinition = lo_serviceactionsummary->get_definitiontype( ).
    ENDIF.
    LOOP AT lo_serviceactiondetail->get_definition( ) into ls_row.
      lv_key = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_serviceactiondefinition_1 = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.