Modifies the Layer 4 or Layer 7 health check configuration of a port forwarding rule.

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 ModifyHealthCheckConfig

The operation that you want to perform. Set the value to ModifyHealthCheckConfig.

ForwardProtocol String Yes tcp

The forwarding protocol of the port forwarding rule. Valid values:

  • tcp
  • udp
FrontendPort Integer Yes 8080

The forwarding port of the port forwarding rule.

HealthCheck String Yes {"Type":"tcp","Timeout":10,"Port":8080,"Interval":10,"Up":10,"Down":40}

Details about the health check configuration. This parameter is a JSON string. The fields in the value are described as follows:

  • Type: the protocol type. This field is required and must be of the STRING type. Valid values: tcp (Layer 4) and http (Layer 7).
  • Domain: the domain name. This field is optional and must be of the STRING type.
    Note This field must be specified only when you want to modify Layer 7 health check configurations.
  • Uri: the check path. This field is optional and must be of the STRING type.
    Note This field must be specified only when you want to modify Layer 7 health check configurations.
  • Timeout: the response timeout period. This field is optional and must be of the INTEGER type. Valid values: 1 to 30. Unit: seconds.
  • Port: the port on which you want to perform the health check. This field is optional and must be of the INTEGER type.
  • Interval: the health check intervals. This field is optional and must be of the INTEGER type. Valid values: 1 to 30. Unit: seconds.
  • Up: the number of consecutive successful health checks that must occur before declaring a port healthy. This field is optional and must be of the INTEGER type. Valid values: 1 to 10.
  • Down: the number of consecutive failed health checks that must occur before declaring a port unhealthy. This field is optional and must be of the INTEGER type. Valid values: 1 to 10.
InstanceId String Yes ddoscoo-cn-mp91j1ao****

The ID of the instance.

Note You can call the DescribeInstanceIds operation to query the IDs of all instances.
RegionId String No cn-hangzhou

The region ID of the instance. Valid values:

  • cn-hangzhou: mainland China, which indicates an Anti-DDoS Pro instance
  • ap-southeast-1: outside mainland China, which indicates an Anti-DDoS Premium instance

Response parameters

Parameter Type Example Description
RequestId String 0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyHealthCheckConfig
&ForwardProtocol=tcp
&FrontendPort=8080
&HealthCheck={"Type":"tcp","Timeout":10,"Port":8080,"Interval":10,"Up":10,"Down":40}
&InstanceId=ddoscoo-cn-mp91j1ao****
&<Common request parameters>

Sample success responses

XML format

<ModifyHealthCheckConfigResponse>
      <RequestId>0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc</RequestId>
</ModifyHealthCheckConfigResponse>

JSON format

{
  "RequestId": "0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc"
}

Error codes

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