This class allows for managing operations on a device.

Hierarchy

Constructors

Methods

Constructors

Methods

  • Creates a new operation.

    Returns

    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);
    })();

    Parameters

    • entity: IOperation

      Operation object with mandantory fragments.

    Returns Promise<IResult<IOperation>>

  • Updates operation data.

    Returns

    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);
    })();

    Parameters

    • entity: Partial<IOperation>

      Operation is partially updatable.

    Returns Promise<IResult<IOperation>>