Syntax for Requesting a New Tenant
PUT /api/tenants/{tenantId} submits a request to create or update a tenant. You can specify request parameters using JSON command line input or by calling an existing JSON file from the command line.
Input
Use the supported input parameters to control the command output.
Parameter | Description |
---|---|
URL | https://$vRA/identity/api/tenants/$tenantId --data @$inputFileName.json |
$vRA |
Specifies the appliance name and fully qualified domain name, or IP address of the vRealize Automation server. |
$token |
Specifies a valid HTTP bearer token with necessary credentials. |
$tenantId |
Specifies the ID of the tenant. |
$tenantURL |
Specifies the URL of the tenant. |
$tenantName |
Specifies the name of the tenant. |
$description |
Specifies a description of the tenant. |
$emailAddress |
Specifies the contact email address for the tenant. |
$password | Optional password for the new tenant. If blank, no password is required. |
JSON Input File Template
To simplify command line input, you can call a JSON file with input parameters from the command line. You create the JSON file using a text editor, replacing italicized variables in the following template with your specific values.
{ "@type" : "Tenant", "id" : "$tenantId", "urlName" : "$tenantURL", "name" : "$tenantName", "description" : "$description", "contactEmail" : "$emailAddress", "password": "$password", "defaultTenant" : false }
Output
The command output contains property names and values based on the command input parameters.
Parameter | Description |
---|---|
Links |
Specifies an array of link objects, each of which contains the following parts:
|
Content |
Specifies an array of data rows, each of which represents one of the tenant objects returned in a pageable list. Each tenant object can contain the following information:
|
Metadata |
Specifies the
following paging-related data:
|
curl Command to Request a New Tenant With JSON File
The following sample newTenant.json file contains parameters for the tenant request.
{ "@type" : "Tenant", "id" : "rainpole", "urlName" : "rainpole", "name" : "rainpoleTenant", "description" : "New Custom Tenant", "contactEmail" : null, "password": "", "defaultTenant" : true }
The following example command requests a new tenant by calling the newTenant.json file.
curl --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/identity/api/tenants/rainpole --data @C:\Temp\newTenant.json
curl Command to Request a New Tenant With Parameters Inline
The following example command requests a new tenant with input parameters specified inline.
curl --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":null,"defaultTenant":false}'