Booting server with network (cURL)#

Issue the following cURL command.

Boot a server with network with cURL request

$ curl https://$API_ENDPOINT/v2/$TENANT-ID/servers \
      -X POST \
      -H "X-Auth-Project-Id: $account" \
      -H "Content-Type: application/json" \
      -H "Accept: application/json" \
      -H "X-Auth-Token: $AUTH_TOKEN" \
      -d '{"server": {"name": "my_server_with_network",
         "imageRef": "d42f821e-c2d1-4796-9f07-af5ed7912d0e",
         "flavorRef": "2", "max_count": 1, "min_count": 1,
         "networks": [{"uuid": "538a112a-34d1-47ff-bf1e-c40639e886e2"},
         {"uuid": "00000000-0000-0000-0000-000000000000"},
         {"uuid": "11111111-1111-1111-1111-111111111111"}]}}' \
   | python -m json.tool

In addition to the isolated network, PublicNet and ServiceNet are attached to the server. You must explicitly specify these networks to attach them to your server.

The operation returns information about the new server, as shown in the following output.

Boot a server with network cURL response


Next topic: Getting network details