All Products
Search
Document Center

API Gateway:UpdateService

Last Updated:Dec 25, 2025

Updates a service. You can call this operation to update the health check, DNS domain name, and fixed address configurations of a service.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apig:UpdateServicenone
*Service
acs:apig:{#regionId}:{#accountId}:service/{#ServiceId}
    none
none

Request syntax

PUT /v1/services/{serviceId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request body.

addressesarrayNo

The list of domain names or fixed addresses.

stringNo

The domain name or fixed address.

127.0.0.1:8080
healthCheckConfigobjectNo

The health check configurations.

enablebooleanNo

Specifies whether to enable health checks.

true
protocolstringNo

The protocol over which the system performs health checks.

Valid values:

  • TCP
  • HTTP
HTTP
timeoutintegerNo

The timeout period for a health check response. Unit: seconds

2
intervalintegerNo

The health check interval. Unit: seconds

2
healthyThresholdintegerNo

The healthy threshold.

2
unhealthyThresholdintegerNo

The unhealthy threshold.

22
httpPathstringNo

The request path of health checks. This parameter is required if the health check protocol is HTTP.

/healthz
httpHoststringNo

The domain name that you want to use for health checks. Optional. This parameter is available if the health check protocol is HTTP.

dev.itemcener.com
expectedStatusesarrayNo

The normal status codes to be returned. This parameter is required if the health check protocol is HTTP.

stringNo

The normal status code to be returned.

Valid values:

  • 200: http_2xx
  • 300: http_3xx
  • 400: http_4xx
  • 500: http_5xx
Enumeration Value:
  • 200: http_2xx.
  • 300: http_3xx.
  • 400: http_4xx.
  • 500: http_5xx.
200
protocolstringNo

The service protocol.

HTTP
aiServiceConfigAiServiceConfigNo

The AI service configurations.

agentServiceConfigAgentServiceConfigNo

The agent service configurations.

dnsServersarrayNo

A DNS service address.

stringNo

A DNS service address.

1.1.1.1
portsarray<object>No

The port information.

objectNo

The port information.

namestringNo

The port name.

catalog
portintegerNo

The port.

80
protocolstringNo

The protocol.

TCP|UDP
healthyPanicThresholdfloatNo

The health check threshold.

80
outlierDetectionConfigobjectNo

The passive health check configurations.

enablebooleanNo

enable

false
baseEjectionTimeintegerNo

The initial isolation duration after a node is isolated (e.g., 30 seconds). The isolation time is calculated as: k * base_ejection_time (with k initially set to 1). Each subsequent isolation increases the isolation time (k is incremented by 1), while consecutive healthy checks gradually decrease the isolation time (k is decremented by 1).

30
failurePercentageThresholdintegerNo

When the request failure rate of a node reaches this threshold, the system triggers the isolation mechanism of the node.

80
failurePercentageMinimumHostsintegerNo

The panic threshold.

When the proportion of healthy nodes in the service is greater than the panic threshold, health checks take effect normally, and requests are only sent to healthy nodes, not to ejected nodes. When the proportion of healthy nodes in the service is less than or equal to the panic threshold, health checks are effectively disabled, and requests are sent to all nodes, including those that have been ejected nodes.

1
intervalintegerNo

The detection interval.

30

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

Examples

Sample success responses

JSONformat

{
  "requestId": "B725275B-50C6-5A49-A9FD-F0332FCB3351",
  "code": "Ok",
  "message": "success"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-12-17Add OperationView Change Details