Optional
realtime: RealtimeCreates a new tenant.
Tenant object.
Returns promise object that is resolved with the details of newly created tenant.
Example
const tenantObject = {
id: "sample_tenant",
company: "sample_company",
domain: "sample_domain.com",
contactName: "Mr. Doe",
...
};
(async () => {
const {data, res} = await tenantService.create(tenantObject);
})();
Required role: ROLE_TENANT_MANAGEMENT_ADMIN or ROLE_TENANT_MANAGEMENT_CREATE
Note that creating a tenant with adminName, adminPass and adminEmail, creates an admin user with these settings.
For the tenant id SQL keywords (e.g., select, cross, where) are not allowed.
Delete a representation of a tenant.
Tenant's id or tenant object.
Returns promise object that is resolved with the IResult.
Example
const tenantId: string = "uniqueTenantId";
(async () => {
const {data, res} = await tenantService.delete(tenantId);
})();
Required role: ROLE_TENANT_MANAGEMENT_ADMIN
Get a representation of a tenant.
Tenant's id or tenant object.
Returns promise object that is resolved with the IIdentified wrapped by IResult.
Example
const tenantId: number = 1;
(async () => {
const {data, res} = await tenantService.detail(tenantId);
})();
Required role: ROLE_TENANT_MANAGEMENT_READ
User password is never returned in GET response. Authentication mechanism is provided by another interface.
Returns two factor-authentication settings for given tenant.
The tenant object.
Promise which resolves with the object with TFA settings.
Example
(async () => {
const currentTenant = (await tenantService.current()).data;
const currentTenantTfaSettings = await tenantService.getTfaSettings(currentTenant);
const subtenant = (await tenantService.detail('t12345')).data;
const subtenantTfaSettings = await tenantService.getTfaSettings(subtenant);
})();
Gets the list of tenants filtered by parameters.
Object containing filters for querying tenants.
Returns promise object that is resolved with the IIdentified wrapped by IResultList.
Example
const filter: object = {
severity: Severity.MAJOR,
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await tenantService.list(filter);
})();
Required role: ROLE_TENANT_MANAGEMENT_READ
Subscribes a given application to a given tenant.
The tenant object.
The application object.
Returns promise object that is resolved with the IResult.
Example
const newApp = {
name: 'New application',
type: 'HOSTED',
key: 'new-app'
};
const application = (await applicationService.create(newApp)).data;
const currentTenant = (await tenantService.current()).data;
const {data, res} = await tenantService.subscribeApplication(currentTenant, application);
})();
Unsubscribes a given application from a given tenant.
The tenant object.
The application object.
Returns promise object that is resolved with the IResult.
Example
const newApp = {
name: 'New application',
type: 'HOSTED',
key: 'new-app'
};
const application = (await applicationService.create(newApp)).data;
const currentTenant = (await tenantService.current()).data;
await tenantService.addApplication(currentTenant, application);
await tenantService.unsubscribeApplication(currentTenant, application);
})();
Updates tenant data.
Tenant is partially updatable.
Returns promise object that is resolved with the saved tenant object.
Example
const partialUpdateObject: IIdentified = {
adminName : "newAdmin"
...
}
(async () => {
const {data, res} = await tenantService.update(partialUpdateObject);
})();
Required role: ROLE_TENANT_MANAGEMENT_ADMIN or ROLE_TENANT_MANAGEMENT_UPDATE
Note that updating adminPass and adminEmail updates these settings in the admin user of the tenant.
Updating adminName has no effect.
Update TFA strategy for tenant.
The tenant object.
The TFA strategy.
Returns promise object that is resolved with the IResult.
Example
(async () => {
const currentTenant = (await tenantService.current()).data;
const res = await tenantService.updateTfaStrategy(currentTenant, TfaStrategy.TOTP);
})();
Description
This service allows for managing tenants.