How to invoke microservice from widget on request

Product/components used and version/fix level:

Cumulocity 1018.503.1

Detailed explanation of the problem:

I’d like to visualize on a widget the output of a custom microservice only after user’s explicit request. Suppose I have developed a custom microservice that computes a KPI based on a series of measurements or that invokes a standard Cumulocity API (for example “create an alarm”). What I want is to have the possibility to manually invoke the microservice from a widget whenever I need it, without using automatic rules (such as Smart Rules or Apama models). Once invoked, I’d also like to view the output on the widget (could be a graph or a table or just a number displayed). Is there some standard component of Cumulocity that allows doing this or it is required a custom implementation?
Thank you in advance for your help

Question related to a free trial, or to a production (customer) instance?



There is a guide related to same topic. Please refer.

Bishan T Prasad

Thanks, the guide is absolutely helpful, but it refers to custom widget development. As far as I understand, there is no standard component of Cumulocity that allows to invoke a micorservice on request, correct?

There is no standard component to do that because all microservice endpoints look totally different from URL and payload perspective. Without an API documentation like Open API it is impossible know which endpoint must be called and the expected response codes & bodies.

1 Like