Help Center/ Cloud Firewall/ API Reference/ API/ East-west Protection/ Obtaining East-West Firewall Information
Updated on 2023-12-06 GMT+08:00

Obtaining East-West Firewall Information

Function

This API is used to obtain east-west firewall information.

Debugging

You can debug this API through automatic authentication in or use the SDK sample code generated by API Explorer.

URI

GET /v1/{project_id}/firewall/east-west

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

Yes

Integer

Number of records displayed on each page

offset

Yes

Integer

Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0. The default value is 0.

enterprise_project_id

No

String

Enterprise project id, the id generated by the enterprise project after the user supports the enterprise project.

fw_instance_id

No

String

Firewall instance ID, which is automatically generated after a CFW instance is created. You can obtain the ID by calling the API used for querying a firewall instance. For details, see the API Explorer and Help Center FAQ.By default, if fw_instance_Id is not specified, information about the first firewall under the account is returned. If fw_instance_Id is specified, information about the firewall with this fw_instance_Id is returned.If object_Id is specified, information about the firewall with this object_Id is returned by default. If both fw_instance_Id and object_Id are specified, the specified object_Id must belong to the specified firewall.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It 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 a token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

GetEastWestFirewallResponseBody object

Get east west firewall data response

Table 5 GetEastWestFirewallResponseBody

Parameter

Type

Description

object_id

String

Protected object ID, which is used to distinguish Internet border protection from VPC border protection after a CFW instance is created. You can obtain the ID by calling the API used for querying a firewall instance. Note that the value 0 indicates the ID of a protected object on the Internet border, and the value 1 indicates the ID of a protected object on the VPC border. For details, see the API Explorer and Help Center FAQ.

project_id

String

Project ID

status

Integer

Protection status. The value can be 0 (protection enabled) or 1 (protection disabled).

er_associated_subnet

SubnetInfo object

Information about the subnet associated with ER

firewall_associated_subnets

Array of SubnetInfo objects

Subnet associated with CFW

er

ErInstance object

Information about the associated outbound enterprise router

inspection_vpc

VpcDetail object

Monitoring VPC information

protect_infos

Array of EwProtectResourceInfo objects

East-west protection resource information

total

Integer

Total number of protected VPCs

offset

Integer

Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0. The default value is 0.

limit

Integer

Number of records displayed on each page

Table 6 SubnetInfo

Parameter

Type

Description

availability_zone

String

Subnet ID

cidr

String

vpc cidr

name

String

Subnet name

id

String

Subnet ID

gateway_ip

String

Subnet gateway IP address

vpc_id

String

vpc id

status

String

Subnet status

Table 7 ErInstance

Parameter

Type

Description

id

String

ER instance ID

name

String

ER name

state

String

ER status

enterprise_project_id

String

Enterprise user ID

project_id

String

User ID

enable_ipv6

String

Whether to enable IPv6

Table 8 VpcDetail

Parameter

Type

Description

id

String

id

name

String

Name

cidr

String

vpc cidr

status

String

Status

Table 9 EwProtectResourceInfo

Parameter

Type

Description

protected_resource_type

Integer

Protection resource type. The value can be 0 (VPC) or 1 (VGW).

protected_resource_name

String

Protected resource name

protected_resource_id

String

Protected resource ID

protected_resource_nat_name

String

Name of the NAT gateway of the protected resource

protected_resource_nat_id

String

ID of the NAT gateway of the protected resource

protected_resource_project_id

String

Tenant ID of the protected resource

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 8

Maximum: 36

error_msg

String

Description

Minimum: 2

Maximum: 512

Example Requests

Obtaining East-West Firewall Information

https://{Endpoint}/v1/09bb24e6f280d23d0f9fc0104b901480/firewall/east-west?limit=10&offset=0

Example Responses

Status code: 200

Response to the request for querying east-west firewall information

{
  "data" : {
    "er" : {
      "id" : "91fcda9e-2ac7-49a0-89f1-ebee2710347f",
      "name" : "er-test2"
    },
    "er_associated_subnet" : {
      "cidr" : "192.168.0.0/28",
      "id" : "f4467981-2271-4330-b403-cc9f024ab913",
      "name" : "aafdsfas"
    },
    "firewall_associated_subnets" : [ {
      "cidr" : "192.168.0.16/28",
      "id" : "b7cc2358-ede7-4be2-88d0-cfa20fcd4fe9",
      "name" : "aaa"
    }, {
      "cidr" : "192.168.0.32/28",
      "id" : "357a9cca-fd98-4b76-b4e4-ef40954c061a",
      "name" : "asdf"
    } ],
    "inspection_vpc" : {
      "cidr" : "192.168.0.0/24",
      "id" : "9a11350a-3ca5-46b6-a33f-d82c263bc7d8",
      "name" : "ws-01"
    },
    "limit" : 10,
    "object_id" : "8839526e-b804-4a15-a082-a2c797dce633",
    "offset" : 0,
    "project_id" : "0b2179bbe180d3762fb0c01a2d5725c7",
    "protect_infos" : [ ],
    "status" : 3,
    "total" : 0
  }
}

Status Codes

Status Code

Description

200

Response to the request for querying east-west firewall information

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.