You can use the REST API identity service to submit a request for 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://$host/identity/api/tenants/$tenantId --data @$inputFileName.json

$token

Specifies a valid HTTP bearer token with necessary credentials.

$host

Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.

$tenantId

Specifies the ID of the tenant.

$tenantURL

Specifies the URL of the tenant.

$enantName

Specifies the name of the tenant.

$description

Specifies a description of the tenant.

$emailAddress

Specifies the contact email address for the tenant.

JSON Input File Template

To simplify command line input, create a JSON file and call that file from the command line. To create a JSON file, copy the following template to a new text file. To maintain formatting, use an XML editor. Replace the italicized variables in the template with your specific values.

{
    "@type" : "Tenant",
    "id" : "$tenantId",
    "urlName" : "$tenantURL",
    "name" : "$tenantName",
    "description" : "$description",
    "contactEmail" : "$emailAddress",
    "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:

  • rel

    Specifies the name of the link.

    • Self refers to the object that was returned or requested.

    • First, Previous, Next, and Last refer to corresponding pages of pageable lists.

    • Specifies the application or service that determines the other names.

  • href

    Specifies the URL that produces the result.

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:

  • Id:

    Specifies the unique tenant identifier.

  • urlName:

    Specifies the name of the tenant as it appears in URLs.

  • Name:

    Specifies the name of the tenant for display purposes.

  • description:

    Specifies the long description of the tenant.

  • contactEmail:

    Specifies the primary contact email address.

  • Password:

    Unused

  • defaultTenant:

    Is set to True if the corresponding tenant is the default tenant (vsphere.local).

Metadata

Specifies the following paging-related data:

  • Size: Specifies the maximum number of rows per page.

  • totalElement: Specifies the number of rows returned.

  • totalPages: Specifies the total number of pages of data available.

  • Number: Specifies the current page number.

  • Offset: Specifies the number of rows skipped.

curl Command

Submit a request for a new tenant and either call a JSON file that contains tenant request parameters or specify those parameters using inline text. The first example uses a JSON file as input. The second example uses inline text as input.

The first example calls the following sample newTenant.json file.

{
    "@type" : "Tenant",
    "id" : "development",
    "urlName" : "development",
    "name" : "DevelopmentTenant",
    "description" : "Tenant for all developers",
    "contactEmail" : "admin@mycompany.com",
    "defaultTenant" : false
}

Example 1: Use the following example to call the above newTenant.json file, which contains parameters for the tenant request.

curl --insecure -H "Content-Type: application/json" 
-H "Authorization: Bearer $token"
https://$host/identity/api/tenants/development --data @C:\Temp\newTenant.json

Example 2: Use the following example to specify parameters for the tenant request by using inline text.

curl --insecure -H "Accept: application/json" -H "Content-Type: application/json" 
-H "Authorization: Bearer $token"
--data '{"@type":"Tenant","id":"development","urlName":"development","name":
"DevelopmentTenant","description":"Tenant for all developers","contactEmail":
"admin@mycompany.com","defaultTenant":false}'