Updated on 2023-12-06 GMT+08:00

Querying the EIP List

Function

This API is used to query the EIP list.

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}/eips/protect

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Minimum: 32

Maximum: 32

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

object_id

Yes

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.

Minimum: 36

Maximum: 36

key_word

No

String

Public network ID or EIP

Minimum: 0

Maximum: 255

status

No

String

Specifies the protection status. The value can be null, 0 (enabled), or 1 (disabled).

Enumeration values:

  • null

  • 0

  • 1

sync

No

Integer

Specifies whether to synchronize tenant EIP data. The options are as follows: 0: no; 1: yes

Enumeration values:

  • 0

  • 1

limit

Yes

Integer

Number of records displayed on each page

Minimum: 0

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.

Minimum: 0

enterprise_project_id

No

String

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

device_key

No

String

Device key

address_type

No

Integer

Specifies the address type. The value can be 0 (IPv4) or 1 (IPv6).

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.

fw_key_word

No

String

The bound firewall name

eps_id

No

String

The enterprise project id of the eip

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

EipResponseData object

eip query response

Table 5 EipResponseData

Parameter

Type

Description

limit

Integer

Number of records displayed on each page

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.

total

Integer

total

records

Array of EipResource objects

eip records

Table 6 EipResource

Parameter

Type

Description

id

String

EIP ID

public_ip

String

EIP

status

Integer

EIP protection status,0:protected,1:unprotected

Enumeration values:

  • 0

  • 1

public_ipv6

String

EIP IPv6

enterprise_project_id

String

Enterprise project ID

device_id

String

Device ID

device_name

String

Device name

device_owner

String

Device owner

associate_instance_type

String

Type of the associated instance

fw_instance_name

String

firewall name

fw_instance_id

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.

fw_enterprise_project_id

String

Firewall enterprise project id bound to Eip

Status code: 400

Table 7 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

Query the data on the non-synchronized first page whose project ID is 9d80d070b6d44942af73c9c3d38e0429 and protected object ID is cfebd347-b655-4b84-b938-3c54317599b2.

https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/eips/protect?object_id=cfebd347-b655-4b84-b938-3c54317599b2&limit=10&offset=0&sync=0

Example Responses

Status code: 200

Return value of EIP data query

{
  "data" : {
    "limit" : 10,
    "offset" : 0,
    "records" : [ {
      "id" : "03e11b49-cddc-4d21-9971-969744a56c1c",
      "public_ip" : "100.95.150.41",
      "status" : 0
    }, {
      "id" : "088c3aa1-82ba-40b0-98b6-476c8a7f1e22",
      "public_ip" : "100.95.145.155",
      "status" : 1
    }, {
      "id" : "199473ce-a09a-496d-902b-c3aba58990ac",
      "public_ip" : "100.85.122.202",
      "status" : 1
    }, {
      "id" : "2d0f799c-0285-49cd-a25a-065f3ae1ab52",
      "public_ip" : "100.85.118.98",
      "status" : 1
    }, {
      "id" : "2d934ad5-ee5b-4d4e-9f62-9a59051cb138",
      "public_ip" : "100.85.123.11",
      "status" : 1
    }, {
      "id" : "3603a902-e731-4ce1-9241-369510509655",
      "public_ip" : "100.85.113.240",
      "status" : 1
    }, {
      "id" : "406641fd-f712-478c-86ee-86de75434408",
      "public_ip" : "100.85.118.102",
      "status" : 1
    }, {
      "id" : "4d218dd9-235f-44f9-b763-7b2a8174751c",
      "public_ip" : "100.85.120.114",
      "status" : 1
    }, {
      "id" : "4d560006-bd48-4be7-9389-1ebe5bb3f73b",
      "public_ip" : "100.85.114.20",
      "status" : 1
    }, {
      "id" : "6afcaf2b-f52c-401c-b709-10156bfde36a",
      "public_ip" : "100.85.122.86",
      "status" : 1
    } ],
    "total" : 25
  }
}

Status code: 400

Bad Request

{
  "error_code" : "CFW.00109004",
  "error_msg" : "http to external service error"
}

Status Codes

Status Code

Description

200

Return value of EIP data query

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.