查詢指定地域已創建的彈性 IP
更新時間 2023-07-06 09:22:03
最近更新時間: 2023-07-06 09:22:03
分享文章
接口功能介紹
調用此接口可查詢指定地域已創建的彈性公網IP(Elastic IP Address,簡稱EIP)。
接口約束
無。
URI
POST /v4/eip/list
請求參數
請求Body參數
| 參數 | 參數類型 | 是否必填 | 說明 | 示例 |
|---|---|---|---|---|
| clientToken | String | 是 | 客戶端存根,用于保證訂單冪等性, 長度 1 - 64 | 79fa97e3-c48b-xxxx-9f46-6a13d8163678 |
| regionID | String | 是 | 資源池 ID | |
| projectID | String | 否 | 企業項目 ID,默認為"0" | |
| page | Integer | 否 | 分頁參數 | |
| pageNo | Integer | 否 | 列表的頁碼,默認值為 1, 推薦使用該字段, page 后續會廢棄 | 1 |
| pageSize | Integer | 否 | 每頁數據量大小,取值 0-50 | |
| ids | Array of Strings | 否 | 是 Array 類型,里面的內容是 String | |
| status | string | 否 | eip狀態 ACTIVE(已綁定)/ DOWN(未綁定)/ FREEZING(已凍結)/ EXPIRED(已過期),不傳是查詢所有狀態的 EIP | |
| ipType | string | 否 | ip類型 ipv4 / ipv6 | |
| eipType | string | 否 | eip類型 normal / cn2 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗) | 800 |
| message | String | statusCode為900時的錯誤信息; statusCode為800時為success, 英文 | success |
| description | String | statusCode為900時的錯誤信息; statusCode為800時為成功, 中文 | 成功 |
| errorCode | String | statusCode為900時為業務細分錯誤碼,三段式:product.module.code; statusCode為800時為SUCCESS | SUCCESS |
| returnObj | Object | object | 返回結果 |
| totalCount | Integer | 列表條目數 | 20 |
| currentCount | Integer | 分頁查詢時每頁的行數。 | 4 |
| totalPage | Integer | 總頁數 | 5 |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 |
|---|---|---|---|
| eips | Array of Objects | 彈性 IP 列表 | 見下表 |
表 eips
| 參數 | 參數類型 | 描述 | 說明 |
|---|---|---|---|
| ID | String | eip ID | |
| name | String | eip 名稱 | |
| description | String | 描述 | |
| eipAddress | String | eip 地址 | |
| associationID | String | 當前綁定的實例的 ID | |
| associationType | String | 當前綁定的實例類型 | |
| privateIpAddress | String | 交換機網段內的一個 IP 地址 | |
| bandwidth | Integer | 帶寬峰值大小,單位 Mb | |
| status | String | 1.ACTIVE 2.DOWN 3.ERROR 4.UPDATING 5.BANDING_OR_UNBANGDING 6.DELETING 7.DELETED 8.EXPIRED | |
| tags | String | EIP 的標簽集合 | |
| createdAt | String | 創建時間 | |
| updatedAt | String | 更新時間 | |
| expiredAt | String | 到期時間 | 2022-11-25T01:08:10Z |
請求示例
POST /v4/eip/list?regionID=xxx&clientToken=xxxx
請求體body
響應示例
{
"statusCode": 800,
"errorCode": "SUCCESS",
"message": "success",
"description": "",
"returnObj": {
"eips": [
{
"ID": "eip-gyl69v26yx",
"name": "turn-test11",
"eipAddress": "100.124.16.204",
"associationID": "natgw-or5g08lk8z",
"associationType": "PORTFORWARDING",
"privateIpAddress": "",
"bandwidth": 100,
"status": "ACTIVE",
"tags": "",
"createdAt": "2022-11-17T11:06:38Z",
"updatedAt": "2022-11-17T11:11:23Z",
"expiredAt": "2022-12-17T11:06:38Z"
},
{
"ID": "eip-ttc46rbdtb",
"name": "turn-test10",
"eipAddress": "100.124.16.191",
"associationID": "natgw-l03gnhsct9",
"associationType": "PORTFORWARDING",
"privateIpAddress": "",
"bandwidth": 0,
"status": "ACTIVE",
"tags": "",
"createdAt": "2022-11-17T10:10:21Z",
"updatedAt": "2022-11-17T10:11:25Z",
"expiredAt": null
},
{
"ID": "eip-zy8vg0kfow",
"name": "turn-test8",
"eipAddress": "100.124.16.200",
"associationID": null,
"associationType": null,
"privateIpAddress": null,
"bandwidth": 0,
"status": "BANGDING_OR_UNBANDING",
"tags": "",
"createdAt": "2022-11-17T10:03:05Z",
"updatedAt": "2022-11-22T03:36:02Z",
"expiredAt": null
},
{
"ID": "eip-8epskb8s6z",
"name": "turn-test7",
"eipAddress": "100.124.16.199",
"associationID": null,
"associationType": null,
"privateIpAddress": null,
"bandwidth": 0,
"status": "BANGDING_OR_UNBANDING",
"tags": "",
"createdAt": "2022-11-17T10:00:31Z",
"updatedAt": "2022-11-22T03:37:54Z",
"expiredAt": null
},
{
"ID": "eip-jvtemnv9ej",
"name": "turn-test6",
"eipAddress": "100.124.16.193",
"associationID": null,
"associationType": null,
"privateIpAddress": null,
"bandwidth": 0,
"status": "BANGDING_OR_UNBANDING",
"tags": "",
"createdAt": "2022-11-17T09:57:55Z",
"updatedAt": "2022-11-22T02:53:16Z",
"expiredAt": null
},
{
"ID": "eip-rymcu5n283",
"name": "turn-test5",
"eipAddress": "100.124.16.72",
"associationID": "",
"associationType": null,
"privateIpAddress": "",
"bandwidth": 100,
"status": "BANGDING_OR_UNBANDING",
"tags": "",
"createdAt": "2022-11-17T09:49:34Z",
"updatedAt": "2022-11-22T03:07:49Z",
"expiredAt": "2122-11-17T09:49:34Z"
},
{
"ID": "eip-z03o5an2o9",
"name": "turn-test4",
"eipAddress": "100.124.16.197",
"associationID": "",
"associationType": null,
"privateIpAddress": "",
"bandwidth": 100,
"status": "DOWN",
"tags": "",
"createdAt": "2022-11-17T09:41:43Z",
"updatedAt": "2022-11-17T09:46:54Z",
"expiredAt": "2023-05-17T09:41:43Z"
},
{
"ID": "ipv6-n19eucosil",
"name": "",
"eipAddress": "100:1:1a4:f400:ba0f:5e72:339d:965f",
"associationID": "6d3867dd-5884-1e08-01e8-f4a7cc711f04",
"associationType": "INSTANCE",
"privateIpAddress": "100:1:1a4:f400:ba0f:5e72:339d:965f",
"bandwidth": 0,
"status": "DOWN",
"tags": "",
"createdAt": "2022-11-17T09:36:14Z",
"updatedAt": "2022-11-17T09:36:14Z",
"expiredAt": null
},
{
"ID": "eip-3k14yhjcsa",
"name": "turn-test3",
"eipAddress": "100.124.16.71",
"associationID": "",
"associationType": "",
"privateIpAddress": "",
"bandwidth": 100,
"status": "DOWN",
"tags": "",
"createdAt": "2022-11-17T08:04:07Z",
"updatedAt": "2022-11-17T08:08:48Z",
"expiredAt": "2023-05-17T08:04:07Z"
},
{
"ID": "eip-jodpct3k9h",
"name": "turn-test2",
"eipAddress": "100.124.16.174",
"associationID": "",
"associationType": null,
"privateIpAddress": "",
"bandwidth": 100,
"status": "DOWN",
"tags": "",
"createdAt": "2022-11-17T08:02:07Z",
"updatedAt": "2022-11-17T08:08:55Z",
"expiredAt": "2022-12-17T08:02:07Z"
}
]
},
"currentCount": 10,
"totalCount": 75,
"totalPage": 8
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 表示請求成功。 |
錯誤碼
請參考 錯誤碼說明。