Enabling or Disabling an Endpoint
Description
This API is used to enable or disable an endpoint based on the input project-id and custom_endpoint_id.
Constraints
This function is only supported in CN-Hong Kong.
URI
PUT /v1/{project_id}/maas/services/custom-endpoint/control/{custom_endpoint_id}
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project-id | Yes | String | Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID and Name. Constraints: N/A. Range: N/A. Default Value: N/A. |
custom_endpoint_id | Yes | String | Definition: Endpoint ID, which is returned when an endpoint is created or obtained using the query API. For details, see Creating an Endpoint or Querying Custom Endpoints. Constraints: N/A. Range: N/A. Default Value: N/A. |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
X-Auth-Token | Yes | String | Definition: User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details, see Authentication. Constraints: N/A. Range: N/A. Default Value: N/A. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
action | Yes | String | Definition: Specifies whether to enable or disable the endpoint. Constraints: N/A. Range:
Default Value: N/A. |
Response Parameters
- The error response parameters are as follows.
Parameter
Type
Description
error_msg
String
Definition: Error description.
Range: N/A.
error_code
String
Definition: Error code, indicating the error type.
Range: N/A.
Request Example
Enable the endpoint whose ID is c4513589-df2e-4d58-ab0c-d5a6f2******.
PUT
/v1/{project_id}/maas/services/custom-endpoint/control/c4513589-df2e-4d58-ab0c-d5a6f2******
{
"action": "activate"
} Response Example
- Success response:
Status code: 204. If the operation is successful, no content is returned.
- Error response:
Status code: If the endpoint ID is not found, 404 is returned, indicating that the endpoint does not exist. If the parameter does not meet the specifications, 400 is returned.
{ "error_msg": "Invalid token.", "error_code": "ModelArts.0104" }
Status Codes
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
