This class allows for managing operations on a device.

Hierarchy (view full)

Constructors

Methods

Constructors

Methods

  • Creates a new operation.

    Parameters

    • entity: IOperation

      Operation object with mandantory fragments.

    Returns Promise<IResult<IOperation>>

    Response wrapped in [[IResult]]

    Example


    const mandantoryObject: IOperation = {
    com_cumulocity_model_WebCamDevice: {
    name: 'take picture',
    parameters: {
    duration: '5s',
    quality: 'HD'
    }
    },
    deviceId: device.id,
    };

    (async () => {
    const {data, res} = await operationService.create(mandantoryObject);
    })();
  • Updates operation data.

    Parameters

    • entity: Partial<IOperation>

      Operation is partially updatable.

    Returns Promise<IResult<IOperation>>

    Response wrapped in [[IResult]]

    Example


    const partialUpdateObject: Partial<IOperation> = {
    com_cumulocity_model_WebCamDevice: {
    name: 'take picture',
    parameters: {
    duration: '2s',
    quality: 'HD',
    ratio: '16:9'
    }
    },
    deviceId: device.id,
    };

    (async () => {
    const {data, res} = await operationService.update(partialUpdateObject);
    })();