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”.