Bulk Create Port

This operation requires a request body.

This operation returns a response body.

This operation enables you to create several ports in a single request. Specify a list of ports in the request body.

 

Example 4.33. Bulk Create Ports: JSON Request

POST /v2.0/ports
Content-Type: application/json
Accept: application/json
{
    "ports": [
        {
            "admin_state_up": true,
            "device_id": "24df1d04-d5cb-41e1-8de5-61ed77c558df",
            "name": "port1",
            "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa",
            "security_groups": [
                "dbc107f4-afcd-4d5a-9352-f68f82241d5b"
            ]
        },
        {
            "admin_state_up": false,
            "name": "port2",
            "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
            "security_groups": [
                "8bf3f7cc-8471-40b1-815f-9da47e79775b",
                "dbc107f4-afcd-4d5a-9352-f68f82241d5b"
            ]
        }
    ]
}

 

Example 4.34. Bulk Create Ports: JSON Response

HTTP/1.1 201 OK
Content-Type: application/json; charset=UTF-8
{
    "ports": [
        {
            "admin_state_up": true,
            "allowed_address_pairs": [],
            "device_id": "24df1d04-d5cb-41e1-8de5-61ed77c558df",
            "device_owner": "",
            "fixed_ips": [
                {
                    "ip_address": "10.56.4.2",
                    "subnet_id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30"
                }
            ],
            "id": "4fa2a5b2-d758-449d-80d6-dff31df9e91e",
            "mac_address": "fa:16:3e:63:b0:82",
            "name": "port1",
            "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa",
            "security_groups": [
                "dbc107f4-afcd-4d5a-9352-f68f82241d5b"
            ],
            "status": "DOWN",
            "tenant_id": "d19231fc08ec4bc4829b668040d34512"
        },
        {
            "admin_state_up": false,
            "allowed_address_pairs": [],
            "device_id": "",
            "device_owner": "",
            "fixed_ips": [
                {
                    "ip_address": "192.168.199.2",
                    "subnet_id": "0468a7a7-290d-4127-aedd-6c9449775a24"
                }
            ],
            "id": "d3c059b8-40fd-489a-8d17-97bde9370987",
            "mac_address": "fa:16:3e:86:09:06",
            "name": "port2",
            "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
            "security_groups": [
                "8bf3f7cc-8471-40b1-815f-9da47e79775b",
                "dbc107f4-afcd-4d5a-9352-f68f82241d5b"
            ],
            "status": "DOWN",
            "tenant_id": "d19231fc08ec4bc4829b668040d34512"
        }
    ]
}

The Networking API v2.0 always guarantees the atomic completion of the bulk operation.

Log a bug against this page


loading table of contents...