查询二层连接列表 - ListConnectionsAllInstances
功能介绍
当您的二层连接创建成功后,您可以通过调用此接口查询租户所有二层连接信息列表。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备如下身份策略权限,更多的权限说明请参见权限和授权项。
|
授权项 |
访问级别 |
资源类型(*为必须) |
条件键 |
别名 |
依赖的授权项 |
|---|---|---|---|---|---|
|
esw:connection:list |
List |
- |
- |
- |
- |
URI
GET /v3/{project_id}/l2cg/connections
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
|
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
id |
否 |
String |
|
|
name |
否 |
String |
|
|
instance_id |
否 |
String |
|
|
vpc_id |
否 |
String |
|
|
virsubnet_id |
否 |
String |
|
请求参数
无
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
request_id |
String |
|
|
page_info |
PageInfo object |
|
|
connections |
Array of Connection objects |
|
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
next_marker |
String |
|
|
previous_marker |
String |
|
|
current_count |
Integer |
|
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
fixed_ips |
Array of strings |
|
|
id |
String |
|
|
instance_id |
String |
|
|
name |
String |
|
|
project_id |
String |
|
|
remote_infos |
Array of RemoteInfosResult objects |
|
|
status |
String |
|
|
virsubnet_id |
String |
|
|
vpc_id |
String |
|
|
created_at |
String |
|
|
updated_at |
String |
|
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
segmentation_id |
Integer |
|
|
tunnel_ip |
String |
|
|
tunnel_port |
Integer |
|
|
tunnel_type |
String |
|
请求示例
GET https://{{endpoint}}/v3/060576782980d5762f9ec014dd2f1148/l2cg/connections
响应示例
状态码:200
GET操作正常返回,更多状态码请参见状态码。
{
"request_id" : "d3301f85b4951cce72aa30e6deae7022",
"connections" : [ {
"name" : "l2conn-ba19",
"id" : "9cb4f6bd-89a0-4633-b53e-c333b8c9277f",
"status" : "disconnect",
"created_at" : "2025-06-24T06:09:03Z",
"updated_at" : "2025-08-22T02:30:50Z",
"project_id" : "88104fcc62a640bfa0a0bf687607621c",
"instance_id" : "16b2eea7-5935-445d-8410-083b7064b939",
"vpc_id" : "41829b5e-66c0-4928-a3d4-f4570ce81d8f",
"virsubnet_id" : "7ef08d1e-6e82-4133-9147-5dde6a50ee90",
"fixed_ips" : [ "192.168.1.170", "192.168.1.140" ],
"remote_infos" : [ {
"segmentation_id" : 6790,
"tunnel_ip" : "192.168.4.202",
"tunnel_port" : 4789,
"tunnel_type" : "vxlan"
} ]
}, {
"name" : "l2conn-89a4",
"id" : "d5a0c32d-e52d-48d8-8afb-ee9975618ba3",
"status" : "disconnect",
"created_at" : "2025-08-22T02:53:04Z",
"updated_at" : "2025-08-22T02:53:18Z",
"project_id" : "88104fcc62a640bfa0a0bf687607621c",
"instance_id" : "a14aa233-3ac1-4218-8d85-b168a6c1b6df",
"vpc_id" : "a36e12f4-b490-4b85-bf41-dc61f8f4f4d7",
"virsubnet_id" : "be272d7a-5111-451a-af8b-09b673b1a7e9",
"fixed_ips" : [ "192.168.1.158", "192.168.1.42" ],
"remote_infos" : [ {
"segmentation_id" : 9732,
"tunnel_ip" : "192.168.0.76",
"tunnel_port" : 4789,
"tunnel_type" : "vxlan"
} ]
} ],
"page_info" : {
"previous_marker" : "9cb4f6bd-89a0-4633-b53e-c333b8c9277f",
"current_count" : 2
}
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
GET操作正常返回,更多状态码请参见状态码。 |
错误码
请参见错误码。