Skip to content

/AWS1/IF_REV=>CREATESERVICE()

About CreateService

Creates a service.

Method Signature

METHODS /AWS1/IF_REV~CREATESERVICE
  IMPORTING
    !IV_NAME TYPE /AWS1/REVENTITYNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/REVLONGDESCRIPTION OPTIONAL
    !IT_ASSOCIATEDSYSTEMS TYPE /AWS1/CL_REVASSOCIATEDSYSTEM=>TT_ASSOCIATEDSYSTEMLIST OPTIONAL
    !IV_POLICYARN TYPE /AWS1/REVARN OPTIONAL
    !IT_REGIONS TYPE /AWS1/CL_REVREGIONLIST_W=>TT_REGIONLIST OPTIONAL
    !IO_PERMISSIONMODEL TYPE REF TO /AWS1/CL_REVPERMISSIONMODEL OPTIONAL
    !IV_DEPENDENCYDISCOVERY TYPE /AWS1/REVDEPNDNCYDISCVRYINPUT OPTIONAL
    !IO_REPORTCONFIGURATION TYPE REF TO /AWS1/CL_REVSERVICEREPORTCONF OPTIONAL
    !IV_KMSKEYID TYPE /AWS1/REVKMSKEYID OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_REVTAGMAP_W=>TT_TAGMAP OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/REVCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_revcreateservicersp
  RAISING
    /AWS1/CX_REVACCESSDENIEDEX
    /AWS1/CX_REVCONFLICTEXCEPTION
    /AWS1/CX_REVINTERNALSERVEREX
    /AWS1/CX_REVRESOURCENOTFOUNDEX
    /AWS1/CX_REVSERVICEQUOTAEXCDEX
    /AWS1/CX_REVVLDTNEXCEPTION
    /AWS1/CX_REVCLIENTEXC
    /AWS1/CX_REVSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_name TYPE /AWS1/REVENTITYNAME /AWS1/REVENTITYNAME

Resource name (used in ARN — no spaces allowed).

it_regions TYPE /AWS1/CL_REVREGIONLIST_W=>TT_REGIONLIST TT_REGIONLIST

The AWS Regions where the service operates.

io_permissionmodel TYPE REF TO /AWS1/CL_REVPERMISSIONMODEL /AWS1/CL_REVPERMISSIONMODEL

The permission model for the service.

Optional arguments:

iv_description TYPE /AWS1/REVLONGDESCRIPTION /AWS1/REVLONGDESCRIPTION

Resource description for services and policies.

it_associatedsystems TYPE /AWS1/CL_REVASSOCIATEDSYSTEM=>TT_ASSOCIATEDSYSTEMLIST TT_ASSOCIATEDSYSTEMLIST

The systems to associate with the service.

iv_policyarn TYPE /AWS1/REVARN /AWS1/REVARN

ARN identifier.

iv_dependencydiscovery TYPE /AWS1/REVDEPNDNCYDISCVRYINPUT /AWS1/REVDEPNDNCYDISCVRYINPUT

Caller-settable values for dependency discovery. INITIALIZING is system-managed.

io_reportconfiguration TYPE REF TO /AWS1/CL_REVSERVICEREPORTCONF /AWS1/CL_REVSERVICEREPORTCONF

Configuration for automatic report generation on a Service.

iv_kmskeyid TYPE /AWS1/REVKMSKEYID /AWS1/REVKMSKEYID

KMS key identifier — accepts key ID, key ARN, alias name, or alias ARN.

it_tags TYPE /AWS1/CL_REVTAGMAP_W=>TT_TAGMAP TT_TAGMAP

Resource tags.

iv_clienttoken TYPE /AWS1/REVCLIENTTOKEN /AWS1/REVCLIENTTOKEN

Idempotency token.

RETURNING

oo_output TYPE REF TO /aws1/cl_revcreateservicersp /AWS1/CL_REVCREATESERVICERSP

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->createservice(
  io_permissionmodel = new /aws1/cl_revpermissionmodel(
    it_crossaccountroles = VALUE /aws1/cl_revcrossaccountrole=>tt_crossaccountrolelist(
      (
        new /aws1/cl_revcrossaccountrole(
          iv_crossaccountrolearn = |string|
          iv_externalid = |string|
        )
      )
    )
    iv_invokerrolename = |string|
  )
  io_reportconfiguration = new /aws1/cl_revservicereportconf(
    it_reportoutputs = VALUE /aws1/cl_revreportoutputconf=>tt_reportoutputconflist(
      (
        new /aws1/cl_revreportoutputconf(
          io_s3 = new /aws1/cl_revs3reportoutputconf(
            iv_bucketowner = |string|
            iv_bucketpath = |string|
          )
        )
      )
    )
  )
  it_associatedsystems = VALUE /aws1/cl_revassociatedsystem=>tt_associatedsystemlist(
    (
      new /aws1/cl_revassociatedsystem(
        it_userjourneyids = VALUE /aws1/cl_revuserjrnyidlist_w=>tt_userjourneyidlist(
          ( new /aws1/cl_revuserjrnyidlist_w( |string| ) )
        )
        iv_systemarn = |string|
        iv_systemname = |string|
      )
    )
  )
  it_regions = VALUE /aws1/cl_revregionlist_w=>tt_regionlist(
    ( new /aws1/cl_revregionlist_w( |string| ) )
  )
  it_tags = VALUE /aws1/cl_revtagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_revtagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_revtagmap_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_dependencydiscovery = |string|
  iv_description = |string|
  iv_kmskeyid = |string|
  iv_name = |string|
  iv_policyarn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_service = lo_result->get_service( ).
  IF lo_service IS NOT INITIAL.
    lv_arn = lo_service->get_servicearn( ).
    lv_entityname = lo_service->get_name( ).
    lv_longdescription = lo_service->get_description( ).
    LOOP AT lo_service->get_associatedsystems( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_arn = lo_row_1->get_systemarn( ).
        lv_entityname = lo_row_1->get_systemname( ).
        LOOP AT lo_row_1->get_userjourneyids( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_userjourneyid = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    lv_arn = lo_service->get_policyarn( ).
    LOOP AT lo_service->get_regions( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_awsregion = lo_row_5->get_value( ).
      ENDIF.
    ENDLOOP.
    lo_permissionmodel = lo_service->get_permissionmodel( ).
    IF lo_permissionmodel IS NOT INITIAL.
      lv_iamrolename = lo_permissionmodel->get_invokerrolename( ).
      LOOP AT lo_permissionmodel->get_crossaccountroles( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_iamrolearn = lo_row_7->get_crossaccountrolearn( ).
          lv_string = lo_row_7->get_externalid( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_dependencydiscoveryconf = lo_service->get_dependencydiscovery( ).
    IF lo_dependencydiscoveryconf IS NOT INITIAL.
      lv_dependencydiscoverystat = lo_dependencydiscoveryconf->get_status( ).
      lv_timestamp = lo_dependencydiscoveryconf->get_updatedat( ).
    ENDIF.
    lo_effectivepolicyvalues = lo_service->get_effectivepolicyvalues( ).
    IF lo_effectivepolicyvalues IS NOT INITIAL.
      lo_slosource = lo_effectivepolicyvalues->get_availabilityslo( ).
      IF lo_slosource IS NOT INITIAL.
        lv_double = lo_slosource->get_value( ).
        lv_entityname = lo_slosource->get_policyname( ).
        lv_policyvaluesource = lo_slosource->get_source( ).
      ENDIF.
      lo_targetsource = lo_effectivepolicyvalues->get_multiazrto( ).
      IF lo_targetsource IS NOT INITIAL.
        lv_integer = lo_targetsource->get_value( ).
        lv_entityname = lo_targetsource->get_policyname( ).
        lv_policyvaluesource = lo_targetsource->get_source( ).
      ENDIF.
      lo_targetsource = lo_effectivepolicyvalues->get_multiazrpo( ).
      IF lo_targetsource IS NOT INITIAL.
        lv_integer = lo_targetsource->get_value( ).
        lv_entityname = lo_targetsource->get_policyname( ).
        lv_policyvaluesource = lo_targetsource->get_source( ).
      ENDIF.
      lo_disasterrecoverysource = lo_effectivepolicyvalues->get_multiazdrapproach( ).
      IF lo_disasterrecoverysource IS NOT INITIAL.
        lv_string = lo_disasterrecoverysource->get_value( ).
        lv_entityname = lo_disasterrecoverysource->get_policyname( ).
        lv_policyvaluesource = lo_disasterrecoverysource->get_source( ).
      ENDIF.
      lo_targetsource = lo_effectivepolicyvalues->get_multiregionrto( ).
      IF lo_targetsource IS NOT INITIAL.
        lv_integer = lo_targetsource->get_value( ).
        lv_entityname = lo_targetsource->get_policyname( ).
        lv_policyvaluesource = lo_targetsource->get_source( ).
      ENDIF.
      lo_targetsource = lo_effectivepolicyvalues->get_multiregionrpo( ).
      IF lo_targetsource IS NOT INITIAL.
        lv_integer = lo_targetsource->get_value( ).
        lv_entityname = lo_targetsource->get_policyname( ).
        lv_policyvaluesource = lo_targetsource->get_source( ).
      ENDIF.
      lo_disasterrecoverysource = lo_effectivepolicyvalues->get_multiregiondrapproach( ).
      IF lo_disasterrecoverysource IS NOT INITIAL.
        lv_string = lo_disasterrecoverysource->get_value( ).
        lv_entityname = lo_disasterrecoverysource->get_policyname( ).
        lv_policyvaluesource = lo_disasterrecoverysource->get_source( ).
      ENDIF.
      lo_targetsource = lo_effectivepolicyvalues->get_datarectimebetweenbkups( ).
      IF lo_targetsource IS NOT INITIAL.
        lv_integer = lo_targetsource->get_value( ).
        lv_entityname = lo_targetsource->get_policyname( ).
        lv_policyvaluesource = lo_targetsource->get_source( ).
      ENDIF.
    ENDIF.
    lo_achievability = lo_service->get_achievability( ).
    IF lo_achievability IS NOT INITIAL.
      lv_achievabilitystatus = lo_achievability->get_availabilityslo( ).
      lv_achievabilitystatus = lo_achievability->get_multiazrtorpo( ).
      lv_achievabilitystatus = lo_achievability->get_multiregionrtorpo( ).
    ENDIF.
    lo_servicereportconfigurat = lo_service->get_reportconfiguration( ).
    IF lo_servicereportconfigurat IS NOT INITIAL.
      LOOP AT lo_servicereportconfigurat->get_reportoutputs( ) into lo_row_8.
        lo_row_9 = lo_row_8.
        IF lo_row_9 IS NOT INITIAL.
          lo_s3reportoutputconfigura = lo_row_9->get_s3( ).
          IF lo_s3reportoutputconfigura IS NOT INITIAL.
            lv_s3bucketpath = lo_s3reportoutputconfigura->get_bucketpath( ).
            lv_awsaccountid = lo_s3reportoutputconfigura->get_bucketowner( ).
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
    lv_kmskeyid = lo_service->get_kmskeyid( ).
    LOOP AT lo_service->get_tags( ) into ls_row_10.
      lv_key = ls_row_10-key.
      lo_value = ls_row_10-value.
      IF lo_value IS NOT INITIAL.
        lv_tagvalue = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
    lo_assessmentcost = lo_service->get_estimatedassessmentcost( ).
    IF lo_assessmentcost IS NOT INITIAL.
      lv_double = lo_assessmentcost->get_amount( ).
      lv_costcurrency = lo_assessmentcost->get_currency( ).
    ENDIF.
    lo_resourcediscoverystatus = lo_service->get_resourcediscovery( ).
    IF lo_resourcediscoverystatus IS NOT INITIAL.
      lv_resourcediscoveryrunsta = lo_resourcediscoverystatus->get_status( ).
      lv_timestamp = lo_resourcediscoverystatus->get_lastrunat( ).
      lv_resourcediscoveryerrorc = lo_resourcediscoverystatus->get_errorcode( ).
      lv_string = lo_resourcediscoverystatus->get_errormessage( ).
    ENDIF.
    lv_assessmentstatus = lo_service->get_assessmentstatus( ).
    lv_boolean = lo_service->get_rerunassessment( ).
    lv_integer = lo_service->get_openfindingscount( ).
    lv_integer = lo_service->get_resolvedfindingscount( ).
    lv_organizationid = lo_service->get_organizationid( ).
    lv_ouid = lo_service->get_ouid( ).
    lv_accountid = lo_service->get_accountid( ).
    lv_timestamp = lo_service->get_createdat( ).
    lv_timestamp = lo_service->get_updatedat( ).
  ENDIF.
ENDIF.