7.3

Table Of Contents
Prerequisites
In addition to the Prerequisites for Creating a Tenant, verify that you have parameter values for the new
tenant.
Procedure
1 Use the identity service to display all the available tenants.
curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token"
https://$vRA/identity/api/tenants
For details regarding input and output of this sample, see Syntax for Displaying Your Current Tenants.
2 Examine the response to verify that the tenant you plan to create is not listed.
See the output of the request to display all tenants Example: Create a Tenant With Parameters Inline.
3 Submit a request for a new tenant with parameters inline.
curl -X PUT --insecure -H "Accept:application/json" -H "Content-Type: application/json" -H
"Authorization: Bearer $token" https://$vRA/identity/api/tenants/rainpole --data
'{"@type":"Tenant","id":"rainpole","urlName":"rainpole","name":"rainpoleTenant","description":"New
Custom Tenant","contactEmail":"admin@vmware.com","defaultTenant":false}'
For details regarding input and output of this sample, see Syntax for Requesting a New Tenant
4 Use the identity service to display all the available tenants again.
curl --insecure -H "Accept:application/json" -H "Authorization: Bearer $token"
https://$vRA/identity/api/tenants
5 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
Parameters Inline.
Example: Create a Tenant With Parameters Inline
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},
Programming Guide
VMware, Inc. 21