Updates a service. You can call this operation to update the health check, DNS domain name, and fixed address configurations of a service.
Debugging
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| apig:UpdateService | none | *Service acs:apig:{#regionId}:{#accountId}:service/{#ServiceId} |
| none |
Request syntax
PUT /v1/services/{serviceId} HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| body | object | No | The request body. | |
| addresses | array | No | The list of domain names or fixed addresses. | |
| string | No | The domain name or fixed address. | 127.0.0.1:8080 | |
| healthCheckConfig | object | No | The health check configurations. | |
| enable | boolean | No | Specifies whether to enable health checks. | true |
| protocol | string | No | The protocol over which the system performs health checks. Valid values:
| HTTP |
| timeout | integer | No | The timeout period for a health check response. Unit: seconds | 2 |
| interval | integer | No | The health check interval. Unit: seconds | 2 |
| healthyThreshold | integer | No | The healthy threshold. | 2 |
| unhealthyThreshold | integer | No | The unhealthy threshold. | 22 |
| httpPath | string | No | The request path of health checks. This parameter is required if the health check protocol is HTTP. | /healthz |
| httpHost | string | No | 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 |
| expectedStatuses | array | No | The normal status codes to be returned. This parameter is required if the health check protocol is HTTP. | |
| string | No | The normal status code to be returned. Valid values:
Enumeration Value:
| 200 | |
| protocol | string | No | The service protocol. | HTTP |
| aiServiceConfig | AiServiceConfig | No | The AI service configurations. | |
| agentServiceConfig | AgentServiceConfig | No | The agent service configurations. | |
| dnsServers | array | No | A DNS service address. | |
| string | No | A DNS service address. | 1.1.1.1 | |
| ports | array<object> | No | The port information. | |
| object | No | The port information. | ||
| name | string | No | The port name. | catalog |
| port | integer | No | The port. | 80 |
| protocol | string | No | The protocol. | TCP|UDP |
| healthyPanicThreshold | float | No | The health check threshold. | 80 |
| outlierDetectionConfig | object | No | The passive health check configurations. | |
| enable | boolean | No | enable | false |
| baseEjectionTime | integer | No | 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 |
| failurePercentageThreshold | integer | No | When the request failure rate of a node reaches this threshold, the system triggers the isolation mechanism of the node. | 80 |
| failurePercentageMinimumHosts | integer | No | 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 |
| interval | integer | No | The detection interval. | 30 |
Response parameters
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 time | Summary of changes | Operation |
|---|---|---|
| 2025-12-17 | Add Operation | View Change Details |
