Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OperationBulkService

This class allows for managing bulk operations.

Hierarchy

Index

Constructors

Methods

Constructors

constructor

Methods

create

  • Creates a new operation.

    example
    
     const mandantoryObject: Partial<IOperationBulk> = {
       creationRamp: 15,
       groupId: '149044',
       operationPrototype: {
         c8y_Restart: {},
         description: 'Restart device',
         deviceId: device.id,
         status: 'PENDING'
       },
        startDate: '2018-02-15T16:01:00.000Z'
     };
    
     (async () => {
       const {data, res} = await operationBulkService.create(mandantoryObject);
     })();
    

    Parameters

    • operation: Partial<IOperationBulk>

      Operation object with mandantory fragments.

    Returns Promise<IResult<IOperationBulk>>

    Response wrapped in IResult

delete

  • Removes an bulk operation with given id.

    example
    
      const id: number = 1;
    
       (async () => {
         const {data, res} = await operationBulkService.delete(id);
      })();
    

    Parameters

    • operationOrId: string | number | IIdentified

      Operation object or id.

    Returns Promise<IResult<null>>

    Response wrapped in IResult

detail

  • Gets the details of selected bulk operation.

    example
    
       const bulkOperationId: number = 1;
    
       (async () => {
         const {data, res} = await operationBulkService.detail(bulkOperationId);
      })();
    

    Parameters

    Returns Promise<IResult<IOperationBulk>>

    Response wrapped in IResult

list

  • Gets the list of bulk operations filtered by parameters.

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

    Parameters

    • Default value filter: object = {}

      Object containing filters for querying alarms.

    Returns Promise<IResultList<IOperationBulk>>

    Response wrapped in IResultList

update

  • Updates a new operation.

    example
    
     const updateObject: Partial<IOperationBulk> = {
       creationRamp: 15,
       groupId: '149044',
       operationPrototype: {
         c8y_Restart: {},
         description: 'Restart device',
         deviceId: device.id,
         status: 'PENDING'
       },
        startDate: '2018-02-15T16:01:00.000Z'
     };
    
     (async () => {
       const {data, res} = await operationBulkService.update(updateObject);
     })();
    

    Parameters

    Returns Promise<IResult<IOperationBulk>>

    Response wrapped in IResult

Generated using TypeDoc