Forum Discussion
12 hours ago, SmokinIndo said:
I'm trying to write a script in Groovy that makes an API request to check the status of VPN tunnels. I've been trying the implement the post() method from the HTTP library to update the header of the url with the API key. I keep running into an error "no signature on method". This is my code so far.
import com.santaba.agent.groovyapi.http.*; ip = "api-mp.meraki.com"; httpClient = HTTP.open(ip, 443); url = "https://"+ip+"/api/v1/organizations/999999/appliance/vpn/statuses"; def postResponse = httpClient.post(url,["X-Cisco-Meraki-API-Key":"ApiKey"]);
I just followed the example from this tutorial: https://www.logicmonitor.com/support/terminology-syntax/scripting-support/access-a-website-from-groovy
I'm wondering if I'm getting the error because I'm not inserting a payload in my method. But I don't have a payload... I'm just trying to update the header.
Maybe it's easier for you to use one the already existent datasource(s) that queries Cisco Meraki API & from there build the query you actually want
You can refer to the code of the DS below for example:
This is usually what I do if I want to extend the capabilities of certain monitoring... I always check if they didn't did the 'connection' already. That way I don't need to loose time understanding how to do it :)/emoticons/smile@2x.png 2x" title=":)" width="20" />
Related Content
- 9 months ago
- 2 years ago
- 11 months agoAnonymous