Ports

Network port management operations

List ports

get
/v2.0/ports

Lists ports to which the project has access.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Query parameters
admin_state_upbooleanOptional

Filter the list result by the administrative state of the resource.

idstringOptional

Filter the list result by the ID of the resource.

namestringOptional

Filter the list result by the human-readable name of the resource.

network_idstringOptional

Filter the list result by the network ID.

project_idstringOptional

Filter the list result by the ID of the project that owns the resource.

tenant_idstringOptional

Filter the list result by the ID of the project that owns the resource.

device_idstringOptional

Filter ports by device ID.

device_ownerstringOptional

Filter ports by device owner.

statusstring · enumOptional

Filter the list result by status.

Possible values:
fieldsstringOptional

The fields that you want the server to return. If no fields are specified, all fields are returned.

sort_dirstring · enumOptional

Sort direction. A valid value is asc (ascending) or desc (descending).

Possible values:
sort_keystringOptional

Sorts by a resource attribute.

tagsstringOptional

A list of tags to filter the list result by. Resources that match all tags in this list will be returned.

tags-anystringOptional

A list of tags to filter the list result by. Resources that match any tag in this list will be returned.

not-tagsstringOptional

A list of tags to filter the list result by. Resources that match all tags in this list will be excluded.

not-tags-anystringOptional

A list of tags to filter the list result by. Resources that match any tag in this list will be excluded.

Responses
200

Successful operation

application/json
get
/v2.0/ports
GET /v2.0/v2.0/ports HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "ports": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "network_id": "123e4567-e89b-12d3-a456-426614174000",
      "admin_state_up": true,
      "status": "ACTIVE",
      "mac_address": "text",
      "fixed_ips": [
        {
          "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
          "ip_address": "0.0.0.0"
        }
      ],
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
      "device_id": "text",
      "device_owner": "text",
      "security_groups": [
        "123e4567-e89b-12d3-a456-426614174000"
      ],
      "allowed_address_pairs": [
        {
          "ip_address": "text",
          "mac_address": "text"
        }
      ],
      "extra_dhcp_opts": [
        {
          "opt_name": "text",
          "opt_value": "text",
          "ip_version": 4
        }
      ],
      "port_security_enabled": true,
      "dns_name": "text",
      "dns_assignment": [
        {
          "hostname": "text",
          "ip_address": "text",
          "fqdn": "text"
        }
      ],
      "dns_domain": "text",
      "data_plane_status": null,
      "qos_policy_id": "123e4567-e89b-12d3-a456-426614174000",
      "tags": [
        "text"
      ],
      "revision_number": 1,
      "created_at": "2025-11-28T20:25:31.027Z",
      "updated_at": "2025-11-28T20:25:31.027Z"
    }
  ]
}

Create port

post
/v2.0/ports

Creates a port.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Body
Responses
post
/v2.0/ports
POST /v2.0/v2.0/ports HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 698

{
  "port": {
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "admin_state_up": true,
    "mac_address": "text",
    "fixed_ips": [
      {
        "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
        "ip_address": "0.0.0.0"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "device_id": "text",
    "device_owner": "text",
    "security_groups": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "allowed_address_pairs": [
      {
        "ip_address": "text",
        "mac_address": "text"
      }
    ],
    "extra_dhcp_opts": [
      {
        "opt_name": "text",
        "opt_value": "text",
        "ip_version": 4
      }
    ],
    "port_security_enabled": true,
    "dns_name": "text",
    "dns_domain": "text",
    "qos_policy_id": "123e4567-e89b-12d3-a456-426614174000"
  }
}
{
  "port": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "admin_state_up": true,
    "status": "ACTIVE",
    "mac_address": "text",
    "fixed_ips": [
      {
        "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
        "ip_address": "0.0.0.0"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "device_id": "text",
    "device_owner": "text",
    "security_groups": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "allowed_address_pairs": [
      {
        "ip_address": "text",
        "mac_address": "text"
      }
    ],
    "extra_dhcp_opts": [
      {
        "opt_name": "text",
        "opt_value": "text",
        "ip_version": 4
      }
    ],
    "port_security_enabled": true,
    "dns_name": "text",
    "dns_assignment": [
      {
        "hostname": "text",
        "ip_address": "text",
        "fqdn": "text"
      }
    ],
    "dns_domain": "text",
    "data_plane_status": null,
    "qos_policy_id": "123e4567-e89b-12d3-a456-426614174000",
    "tags": [
      "text"
    ],
    "revision_number": 1,
    "created_at": "2025-11-28T20:25:31.027Z",
    "updated_at": "2025-11-28T20:25:31.027Z"
  }
}

Show port details

get
/v2.0/ports/{port_id}

Shows details for a port.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Path parameters
port_idstring · uuidRequired

The ID of the port.

Query parameters
fieldsstringOptional

The fields that you want the server to return. If no fields are specified, all fields are returned.

Responses
200

Successful operation

application/json
get
/v2.0/ports/{port_id}
GET /v2.0/v2.0/ports/{port_id} HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "port": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "admin_state_up": true,
    "status": "ACTIVE",
    "mac_address": "text",
    "fixed_ips": [
      {
        "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
        "ip_address": "0.0.0.0"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "device_id": "text",
    "device_owner": "text",
    "security_groups": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "allowed_address_pairs": [
      {
        "ip_address": "text",
        "mac_address": "text"
      }
    ],
    "extra_dhcp_opts": [
      {
        "opt_name": "text",
        "opt_value": "text",
        "ip_version": 4
      }
    ],
    "port_security_enabled": true,
    "dns_name": "text",
    "dns_assignment": [
      {
        "hostname": "text",
        "ip_address": "text",
        "fqdn": "text"
      }
    ],
    "dns_domain": "text",
    "data_plane_status": null,
    "qos_policy_id": "123e4567-e89b-12d3-a456-426614174000",
    "tags": [
      "text"
    ],
    "revision_number": 1,
    "created_at": "2025-11-28T20:25:31.027Z",
    "updated_at": "2025-11-28T20:25:31.027Z"
  }
}

Update port

put
/v2.0/ports/{port_id}

Updates a port.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Path parameters
port_idstring · uuidRequired

The ID of the port.

Body
Responses
200

Port updated successfully

application/json
put
/v2.0/ports/{port_id}
PUT /v2.0/v2.0/ports/{port_id} HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 547

{
  "port": {
    "name": "text",
    "description": "text",
    "admin_state_up": true,
    "fixed_ips": [
      {
        "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
        "ip_address": "0.0.0.0"
      }
    ],
    "device_id": "text",
    "device_owner": "text",
    "security_groups": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "allowed_address_pairs": [
      {
        "ip_address": "text",
        "mac_address": "text"
      }
    ],
    "extra_dhcp_opts": [
      {
        "opt_name": "text",
        "opt_value": "text",
        "ip_version": 4
      }
    ],
    "port_security_enabled": true,
    "dns_name": "text",
    "dns_domain": "text",
    "data_plane_status": null,
    "qos_policy_id": "123e4567-e89b-12d3-a456-426614174000"
  }
}
{
  "port": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "admin_state_up": true,
    "status": "ACTIVE",
    "mac_address": "text",
    "fixed_ips": [
      {
        "subnet_id": "123e4567-e89b-12d3-a456-426614174000",
        "ip_address": "0.0.0.0"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "device_id": "text",
    "device_owner": "text",
    "security_groups": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "allowed_address_pairs": [
      {
        "ip_address": "text",
        "mac_address": "text"
      }
    ],
    "extra_dhcp_opts": [
      {
        "opt_name": "text",
        "opt_value": "text",
        "ip_version": 4
      }
    ],
    "port_security_enabled": true,
    "dns_name": "text",
    "dns_assignment": [
      {
        "hostname": "text",
        "ip_address": "text",
        "fqdn": "text"
      }
    ],
    "dns_domain": "text",
    "data_plane_status": null,
    "qos_policy_id": "123e4567-e89b-12d3-a456-426614174000",
    "tags": [
      "text"
    ],
    "revision_number": 1,
    "created_at": "2025-11-28T20:25:31.027Z",
    "updated_at": "2025-11-28T20:25:31.027Z"
  }
}

Delete port

delete
/v2.0/ports/{port_id}

Deletes a port.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Path parameters
port_idstring · uuidRequired

The ID of the port.

Responses
delete
/v2.0/ports/{port_id}
DELETE /v2.0/v2.0/ports/{port_id} HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated

Was this helpful?