
# 查询端口列表
#### 功能介绍
查询提交请求的租户的所有端口，单次查询最多返回2000条数据，超过2000后会返回分页标记。
#### 调试
您可以在[API Explorer](https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc?product=VPC&version=v2&api=NeutronListPorts)中调试该接口。
#### URI
GET /v2.0/ports
样例：
```
GET https://{Endpoint}/v2.0/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}&tenant_id={tenant_id}&status={port_status}&fixed_ips=ip_address={ip_address}&fixed_ips=subnet_id={subnet_id}&dns_name={dns_name}
```
分页查询样例：
```
GET https://{Endpoint}/v2.0/ports?limit=2&marker=791870bd-36a7-4d9b-b015-a78e9b06af08&page_reverse=False
```
参数说明请参见[表1]。
 表1参数说明 
| 名称              | 是否必选 | 参数类型             | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| id              | 否    | String           | 按照端口的ID过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| name            | 否    | String           | 按照端口的名称过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| admin_state_up  | 否    | Boolean          | - 功能说明：按照端口的管理状态过滤查询。  - 取值范围：true o false。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| network_id      | 否    | String           | 按照端口所属的网络ID过滤查询。 说明： 网络ID的获取方式： - 方法1：登录虚拟私有云服务的控制台界面，单击VPC下的子网，进入子网详情页面，查找网络ID。  - 方法2：通过虚拟私有云服务的API接口查询，具体操作可参考[查询子网列表](https://support.huaweicloud.com/api-vpc/vpc_subnet01_0003.html)                                                                                                                                                                                                                                                                                                          |
| mac_address     | 否    | String           | 按照端口的mac地址过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| device_id       | 否    | String           | 按照端口的设备ID过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| device_owner    | 否    | String           | 按照端口的设备所属过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| status          | 否    | String           | - 功能说明：按照端口状态过滤查询。  - 取值范围：ACTIVE、BUILD、DOWN。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| security_groups | 否    | Array of strings | 按照端口关联的安全组ID过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| fixed_ips       | 否    | Array of strings | 按照端口的IP地址过滤查询，fixed_ips=ip_address={ip_address}或者fixed_ips=subnet_id={subnet_id}过滤查询，其中{ip_address}填ip地址，如192.168.21.22，2a07:b980:4030:14::1；{subnet_id}填IPv4子网或IPv6子网的ID，如011fc878-5521-4654-a1ad-f5b0b5820302。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| tenant_id       | 否    | String           | 按照端口所属的项目ID过滤查询。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| marker          | 否    | String           | 分页查询的起始资源ID，表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用： - 若不传入marker和limit参数，查询结果返回第一页全部资源记录。  - 若不传入marker参数，limit为10，查询结果返回第1\~10条资源记录。  - 若marker为第10条记录的资源ID，limit为10，查询结果返回第11\~20条资源记录。  - 若marker为第10条记录的资源ID，不传入limit参数，查询结果返回第11\~2000条（limit默认值2000）资源记录。   |
| limit           | 否    | Integer          | 分页查询每页返回的记录个数，取值范围为0\~2000，默认值2000。 limit需要和marker配合使用，详细规则请见marker的参数说明。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
#### 请求参数
无
#### 请求示例
【示例一】
```
GET https://{Endpoint}/v2.0/ports?limit=1
```
【示例二】
```
GET https://{Endpoint}/v2.0/ports?mac_address=fa:16:3e:f1:0b:09
```
【示例三】
```
GET https://{Endpoint}/v2.0/ports?admin_state_up=False
```
【示例四】
```
GET https://{Endpoint}/v2.0/ports?device_id=e6c05704-c907-4cc1-8106-69b0996c43b9
```
【示例五】
```
GET https://{Endpoint}/v2.0/ports?tenant_id=6c9298ec8c874f7f99688489ab65f90e&name=port_vm_50_3
```
【示例六】
```
GET https://{Endpoint}/v2.0/ports?name=port_vm_50_3
```
#### 响应参数
表2响应参数 
| 参数名称        | 类型                                                                                   | 说明                                                                                                                                                                                                        |
|:---|:---|:---|
| ports       | Array of [port] objects     | port对象列表，参见[表3]。                                                                                                                                 |
| ports_links | Array of [ports_link] objects | 分页信息，参见[表9]。 只有在使用limit过滤，并且资源个数超过limit或者资源个数超过2000时（limit默认值），该参数的rel和href取值才会显示为next和其对应的link。 |
   
 表3port对象 
| 参数名称                  | 类型                                                                                                                 | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|
| id                    | String                                                                                                             | - 功能说明：端口的ID，最大长度不超过255。  - 使用说明：在查询端口列表时非必选。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| name                  | String                                                                                                             | 端口的名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| network_id            | String                                                                                                             | 所属网络的ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| admin_state_up        | Boolean                                                                                                            | - 功能说明：端口的管理状态。  - 使用说明：默认为true。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| mac_address           | String                                                                                                             | - 功能说明：端口MAC地址，例如："mac_address": "fa:16:3e:9e:ff:55"。  - 使用说明：只支持系统动态分配，不支持指定。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| fixed_ips             | Array of [fixed_ip] objects                                | - 功能说明：端口IP，参见[表4]。 例如，"fixed_ips": \[{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}\]， "fixed_ips": \[{"subnet_id": "1fd001aa-6946-4168-86d9-924c7d3ef8fb", "ip_address": "2a07:b980:4030:14::1"}\]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| device_id             | String                                                                                                             | - 功能说明：设备ID。  - 使用说明：不支持设置和更新，由系统自动维护，该字段非空的端口不允许删除。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| device_owner          | String                                                                                                             | - 功能说明：设备所属（DHCP/Router/ Nova等）。  - 取值范围：network:dhcp，network:router_interface_distributed，compute:xxx(xxx对应具体的可用区名称，例如compute:aa-bb-cc表示是被可用区aa-bb-cc上的ECS使用)，neutron:VIP_PORT，neutron:LOADBALANCERV2，neutron:LOADBALANCERV3，network:endpoint_interface，network:nat_gateway，network:ucmp。  - 使用说明： - 不支持更新，只允许用户在创建虚拟IP端口时，为虚拟IP端口设置device_owner为neutron:VIP_PORT，当端口的该字段不为空时，仅支持该字段为neutron:VIP_PORT时的端口删除。  - 该字段非空的端口不允许删除。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| tenant_id             | String                                                                                                             | 项目ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| status                | String                                                                                                             | - 功能说明：端口状态。  - 取值范围：ACTIVE，BUILD，DOWN。  - 使用说明：Hana硬直通虚拟机端口状态总为DOWN。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| security_groups       | Array of strings                                                                                                   | - 功能说明：扩展属性，安全组的UUID，例如："security_groups": \["a0608cbf-d047-4f54-8b28-cd7b59853fff"\]。  - 使用说明：不支持更新为空。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| allowed_address_pairs | Array of [allowed_address_pairs] objects | - 功能说明：扩展属性，IP/Mac对列表，allow_address_pair参见[表5]。  - 使用说明： - IP地址不允许为 "0.0.0.0/0"  - 如果allowed_address_pairs配置地址池较大的CIDR（掩码小于24位），建议为该port配置一个单独的安全组  - 如果allowed_address_pairs的IP地址为"1.1.1.1/0"，表示关闭源目的地址检查开关。  - 硬件SDN环境不支持ip_address属性配置为CIDR格式  - 为虚拟IP配置后端ECS场景，allowed_address_pairs中配置的IP地址，必须为ECS网卡已有的IP地址，否则可能会导致虚拟IP通信异常。  - 被绑定的云服务器网卡allowed_address_pairs的IP地址填"1.1.1.1/0"。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| extra_dhcp_opts       | Array of [extra_dhcp_opt] objects                          | 扩展属性，DHCP的扩展Option，参见[表6]。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| binding:vif_details   | [binding:vif_details] object                                 | vif的详细信息，参见[表7]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| binding:profile       | Object                                                                                                             | - 功能说明：扩展属性，提供用户设置自定义信息。  - 使用说明： - internal_elb字段，布尔类型，普通租户可见。只有在创建内网ELB的虚拟IP的网卡时设置为true。普通租户没有权限更改该字段，由系统维护。【举例】 {"internal_elb": true}     - disable_security_groups字段，布尔类型，普通租户可见。默认为false高性能通信场景下，允许指定为true普通租户可见。仅支持创建port和读取时指定。当前仅支持指定为true，不支持指定为false。 【举例】 {"disable_security_groups"：true } 当前仅支持指定为true，不支持指定为false，指定为true时，FWaaS功能不生效。     - 仅对于"华北-北京二"：udp_srvports和tcp_srvports，字段，字符串类型，默认不设置udp_srvports和tcp_srvports字段。允许指定udp_srvports和tcp_srvports字段为端口号，表示这些端口的tcp报文和udp报文可支持高并发连接，但是此类报文不受ACL和安全组规则的限制。udp_srvports和tcp_srvports字段同时支持更新操作。 【格式】 {"tcp_srvports": "port1 port2 port3", "udp_srvports": "port1 port2 port3"} 端口号之间以空格间隔，最多允许指定的端口号总共为15个，端口号范围是1到65535。 【示例】 {"tcp_srvports": "80 443", "udp_srvports": "53"} 示例表示入方向目的端口为80或者443的tcp报文可支持高并发连接。入方向目的端口为53的udp报文可支持高并发连接。但是此类报文不受ACL和安全组规则的限制。      |
| binding:vnic_type     | String                                                                                                             | - 功能说明：绑定的vNIC类型。  - 取值范围： - normal: 软交换。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| port_security_enabled | Boolean                                                                                                            | 端口安全使能标记。 取值范围：true，允许加入安全组和开启dhcp防欺骗；false，安全组和dhcp防欺骗不生效。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| dns_assignment        | Array of [dns_assignment] objects                          | - 功能说明：扩展属性，主网卡默认内网域名信息。  - 使用说明：不支持设置和更新，由系统自动维护。  - 取值范围： - hostname：与端口dns_name一致。  - ip_address：端口ipv4私有地址。  - fqdn：为端口创建默认内网fqdn。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| dns_name              | String                                                                                                             | - 功能说明：扩展属性，主网卡默认内网DNS名称。  - 使用说明：不支持设置和更新，由系统自动维护，访问该默认内网域名前，请确保子网使用当前系统提供的DNS。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| project_id            | String                                                                                                             | 项目ID，请参见[获取项目ID](https://support.huaweicloud.com/api-vpc/vpc_api_0011.html)。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| created_at            | String                                                                                                             | - 功能说明：资源创建时间，UTC时间。  - 格式：yyyy-MM-ddTHH:mm:ss。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| updated_at            | String                                                                                                             | - 功能说明：资源更新时间，UTC时间。  - 格式：yyyy-MM-ddTHH:mm:ss。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   
 表4fixed_ip对象 
| 参数名称       | 类型     | 说明                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|
| subnet_id  | String | - 功能说明：所属子网ID。  - 使用说明：不支持更新。   |
| ip_address | String | - 功能说明：端口IP地址。  - 使用说明：不支持更新。           |
   
 表5allowed_address_pairs对象 
| 名称          | 是否必选 | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| ip_address  | 是    | String | - 功能说明：IP地址。  - 约束：不支持0.0.0.0/0。  - 如果allowed_address_pairs配置地址池较大的CIDR（掩码小于24位），建议为该port配置一个单独的安全组。  - 如果allowed_address_pairs的IP地址为"1.1.1.1/0"，表示关闭源目的地址检查开关。  - 被绑定的云服务器网卡allowed_address_pairs的IP地址填"1.1.1.1/0"。  - 如果填写allowed_address_pairs参数，则ip_address是必选参数。   |
| mac_address | 否    | String | MAC地址。默认使用当前端口的MAC地址。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   
 表6extra_dhcp_opt对象 
| 参数名称      | 类型     | 说明        |
|:---|:---|:---|
| opt_name  | String | Option名称。 |
| opt_value | String | Option值。  |
   
 表7binding:vif_details对象 
| 名称                | 参数类型    | 说明                                 |
|:---|:---|:---|
| primary_interface | Boolean | 取值为true，表示是虚拟机的主网卡。                |
| port_filter       | Boolean | 表示该网络服务提供端口过滤特性，如安全组和反MAC/IP欺骗。    |
| ovs_hybrid_plug   | Boolean | 用于通知像nova这样的API消费者，应该使用OVS的混合插入策略。 |
| vlan_id           | Integer | 辅助弹性网卡的vlan ID。                    |
| parent_id         | String  | 辅助弹性网卡的宿主网卡ID。                     |
| parent_device_id  | String  | 辅助弹性网卡的宿主网卡所属的设备ID。                |
   
 表8dns_assignment对象 
| 名称         | 参数类型   | 说明          |
|:---|:---|:---|
| hostname   | String | 端口hostname。 |
| ip_address | String | 端口IP地址。     |
| fqdn       | String | 端口内网fqdn。   |
   
 表9ports_link对象 
| 名称   | 参数类型   | 说明               |
|:---|:---|:---|
| href | String | API链接。           |
| rel  | String | API链接与该API版本的关系。 |
   
#### 响应示例
【示例一】
```
{
 "ports": [{
       "id": "791870bd-36a7-4d9b-b015-a78e9b06af08",
       "name": "port-test",
       "status": "DOWN",
       "admin_state_up": true,
       "fixed_ips": [],
       "mac_address": "fa:16:3e:01:e0:b2",
       "network_id": "00ae08c5-f727-49ab-ad4b-b069398aa171",
       "tenant_id": "db82c9e1415a464ea68048baa8acc6b8",
       "project_id": "db82c9e1415a464ea68048baa8acc6b8",
       "device_id": "",
       "device_owner": "",
       "security_groups": ["d0d58aa9-cda9-414c-9c52-6c3daf8534e6"],
       "extra_dhcp_opts": [],
       "allowed_address_pairs": [],
       "binding:vnic_type": "normal",
       "binding:vif_details": {},
       "binding:profile": {},
       "port_security_enabled": true,
       "created_at": "2018-09-13T01:43:41",
       "updated_at": "2018-09-13T01:43:41"
 },
{
"id": "7a8c720d-32b7-47cc-a943-23e48d69e30a",
"name": "a8d001aa-6946-4168-86d9-924c7d3ef8fb",
"status": "DOWN",
"admin_state_up": true,
"fixed_ips": [
{
"subnet_id": "a8d001aa-6946-4168-86d9-924c7d3ef8fb",
"ip_address": "2a07:b980:4030:14::1"
}
],
"mac_address": "fa:16:3e:57:39:c3",
"network_id": "26cf88ff-1a8c-4233-a8e6-183e1e299357",
"tenant_id": "db82c9e1415a464ea68048baa8acc6b8",
"project_id": "db82c9e1415a464ea68048baa8acc6b8",
"device_id": "6c2fcea1-b785-4253-b84e-3d887e1c67e1",
"device_owner": "network:router_interface_distributed",
"security_groups": ["34acbeed-8f65-4875-86ca-66417b1733fd"],
"extra_dhcp_opts": [],
"allowed_address_pairs": [],
"binding:vnic_type": "normal",
"binding:vif_details": {},
"binding:profile": {},
"port_security_enabled": true,
        "created_at": "2018-09-13T01:43:41",
        "updated_at": "2018-09-13T01:43:41"
}
],
    "ports_links": [
       {
            "rel": "next", 
            "href": "https://{Endpoint}/v2.0/ports?limit=1&marker=7a8c720d-32b7-47cc-a943-23e48d69e30a"
        }, 
       {    "rel": "previous", 
            "href": "https://{Endpoint}/v2.0/ports?limit=1&marker=7a8c720d-32b7-47cc-a943-23e48d69e30a&page_reverse=True"
        }
    ]
}
```
【示例二】
```
{
    "ports": [
        {
            "admin_state_up": true,
            "allowed_address_pairs": [],
            "binding:vnic_type": "normal",
            "device_id": "e6c05704-c907-4cc1-8106-69b0996c43b9",
            "device_owner": "compute:az3.dc1",
            "port_security_enabled":true,
            "extra_dhcp_opts": [],
            "fixed_ips": [
                {
                    "ip_address": "172.16.0.37",
                    "subnet_id": "b3ac1347-63f2-4e82-b853-3d86416a0db5"
                }
            ],
            "dns_assignment": [
                {
                    "hostname": "ip-172-16-0-37",
                    "ip_address": "172.16.0.37",
                    "fqdn": "ip-172-16-0-37.xxx.compute.internal."
                }
            ],
            "dns_name": "ip-172-16-0-37",
            "id": "7bb64706-6e46-4f94-a28a-4bc7caaab87d",
            "mac_address": "fa:16:3e:f1:0b:09",
            "name": "port_vm_50_3",
            "network_id": "a54e1b19-ce78-4b7e-b28b-d2d716cdc161",
            "security_groups": [
                "ef69bc60-2f4b-4f97-b95b-e3b68df0c0b2"
            ],
            "status": "ACTIVE",
            "tenant_id": "6c9298ec8c874f7f99688489ab65f90e",
            "project_id": "6c9298ec8c874f7f99688489ab65f90e", 
            "created_at": "2018-09-13T01:43:41",
            "updated_at": "2018-09-13T01:43:41"
        }
    ],
    "ports_links": [
       {    "rel": "previous", 
            "href": "https://{Endpoint}/v2.0/ports?mac_address=fa%3A16%3A3e%3Af1%3A0b%3A09&marker=7bb64706-6e46-4f94-a28a-4bc7caaab87d&page_reverse=True"
        }
    ]
}
```
【示例三】
```
{
    "ports": [
        {
            "admin_state_up": false, 
            "allowed_address_pairs": [], 
            "binding:vnic_type": "normal", 
            "device_id": "", 
            "device_owner": "", 
            "port_security_enabled":true,
            "extra_dhcp_opts": [], 
            "fixed_ips": [
                {
                    "ip_address": "10.100.100.62", 
                    "subnet_id": "9b28f20c-0234-419f-a0b4-4a84f182f64b"
                }
            ], 
            "dns_name": "",
            "id": "ffc0bdee-8413-4fa2-bd82-fa8efe5b3a87", 
            "mac_address": "fa:16:3e:2b:bc:57", 
            "name": "small_net_port", 
            "network_id": "b299b151-7a66-4c6f-a313-cdd3b5724296", 
            "security_groups": [
                "ef69bc60-2f4b-4f97-b95b-e3b68df0c0b2"
            ], 
            "status": "DOWN", 
            "tenant_id": "6c9298ec8c874f7f99688489ab65f90e",
            "project_id": "6c9298ec8c874f7f99688489ab65f90e", 
            "created_at": "2018-09-13T01:43:41",
            "updated_at": "2018-09-13T01:43:41"
        }
    ],
    "ports_links": [
       {    "rel": "previous", 
            "href": "https://{Endpoint}/v2.0/ports?admin_state_up=False&marker=ffc0bdee-8413-4fa2-bd82-fa8efe5b3a87&page_reverse=True"
        }
    ]
}
```
【示例四】
```
{
    "ports": [
        {
            "admin_state_up": true, 
            "allowed_address_pairs": [], 
            "binding:vnic_type": "normal", 
            "device_id": "e6c05704-c907-4cc1-8106-69b0996c43b9", 
            "device_owner": "compute:az3.dc1", 
            "port_security_enabled":true,
            "extra_dhcp_opts": [], 
            "fixed_ips": [
                {
                    "ip_address": "10.1.0.37", 
                    "subnet_id": "b3ac1347-63f2-4e82-b853-3d86416a0db5"
                }
            ], 
            "dns_assignment": [
                {
                    "hostname": "ip-10-1-0-37",
                    "ip_address": "10.1.0.37",
                    "fqdn": "ip-10-1-0-37.xxx.compute.internal."//xxx为区域名称。
                }
            ],
            "dns_name": "ip-10-1-0-37",
            "id": "7bb64706-6e46-4f94-a28a-4bc7caaab87d", 
            "mac_address": "fa:16:3e:f1:0b:09", 
            "name": "port_vm_50_3", 
            "network_id": "a54e1b19-ce78-4b7e-b28b-d2d716cdc161", 
            "security_groups": [
                "ef69bc60-2f4b-4f97-b95b-e3b68df0c0b2"
            ], 
            "status": "ACTIVE", 
            "tenant_id": "6c9298ec8c874f7f99688489ab65f90e",
            "project_id": "6c9298ec8c874f7f99688489ab65f90e" ,
            "created_at": "2018-09-13T01:43:41",
            "updated_at": "2018-09-13T01:43:41"
        }
    ],
    "ports_links": [
       {    "rel": "previous", 
            "href": "https://{Endpoint}/v2.0/ports?device_id=77307088-ae60-49fb-9146-924dcf1d1402&marker=7bb64706-6e46-4f94-a28a-4bc7caaab87d&page_reverse=True"
        }
    ]
}
```
【示例五】
```
{
    "ports": [
        {
            "admin_state_up": true, 
            "allowed_address_pairs": [], 
            "binding:vnic_type": "normal", 
            "device_id": "e6c05704-c907-4cc1-8106-69b0996c43b9", 
            "device_owner": "compute:az3.dc1", 
            "port_security_enabled":true,
            "extra_dhcp_opts": [], 
            "fixed_ips": [
                {
                    "ip_address": "10.1.0.37", 
                    "subnet_id": "b3ac1347-63f2-4e82-b853-3d86416a0db5"
                }
            ], 
            "dns_assignment": [
                {
                    "hostname": "ip-10-1-0-37",
                    "ip_address": "10.1.0.37",
                    "fqdn": "ip-10-1-0-37.xxx.compute.internal."//xxx为区域名称。
                }
            ],
            "dns_name": "ip-10-1-0-37",
            "id": "7bb64706-6e46-4f94-a28a-4bc7caaab87d", 
            "mac_address": "fa:16:3e:f1:0b:09", 
            "name": "port_vm_50_3",
            "network_id": "a54e1b19-ce78-4b7e-b28b-d2d716cdc161", 
            "security_groups": [
                "ef69bc60-2f4b-4f97-b95b-e3b68df0c0b2"
            ], 
            "status": "ACTIVE", 
            "tenant_id": "6c9298ec8c874f7f99688489ab65f90e",
            "project_id": "6c9298ec8c874f7f99688489ab65f90e" ,
            "created_at": "2018-09-13T01:43:41",
            "updated_at": "2018-09-13T01:43:41"
        }
    ],
    "ports_links": [
       {    "rel": "previous", 
            "href": "https://{Endpoint}/v2.0/ports?tenant_id=6c9298ec8c874f7f99688489ab65f90e&name=port_vm_50_3&marker=7bb64706-6e46-4f94-a28a-4bc7caaab87d&page_reverse=True"
        }
    ]
}
```
【示例六】
```
{
    "ports": [
        {
            "status": "DOWN",
            "allowed_address_pairs": [],
            "extra_dhcp_opts": [],
            "device_owner": "",
            "port_security_enabled":true,
            "fixed_ips": [
                {
                    "subnet_id": "391c74f7-e3b1-405c-8473-2f71a0aec7dc",
                    "ip_address": "10.1.0.33"
                }
            ],
            "dns_name": "",
            "id": "0f405555-739f-4a19-abb7-ec11d005b3a9",
            "security_groups": [
                "043548bc-1020-4be0-885a-caac8530e8f6"
            ],
            "device_id": "",
            "port_security_enabled":true,
            "name": "port_vm_50_3",
            "admin_state_up": true,
            "network_id": "9898a82d-7795-4ad5-bf2c-0ed8b822be4f",
            "tenant_id": "3e4a1816927f405cacbc3dca1e05111e",
            "project_id": "3e4a1816927f405cacbc3dca1e05111e",
            "created_at": "2018-09-13T01:43:41",
            "updated_at": "2018-09-13T01:43:41",
            "binding:vnic_type": "normal",
            "mac_address": "fa:16:3e:b0:d9:cf"
        },
        {
            "status": "ACTIVE",
            "allowed_address_pairs": [],
            "extra_dhcp_opts": [],
            "device_owner": "compute:az3.dc1",
            "port_security_enabled":true,
            "fixed_ips": [
                {
                    "subnet_id": "b3ac1347-63f2-4e82-b853-3d86416a0db5",
                    "ip_address": "10.1.0.37"
                }
            ],
            "dns_assignment": [
                {
                    "hostname": "ip-10-1-0-37",
                    "ip_address": "10.1.0.37",
                    "fqdn": "ip-10-1-0-37.xxx.compute.internal."//xxx为区域名称。
                 }  
            ],
            "dns_name": "ip-10-1-0-37",
            "id": "7bb64706-6e46-4f94-a28a-4bc7caaab87d",
            "security_groups": [
                "ef69bc60-2f4b-4f97-b95b-e3b68df0c0b2"
            ],
            "device_id": "e6c05704-c907-4cc1-8106-69b0996c43b9",
            "name": "port_vm_50_3",
            "admin_state_up": true,
            "network_id": "a54e1b19-ce78-4b7e-b28b-d2d716cdc161",
            "tenant_id": "6c9298ec8c874f7f99688489ab65f90e",
            "project_id": "3e4a1816927f405cacbc3dca1e05111e",
            "created_at": "2018-09-13T01:43:41",
            "updated_at": "2018-09-13T01:43:41",
             "binding:vnic_type": "normal", 
            "binding:vnic_type": "normal",
            "mac_address": "fa:16:3e:f1:0b:09"
        }
    ],
    "ports_links": [
       {    "rel": "previous", 
            "href": "https://{Endpoint}/v2.0/ports?name=port_vm_50_3&marker=0f405555-739f-4a19-abb7-ec11d005b3a9&page_reverse=True"
        }
    ]
}
```
#### 状态码
请参见[状态码](https://support.huaweicloud.com/api-vpc/vpc_api_0002.html)。
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-vpc/vpc_api_0003.html)。
