Skip to content

/AWS1/IF_CWF=>CREATESCOPE()

About CreateScope

In Network Flow Monitor, you specify a scope for the service to generate metrics for. By using the scope, Network Flow Monitor can generate a topology of all the resources to measure performance metrics for. When you create a scope, you enable permissions for Network Flow Monitor.

A scope is a Region-account pair or multiple Region-account pairs. Network Flow Monitor uses your scope to determine all the resources (the topology) where Network Flow Monitor will gather network flow performance metrics for you. To provide performance metrics, Network Flow Monitor uses the data that is sent by the Network Flow Monitor agents you install on the resources.

To define the Region-account pairs for your scope, the Network Flow Monitor API uses the following constucts, which allow for future flexibility in defining scopes:

  • Targets, which are arrays of targetResources.

  • Target resources, which are Region-targetIdentifier pairs.

  • Target identifiers, made up of a targetID (currently always an account ID) and a targetType (currently always an account).

Method Signature

IMPORTING

Required arguments:

it_targets TYPE /AWS1/CL_CWFTARGETRESOURCE=>TT_TARGETRESOURCELIST TT_TARGETRESOURCELIST

The targets to define the scope to be monitored. A target is an array of targetResources, which are currently Region-account pairs, defined by targetResource constructs.

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.