Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TenantOptionsService

description

This service allows for managing tenant's options.

Hierarchy

Index

Constructors

constructor

Methods

create

  • Creates a new tenant's option.

    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_OPTION_MANAGEMENT_ADMIN

    Options are category-key-value tuples, storing tenant configuration.Some categories of options allow creation of new one, other are limited to predefined set of keys.

    Any option of any tenant can be defined as "non-editable" by "management" tenant. Afterwards, any PUT or DELETE requests made on that option by the owner tenant, will result in 403 error (Unauthorized).

    Parameters

    Returns Promise<IResult<ITenantOption>>

    Returns promise object that is resolved with the details of newly created tenant option.

delete

  • Delete a representation of a tenant's option.

    example
    
       const tenantOptionId: string = "uniqueTenantId";
    
       (async () => {
         const {data, res} = await tenantOptionsService.delete(tenantOptionId);
      })();
    

    Required role: ROLE_TENANT_MANAGEMENT_ADMIN

    Parameters

    • entityOrId: string | number | IIdentified

      Tenant's option id or tenant's option object.

    Returns Promise<IResult<null>>

    Returns promise object that is resolved with the IResult.

detail

  • Get a representation of a tenant's option.

    example
    
       const option: ITenantOption = {
         category: 'access.control',
         key: 'allow.origin'
       };
    
       (async () => {
         const {data, res} = await tenantService.detail(option);
      })();
    

    Required role: ROLE_OPTION_MANAGEMENT_READ

    Parameters

    Returns Promise<IResult<ITenantOption>>

    Returns promise object that is resolved with the ITenantOption wrapped by IResult.

list

  • Gets the list of tenant's options filtered by parameters.

    example
    
     const filter: object = {
        severity: Severity.MAJOR,
        pageSize: 100,
        withTotalPages: true
      };
    
      (async () => {
        const {data, res, paging} = await tenantOptionsService.list(filter);
      })();
    

    Required role: ROLE_OPTION_MANAGEMENT_READ

    Parameters

    • Default value filter: object = {}

      Object containing filters for querying tenant options.

    Returns Promise<IResultList<ITenantOption>>

    Returns promise object that is resolved with the ITenantOption wrapped by IResultList.

systemDetail

  • Get a representation of a tenant's system option.

    example
    
       const option: ITenantOption = {
         category: 'password',
         key: 'enforce.strength'
       };
    
       (async () => {
         const {data, res} = await tenantService.systemDetail(option);
      })();
    

    Parameters

    Returns Promise<IResult<ITenantOption>>

    Returns promise object that is resolved with the ITenantOption wrapped by IResult.

update

  • Updates tenant's option data.

    example
    
     const partialUpdateObject: IIdentified = {
        value : "http://developer.cumulocity.com"
        ...
      }
    
     (async () => {
       const {data, res} = await tenantOptionsService.update(partialUpdateObject);
     })();
    

    Required role: ROLE_OPTION_MANAGEMENT_ADMIN

    Parameters

    Returns Promise<IResult<ITenantOption>>

    Returns promise object that is resolved with the saved tenant option object.

Generated using TypeDoc