Create Port

Verb URI Description
POST /ports Create a new port and explicitly specify attributes with the extra-dhcp-opt extension attributes.

Normal Response Code: 200 OK

Error Response Code: 401 Unauthorized.

This operation returns, for the port specified in the request URI, its port attributes, including the extra_dhcp_opts attributes.

 

Example 4.216. Create port with extra-dhcp-opt attributes: JSON Request

{
    "port":
    {
        "network_id": "87733bcc-8144-41b1-bb6b-d011d7a5168e",
        "extra_dhcp_opts": [
            {"opt_value": "pxelinux.0", "opt_name": "bootfile-name"},
            {"opt_value": "123.123.123.123", "opt_name": "tftp-server"},
            {"opt_value": "123.123.123.45", "opt_name": "server-ip-address"}
        ],
        "fixed_ips": [{"subnet_id": "99a8aea3-b9da-409d-a5e5-f45338ceb4d3", "ip_address": "172.24.4.230"}],
        "admin_state_up": true
    }
}

 

Example 4.217. Create port with extra-dhcp-opt attributes: JSON Response

{
    "port":
    {
        "status": "DOWN",
        "binding:host_id": null,
        "name": "",
        "allowed_address_pairs": [],
        "admin_state_up": true,
        "network_id": "87733bcc-8144-41b1-bb6b-d011d7a5168e",
        "tenant_id": "7ea98790cd854fb5a82ef3d41e5c156b",
        "extra_dhcp_opts": [
            {"opt_value": "123.123.123.123", "opt_name": "tftp-server"},
            {"opt_value": "pxelinux.0", "opt_name": "bootfile-name"},
            {"opt_value": "123.123.123.45", "opt_name": "server-ip-address"}
        ],
        "binding:vif_type": "ovs",
        "device_owner": "",
        "binding:capabilities": {"port_filter": true},
        "mac_address": "fa:16:3e:43:3c:b7",
        "fixed_ips": [{"subnet_id": "99a8aea3-b9da-409d-a5e5-f45338ceb4d3", "ip_address": "172.24.4.230"}],
        "id": "055d27c0-0194-4782-be45-275ff2c95c61",
        "security_groups": ["9bf6f19a-ba4a-470f-b8ce-28c9ad66556c"],
        "device_id": ""
    }
}

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...