system.mes.operation.stopOperation
Description
Stops an Operations object.
Optionally sets the end time. Provide either endDate (a Date) or endDateMillis (epoch milliseconds); if both are given, the millis value takes precedence. If neither is provided, the operation stops now.
Permissions
This method requires the OPERATION.EXECUTE permission.
Syntax
The only required argument is operationId. All arguments may be passed positionally or as keyword arguments.
# Stop now
system.mes.operation.stopOperation(operationId)
# Stop at a specific time (as a Date)
system.mes.operation.stopOperation(operationId, endDate=endDate)
# Stop at a specific time (as epoch milliseconds)
system.mes.operation.stopOperation(operationId, endDateMillis=endDateMillis)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
operationId | String (ULID) | False | The ID of the operation to stop. |
endDate | Date | True | The stop date of the operation. Provide either this or endDateMillis. |
endDateMillis | Long | True | The stop date of the operation in epoch milliseconds. Takes precedence over endDate if both are provided. |
Returns
Returns a JSON object of the operation execution result for the end of the operation.
Example Usage
# Stop the operation
stoppedOperationResult = system.mes.operation.stopOperation('01JPBCPKSR-972W3V0Y-H00NNSKQ')
# Output the operation execution result of the stopped operation
print(stoppedOperationResult)