Skip to content

/AWS1/IF_LOC=>UPDATEKEY()

About UpdateKey

Updates the specified properties of a given API key resource.

Method Signature

METHODS /AWS1/IF_LOC~UPDATEKEY
  IMPORTING
    !IV_KEYNAME TYPE /AWS1/LOCRESOURCENAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/LOCRESOURCEDESCRIPTION OPTIONAL
    !IV_EXPIRETIME TYPE /AWS1/LOCTIMESTAMP OPTIONAL
    !IV_NOEXPIRY TYPE /AWS1/LOCBOOLEAN OPTIONAL
    !IV_FORCEUPDATE TYPE /AWS1/LOCBOOLEAN OPTIONAL
    !IO_RESTRICTIONS TYPE REF TO /AWS1/CL_LOCAPIKEYRESTRICTIONS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_locupdatekeyresponse
  RAISING
    /AWS1/CX_LOCACCESSDENIEDEX
    /AWS1/CX_LOCINTERNALSERVEREX
    /AWS1/CX_LOCRESOURCENOTFOUNDEX
    /AWS1/CX_LOCTHROTTLINGEX
    /AWS1/CX_LOCVALIDATIONEX
    /AWS1/CX_LOCCLIENTEXC
    /AWS1/CX_LOCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_keyname TYPE /AWS1/LOCRESOURCENAME /AWS1/LOCRESOURCENAME

The name of the API key resource to update.

Optional arguments:

iv_description TYPE /AWS1/LOCRESOURCEDESCRIPTION /AWS1/LOCRESOURCEDESCRIPTION

Updates the description for the API key resource.

iv_expiretime TYPE /AWS1/LOCTIMESTAMP /AWS1/LOCTIMESTAMP

Updates the timestamp for when the API key resource will expire in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.

iv_noexpiry TYPE /AWS1/LOCBOOLEAN /AWS1/LOCBOOLEAN

Whether the API key should expire. Set to true to set the API key to have no expiration time.

iv_forceupdate TYPE /AWS1/LOCBOOLEAN /AWS1/LOCBOOLEAN

The boolean flag to be included for updating ExpireTime or Restrictions details.

Must be set to true to update an API key resource that has been used in the past 7 days.

False if force update is not preferred

Default value: False

io_restrictions TYPE REF TO /AWS1/CL_LOCAPIKEYRESTRICTIONS /AWS1/CL_LOCAPIKEYRESTRICTIONS

Updates the API key restrictions for the API key resource.

RETURNING

oo_output TYPE REF TO /aws1/cl_locupdatekeyresponse /AWS1/CL_LOCUPDATEKEYRESPONSE

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->updatekey(
  io_restrictions = new /aws1/cl_locapikeyrestrictions(
    it_allowactions = VALUE /aws1/cl_locapikeyactionlist_w=>tt_apikeyactionlist(
      ( new /aws1/cl_locapikeyactionlist_w( |string| ) )
    )
    it_allowandroidapps = VALUE /aws1/cl_locandroidapp=>tt_androidapplist(
      (
        new /aws1/cl_locandroidapp(
          iv_certificatefingerprint = |string|
          iv_package = |string|
        )
      )
    )
    it_allowappleapps = VALUE /aws1/cl_locappleapp=>tt_appleapplist(
      ( new /aws1/cl_locappleapp( |string| ) )
    )
    it_allowreferers = VALUE /aws1/cl_locrefererpatlist_w=>tt_refererpatternlist(
      ( new /aws1/cl_locrefererpatlist_w( |string| ) )
    )
    it_allowresources = VALUE /aws1/cl_locgeoarnlist_w=>tt_geoarnlist(
      ( new /aws1/cl_locgeoarnlist_w( |string| ) )
    )
  )
  iv_description = |string|
  iv_expiretime = '20150101000000.0000000'
  iv_forceupdate = ABAP_TRUE
  iv_keyname = |string|
  iv_noexpiry = ABAP_TRUE
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_arn = lo_result->get_keyarn( ).
  lv_resourcename = lo_result->get_keyname( ).
  lv_timestamp = lo_result->get_updatetime( ).
ENDIF.