/AWS1/IF_SDY=>UPDATESERVICE()¶
About UpdateService¶
Submits a request to perform the following operations:
-
Update the TTL setting for existing
DnsRecordsconfigurations -
Add, update, or delete
HealthCheckConfigfor a specified serviceYou can't add, update, or delete a
HealthCheckCustomConfigconfiguration.
For public and private DNS namespaces, note the following:
-
If you omit any existing
DnsRecordsorHealthCheckConfigconfigurations from anUpdateServicerequest, the configurations are deleted from the service. -
If you omit an existing
HealthCheckCustomConfigconfiguration from anUpdateServicerequest, the configuration isn't deleted from the service.
You can't call UpdateService and update settings in the following
scenarios:
-
When the service is associated with an HTTP namespace
-
When the service is associated with a shared namespace and contains instances that were registered by Amazon Web Services accounts other than the account making the
UpdateServicecall
When you update settings for a service, Cloud Map also updates the corresponding settings in all the records and health checks that were created by using the specified service.
Method Signature¶
METHODS /AWS1/IF_SDY~UPDATESERVICE
IMPORTING
!IV_ID TYPE /AWS1/SDYARN OPTIONAL
!IO_SERVICE TYPE REF TO /AWS1/CL_SDYSERVICECHANGE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sdyupdateservicersp
RAISING
/AWS1/CX_SDYDUPLICATEREQUEST
/AWS1/CX_SDYINVALIDINPUT
/AWS1/CX_SDYSERVICENOTFOUND
/AWS1/CX_SDYCLIENTEXC
/AWS1/CX_SDYSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_id TYPE /AWS1/SDYARN /AWS1/SDYARN¶
The ID or Amazon Resource Name (ARN) of the service that you want to update. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide
io_service TYPE REF TO /AWS1/CL_SDYSERVICECHANGE /AWS1/CL_SDYSERVICECHANGE¶
A complex type that contains the new settings for the service. You can specify a maximum of 30 attributes (key-value pairs).
RETURNING¶
oo_output TYPE REF TO /aws1/cl_sdyupdateservicersp /AWS1/CL_SDYUPDATESERVICERSP¶
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->updateservice(
io_service = new /aws1/cl_sdyservicechange(
io_dnsconfig = new /aws1/cl_sdydnsconfigchange(
it_dnsrecords = VALUE /aws1/cl_sdydnsrecord=>tt_dnsrecordlist(
(
new /aws1/cl_sdydnsrecord(
iv_ttl = 123
iv_type = |string|
)
)
)
)
io_healthcheckconfig = new /aws1/cl_sdyhealthcheckconfig(
iv_failurethreshold = 123
iv_resourcepath = |string|
iv_type = |string|
)
iv_description = |string|
)
iv_id = |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.
UpdateService Example¶
This example submits a request to replace the DnsConfig and HealthCheckConfig settings of a specified service.
DATA(lo_result) = lo_client->updateservice(
io_service = new /aws1/cl_sdyservicechange(
io_dnsconfig = new /aws1/cl_sdydnsconfigchange(
it_dnsrecords = VALUE /aws1/cl_sdydnsrecord=>tt_dnsrecordlist(
(
new /aws1/cl_sdydnsrecord(
iv_ttl = 60
iv_type = |A|
)
)
)
)
io_healthcheckconfig = new /aws1/cl_sdyhealthcheckconfig(
iv_failurethreshold = 2
iv_resourcepath = |/|
iv_type = |HTTP|
)
)
iv_id = |srv-e4anhexample0004|
).
Update service using service ARN for shared namespace¶
This example updates a service using a service ARN instead of service ID. This is useful for updating services associated with shared namespaces.
DATA(lo_result) = lo_client->updateservice(
io_service = new /aws1/cl_sdyservicechange( iv_description = |Updated service description for shared namespace| )
iv_id = |arn:aws:servicediscovery:us-west-2:123456789012:service/srv-e4anhexample0004|
).