Modifying the Automatic EIP Protection Switch
Function
This API is used to modify the automatic EIP protection switch.
URI
POST /v1/{project_id}/eip/auto-protect-status/switch
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. You can obtain it by referring to Obtaining a Project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| enterprise_project_id | No | String | Enterprise project ID, which is the ID of a project planned based on organizations. If the enterprise project function is not enabled, the value is 0. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| fw_instance_id | No | String | Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
| object_id | No | String | Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the API for querying firewall instances. In the return value, find the ID in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects). If the value of type is 0, object_id is the protected object ID on the Internet border. If the value of type is 1, object_id is the protected object ID on the VPC border. You can obtain the value of type from data.records.protect_objects.type (The period [.] is used to separate different levels of objects). |
| status | No | Integer | Whether to enable automatic protection for new EIPs: 1 (yes), 0 (no). |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | String |
Status code: 201
Created
Example Requests
Change the automatic EIP protection status of the project whose ID is 408972e72dcd4c1a9b033e955802a36b. The firewall ID is e743cfaf-8164-4807-aa13-d893d83313cf, and the target protected object ID is 1b90f031-0c7b-4f25-95e2-b6d9940d269e. Change the status to 0.
https://{Endpoint}/v1/408972e72dcd4c1a9b033e955802a36b/eip/auto-protect-status/switch
{
"object_id" : "1b90f031-0c7b-4f25-95e2-b6d9940d269e",
"fw_instance_id" : "e743cfaf-8164-4807-aa13-d893d83313cf",
"status" : 0
} Example Responses
Status code: 200
OK
{
"data" : "1b90f031-0c7b-4f25-95e2-b6d9940d269e"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 201 | Created |
| 401 | Unauthorized: Request error. |
| 403 | Forbidden: Access forbidden. |
| 404 | Not Found: Web page not found. |
Error Codes
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