To manage the Tenant Virtual Data Center, you can use the REST API as an alternative to viocli.

The VDC API supports both basic authentication and token-based authentication. For token-based authentication, you submit an API request to obtain a token that you set in the header of subsequent API calls as -H "JSESSIONID:<JSESSIONID>". See REST API Authentication.

Each of the following VDC API examples shows a curl command with the same parameters described in Create Tenant Virtual Data Centers.

Note:

Since VMware Integrated OpenStack provides an https service, every request must either specify certificate options or include the -k option. The following examples include the -k option.

Create a Tenant Virtual Data Center

Request with basic authentication

curl -XPOST -s 1 --user administrator@vsphere.local -H "Content-Type: application/json" 
   "https://<oms-ip>:9449/rest/vio/tenant/vdc" 
   -k 
   -d '{
      "spec":{
         "compute":"compute03",
         "display_name":"tvdc04",
         "project_id":"8d1fb629a0464968a5245d36149f1013",
         "cpu_limit":2000,
         "cpu_reserve":1000,
         "mem_limit":2000,
         "mem_reserve":1000
      }
   }'

Update a Specified Tenant Virtual Data Center

Request with basic authentication

curl -XPATCH -s 1 --user administrator@vsphere.local" -H "Content-Type: application/json" 
   "https://<oms-ip>:9449/rest/vio/tenant/vdc/<tenant-vdc-id>" 
   -k 
   -d '{
      "spec":{
         "cpu_limit":4000, 
         "compute":"compute01"
      }
   }'

List All Tenant Virtual Data Centers

Request with basic authentication

curl -s 1 --user administrator@vsphere.local 
   "https://<oms-ip>:9449/rest/vio/tenant/vdc" 
   -k | python 
   -m json.tool

Get the UUID for a Specified Tenant Virtual Data Center

Request with basic authentication

curl -s 1 --user administrator@vsphere.local 
   "https://<oms-ip>:9449/rest/vio/tenant/vdc/<tenant-vdc-id>" 
   -k | python 
   -m json.tool

Delete a Specified Tenant Virtual Data Center

Request with basic authentication

curl -XPOST -s 1 --user administrator@vsphere.local" -H "Content-Type: application/json" 
   "https://<oms-ip>:9449/rest/vio/tenant/vdc/<tenant-vdc-id>?action=delete-tvdc" 
   -k 
   -d '{
      "spec":{
         "compute":"compute03"
      }
   }'