Skip to content

/AWS1/IF_PTC=>TAGRESOURCE()

About TagResource

Adds or updates tags for a specified resource.

Method Signature

METHODS /AWS1/IF_PTC~TAGRESOURCE
  IMPORTING
    !IV_RESOURCEARN TYPE /AWS1/PTCTAGGABLEARN OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_PTCTAG=>TT_TAGLIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ptctagresresponse
  RAISING
    /AWS1/CX_PTCACCESSDENIEDEX
    /AWS1/CX_PTCINTERNALSERVEREX
    /AWS1/CX_PTCRESOURCENOTFOUNDEX
    /AWS1/CX_PTCTHROTTLINGEX
    /AWS1/CX_PTCVLDTNEXCEPTION
    /AWS1/CX_PTCCONFLICTEXCEPTION
    /AWS1/CX_PTCCLIENTEXC
    /AWS1/CX_PTCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_resourcearn TYPE /AWS1/PTCTAGGABLEARN /AWS1/PTCTAGGABLEARN

The Amazon Resource Name (ARN) of the resource to tag.

it_tags TYPE /AWS1/CL_PTCTAG=>TT_TAGLIST TT_TAGLIST

Key-value pairs to associate with the resource.

RETURNING

oo_output TYPE REF TO /aws1/cl_ptctagresresponse /AWS1/CL_PTCTAGRESRESPONSE

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->tagresource(
  it_tags = VALUE /aws1/cl_ptctag=>tt_taglist(
    (
      new /aws1/cl_ptctag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_resourcearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
ENDIF.

Example for TagResource

Example for TagResource

DATA(lo_result) = lo_client->tagresource(
  it_tags = VALUE /aws1/cl_ptctag=>tt_taglist(
    (
      new /aws1/cl_ptctag(
        iv_key = |ExampleKey|
        iv_value = |ExampleValue|
      )
    )
  )
  iv_resourcearn = |arn:aws:partnercentral:us-east-1:123456789012:catalog/AWS/program-management-account/pma-u8ic702rtzng8/relationship/rs-l9o4fj3b5zb91|
).