CreateHealthCheck

更新时间:
复制 MD 格式

Calls CreateHealthCheck to create a health check for a Smart Access Gateway instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

smartag:CreateHealthCheck

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the Smart Access Gateway instance is deployed.

cn-shanghai

SmartAGId

string

Yes

The ID of the Smart Access Gateway instance.

sag-1um5x5nwhilymw****

Name

string

Yes

The name of the health check instance.

The name must be 2 to 100 characters in length, and must start with a letter or a Chinese character. The name can contain digits, periods (.), underscores (_), and hyphens (-).

hc-123

Description

string

No

The description of the health check instance.

The description must be 2 to 256 characters in length, and must start with a letter or a Chinese character. The description can contain digits, periods (.), underscores (_), and hyphens (-).

hc_123

Type

string

Yes

The type of health check packets.

Note

Only ICMP_ECHO is supported.

ICMP_ECHO

DstIpAddr

string

Yes

The destination IP address of the health check.

192.XX.XX.1

DstPort

integer

No

The destination port of the health check.

Note

This feature is currently not supported.

1333

SrcIpAddr

string

Yes

The source IP address of the health check instance.

10.XX.XX.1

SrcPort

integer

No

The source port of the health check.

Note

This feature is currently not supported.

1344

ProbeInterval

integer

No

The interval between health check probes. The next probe will not be initiated until the current probe is complete.

Valid values: 1000 to 60000.

Default value: 2000.

Unit: milliseconds.

2000

ProbeCount

integer

No

The number of probes per health check.

Valid values: 1 to 20.

Default value: 1.

1

ProbeTimeout

integer

No

The timeout period for a single probe.

Valid values: 10 to 30000.

Default value: 1000.

Unit: milliseconds.

1000

RttThreshold

integer

No

The round-trip time (RTT) threshold.

Valid values: -1 or 1 to 5000.

Default value: -1, which indicates that no RTT threshold is set.

Unit: milliseconds.

1000

RttFailThreshold

integer

No

The number of times that the RTT threshold can be reached.

Valid values: 1 to 15.

Default value: 3.

3

FailCountThreshold

integer

No

The threshold for the number of consecutive probe failures.

Valid values: 1 to 15.

Default value: 3.

3

Response elements

Element

Type

Description

Example

object

InstanceId

string

The ID of the health check instance.

hc-rrqoucina3gmpn****

RequestId

string

The request ID.

E38E950D-28A4-4C41-9428-A8908EC6AE5C

Examples

Success response

JSON format

{
  "InstanceId": "hc-rrqoucina3gmpn****",
  "RequestId": "E38E950D-28A4-4C41-9428-A8908EC6AE5C"
}

Error codes

HTTP status code

Error code

Error message

Description

400 HC.AutoGenerated The health check instance is automatically generated and cannot be modified. The health check instance is automatically generated and cannot be modified.
400 HC.InstanceNoFound The specified network health check instance does not exist. The specified network health check instance does not exist.
400 HC.InvalidDescription The specified description is invalid. The specified description is invalid.
400 HC.InvalidDstIpAddr The specified destination IP address is invalid. The specified destination IP address is invalid.
400 HC.InvalidDstPort The specified destination port is invalid. The specified destination port is invalid.
400 HC.InvalidFailCountThreshold The maximum number of successive failed probes is exceeded. The maximum number of successive failed probes is exceeded.
400 HC.InvalidName The specified name is invalid. The specified name is invalid.
400 HC.InvalidProbeCount The specified number of probes is invalid. The specified number of probes is invalid.
400 HC.InvalidProbeInterval The specified probe interval is invalid. The specified probe interval is invalid.
400 HC.InvalidProbeTimeout The specified probe timeout period is invalid. The specified probe timeout period is invalid.
400 HC.InvalidRttFailThreshold The RTT threshold has been triggered too many times. The RTT threshold has been triggered too many times.
400 HC.InvalidRttThreshold The specified RTT is invalid. The specified RTT is invalid.
400 HC.InvalidSrcIpAddr The specified source IP address is invalid. The specified source IP address is invalid.
400 HC.InvalidSrcPort The specified source port is invalid. The specified source port is invalid.
400 HC.InvalidType The specified type is invalid. The specified type is invalid.
400 HC.RelatedRoute The specified health check instance has associated routes and cannot be deleted. The specified health check instance has associated routes and cannot be deleted.
400 SAG.Arrearage The specified SAG instance has overdue payments. Renew the instance first. The specified SAG instance has overdue payments. Renew the instance first.
400 SAG.InstanceIdEmpty You must specify the SAG instance ID. You must specify the SAG instance ID.
400 SAG.InstanceNoFound The specified SAG instance does not exist. The specified SAG instance does not exist.
400 SAG.NoActive The specified SAG instance has not been activated. The specified SAG instance has not been activated.
400 HC.AmountLimit The maximum number of health check instances is exceeded. The maximum number of health check instances is exceeded.
500 InternalError An error occurred while processing your request. An error occurred while processing your request.
403 FeatureNotSupport The current edition of the smart access gateway does not support this feature. The current version of Smart Access Gateway does not support this feature.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.