I’m pretty sure there is not. Not officially anyways and a custom query for example is ignored (just tried).
Care to elaborate a bit why this would be beneficial? Apart from just being nice? I guess you could try to work with custom Fragments if you really need to, i.e. manually create a fragment when am operation goes to PENDING.
Yeah, that what I found as well. It looks like there is no way to actually get an operation in either of two states in one call.
I have a piece of functionality, that should block any other operation creation if there is one scheduled or executing already. I will create an Aha ticket for it
Actually you can just delete the status parameter which will give you all operations with ALL status.
You have to filter in the result list for pending and executing operations though.
Another approach is by just sending two requests: One for PENDING and one for EXECUTING. If either both of them containing something you have the result you are looking for.
There is another way to get that resolved with a revert parameter. General guideline from Cumulocity is that all operations has to be executed in order created on the platform. So getting one or a couple of latest operations works. Here is a code snippet for it:
This will return a list of at most one operation with the newest operation of the specified type for the specified device. If it is in status PENDING or EXECUTING then there is an operation, if it doesn’t exists or if it is in status SUCCESSFUL or FAILED then there is no ongoing operation. This works for single devices because devices are responsible to execute operations in order.