Obtaining the Automatic EIP Protection Status
Function
This API is used to obtain the automatic EIP protection status.
URI
GET /v1/{project_id}/eip/auto-protect-status/{object_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| object_id | Yes | 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 type is 0, object_id is the ID of a protected object on the Internet border. If type is 1, object_id is the ID of a protected object on the VPC border. Here, a protected object ID whose type is 1 is used. You can obtain the value of type from data.records.protect_objects.type (The period [.] is used to separate different levels of objects). |
| 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). |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | FirewallStatusVO object | Firewall status object. |
| Parameter | Type | Description |
|---|---|---|
| available_eip_count | Integer | Number of EIPs that can be protected. |
| beyond_max_count | Boolean | Whether the number of EIPs exceeds the upper limit. |
| eip_protected_self | Integer | Number of protected EIPs. |
| eip_total | Integer | Total EIPs. |
| eip_un_protected | Integer | Number of unprotected EIPs. |
| object_id | String | Protected object ID. |
| status | Integer | Whether to enable automatic protection for new EIPs: 1 (yes), 0 (no). |
Example Requests
Obtain the automatic EIP protection status of the project whose ID is 408972e72dcd4c1a9b033e955802a36b. The firewall ID is e743cfaf-8164-4807-aa13-d893d83313cf, the enterprise project ID is fb55459c-41b3-47fc-885d-540946fddda4, and the target object ID is 1b90f031-0c7b-4f25-95e2-b6d9940d269e.
https://{Endpoint}/v1/408972e72dcd4c1a9b033e955802a36b/eip/auto-protect-status/1b90f031-0c7b-4f25-95e2-b6d9940d269e?fw_instance_id=e743cfaf-8164-4807-aa13-d893d83313cf&enterprise_project_id=fb55459c-41b3-47fc-885d-540946fddda4&object_id=1b90f031-0c7b-4f25-95e2-b6d9940d269e&project_id=408972e72dcd4c1a9b033e955802a36b Example Responses
Status code: 200
OK
{
"data" : {
"available_eip_count" : 50,
"beyond_max_count" : false,
"eip_protected_self" : 15,
"eip_total" : 24,
"eip_un_protected" : 9,
"object_id" : "1b90f031-0c7b-4f25-95e2-b6d9940d269e",
"status" : 1
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Unauthorized: Request error. |
| 403 | Forbidden: Access forbidden. |
| 404 | Not Found: Web page not found. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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