Skip to content

/AWS1/IF_NWS=>CREATETEMPLATESNAPSHOT()

About CreateTemplateSnapshot

Creates a snapshot of the current published version of the specified template.

Method Signature

METHODS /AWS1/IF_NWS~CREATETEMPLATESNAPSHOT
  IMPORTING
    !IV_TEMPLATEIDENTIFIER TYPE /AWS1/NWSTEMPLATEIDENTIFIER OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/NWSIDEMPOTENCYTOKEN OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_NWSTAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_nwscretmplnapshotout
  RAISING
    /AWS1/CX_NWSACCESSDENIEDEX
    /AWS1/CX_NWSCONFLICTEXCEPTION
    /AWS1/CX_NWSINTERNALSERVEREX
    /AWS1/CX_NWSRESOURCENOTFOUNDEX
    /AWS1/CX_NWSSERVICEQUOTAEXCDEX
    /AWS1/CX_NWSTHROTTLINGEX
    /AWS1/CX_NWSVLDTNEXCEPTION
    /AWS1/CX_NWSCLIENTEXC
    /AWS1/CX_NWSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_templateidentifier TYPE /AWS1/NWSTEMPLATEIDENTIFIER /AWS1/NWSTEMPLATEIDENTIFIER

The identifier of the template. This is the template's Amazon Resource Name (ARN).

Optional arguments:

iv_clienttoken TYPE /AWS1/NWSIDEMPOTENCYTOKEN /AWS1/NWSIDEMPOTENCYTOKEN

A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.

it_tags TYPE /AWS1/CL_NWSTAGMAP_W=>TT_TAGMAP TT_TAGMAP

The tags to add to the snapshot when it is created.

RETURNING

oo_output TYPE REF TO /aws1/cl_nwscretmplnapshotout /AWS1/CL_NWSCRETMPLNAPSHOTOUT

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->createtemplatesnapshot(
  it_tags = VALUE /aws1/cl_nwstagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_nwstagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_nwstagmap_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_templateidentifier = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_templateid = lo_result->get_templateid( ).
  lv_templatearn = lo_result->get_templatearn( ).
  lv_templatename = lo_result->get_templatename( ).
  lv_description = lo_result->get_templatedescription( ).
  lv_entitystatus = lo_result->get_status( ).
  lv_entityversion = lo_result->get_version( ).
  LOOP AT lo_result->get_associatedrulelist( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_rulearn = lo_row_1->get_rulearn( ).
    ENDIF.
  ENDLOOP.
  lv_updatetoken = lo_result->get_updatetoken( ).
  lv_issnapshot = lo_result->get_issnapshot( ).
  lv_haspublishedversion = lo_result->get_haspublishedversion( ).
  lv_templatefirewalltype = lo_result->get_firewalltype( ).
  lv_datetimestamp = lo_result->get_updatedat( ).
ENDIF.

Create a template snapshot

Creates an immutable snapshot of the current published version of a template. The snapshot is addressable by a version-qualified ARN.

DATA(lo_result) = lo_client->createtemplatesnapshot(
  iv_clienttoken = |550e8400-e29b-41d4-a716-446655440012|
  iv_templateidentifier = |arn:aws:network-security-manager:us-east-1:123456789012:template:xyz789|
).