Updated on 2024-11-11 GMT+08:00

Updating an Endpoint

Function

This API is used to update an endpoint.

Calling Method

For details, see Calling APIs.

URI

PUT /v1/endpoint-groups/{endpoint_group_id}/endpoints/{endpoint_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

endpoint_group_id

Yes

String

Specifies the endpoint group ID.

endpoint_id

Yes

String

Specifies the endpoint ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

endpoint

Yes

UpdateEndpointOption object

Specifies the detailed information about updating an endpoint.

Table 4 UpdateEndpointOption

Parameter

Mandatory

Type

Description

weight

No

Integer

Specifies the weight of the endpoint based on which the listener distributes traffic.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

endpoint

EndpointDetail object

Specifies the detail of the endpoint.

request_id

String

Specifies the request ID.

Table 6 EndpointDetail

Parameter

Type

Description

id

String

Specifies the endpoint ID.

resource_id

String

Specifies the endpoint ID.

endpoint_group_id

String

Specifies the endpoint group ID.

resource_type

String

Specifies the endpoint type.

status

String

Specifies the provisioning status. The value can be one of the following:

  • ACTIVE: The resource is running.

  • PENDING: The status is to be determined.

  • ERROR: Failed to create the resource.

  • DELETING: The resource is being deleted.

weight

Integer

Specifies the weight of the endpoint based on which the listener distributes traffic.

health_state

String

Specifies the health check result of the endpoint. The value can be one of the following:

  • INITIAL: Initial

  • HEALTHY: Healthy

  • UNHEALTHY: Unhealthy

  • NO_MONITOR: Not monitored

created_at

String

Specifies when the endpoint was added.

updated_at

String

Specifies when the endpoint was updated.

domain_id

String

Specifies the tenant ID.

ip_address

String

Specifies the IP address of the endpoint.

frozen_info

FrozenInfo object

Specifies the frozen details of cloud services or resources.

Table 7 FrozenInfo

Parameter

Type

Description

status

Integer

Specifies the status of a cloud service or resource. The value can be one of the following:

  • 0: unfrozen/normal (The cloud service will recover after being unfrozen.)

  • 1: frozen (Resources and data will be retained, but the cloud service cannot be used.)

  • 2: deleted/terminated (Both resources and data will be cleared.)

effect

Integer

Specifies the status of the resource after being frozen. The value can be one of the following:

  • 1 (default): The resource is frozen and can be released.

  • 2: The resource is frozen and cannot be released.

  • 3: The resource is frozen and cannot be renewed.

scene

Array of strings

Specifies the service scenario. The value can be one of the following:

  • ARREAR: The cloud service is in arrears, including expiration of yearly/monthly resources and fee deduction failure of pay-per-use resources.

  • POLICE: The cloud service is frozen for public security.

  • ILLEGAL: The cloud service is frozen due to violation of laws and regulations.

  • VERIFY: The cloud service is frozen because the user fails to pass the real-name authentication.

  • PARTNER: A partner freezes their customer's resources.

Example Requests

Changing the weight of an endpoint to 5

PUT https://{ga_endpoint}/v1/endpoint-groups/3a9f50bb-f041-4eac-a117-82472d8a0007/endpoints/0aa23a52-1ac2-4a2d-8dfa-1e11cb26079d

{
  "endpoint" : {
    "weight" : 5
  }
}

Example Responses

Status code: 200

Operation succeeded.

{
  "endpoint" : {
    "id" : "0aa23a52-1ac2-4a2d-8dfa-1e11cb26079d",
    "resource_id" : "08155cd2-5897-49be-933f-eec757fd4010",
    "endpoint_group_id" : "3a9f50bb-f041-4eac-a117-82472d8a0007",
    "resource_type" : "EIP",
    "status" : "ACTIVE",
    "weight" : 5,
    "health_state" : "HEALTHY",
    "created_at" : "2019-01-08T01:21:37.151Z",
    "updated_at" : "2019-01-08T01:21:37.151Z",
    "domain_id" : "99a3fff0d03c428eac3678da6a7d0f24",
    "ip_address" : "208.182.11.121",
    "frozen_info" : {
      "status" : 2,
      "effect" : 1,
      "scene" : [ "ARREAR", "POLICE" ]
    }
  },
  "request_id" : "915a14a6-867b-4af7-83d1-70efceb146f9"
}

Status Codes

Status Code

Description

200

Operation succeeded.

Error Codes

See Error Codes.