Syntax for Retrieving Directories

GET /api/tenants/{tenantId}/directories retrieves a list of directories for a tenant.

Input

Use the supported input parameters to control the command output.

Parameter Description
URL https://$vRA/identity/api/tenants/{tenantId}/directories, where tenantId is the ID of the tenant.
$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.

The bearer token is included in the HEADER of the request.

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. This property does not exist when you query for a single profile.
    • 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 objects returned in a pageable list. Each object can contain the following information:
  • domain: Specifies the domain name for the directory.
  • name: Specifies the name of the directory.
  • description: Specifies a description of the directory.
  • alias: Specifies the alternate name of the directory, if applicable.
  • type: Specifies the type of directory, such as active directory or local directory.
Metadata
Specifies the following paging-related data:
  • Size: Specifies the maximum number of rows per page.
  • totalElement: Specifies the number of rows returned. This parameter is not output when you query for a single profile.
  • 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 to Retrieve Directories

The following example command retrieves all directories for the tenant.
curl -X --insecure -H "accept: application/json" -H "Authorization: Bearer $token”  https://$vRA/identity/api/$tenantId/directories

The response in JSON lists the information for the tenant specified.

{
    "links": [],
    "content": [
        {
            "@type": "IdentityStore",
            "domain": "domain_name1",
            "name": "Active Directory Example 1",
            "description": "Active Directory Example 1",
            "alias": "",
            "type": "AD",
            ...
        }
        {
            "@type": "IdentityStore",
            "domain": "domain_name2",
            "name": "Active Directory Example 2",
            "description": "Active Directory Example 2",
            "alias": "",
            "type": "AD",
            ...
        }
    ],
    "metadata": {
        "size": 20,
        "totalElements": 1,
        "totalPages": 1,
        "number": 1,
        "offset": 0
    }
}