Using Tenant Management Service

Creating a Tenant

About This Task

Tenancy Management Service Provides REST APIs for creating a tenant and provisioning the services required for that tenant. For a tenant, you can either create new instances of the required services or bind the tenant to existing service instances.

To create new instances of the services, you must first obtain the required trusted issuer IDs. For more information on creating trusted issuers, see uaas-get-started.html#task_y1l_vms_2s.

Procedure

Use the following REST API to create a tenant.
HTTP POST
/tenant

For more information about this API, see the API Documentation.

For example, to create and bind to new instances of the ACS and Asset service, specify the following parameters in the REST API:

...
"services": [
  {
    "parameters": {},
    "seq": 0,
    "serviceName": "predix-acs",
    "servicePlan": "free",
    "trustedIssuerIds": [
      "https://13fa0384-9e2a-48e2-9d06-2c95a1f4f5ea.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token"
    ]
  }

  {
    "parameters": {},
    "seq": 1,
    "serviceName": "predix-asset",
    "servicePlan": "free",
    "trustedIssuerIds": [
      "https://13fa0384-9e2a-48e2-9d06-2c95a1f4f5ea.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token"
    ]
  }
]
...

To bind to existing instances of ACS and Asset service, specify the following parameters in the REST API:

...
"serviceInstances": [
  {
    "serviceInstanceName": "my-acs-instance",
    "serviceName": "predix-acs"
  }

  {
    "serviceInstanceName": "my-asset-instance",
    "serviceName": "predix-asset"
  }
]
...

Retrieving Service Instance Details

About This Task

When you use the Tenant Management service to create and bind to service instances, you can use the REST APIs to retrieve the service instance information for each tenant service.

For more information about this API, see the API Documentation.

Procedure

  1. Use the following REST API to retrieve the details of all service instances for a tenant:
    HTTP GET
    /v1/tenant/{tenantName}
  2. Use the following REST API to retrieve details of a specific service instance for a specific tenant:
    HTTP GET
    /v1/tenant/{tenantName}/service/{serviceName}
    Note:

    If you require the credentials of a specific service instance, use the following REST API:

    HTTP GET
    /v1/tenant/{tenantName}/service/{serviceName}/credentials

Updating a Tenant

About This Task

You can update a tenant for adding additional services.

Procedure

Use the following REST API to update a tenant:
HTTP PUT
/v1/tenant

For more information about this API, see the API Documentation.

For example, to create and bind to a new instances of the ACS service, specify the following parameters in the REST API:

...
    "services": [
      {
        "parameters": {},
        "seq": 0,
        "serviceInstanceName": "my_acs_instance",
        "serviceName": "predix-acs",
        "servicePlan": "basic",
        "trustedIssuerIds": [
                  "https://13fa0384-9e2a-48e2-9d06-2c95a1f4f5ea.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token"
                ]
      }

    ]

To bind to an existing instance of the ACS service, specify the following parameters in the REST API:

...
  "name": "string",
  "templateData": {
    "serviceInstances": [
      {
        "serviceInstanceName": "my_new_acs_instance",
        "serviceName": "predix-acs"
      }
    ],
}

Updating Services Provisioned Using Tenant Management Service

About This Task

You can update services that you provisioned using Tenant Management service.

Procedure

Use the following REST API to update a service:
HTTP PUT
/v1/tenant/{tenantName}/service/{instanceName}

For more information about this API, see the API Documentation.

Deleting a Tenant

About This Task

You can use the Tenant Management service REST API to delete a tenant. When you delete a tenant, all service instances associated with that tenant are also deleted if they are not being used by another tenant.

Procedure

Use the following REST API to delete a specific tenant:
HTTP DELETE
/v1/tenant/{tenantName}