Forum Discussion

mmatec01's avatar
mmatec01
Icon for Neophyte rankNeophyte
4 years ago

Service Insight - is there a way to create Service using REST API?

I am about to create bunch of Services under my Resources tree.  Service is just another name for logical group of resources (e.g. devices) and instances supporting a common service or application and aggregate data across them to achieve service-level monitoring and alerting.  OK, there is a bunch of steps to create a Service.  It's easy once you get a grasp of it.  But it is also very repetitive task and lots of clicks if you have to create hundreds of them.  Is there a better mousetrap out there?  Specifically, can I use REST API calls to create these Services?  And I don't care whether one uses PowerShell, Python or Go language, is it possible?  I searched  API and SDK Documentation and the closest one I found is 'addDevice' REST API call.  Service is nothing else than a device with deviceType 6.  Alas, that seems to be a problem since the documentation only lists 3 types of devices (integers) that you can use when POSTing a new device.  

0 indicates a regular device, 2 indicates an AWS device, 4 indicates an Azure device

Has anybody created a Service using REST API?

  • Anonymous's avatar
    Anonymous

    There is an API endpoint to do this, since this is how the UI does it. However, that endpoint is available only in v3 of the API. You can deconstruct that API call (or series of calls, I haven't looked at it deep enough) and build your own to do it. You just need to specify v3 of the API instead of v2 or v1. 

    V3 of the API isn't technically supported, so if you run into issues, support won't be able to help you. Contact your CSM and ask for v3 of the API to be published (supported and documented).