Creating a virtual interface (cURL)#

Issue the following cURL command.

Create a virtual interface with cURL request

$ curl https://$API_ENDPOINT/v2/$TENANT-ID/servers/<instance_id>/os-virtual-interfacesv2 \
      -X POST \
      -H "Content-Type: application/json" \
      -H "Accept: application/json" \
      -H "X-Auth-Token: $AUTH_TOKEN" \
      -d '{"virtual_interface": {"network_id": "<network_id>"}}'| python -m json.tool

Positional arguments:

  • instance_id. The ID of the server instance to which you want to connect the virtual interface.

  • network_id. The ID of the network for which you want to create a virtual interface.

The operation returns a response as shown in the following example.

Create a virtual interface with cURL response


Next topic: Listing virtual interfaces for a server