7.3

Table Of Contents
6 Examine the response to verify that the tenant you requested is listed.
See the output of the request to verify the new tenant is created Example: Create a Tenant With a
JSON File.
Example: Create a Tenant With a JSON File
The following sample output for Step 1 lists three tenants.
curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token"
https://$vRA/identity/api/tenants
{
"links":[],
"content"[
{"@type":"Tenant",
"id":"vsphere.local",
"urlName":"vsphere.local",
"name":"vsphere.local",
"description":null,
"contactEmail":null,
"password":"",
"defaultTenant":true},
{"@type":"Tenant",
"id":"qe",
...},
{"@type":"Tenant",
"id":"management",
...}
],
"metadata":{"size":20,"totalElements":3,"totalPages":1,"number":1,"offset":0}
}
The following sample output for Step 4, shows that the tenant named rainpole has been created.
curl -X PUT --insecure -H "Accept:application/json" -H "Content-Type:application/json" -H
"Authorization: Bearer $token" https://$vRA/identity/api/tenants/rainpole --data
@C:/Temp/newTenant.json
{
"id": "rainpole",
"urlName":"rainpole",
"name":"rainpoleTenant",
"description":"New Custom Tenant",
"contactEmail":"admin@vmware.com",
"password":"",
"defaultTenant":false
}
The following sample output for Step 5 lists four tenants including rainpole.
curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token"
https://$vRA/identity/api/tenants
{
"links":[],
Programming Guide
VMware, Inc. 24