Skip to content

/AWS1/IF_SDY=>DEREGISTERINSTANCE()

About DeregisterInstance

Deletes the Amazon RouteĀ 53 DNS records and health check, if any, that Cloud Map created for the specified instance.

Method Signature

METHODS /AWS1/IF_SDY~DEREGISTERINSTANCE
  IMPORTING
    !IV_SERVICEID TYPE /AWS1/SDYARN OPTIONAL
    !IV_INSTANCEID TYPE /AWS1/SDYRESOURCEID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sdydereginstresponse
  RAISING
    /AWS1/CX_SDYDUPLICATEREQUEST
    /AWS1/CX_SDYINSTANCENOTFOUND
    /AWS1/CX_SDYINVALIDINPUT
    /AWS1/CX_SDYRESOURCEINUSE
    /AWS1/CX_SDYSERVICENOTFOUND
    /AWS1/CX_SDYCLIENTEXC
    /AWS1/CX_SDYSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_serviceid TYPE /AWS1/SDYARN /AWS1/SDYARN

The ID or Amazon Resource Name (ARN) of the service that the instance is associated with. If the namespace associated with the service is shared with your account, specify the service ARN. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide.

iv_instanceid TYPE /AWS1/SDYRESOURCEID /AWS1/SDYRESOURCEID

The value that you specified for Id in the RegisterInstance request.

RETURNING

oo_output TYPE REF TO /aws1/cl_sdydereginstresponse /AWS1/CL_SDYDEREGINSTRESPONSE

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->deregisterinstance(
  iv_instanceid = |string|
  iv_serviceid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_operationid = lo_result->get_operationid( ).
ENDIF.

Example: Deregister a service instance

Example: Deregister a service instance

DATA(lo_result) = lo_client->deregisterinstance(
  iv_instanceid = |myservice-53|
  iv_serviceid = |srv-p5zdwlg5uvvzjita|
).

Deregister instance using service ARN

Deregisters an instance using a service ARN instead of service ID, useful when working with shared namespaces.

DATA(lo_result) = lo_client->deregisterinstance(
  iv_instanceid = |i-abcd1234xmpl5678|
  iv_serviceid = |arn:aws:servicediscovery:us-west-2:123456789012:service/srv-abcd1234xmpl5678|
).