查询端口列表
功能介绍
查询端口列表。
URI
GET /v1/{project_id}/ports
GET https://{Endpoint}/v1/{project_id}/ports?id={port_id}&name={port_name}&admin_state_up={is_admin_status_up}&network_id={network_id}&mac_address={port_mac}&device_id={port_device_id}&device_owner={device_owner}&status={port_status}&fixed_ips=ip_address={ip_address}&fixed_ips=subnet_id={subnet_id}&limit=10&marker={marker}
|
名称 |
是否必选 |
参数类型 |
说明 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID,请参见获取项目ID。 |
|
id |
否 |
String |
|
|
name |
否 |
String |
|
|
admin_state_up |
否 |
Boolean |
|
|
network_id |
否 |
String |
|
|
mac_address |
否 |
String |
|
|
device_id |
否 |
String |
|
|
device_owner |
否 |
String |
|
|
status |
否 |
String |
|
|
security_groups |
否 |
Array of strings |
|
|
marker |
否 |
String |
分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用:
|
|
limit |
否 |
Integer |
分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。 |
|
fixed_ips |
否 |
Array of strings |
|
|
enterprise_project_id |
否 |
String |
说明:
|
|
enable_efi |
否 |
Boolean |
|
请求参数
无
请求示例
GET https://{Endpoint}/v1/{project_id}/ports
响应参数
|
名称 |
参数类型 |
说明 |
|---|---|---|
|
id |
String |
端口唯一标识。 |
|
name |
String |
|
|
network_id |
String |
|
|
admin_state_up |
Boolean |
|
|
mac_address |
String |
|
|
fixed_ips |
Array of fixed_ip objects |
|
|
device_id |
String |
|
|
device_owner |
String |
|
|
tenant_id |
String |
项目ID。 |
|
status |
String |
|
|
security_groups |
Array of strings |
安全组的UUID(扩展属性)。 |
|
allowed_address_pairs |
Array of allowed_address_pairs objects |
|
|
extra_dhcp_opts |
Array of extra_dhcp_opt objects |
DHCP的扩展Option(扩展属性),请参见表6。 |
|
binding:vif_details |
binding:vif_details object |
vif的详细信息,参见表7。 |
|
binding:profile |
Object |
功能说明:扩展属性,提供用户设置自定义信息。 使用说明: |
|
binding:vnic_type |
String |
|
|
dns_assignment |
Array of dns_assignment objects |
|
|
dns_name |
String |
|
|
instance_id |
String |
|
|
instance_type |
String |
|
|
port_security_enabled |
Boolean |
|
|
ipv6_bandwidth_id |
String |
|
|
名称 |
参数类型 |
说明 |
|---|---|---|
|
ip_address |
String |
|
|
mac_address |
String |
MAC地址。默认使用本端口的MAC地址。 |
|
名称 |
参数类型 |
说明 |
|---|---|---|
|
opt_name |
String |
DHCP选项名称,目前仅支持填写“51”,表示DHCP租约时间。 |
|
opt_value |
String |
|
响应示例
{
"ports": [
{
"id": "d00f9c13-412f-4855-8af3-de5d8c24cd60",
"name": "test",
"status": "DOWN",
"admin_state_up": "true",
"fixed_ips": [
{
"subnet_id": "70f2e74b-e660-410a-b754-0ca46744348a",
"ip_address": "10.128.1.10"
}
],
"dns_name": "",
"mac_address": "fa:16:3e:d7:f2:6c",
"network_id": "5b808927-13c9-4e60-a4f4-ed6ffe225167",
"tenant_id": "43f2d1cca56a40729dcb17212482f34d",
"device_id": "",
"device_owner": "",
"security_groups": [
"02b4e8ee-74fa-4a31-802e-5490df11245e"
],
"extra_dhcp_opts": [],
"allowed_address_pairs": [],
"binding:vnic_type": "normal",
"instance_type": "RDS",
"instance_id": "03a4e9ee-64eb-4a31-802e-5490df22146c"
},
{
"id": "28ba8f45-7636-45e4-8c0a-675d7663717c",
"name": "test1",
"status": "DOWN",
"admin_state_up": "true",
"fixed_ips": [
{
"subnet_id": "061d3ca2-bd1f-4bd1-a01d-7a5155328c0e",
"ip_address": "192.168.10.10"
}
],
"dns_name": "",
"mac_address": "fa:16:3e:3d:91:cd",
"network_id": "be2fe79a-3ee2-4d87-bd71-5afa78a5670d",
"tenant_id": "43f2d1cca56a40729dcb17212482f34d",
"device_id": "",
"device_owner": "",
"security_groups": [
"0bfc8687-ca18-4c37-ac84-d2198baba585"
],
"extra_dhcp_opts": [],
"allowed_address_pairs": [],
"binding:vnic_type": "normal"
}
]
}
状态码
请参见状态码。
错误码
请参考错误码。