Verb | URI | Description |
GET | /ports | Lists ports to which the tenant has access. |
Normal Response Code: 200
Error Response Codes: Unauthorized (401)
This operation lists ports to which the tenant has access. Default policy settings return only those ports that are owned by the tenant who submits the request, unless the request is submitted by an user with administrative rights.
Users can control which attributes are returned
by using the fields
query
parameter. Additionally, you can filter results by
using query string parameters.
This operation does not require a request body.
This operation returns a response body. The response body contains the following fields:
Field | Description |
---|---|
admin_state_up | Administrative state of the router. |
device_id | The ID of the device that uses this port. For example, a virtual server, |
device_owner | The ID of the entity that uses this port. For example, a dhcp agent. |
fixed_ips | IP addresses for the port. Includes the IP address and subnet ID. |
id | The ID of the port. |
mac_address | The MAC address of the port. |
name | The name of the port. |
network_id | The ID of the attached network. |
security_groups | The IDs of any attached security groups. |
status | The status of the port: UP or DOWN. |
tenant_id | The ID of the tenant who owns the network. Only administrative users can specify a tenant_id other than their own. |
Example 4.27. List Ports: JSON Request
GET /v2.0/ports.json HTTP/1.1 content-type: application/json accept: application/json
Example 4.28. List Ports: JSON Response
{ "ports":[ { "admin_state_up":true, "device_id":"", "device_owner":"", "fixed_ips":[ { "ip_address":"10.0.0.4", "subnet_id":"3b498f11-0a20-43ed-b992-0e4202d5f930" } ], "id":"358c03ee-20f8-40d2-b74b-9b21a9df10a7", "mac_address":"fa:16:3e:ac:95:a9", "name":"", "network_id":"abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "security_groups":[ "85cc3048-abc3-43cc-89b3-377341426ac5" ], "status":"DOWN", "tenant_id":"e4f50856753b4dc6afee5fa6b9b6c550" }, { "admin_state_up":true, "device_id":"", "device_owner":"", "fixed_ips":[ { "ip_address":"10.0.0.6", "subnet_id":"3b498f11-0a20-43ed-b992-0e4202d5f930" } ], "id":"74ec4d1d-27e8-4461-9257-8fc153288b19", "mac_address":"fa:16:3e:a8:94:2a", "name":"", "network_id":"abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "security_groups":[ "85cc3048-abc3-43cc-89b3-377341426ac5" ], "status":"DOWN", "tenant_id":"e4f50856753b4dc6afee5fa6b9b6c550" }, { "admin_state_up":true, "device_id":"d6f00d75-c6ef-45a6-bf26-94b9844f8a64", "device_owner":"network:router_interface", "fixed_ips":[ { "ip_address":"10.0.0.1", "subnet_id":"3b498f11-0a20-43ed-b992-0e4202d5f930" } ], "id":"88a5b3ee-4625-4b16-b513-62581294f281", "mac_address":"fa:16:3e:33:4c:d2", "name":"", "network_id":"abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "security_groups":[ ], "status":"ACTIVE", "tenant_id":"e4f50856753b4dc6afee5fa6b9b6c550" }, { "admin_state_up":true, "device_id":"24df1d04-d5cb-41e1-8de5-61ed77c558df", "device_owner":"compute:None", "fixed_ips":[ { "ip_address":"10.0.0.3", "subnet_id":"3b498f11-0a20-43ed-b992-0e4202d5f930" } ], "id":"a5d9a8e4-a4f3-41f0-b5dc-f0ec0562cbe9", "mac_address":"fa:16:3e:b6:da:54", "name":"", "network_id":"abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "security_groups":[ ], "status":"ACTIVE", "tenant_id":"e4f50856753b4dc6afee5fa6b9b6c550" }, { "admin_state_up":true, "device_id":"dhcpacb6d6f0-2d56-5c7a-9905-4c3a3d168f49-abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "device_owner":"network:dhcp", "fixed_ips":[ { "ip_address":"10.0.0.2", "subnet_id":"3b498f11-0a20-43ed-b992-0e4202d5f930" } ], "id":"adf92676-97a8-4ada-b6e8-4fa7195b5eb3", "mac_address":"fa:16:3e:a9:34:c3", "name":"", "network_id":"abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "security_groups":[ "49258a30-81f9-44d7-9440-c60dba50e29e" ], "status":"ACTIVE", "tenant_id":"e4f50856753b4dc6afee5fa6b9b6c550" }, { "admin_state_up":true, "device_id":"", "device_owner":"", "fixed_ips":[ { "ip_address":"10.0.0.5", "subnet_id":"3b498f11-0a20-43ed-b992-0e4202d5f930" } ], "id":"c81cf7ff-1ba1-403a-bddb-58aa0aecd92c", "mac_address":"fa:16:3e:9c:11:3c", "name":"", "network_id":"abaf2e70-4305-4e8d-ac70-3e4cc5f66a07", "security_groups":[ "85cc3048-abc3-43cc-89b3-377341426ac5" ], "status":"DOWN", "tenant_id":"e4f50856753b4dc6afee5fa6b9b6c550" } ] }