Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TenantOptionsService

Hierarchy

Index

Constructors

constructor

Methods

create

  • Parameters

    Returns Promise<IResult<ITenantOption>>

    Returns promise object that is resolved with the details of newly created tenant 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).

delete

  • Parameters

    Returns Promise<IResult<null>>

    Returns promise object that is resolved with the IResult.

    Example

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

    Required role: ROLE_TENANT_MANAGEMENT_ADMIN

detail

  • Parameters

    Returns Promise<IResult<ITenantOption>>

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

    Example

    const option: ITenantOption = {
      category: 'access.control',
      key: 'allow.origin'
    };
    const params: ITenantOptionDetailParams = {
      evaluate: 'inherited'
    };
    (async () => {
      const { data, res } = await tenantService.detail(option);
      console.log('value inherited from parent tenant:', data.value);
    })();
    

    Required role: ROLE_OPTION_MANAGEMENT_READ

list

  • Parameters

    • Default value filter: object = {}

    Returns Promise<IResultList<ITenantOption>>

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

    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

list$

  • Parameters

    Returns Observable<ITenantOption[]>

    Data wrapped as Observable.

    Example

    
      const list$ = tenantOptionsService.list$();
      list$.subscribe((data) => console.log(data));
    

    Deprecated This function will be removed soon in favor of decoupling this library from rxjs. Use Realtime for realtime connection and rxjs defer() or from() to composite an observable on your own.

update

  • Parameters

    Returns Promise<IResult<ITenantOption>>

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

    Example

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

    Required role: ROLE_OPTION_MANAGEMENT_ADMIN

Generated using TypeDoc