Applies a health check template to a server group to replace the configurations of health checks for the server group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ApplyHealthCheckTemplateToServerGroup

The operation that you want to perform.

Set the value to ApplyHealthCheckTemplateToServerGroup.

HealthCheckTemplateId String Yes hct-bp1qjwo61pqz3ahltv****

The ID of the template.

ServerGroupId String Yes sgp-n80wyad08u0tox****

The ID of the server group.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId may be different for each API request.
DryRun Boolean No false

Specifies whether to check the request without applying the template. Valid values:

  • true: checks the request without applying the template. The system checks the required parameters, request syntax, and limits. If the request fails to pass the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the API request. If the request passes the check, a 2xx HTTP status code is returned and the template is applied.

Response parameters

Parameter Type Example Description
JobId String 72dcd26b-f12d-4c27-b3af-18f6aed5****

The ID of the asynchronous task.

RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ApplyHealthCheckTemplateToServerGroup
&HealthCheckTemplateId=hct-bp1qjwo61pqz3ahltv****
&ServerGroupId=sgp-n80wyad08u0tox****
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&DryRun=false
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ApplyHealthCheckTemplateToServerGroupResponse>
    <JobId>72dcd26b-f12d-4c27-b3af-18f6aed5****</JobId>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
</ApplyHealthCheckTemplateToServerGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "JobId" : "72dcd26b-f12d-4c27-b3af-18f6aed5****",
  "RequestId" : "365F4154-92F6-4AE4-92F8-7FF34B540710"
}

Error codes

HttpCode Error code Error message Description
400 IncorrectStatus.HealthCheckTemplate The status of %s [%s] is incorrect. The error message returned because the status of the specified resource %s [%s] is invalid.
400 IncorrectStatus.ServerGroup The status of %s [%s] is incorrect. The error message returned because the server group is in a state that does not support the operation.
404 ResourceNotFound.HealthCheckTemplate The specified resource %s is not found. The error message returned because the specified resource %s does not exist.
404 ResourceNotFound.ServerGroup The specified resource %s is not found. The error message returned because the specified resource %s does not exist.

For a list of error codes, visit the API Error Center.