diff --git a/docs/api_doc/butler-api.html b/docs/api_doc/butler-api.html new file mode 100644 index 00000000..0b95fd8b --- /dev/null +++ b/docs/api_doc/butler-api.html @@ -0,0 +1,2315 @@ + + + +
+ +Download OpenAPI specification:Download
Butler is a microservice that provides add-on features to Qlik Sense Enterprise on Windows. +Butler offers both a REST API and things like failed reload notifications etc.
+This page contains the API documentation. Full documentation is available at https://butler.ptarmiganlabs.com
+Get an array of all enabled API endpoints, using the key names from the Butler config file.
+Note: Endpoints are enabled/disabled in the Butler main configuration file.
+[- "activeUserCount",
- "activeUsers",
- "apiListEnbledEndpoints"
]
Converts strings from base62 to base16.
+base62 required | string Example: base62=6DMW88LpSok9Z7P7hUK0wv7bF The base62 encoded string that should be converted to base16 + |
{- "base62": "6DMW88LpSok9Z7P7hUK0wv7bF",
- "base16": "3199af08bfeeaf5d420f27ed9c01e74370077"
}
Converts strings from base16 to base62.
+base16 required | string Example: base16=3199af08bfeeaf5d420f27ed9c01e74370077 The base16 encoded string that should be converted to base62 + |
{- "base16": "3199af08bfeeaf5d420f27ed9c01e74370077",
- "base62": "6DMW88LpSok9Z7P7hUK0wv7bF"
}
Copying of files is only posttible between pre-approved directories. +Defining approved source and destination directories is done in Butler's config file.
+If the source directory contains subdirectories, these will be copied too.
+fromFile | string Name of source file. + |
toFile | string Name of destination file. Can be different from source file name, if needed. + |
overwrite | boolean Controls whether destination file should be overwritten if it already exists. Note that the copy operation will silently fail if you set this to false and the destination exists. Defaults to false. + |
preserveTimestamp | boolean When true, the timestamp of the source file(s) will be preserved on the destination file(s). When false, timestamp behaviour is OS-dependent. Defaults to false. + |
{- "fromFile": "subfolder/file1.qvd",
- "toFile": "archive/file1_20200925.qvd",
- "overwrite": false,
- "preserveTimestamp": false
}
{- "fromFile": "subfolder/file1.qvd",
- "toFile": "archive/file1_20200925.qvd",
- "overwrite": false,
- "preserveTimestamp": false
}
Moving of files is only posttible between pre-approved directories. +Defining approved source and destination directories is done in Butler's config file.
+If the source directory contains subdirectories, these will be moved too.
+fromFile | string Name of source file. + |
toFile | string Name of destination file. Can be different from source file name, if needed. + |
overwrite | boolean Controls whether destination file should be overwritten if it already exists. Defaults to false. + |
{- "fromFile": "subfolder/file1.qvd",
- "toFile": "archive/file1_20200925.qvd",
- "overwrite": false
}
{- "fromFile": "subfolder/file1.qvd",
- "toFile": "archive/file1_20200925.qvd",
- "overwrite": false
}
It is only possible to delete files in pre-approved directories, or subdirectories thereof. +Defining approved directories is done in Butler's config file.
+deleteFile | string Name of file to be deleted. Use forward/backward slashes in paths as needed, depending on whether Butler runs on Windows/non-Windows platform. + |
{- "deleteFile": "data/qvdstore/sales/file1.qvd"
}
{ }
Creates a directory in QVD directory (which is defined in Butler's config file).
+directory | string Directory that should be created. + |
{- "directory": "subfolder/2020-10"
}
{- "directory": "subfolder/2020-10"
}
If the directory already exists nothing will happen. +If permissions don't allow a directory to be created, or if the path is invalid, an error will be returned.
+directory | string Path to directory that should be created. Can be a relative or absolute path. + |
{- "directory": "/Users/joe/data/qvds/2020"
}
{- "directory": "/Users/joe/data/qvds/2020"
}
namespace required | string Example: Sales ETL step 2 |
key required | string Example: key=Last extract timestamp |
{- "namespace": "Sales ETL step 2",
- "key": "Last extract timestamp",
- "value": "2020-09-29 17:14:56"
}
If the specified key already exists it will be overwritten.
+If the posted data has a TTL, it will start counting when the post occur. +I.e. if a previouly posted key also had a TTL, it will be replace with the most recent TTL.
+namespace required | string Example: Sales ETL step 2 Name of namespace. + |
key | string Key to use + |
value | string Value to set + |
ttl | number Time to live = how long (milliseconds) the key-value pair should exist before being automatically deleted + |
{- "key": "ce68c8ca-b3ff-4371-8285-7c9ce5040e42_parameter_1",
- "value": "12345.789",
- "ttl": 10000
}
{- "namespace": "Sales ETL step 2",
- "key": "Last extract timestamp",
- "value": "2020-09-29 17:14:56",
- "ttl": 60000
}
Returns true if the specified key exists, otherwise false.
+namespace required | string Example: Sales ETL step 2 |
key required | string Example: key=Last extract timestamp |
{- "keyExists": true,
- "keyValue": {
- "namespace": "Sales ETL step 2",
- "key": "Last extract timestamp",
- "value": "2020-09-29 17:14:56"
}
}
namespace required | string Example: Sales ETL step 2 Name of namespace whose keys should be returned. + |
{- "namespace": "Sales ETL step 2",
- "keys": [
- {
- "key": "ce68c8ca-b3ff-4371-8285-7c9ce5040e42_parameter_1"
}, - {
- "key": "ce68c8ca-b3ff-4371-8285-7c9ce5040e42_parameter_2"
}
]
}
topic required | string Topic to which message should be published. + |
message required | string The message is a generic text string and can thus contain anything that can be represented in a string, including JSON, key-value pairs, plain text etc. + |
{- "topic": "qliksense/new_data_notification/sales",
- "message": "dt=20201028"
}
{- "topic": "qliksense/new_data_notification/sales",
- "message": "dt=20201028"
}
This endpoint posts metrics to the New Relic metrics API.
+name required | string Metric name. + |
type required | string Metric type. Valid options are count, distribution, gauge, summary. + |
value required | number Value of the metric. + |
timestamp | number The metric's start time in Unix time. Uses UTC time zone. This field also support seconds, microseconds, and nanoseconds. However, the data will be converted to milliseconds for storage and query. Metrics reported with a timestamp older than 48 hours ago or newer than 24 hours from the time they are reported are dropped by New Relic. If left empty Butler will use the current time as timestamp. + |
interval | number The length of the time window. Required for count and summary metric types. + |
Array of objects[ items ] Dimensions that will be associated with the metric. + |
{- "name": "memory.heap",
- "type": "gauge",
- "value": 2.3,
- "timestamp": 1642164296053,
- "interval": 0,
- "attributes": [
- {
- "name": "host.name",
- "value": "dev.server.com"
}
]
}
{- "newRelicResultCode": "202",
- "newRelicResultText": "Data accepted."
}
If a schedule ID is specified using a query parameter (and there exists a schedule with that ID), information about that schedule will be returned. +If no schedule ID is specified, all schedules will be returned.
+id | string Example: id=e4b1c455-aa15-4a51-a9cf-c5e4cfc91339 Scheduld ID + |
[- {
- "id": "e4b1c455-aa15-4a51-a9cf-c5e4cfc91339",
- "created": "2020-09-29T14:29:12.283Z",
- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]",
- "lastKnownState": "started"
}
]
name required | string Descriptive name for the schedule. + |
cronSchedule required | string 5 or 6 position cron schedule. +If 6 positions used, the leftmost position represent seconds. +If 5 positions used, leftmost position is minutes. +The example schedule will trigger at 00 and 30 minutes past 6:00 on Mon-Fri. + |
timezone required | string Time zone the schedule should use. Ex "Europe/Stockholm". + |
qlikSenseTaskId required | string ID of Qlik Sense task that should be started when schedule triggers. + |
startupState required | string Enum: "start" "started" "stop" "stopped" If set to "start" or "started", the schedule will be started upon creation. Otherwise it will remain in stopped state. + |
tags | Array of strings Can be used to categorise schedules. + |
{- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]"
}
[- {
- "id": "e4b1c455-aa15-4a51-a9cf-c5e4cfc91339",
- "created": "2020-09-29T14:29:12.283Z",
- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]",
- "lastKnownState": "started"
}
]
Start a schedule, i.e. have the scheduler run the associated reload task according to the schedule's cron settings.
+scheduleId required | string Example: e4b1c455-aa15-4a51-a9cf-c5e4cfc91339 Schedule ID. + |
{- "id": "e4b1c455-aa15-4a51-a9cf-c5e4cfc91339",
- "created": "2020-09-29T14:29:12.283Z",
- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]",
- "lastKnownState": "started"
}
Start all schedules, i.e. tell the scheduler to run each schedule and start associated tasks according to each schedule's settings.
+[- {
- "id": "e4b1c455-aa15-4a51-a9cf-c5e4cfc91339",
- "created": "2020-09-29T14:29:12.283Z",
- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]"
}
]
Stop a schedule, i.e. tell the scheduler to no longer execute the schedule according to its cron settings.
+scheduleId required | string Example: e4b1c455-aa15-4a51-a9cf-c5e4cfc91339 Schedule ID. + |
{- "id": "e4b1c455-aa15-4a51-a9cf-c5e4cfc91339",
- "created": "2020-09-29T14:29:12.283Z",
- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]",
- "lastKnownState": "started"
}
Stop all schedules, i.e. tell the scheduler to no longer execute any schedule according to its cron settings.
+[- {
- "id": "e4b1c455-aa15-4a51-a9cf-c5e4cfc91339",
- "created": "2020-09-29T14:29:12.283Z",
- "name": "Reload sales metrics",
- "cronSchedule": "0,30 6 * * 1-5",
- "timezone": "Europe/Stockholm",
- "qlikSenseTaskId": "210832b5-6174-4572-bd19-3e61eda675ef",
- "startupState": "started",
- "tags": "[\"tag 1\", \"tag 2\"]"
}
]
appId required | string Example: 210832b5-6174-4572-bd19-3e61eda675ef ID of Qlik Sense app. + |
reloadMode | integer Reload mode that will be used. 0, 1 or 2. If not specified 0 will be used + |
partialReload | boolean Should a full (=false) or partial (=true) reload be done? If not specified a full reload will be done. + |
startQSEoWTaskOnSuccess | Array of strings[ items >= 0 items ] Array of task IDs that should be started when the app has successfully reloaded. + |
startQSEoWTaskOnFailure | Array of strings[ items >= 0 items ] Array of task IDs that should be started if the app fails reloading. + |
{- "reloadMode": 0,
- "partialReload": true,
- "startQSEoWTaskOnSuccess": [
- "09b3c78f-04dd-45e3-a4bf-1b074d6572fa",
- "eaf1da4f-fd44-4cea-b2de-7b67a6496ee3"
], - "startQSEoWTaskOnFailure": [
- "09b3c78f-04dd-45e3-a4bf-1b074d6572fa",
- "eaf1da4f-fd44-4cea-b2de-7b67a6496ee3"
]
}
{- "appId": "210832b5-6174-4572-bd19-3e61eda675ef"
}
Does the same thing as /v4/app/:appId/dump
appId required | string Example: 210832b5-6174-4572-bd19-3e61eda675ef ID of Qlik Sense app. + |
{- "properties": { },
- "loadScript": "",
- "sheets": [ ],
- "stories": [ ],
- "masterobjects": [ ],
- "appprops": [ ],
- "dataconnections": [ ],
- "dimensions": [ ],
- "bookmarks": [ ],
- "embeddedmedia": [ ],
- "snapshots": [ ],
- "fields": [ ],
- "variables": [ ],
- "measures": [ ]
}
Does the same thing as /v4/senseappdump/:appId
appId required | string Example: 210832b5-6174-4572-bd19-3e61eda675ef ID of Qlik Sense app. + |
{- "properties": { },
- "loadScript": "",
- "sheets": [ ],
- "stories": [ ],
- "masterobjects": [ ],
- "appprops": [ ],
- "dataconnections": [ ],
- "dimensions": [ ],
- "bookmarks": [ ],
- "embeddedmedia": [ ],
- "snapshots": [ ],
- "fields": [ ],
- "variables": [ ],
- "measures": [ ]
}
An optional array of zero or more objects can be passed in the message body. It is used to pass additional info related to the reload task being started.
+Currently supported values in this array are:
+ttl=0
disables the TTL feature, i.e. the KV pair will not expire.This parameter uses a generic JSON/object format (type + payload). +It's thus possible to add new integrations in future Butler versions.
+taskId required | string Example: 210832b5-6174-4572-bd19-3e61eda675ef ID of Qlik Sense task. +Butler will ignore the "magic" task ID of "-" (=dash, hyphen). This ID will not be reported as invalid. + |
allTaskIdsMustExist | boolean Example: allTaskIdsMustExist=true If set to If set to In either case, missing/invalid taskIds will be reported in the result set back to the client calling the API. +Note: Tasks started by specifying tags and/or custom properties are not affected by this. + |
type | string Enum: "keyvaluestore" "starttaskid" "starttasktag" "starttaskcustomproperty" |
payload | object |
[- {
- "type": "starttaskid",
- "payload": {
- "taskId": "7552d9fc-d1bb-4975-9a38-18357de531ea"
}
}, - {
- "type": "starttasktag",
- "payload": {
- "tag": "startTask1"
}
}, - {
- "type": "starttaskcustomproperty",
- "payload": {
- "customPropertyName": "taskGroup",
- "customPropertyValue": "tasks2"
}
}, - {
- "type": "keyvaluestore",
- "payload": {
- "namespace": "MyFineNamespace",
- "key": "AnImportantKey",
- "value": "TheValue",
- "ttl": 10000
}
}
]
{- "tasksId": {
- "started": [
- {
- "taskId": "e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e",
- "taskName": "Reload task of App1"
}
], - "invalid": [
- {
- "taskId": "abc"
}
], - "denied": [
- {
- "taskId": "a1a11a11-b1c0-4879-88fc-c7cdd9c1cf3e"
}
]
}, - "tasksTag": [
- {
- "taskId": "e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e",
- "taskName": "Reload task of App1"
}
], - "tasksTagDenied": [
- {
- "tag": "startTask_invalid1"
}
], - "tasksCP": [
- {
- "taskId": "e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e",
- "taskName": "Reload task of App1"
}
], - "tasksCPDenied": [
- {
- "name": "taskGroup",
- "value": "cp_value_denied1"
}
]
}
An optional array of zero or more objects can be passed in the message body. It is used to pass additional info related to the reload task being started.
+Currently supported values in this array are:
+ttl=0
disables the TTL feature, i.e. the KV pair will not expire.This parameter uses a generic JSON/object format (type + payload). +It's thus possible to add new integrations in future Butler versions.
+taskId required | string Example: 210832b5-6174-4572-bd19-3e61eda675ef ID of Qlik Sense task. +Butler will ignore the "magic" task ID of "-" (=dash, hyphen). This ID will not be reported as invalid. + |
allTaskIdsMustExist | boolean Example: allTaskIdsMustExist=true If set to If set to In either case, missing/invalid taskIds will be reported in the result set back to the client calling the API. +Note: Tasks started by specifying tags and/or custom properties are not affected by this. + |
type | string Enum: "keyvaluestore" "starttaskid" "starttasktag" "starttaskcustomproperty" |
payload | object |
[- {
- "type": "starttaskid",
- "payload": {
- "taskId": "7552d9fc-d1bb-4975-9a38-18357de531ea"
}
}, - {
- "type": "starttasktag",
- "payload": {
- "tag": "startTask1"
}
}, - {
- "type": "starttaskcustomproperty",
- "payload": {
- "customPropertyName": "taskGroup",
- "customPropertyValue": "tasks2"
}
}, - {
- "type": "keyvaluestore",
- "payload": {
- "namespace": "MyFineNamespace",
- "key": "AnImportantKey",
- "value": "TheValue",
- "ttl": 10000
}
}
]
{- "tasksId": {
- "started": [
- {
- "taskId": "e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e",
- "taskName": "Reload task of App1"
}
], - "invalid": [
- {
- "taskId": "abc"
}
], - "denied": [
- {
- "taskId": "a1a11a11-b1c0-4879-88fc-c7cdd9c1cf3e"
}
]
}, - "tasksTag": [
- {
- "taskId": "e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e",
- "taskName": "Reload task of App1"
}
], - "tasksTagDenied": [
- {
- "tag": "startTask_invalid1"
}
], - "tasksCP": [
- {
- "taskId": "e3b27f50-b1c0-4879-88fc-c7cdd9c1cf3e",
- "taskName": "Reload task of App1"
}
], - "tasksCPDenied": [
- {
- "name": "taskGroup",
- "value": "cp_value_denied1"
}
]
}
Sends a basic message to Slack.
+channel required | string Slack channel to post message into. Prefix channel name with #. + |
from_user required | string Name of sending user, as shown in the Slack message + |
msg required | string Text going into the Slack message + |
emoji | string Emoji to shown next to Slack message + |
{- "channel": "#reload-notification",
- "from_user": "Butler the Bot",
- "msg": "This is a message from Qlik Sense",
- "emoji": "thumbsup"
}
{- "channel": "#reload-notification",
- "from_user": "Butler the Bot",
- "msg": "This is a message from Qlik Sense",
- "emoji": "thumbsup"
}