Creating Sense data connections | Butler Butler What is Butler? Documentation News Blog The Butler family About Documentation About Butler Use cases Retired use cases The Butler family Versions Contribution guidelines Telemetry Getting started Overview Installing Butler Time to decide Native app Docker Node.js app Setup Which config file? Sense server settings REST API Reload alerts Email Slack MS Teams MQTT Webhook Reload script logs Scheduler Key-value store File system access Incident management New Relic Signl4 MQTT Heartbeats Uptime monitor Docker healthcheck Sense data connections User activity events Task filter Telemetry Day 2 operations Standalone app Docker Node.js app Upgrade Concepts Key-value store Scheduler Alert emails Alerts via Slack/Teams Failed reload logs Start Sense tasks Incident management New Relic Signl4 Copy/move/delete files MQTT integration UDP client Real-time metrics Examples OpenAPI/Swagger Task scheduling Reload chaining Monitoring Butler Starting Sense tasks REST API Load script MQTT File system operations Sense demo apps Butler 5.0 API demo Partial loads Post to Slack Publish to MQTT Reference docs Config file syntax REST API 1 REST API 2 Scheduler Key-value store Alert template fields Sense helper subs Test cases Security considerations Legal stuff View page source Edit this page Create child page Create documentation issue Create project issue URL encode table Butler_GET Butler_POST Documentation Getting started Setup Sense data connections Creating Sense data connections If you intend to call Butler’s REST API from the load script of Sense apps, you must create a few data connections first. A couple of them are mandatory, one is optional. Two mandatory data connections must be created: Butler_GET and Butler_POST. The latter is used both for POST calls and also PUT, DELETE and other HTTP operations. The X-HTTP-Method-Override HTTP header is used with the Butler_POST data connection to tell Butler which HTTP operation should be used. This is a way to work around a limitation of Qlik’s REST connector, as it only supports GET and POST operations. One data connection is optional: URL encode table It is used to URL encode strings, which is useful when passing strings to Butler’s REST API (or other APIs!). URL encode table Optional Creating this data connection is optional. That said, if you plan to use the Slack, Teams, email, or webhook connectivity features of Butler, you should create this data connection. This is a basic “web file” connector pointing to http://www.w3schools.com/tags/ref_urlencode.asp: Remember! As with all new data connections, Sense will change the name your new connection (adding your username as a suffix). Use the QMC to change the name to “URL encode table”. Butler_GET Mandatory These settings are mandatory if you plan to use Butler’s REST API from the load scripts of Sense apps. With Butler running, create a new REST data connection called “Butler_GET”. It’s URL should point to Butler’s host/port. When createing REST data connections it’s always a good idea to verify they work. Using the /v4/butlerping endpoint is an easy way to do this (assuming that endpoint is enabled in Butler’s config file): Creating the data connection can look like this: No special settings are needed - just make sure the REST connector finds Butler as it should. The actual URL of the data connection will be modified on the fly every time you call the Butler APIs, it’s thus not really important which URL is entered during the setup phase. But the /v4/butlerping endpoint is a conveneint way to check that the data connection works. Test the connection before creating it: Remember! As with all new data connections, Sense will change the name your new connection (adding your username as a suffix). Use the QMC to change the name to “Butler_GET”. Butler_POST Mandatory These settings are mandatory if you plan to use Butler’s REST API from the load scripts of Sense apps. The data connection used for POST, PUT, DELETE and all other HTTP operations beyond GET should be named “Butler_POST”. Its configuration is similar to that of Butler_GET, except that a message body is also needed for the POST to work. Assuming Butler’s key-value store is enabled in the main config file, you can create a dummy key-value pair using a POST command with the following payload. The effect is that the data connection is created and can be used for future POST/PUT/DELETE operations against Butler’s API. The fact that is was created against the key-value store doesn’t matter, the data conncetion details will be replaced each time it is used. {   "key": "abc",   "value": "123",   "ttl": "5000" } Creating the data connection can look like this: … and test the connection before creting it. Remember! As with all new data connections, Sense will change the name your new connection (adding your username as a suffix). Use the QMC to change the name to “Butler_POST”. Feedback Was this page helpful? Yes No Glad to hear it! Please tell us how we can improve. Sorry to hear that. Please tell us how we can improve. Last modified 2021-11-03: wip towards 7.0 (dbfa572) © 2022 Ptarmigan Labs AB All Rights Reserved About