List the tenants

Use this operation to list the tenants that are defined for IBM Cloud Provisioning and Management for z/OS.

HTTP method and URI path

GET /zosmf/resource-mgmt/rest/<version>/tenants/
In this request:
<version>
Is the URI path variable that identifies the version of the z/OSMF software services template service. The following value is valid: 1.0.

Query parameters

None.

Description

This operation lists the tenants that are defined for IBM Cloud Provisioning and Management for z/OS.

On successful completion, HTTP status code 200 (OK) is returned, and a response body is returned. See Response content.

Request content

None.

Authorization requirements

The user must be the domain administrator, or a consumer in the tenant.

For more information, see Resource management services.

HTTP status codes

On successful completion, HTTP status code 200 (OK) is returned.

Otherwise, the following HTTP status codes are returned for the indicated errors. The response body is a standard error response body that provides the reason code that is indicated and associated error message.

Table 1. HTTP error response codes for a list tenants request
HTTP error status code Description
HTTP 404 Not found The domain does not exist.
HTTP 500 Internal server error The server encountered an error. See the response body for a JSON object with information about the error.

Response content

On successful completion, the service returns a response body, which contains a JSON object with details about the tenants. See Table 2.

Table 2. Response from a list tenants request
Field Type Description
tenant-list Array Information about the tenants that are defined. See Table 3.
Table 3. Response from a list tenants request: Tenants
Field Type Description
tenant-id String The generated ID for the tenant.
tenant-name String Descriptive name for the tenant.
tenant-domain-id String Identifier of the domain to which the tenant belongs.
tenant-domain-name String Descriptive name of the domain to which the tenant belongs.
tenant-templates Array Describes the templates for the tenant. See Table 4.
tenant-consumer-list Array User IDs for the consumers in the tenant.
object-uri String URI of the newly created object.
tenant-description String Description of the tenant.
Table 4. Response from a list tenants request: Templates
Field Type Description
template-available String Indicates if the template is available (true or false).
template-id String Identifier of the template.
template-name String Name of the template.

Example HTTP interaction

In Figure 1, a request is submitted to list the tenants.
Figure 1. Sample request to list tenants
GET https://localhost:4444/zosmf/resource-mgmt/rest/1.0/tenants/

The following is the response body for the example list tenants request.

{
   "tenant-List" : [{
       "tenant-id": "izu$000",
        "tenant-name": "default",
  "tenant-domain-id": "izu$0",
  "tenant-domain-name": "default",
  "tenant-templates": [
   {
    "rdp-id": "000",
    "template-available": false,
    "template-id": "template-id0",
    "template-name": "tem0 name"
   }, ...
   ],
 "tenant-consumer-list": [
    "ZOSMFAD",
    "ZOSMFT2"
     ],
 "object-uri": "\/zosmf\/resource-mgmt\/rest\/1.0\/tenants\/izu$000",
 "tenant-description": "default tenant",
 }, ...
 ]
 }