You can update a tenant using the CLI tool or the REST API as shown below:
The
tenantDomain
can not be changed in the updating process.- The
tenantId
needs to be given when updating a tenant. ThetenantId
can be retrieved by listing the tenant details.
Updating a tenant via the CLI
Overview
CLI command |
|
Description | Update a specific tenant. |
Command format | update-tenant -u <USERNAME> -f <FIRST_NAME> -l <LAST_NAME> -p <PASSWORD> -d <DOMAIN_NAME> -e <EMAIL> -i <TENANT_ID> |
Parameter definition
Short option | Long option | Description | Required | Example value |
---|---|---|---|---|
-u |
| Username given to the Tenant | Yes | admin |
-f |
| Tenant's first name | Yes | frank |
-l |
| Tenant's last name | Yes | Myers |
-p |
| Tenant's password | Yes | admin123 |
-d |
| Tenant's domain name | Yes | frank.com |
-e |
| Tenant's email address | Yes | [email protected] |
-i | --tenant-id | Tenant's ID. | Yes | 1 |
Example
Update the tenant with the username: admin.
update-tenant -u admin -f Frank -l Myers -p admin123 -d frank.com -e [email protected] -i 1
Sample output
Tenant updated successfully: frank.com
Updating a tenant via the REST API
Overview
Description | Update a tenant. |
Resource Path | /tenants |
HTTP Method | PUT |
Request/Response Format | application/json |
Command format | curl -X PUT -H "Content-Type: application/json" -d @'<JSON_PAYLOAD>' -k -v -u <USERNAME>:<PASSWORD> https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/tenants
|
Example
Add the tenant defined in the tenant.json
file.
curl -X PUT -H "Content-Type: application/json" -d @'tenant.json' -k -v -u admin:admin https://localhost:9443/api/tenants
Sample output
> POST /api/tenants HTTP/1.1 > Host: localhost:9443 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Content-Length: 169 > < HTTP/1.1 201 Created < Date: Wed, 14 Oct 2015 06:40:13 GMT < Location: https://localhost:9443/api/tenants/frank.com < Content-Type: application/json < Transfer-Encoding: chunked < Server: WSO2 Carbon Server < {"status":"success","message":"Tenant added successfully: [tenant] frank.com"}
You will come across the following HTTP status codes while updating a tenant:
HTTP status code | 201, 404, 500 See the descriptions of the HTTP status codes here. |
Sample tenant JSON
{ "admin": "admin", "firstName": "Frank", "lastName": "Myers", "adminPassword": "admin123", "tenantDomain": "frank.com", "email": "[email protected]", "active": "true" }
Overview
Content Tools
Activity