This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Managing Tenants with APIs
This section guides you through invoking and working with the TenantManagementService and the operations you can work within this service.
Invoking the admin service
TenantMgtAdminService is an admin service of the WSO2 Carbon platform. As admin services are secured to prevent anonymous invocations, you cannot view the WSDL of the admin service by default. Follow the steps below to view and invoke it:
Set the
<HideAdminServiceWSDLs>element tofalsein<IS_HOME>/repository/conf/carbon.xmlfile.<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>Restart the Identity Server.
If you have started the server in default configurations, use the following URL in your browser to see the WSDL of the admin service: https://localhost:9443/services/TenantMgtAdminService?wsdl.
For more information on WSO2 admin services and how to invoke an admin service using either SoapUI or any other client program, see Calling Admin Services from Apps section in WSO2 Carbon documentation.
Operations included in the API
The following operations are available in the TenantManagement Service:
addTenant()
Description | Adds a new tenant. | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Permission Level | /permission/protected/manage/monitor/tenants | |||||||||||||||||||||||||||||||||||||||||||||
Input Parameters |
| |||||||||||||||||||||||||||||||||||||||||||||
Request | <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:addSkeletonTenant>
<!Optional:>
<ser:tenantInfoBean>
<!Optional:>
<xsd:active>true</xsd:active>
<!Optional:>
<xsd:admin>testuser</xsd:admin>
<!Optional:>
<xsd:adminPassword>testpw</xsd:adminPassword>
<!Optional:>
<xsd:createdDate></xsd:createdDate>
<!Optional:>
<xsd:email>testuser@example.com</xsd:email>
<!Optional:>
<xsd:firstname>First</xsd:firstname>
<!Optional:>
<xsd:lastname>Last</xsd:lastname>
<!Optional:>
<xsd:originatedService></xsd:originatedService>
<!Optional:>
<xsd:successKey></xsd:successKey>
<!Optional:>
<xsd:tenantDomain>example.com</xsd:tenantDomain>
<!Optional:>
<xsd:tenantId></xsd:tenantId>
<!Optional:>
<xsd:usagePlan></xsd:usagePlan>
</ser:tenantInfoBean>
</ser:addSkeletonTenant>
</soapenv:Body>
</soapenv:Envelope> | |||||||||||||||||||||||||||||||||||||||||||||
Response | None |
activateTenant()
Description | Activates an existing tenant. | ||||||
|---|---|---|---|---|---|---|---|
Permission Level | /permission/protected/manage/modify/tenants | ||||||
Input Parameters |
| ||||||
Request | <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://services.mgt.tenant.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<ser:activateTenant>
<!Optional:>
<ser:tenantDomain>example.com</ser:tenantDomain>
</ser:activateTenant>
</soapenv:Body>
</soapenv:Envelope> | ||||||
Response | <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:activateTenantResponse xmlns:ns="http://services.mgt.tenant.carbon.wso2.org">
<ns:return xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" />
</ns:activateTenantResponse>
</soapenv:Body>
</soapenv:Envelope> |