Creating an East-West Firewall
Function
This API is used to create an east-west firewall.
URI
POST /v1/{project_id}/firewall/east-west
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. For details, see 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. You can obtain the enterprise project ID by referring to Obtaining an Enterprise Project ID. If the enterprise project function is not enabled, the value is 0. |
| fw_instance_id | Yes | String | Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. You can obtain the token by referring to Obtaining a User Token. |
| Content-Type | Yes | String | Content type. It can only be set to application/json. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| er_id | Yes | String | ID of the associated enterprise router in the outbound direction, which can be obtained by calling the API for querying the enterprise router list of the Enterprise Router service. Find the enterprise router ID in instances.id (The period [.] is used to separate different levels of objects). |
| inspection_cidr | Yes | String | CIDR block used for creating a traffic diversion VPC. Only private network address segments (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) are supported. Otherwise, route conflicts may occur in public network access scenarios, such as SNAT. The CIDR block 10.6.0.0/16-10.7.0.0/16 is reserved for CFW and cannot be specified. This CIDR block cannot overlap with the private CIDR block to be protected, or routing conflicts and protection failures may occur. |
| mode | Yes | String | East-west firewall mode. Enter er. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | CreateEWFirewallResp object | Return value for creating an east-west firewall. |
| Parameter | Type | Description |
|---|---|---|
| id | String | East-west protection ID, corresponding to the object_id field. |
| er | ER object | Enterprise router information. |
| inspertion_vpc | Information about the inspection VPC. |
| Parameter | Type | Description |
|---|---|---|
| er_id | String | Enterprise router ID, which is referenced when east-west protection is created. |
| er_attach_id | String | Connection ID of an enterprise router. This connection is used to connect the firewall and the enterprise router. This field can be used to obtain the connection details on the connection management page after querying a specified enterprise router by its ID on the Enterprise Router page. |
Example Requests
Under firewall 55b26ab5-e4b0-40e8-941c-a1778fe2a500 in project 09bb24e6f280d23d0f9fc0104b901480, create a firewall in enterprise router mode. The enterprise router ID is 0eb296a4-aa9b-493e-b58a-ce993a16edfc, the inspection VPC is 0eb296a4-aa9b-493e-b58a-ce993a16edfd.
https://{Endpoint}/v1/09bb24e6f280d23d0f9fc0104b901480/firewall/east-west?fw_instance_id=55b26ab5-e4b0-40e8-941c-a1778fe2a500&enterprise_project_id=default
{
"er_id": "0eb296a4-aa9b-493e-b58a-ce993a16edfc",
"mode": "er"
"inspection_vpc_id": "0eb296a4-aa9b-493e-b58a-ce993a16edfd"
} Example Responses
Status code: 200
Return value for creating an east-west firewall.
{
"data" : {
"id" : "acc86ca7-818b-4c3d-8a9a-3915a2b21651",
"er" : {
"er_id" : "f0f5275a-40aa-4d1e-ac78-2550f7818d43",
"er_attach_id" : "bd62ddd3-5e20-482b-aefa-9e2940e2b1a9"
},
"inspertion_vpc" : {
"vpc_id" : "00672633-0466-4c35-99ef-5e3f5c813a4b",
"subnet_ids" : [ "294682a0-1e85-45f5-92c8-e52bee09c204", "a86277bb-35d5-4442-bc0b-2e9d4e6a9080", "95829240-14e0-47e6-b9e7-2ac228e7b00f" ]
}
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Return value for creating an east-west firewall. |
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