Skip to content

/AWS1/CL_CWF=>CREATESCOPE()

About CreateScope

Create a scope of resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend. This call returns a scope ID to identify the scope.

When you create a scope, you enable permissions for Network Flow Monitor. The scope is set to the resources for the Amazon Web Services that enables the feature.

Method Signature

IMPORTING

Required arguments:

it_targets TYPE /AWS1/CL_CWFTARGETRESOURCE=>TT_TARGETRESOURCELIST TT_TARGETRESOURCELIST

The targets to define the scope to be monitored. Currently, a target is an Amazon Web Services account.

Optional arguments:

iv_clienttoken TYPE /AWS1/CWFUUIDSTRING /AWS1/CWFUUIDSTRING

A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.

it_tags TYPE /AWS1/CL_CWFTAGMAP_W=>TT_TAGMAP TT_TAGMAP

The tags for a scope. You can add a maximum of 200 tags.

RETURNING

oo_output TYPE REF TO /aws1/cl_cwfcreatescopeoutput /AWS1/CL_CWFCREATESCOPEOUTPUT

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->/aws1/if_cwf~createscope(
  it_tags = VALUE /aws1/cl_cwftagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_cwftagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_cwftagmap_w( |string| )
      )
    )
  )
  it_targets = VALUE /aws1/cl_cwftargetresource=>tt_targetresourcelist(
    (
      new /aws1/cl_cwftargetresource(
        io_targetidentifier = new /aws1/cl_cwftargetidentifier(
          io_targetid = new /aws1/cl_cwftargetid( |string| )
          iv_targettype = |string|
        )
        iv_region = |string|
      )
    )
  )
  iv_clienttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_scopeid = lo_result->get_scopeid( ).
  lv_scopestatus = lo_result->get_status( ).
  lv_arn = lo_result->get_scopearn( ).
  LOOP AT lo_result->get_tags( ) into ls_row.
    lv_key = ls_row-key.
    lo_value = ls_row-value.
    IF lo_value IS NOT INITIAL.
      lv_tagvalue = lo_value->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.