qe-api-client 1.2.0__py3-none-any.whl → 2.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qe_api_client/api_classes/__init__.py +0 -0
- qe_api_client/{engine_app_api.py → api_classes/engine_app_api.py} +249 -329
- qe_api_client/api_classes/engine_field_api.py +127 -0
- qe_api_client/api_classes/engine_generic_dimension_api.py +38 -0
- qe_api_client/api_classes/engine_generic_measure_api.py +37 -0
- qe_api_client/api_classes/engine_generic_object_api.py +180 -0
- qe_api_client/api_classes/engine_generic_variable_api.py +56 -0
- qe_api_client/{engine_global_api.py → api_classes/engine_global_api.py} +286 -134
- qe_api_client/engine.py +253 -72
- qe_api_client/engine_helper.py +15 -15
- qe_api_client/structs.py +58 -107
- {qe_api_client-1.2.0.dist-info → qe_api_client-2.1.0.dist-info}/METADATA +26 -6
- qe_api_client-2.1.0.dist-info/RECORD +18 -0
- {qe_api_client-1.2.0.dist-info → qe_api_client-2.1.0.dist-info}/WHEEL +1 -1
- qe_api_client/engine_field_api.py +0 -81
- qe_api_client/engine_generic_dimension_api.py +0 -16
- qe_api_client/engine_generic_measure_api.py +0 -15
- qe_api_client/engine_generic_object_api.py +0 -101
- qe_api_client/engine_generic_variable_api.py +0 -24
- qe_api_client-1.2.0.dist-info/RECORD +0 -17
- {qe_api_client-1.2.0.dist-info → qe_api_client-2.1.0.dist-info}/LICENSE +0 -0
- {qe_api_client-1.2.0.dist-info → qe_api_client-2.1.0.dist-info}/top_level.txt +0 -0
@@ -2,25 +2,46 @@ import json
|
|
2
2
|
|
3
3
|
|
4
4
|
class EngineGlobalApi:
|
5
|
+
"""
|
6
|
+
A class to interact with the Qlik Engine Global API using a provided socket interface.
|
7
|
+
|
8
|
+
Attributes:
|
9
|
+
engine_socket : object
|
10
|
+
The socket object used to communicate with the Qlik Engine.
|
11
|
+
"""
|
12
|
+
|
5
13
|
def __init__(self, socket):
|
14
|
+
"""
|
15
|
+
Initializes the EngineGlobalApi with a socket object.
|
16
|
+
|
17
|
+
Parameters:
|
18
|
+
socket : object
|
19
|
+
The socket object used to communicate with the Qlik Engine.
|
20
|
+
"""
|
6
21
|
self.engine_socket = socket
|
7
22
|
|
8
|
-
# returns an array of doc objects.
|
9
|
-
# The doc object contains doc name, size, file time etc
|
10
23
|
def get_doc_list(self):
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
24
|
+
"""
|
25
|
+
Retrieves a list of documents available in the Qlik Sense environment.
|
26
|
+
|
27
|
+
Returns:
|
28
|
+
list of dict: An array of document objects containing details such as doc name, size, and file time.
|
29
|
+
"""
|
30
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetDocList", "params": []})
|
31
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
15
32
|
try:
|
16
33
|
return response['result']['qDocList']
|
17
34
|
except KeyError:
|
18
35
|
return response['error']
|
19
36
|
|
20
|
-
# returns the os name (always windowsNT). Obsolete?
|
21
37
|
def get_os_name(self):
|
22
|
-
|
23
|
-
|
38
|
+
"""
|
39
|
+
Retrieves the operating system name where the Qlik Sense Engine is running.
|
40
|
+
|
41
|
+
Returns:
|
42
|
+
str: The OS name, typically "windowsNT".
|
43
|
+
"""
|
44
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "OSName", "params": []})
|
24
45
|
response = json.loads(
|
25
46
|
self.engine_socket.send_call(self.engine_socket, msg))
|
26
47
|
try:
|
@@ -28,14 +49,19 @@ class EngineGlobalApi:
|
|
28
49
|
except KeyError:
|
29
50
|
return response['error']
|
30
51
|
|
31
|
-
# returns the app id. If desktop is used the app id is the same
|
32
|
-
# as the full path to qvf if it's running against Enterprise,
|
33
|
-
# app id will be a guid
|
34
52
|
def create_app(self, app_name):
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
53
|
+
"""
|
54
|
+
Creates a new application in Qlik Sense.
|
55
|
+
|
56
|
+
Parameters:
|
57
|
+
app_name : str
|
58
|
+
The name of the application to be created.
|
59
|
+
|
60
|
+
Returns:
|
61
|
+
dict: Information about the created app, including its ID.
|
62
|
+
"""
|
63
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "CreateApp", "params": [app_name]})
|
64
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
39
65
|
try:
|
40
66
|
return response['result']
|
41
67
|
except KeyError:
|
@@ -48,10 +74,18 @@ class EngineGlobalApi:
|
|
48
74
|
# of the app to delete. In Qlik Sense Enterprise, the identifier of the app is a GUID in the Qlik Sense # NOQA
|
49
75
|
# repository. In Qlik Sense Desktop, the identifier of the app is the name of the app, as defined in the apps # NOQA
|
50
76
|
# folder %userprofile%\Documents\Qlik\Sense\Apps. This parameter is mandatory. # NOQA
|
51
|
-
|
52
77
|
def delete_app(self, app_name):
|
53
|
-
|
54
|
-
|
78
|
+
"""
|
79
|
+
Deletes an application from the Qlik Sense repository or file system.
|
80
|
+
|
81
|
+
Parameters:
|
82
|
+
app_name : str
|
83
|
+
The name or identifier of the app to delete.
|
84
|
+
|
85
|
+
Returns:
|
86
|
+
dict: Information about the deletion result.
|
87
|
+
"""
|
88
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "DeleteApp", "params": [app_name]})
|
55
89
|
response = json.loads(
|
56
90
|
self.engine_socket.send_call(self.engine_socket, msg))
|
57
91
|
try:
|
@@ -59,8 +93,25 @@ class EngineGlobalApi:
|
|
59
93
|
except KeyError:
|
60
94
|
return response["error"]
|
61
95
|
|
62
|
-
# opens an app and returns an object with handle, generic id and type
|
63
96
|
def open_doc(self, app_name, user_name='', password='', serial='', no_data=False):
|
97
|
+
"""
|
98
|
+
Opens a document (app) in Qlik Sense and returns details about it.
|
99
|
+
|
100
|
+
Parameters:
|
101
|
+
app_name : str
|
102
|
+
The name of the app to open.
|
103
|
+
user_name : str, optional
|
104
|
+
The username for authentication (default is '').
|
105
|
+
password : str, optional
|
106
|
+
The password for authentication (default is '').
|
107
|
+
serial : str, optional
|
108
|
+
The serial key for authentication (default is '').
|
109
|
+
no_data : bool, optional
|
110
|
+
If True, opens the app without data (default is False).
|
111
|
+
|
112
|
+
Returns:
|
113
|
+
dict: Information about the opened document, including handle, generic ID, and type.
|
114
|
+
"""
|
64
115
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "OpenDoc",
|
65
116
|
"params": [app_name, user_name, password, serial, no_data]})
|
66
117
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -71,28 +122,29 @@ class EngineGlobalApi:
|
|
71
122
|
|
72
123
|
# returns an object with handle, generic id and type for the active app
|
73
124
|
def get_active_doc(self):
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
125
|
+
"""
|
126
|
+
Retrieves the currently active document in Qlik Sense.
|
127
|
+
|
128
|
+
Returns:
|
129
|
+
dict: Information about the active document.
|
130
|
+
"""
|
131
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetActiveDoc", "params": []})
|
132
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
78
133
|
try:
|
79
134
|
return response['result']
|
80
135
|
except KeyError:
|
81
136
|
return response["error"]
|
82
137
|
|
83
|
-
@staticmethod
|
84
|
-
def get_handle(obj):
|
85
|
-
try:
|
86
|
-
return obj["qHandle"]
|
87
|
-
except ValueError:
|
88
|
-
return "Bad handle value in " + obj
|
89
|
-
|
90
138
|
# Abort All commands
|
91
139
|
def abort_all(self):
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
140
|
+
"""
|
141
|
+
Aborts all ongoing commands in Qlik Sense.
|
142
|
+
|
143
|
+
Returns:
|
144
|
+
dict: Information about the abort result.
|
145
|
+
"""
|
146
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "AbortAll", "params": []})
|
147
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
96
148
|
try:
|
97
149
|
return response['result']
|
98
150
|
except KeyError:
|
@@ -100,9 +152,18 @@ class EngineGlobalApi:
|
|
100
152
|
|
101
153
|
# Abort Specific Request
|
102
154
|
def abort_request(self, request_id):
|
155
|
+
"""
|
156
|
+
Aborts a specific request in Qlik Sense.
|
157
|
+
|
158
|
+
Parameters:
|
159
|
+
request_id : str
|
160
|
+
The identifier of the request to abort.
|
161
|
+
|
162
|
+
Returns:
|
163
|
+
dict: Information about the abort result.
|
164
|
+
"""
|
103
165
|
msg = json.dumps(
|
104
|
-
{"jsonrpc": "2.0", "id": 0, "handle": -1,
|
105
|
-
"method": "AbortRequest", "params": {"qRequestId": request_id}})
|
166
|
+
{"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "AbortRequest", "params": {"qRequestId": request_id}})
|
106
167
|
response = json.loads(
|
107
168
|
self.engine_socket.send_call(self.engine_socket, msg))
|
108
169
|
try:
|
@@ -118,15 +179,25 @@ class EngineGlobalApi:
|
|
118
179
|
# interaction is 1 (qDef.qResult is 1), the engine continues the script execution otherwise the execution is # NOQA
|
119
180
|
# halted. This parameter is relevant only if the variable ErrorMode is set to 1 and the script is run in debug # NOQA
|
120
181
|
# mode (qDebug is set to true when calling the DoReload method).
|
121
|
-
def configure_reload(self, cancel_on_error=False,
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
182
|
+
def configure_reload(self, cancel_on_error=False, use_error_data=True, interact_on_error=False):
|
183
|
+
"""
|
184
|
+
Configures the reload settings for a Qlik Sense application.
|
185
|
+
|
186
|
+
Parameters:
|
187
|
+
cancel_on_error : bool, optional
|
188
|
+
If True, the script execution is halted on error (default is False).
|
189
|
+
use_error_data : bool, optional
|
190
|
+
If True, any script execution error is returned in qErrorData (default is True).
|
191
|
+
interact_on_error : bool, optional
|
192
|
+
If True, script execution is halted on error and awaits interaction (default is False).
|
193
|
+
|
194
|
+
Returns:
|
195
|
+
dict: Information about the configuration result.
|
196
|
+
"""
|
197
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "ConfigureReload",
|
198
|
+
"params": {"qCancelOnScriptError": cancel_on_error, "qUseErrorData": use_error_data,
|
127
199
|
"qInteractOnError": interact_on_error}})
|
128
|
-
response = json.loads(
|
129
|
-
self.engine_socket.send_call(self.engine_socket, msg))
|
200
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
130
201
|
try:
|
131
202
|
return response['result']
|
132
203
|
except KeyError:
|
@@ -146,11 +217,22 @@ class EngineGlobalApi:
|
|
146
217
|
|
147
218
|
# BUG - Does not work in September 2017 release
|
148
219
|
def copy_app(self, target_app_id, src_app_id, qIds=[""]):
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
220
|
+
"""
|
221
|
+
Copies an app in Qlik Sense from a source app ID to a target app ID.
|
222
|
+
|
223
|
+
Parameters:
|
224
|
+
target_app_id : str
|
225
|
+
The identifier (GUID) of the target app.
|
226
|
+
src_app_id : str
|
227
|
+
The identifier (GUID) of the source app.
|
228
|
+
qIds : list, optional
|
229
|
+
List of object identifiers to copy. If empty, all objects are copied (default is [""]).
|
230
|
+
|
231
|
+
Returns:
|
232
|
+
dict: Information about the copy result.
|
233
|
+
"""
|
234
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "CopyApp",
|
235
|
+
"params": {"qTargetAppId": target_app_id, "qSrcAppId": src_app_id, "qIds": qIds}})
|
154
236
|
response = json.loads(
|
155
237
|
self.engine_socket.send_call(self.engine_socket, msg))
|
156
238
|
try:
|
@@ -162,10 +244,14 @@ class EngineGlobalApi:
|
|
162
244
|
# automatically assigns a unique identifier to the session app. A session app is not persisted and cannot be # NOQA
|
163
245
|
# saved. Everything created during a session app is non-persisted; for example: objects, data connections. # NOQA
|
164
246
|
def create_session_app(self):
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
247
|
+
"""
|
248
|
+
Creates an empty session app in Qlik Sense.
|
249
|
+
|
250
|
+
Returns:
|
251
|
+
dict: Information about the created session app.
|
252
|
+
"""
|
253
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "CreateSessionApp", "params": {}})
|
254
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
169
255
|
try:
|
170
256
|
return response['result']
|
171
257
|
except KeyError:
|
@@ -181,11 +267,19 @@ class EngineGlobalApi:
|
|
181
267
|
# persisted and cannot be saved. Everything created during a session app is non-persisted; for example: objects, # NOQA
|
182
268
|
# data connections.
|
183
269
|
def create_session_app_from_app(self, src_app_id):
|
184
|
-
|
185
|
-
|
270
|
+
"""
|
271
|
+
Creates a session app in Qlik Sense from an existing app.
|
272
|
+
|
273
|
+
Parameters:
|
274
|
+
src_app_id : str
|
275
|
+
The identifier (GUID) of the source app.
|
276
|
+
|
277
|
+
Returns:
|
278
|
+
dict: Information about the created session app.
|
279
|
+
"""
|
280
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "CreateSessionAppFromApp",
|
186
281
|
"params": {"qSrcAppId": src_app_id}})
|
187
|
-
response = json.loads(
|
188
|
-
self.engine_socket.send_call(self.engine_socket, msg))
|
282
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
189
283
|
try:
|
190
284
|
return response['result']
|
191
285
|
except KeyError:
|
@@ -197,14 +291,23 @@ class EngineGlobalApi:
|
|
197
291
|
# repository. qIds - Array of identifiers.. The list of all the objects in the app to be exported must be given. # NOQA
|
198
292
|
# This list must contain the GUIDs of all these objects.
|
199
293
|
def export_app(self, target_path, src_app_id, qIds=[""]):
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
294
|
+
"""
|
295
|
+
Exports an app from the Qlik Sense repository to the file system.
|
296
|
+
|
297
|
+
This operation is available only in Qlik Sense Enterprise.
|
298
|
+
|
299
|
+
Parameters:
|
300
|
+
target_path (str): The path and name of the target app file to export to.
|
301
|
+
src_app_id (str): The GUID of the source app in the Qlik Sense repository.
|
302
|
+
qIds (list of str): An array of identifiers (GUIDs) for the objects in the app to be exported.
|
303
|
+
The list must contain the GUIDs of all these objects.
|
304
|
+
|
305
|
+
Returns:
|
306
|
+
dict: The result of the export operation. In case of an error, returns the error information.
|
307
|
+
"""
|
308
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "ExportApp",
|
309
|
+
"params": {"qTargetPath": target_path, "qSrcAppId": src_app_id, "qIds": qIds}})
|
310
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
208
311
|
try:
|
209
312
|
return response['result']
|
210
313
|
except KeyError:
|
@@ -221,14 +324,27 @@ class EngineGlobalApi:
|
|
221
324
|
# contains objects that are not present in the source app, the objects related to these identifiers are removed # NOQA
|
222
325
|
# from the target app.
|
223
326
|
def replace_app_from_id(self, target_path, src_app_id, qIds=[""]):
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
327
|
+
"""
|
328
|
+
Replaces an app with the objects from a source app.
|
329
|
+
|
330
|
+
The list of objects in the app to be replaced must be defined in qIds.
|
331
|
+
This operation is available only in Qlik Sense Enterprise.
|
332
|
+
|
333
|
+
Parameters:
|
334
|
+
target_app_id (str): The GUID of the target app to be replaced.
|
335
|
+
src_app_id (str): The GUID of the source app in the Qlik Sense repository.
|
336
|
+
qIds (list of str): An array of GUIDs for the objects in the target app to be replaced.
|
337
|
+
Only QRS-approved GUIDs are applicable. If qIds is empty,
|
338
|
+
the engine automatically creates a list containing all QRS-approved objects.
|
339
|
+
If the array contains objects not present in the source app,
|
340
|
+
those objects are removed from the target app.
|
341
|
+
|
342
|
+
Returns:
|
343
|
+
dict: The result of the replace operation. In case of an error, returns the error information.
|
344
|
+
"""
|
345
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "ReplaceAppFromID",
|
346
|
+
"params": {"qTargetAppId": target_path, "qSrcAppId": src_app_id, "qIds": qIds}})
|
347
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
232
348
|
try:
|
233
349
|
return response['result']
|
234
350
|
except KeyError:
|
@@ -237,10 +353,15 @@ class EngineGlobalApi:
|
|
237
353
|
# GetAuthenticatedUser
|
238
354
|
# No parameters
|
239
355
|
def get_auth_user(self):
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
356
|
+
"""
|
357
|
+
Retrieves information about the authenticated user.
|
358
|
+
|
359
|
+
Returns:
|
360
|
+
dict: The result containing information about the authenticated user.
|
361
|
+
In case of an error, returns the error information.
|
362
|
+
"""
|
363
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetAuthenticatedUser", "params": {}})
|
364
|
+
response_json = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
244
365
|
try:
|
245
366
|
return response_json["result"]
|
246
367
|
except KeyError:
|
@@ -261,50 +382,60 @@ class EngineGlobalApi:
|
|
261
382
|
# qModifiedDate: Is generated by the engine. Creation date of the connection or last modification date of th # NOQA
|
262
383
|
# connection. qMeta: Information about the connection. qLogOn (SSO Passthrough or not): Select which user # NOQA
|
263
384
|
# credentials to use to connect to the source. LOG_ON_SERVICE_USER: Disables, LOG_ON_CURRENT_USER: Enabl # NOQA
|
264
|
-
def list_databases_from_odbc(self, connect_name,
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
385
|
+
def list_databases_from_odbc(self, connect_name, connect_string, connect_type, user_name, password, mod_date="",
|
386
|
+
meta="", sso_passthrough="LOG_ON_SERVICE_USER"):
|
387
|
+
"""
|
388
|
+
Lists the databases available in an ODBC, OLEDB, or CUSTOM data source.
|
389
|
+
|
390
|
+
Parameters:
|
391
|
+
connect_name (str): Name of the connection.
|
392
|
+
connect_string (str): Connection string (e.g., ODBC CONNECT TO [<provider name>]).
|
393
|
+
connect_type (str): Type of the connection (ODBC, OLEDB, CUSTOM, etc.).
|
394
|
+
user_name (str): Name of the user creating the connection.
|
395
|
+
password (str): Password of the user creating the connection.
|
396
|
+
mod_date (str, optional): Modification date of the connection.
|
397
|
+
meta (str, optional): Metadata information about the connection.
|
398
|
+
sso_passthrough (str, optional): User credentials to use (LOG_ON_SERVICE_USER, LOG_ON_CURRENT_USER).
|
399
|
+
|
400
|
+
Returns:
|
401
|
+
dict: A dictionary containing the list of databases.
|
402
|
+
In case of an error, returns the error information.
|
403
|
+
"""
|
404
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetDatabasesFromConnectionString",
|
405
|
+
"params": [{"qId": "", "qName": connect_name, "qConnectionString": connect_string,
|
406
|
+
"qType": connect_type, "qUserName": user_name, "qPassword": password,
|
407
|
+
"qModifiedDate": mod_date, "qMeta": meta, "qLogOn": sso_passthrough}]})
|
408
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
282
409
|
try:
|
283
410
|
return response['result']
|
284
411
|
except KeyError:
|
285
412
|
return response['error']
|
286
413
|
|
287
414
|
# IsValidConnectionString method: Checks if a connection string is valid.
|
288
|
-
def is_valid_connect_string(self, connect_name,
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
415
|
+
def is_valid_connect_string(self, connect_name, connect_string, connect_type, user_name, password, mod_date="",
|
416
|
+
meta="", sso_passthrough="LOG_ON_SERVICE_USER"):
|
417
|
+
"""
|
418
|
+
Checks if a connection string is valid.
|
419
|
+
|
420
|
+
Parameters:
|
421
|
+
connect_name (str): Name of the connection.
|
422
|
+
connect_string (str): Connection string (e.g., ODBC CONNECT TO [<provider name>]).
|
423
|
+
connect_type (str): Type of the connection (ODBC, OLEDB, CUSTOM, etc.).
|
424
|
+
user_name (str): Name of the user creating the connection.
|
425
|
+
password (str): Password of the user creating the connection.
|
426
|
+
mod_date (str, optional): Modification date of the connection.
|
427
|
+
meta (str, optional): Metadata information about the connection.
|
428
|
+
sso_passthrough (str, optional): User credentials to use (LOG_ON_SERVICE_USER, LOG_ON_CURRENT_USER).
|
429
|
+
|
430
|
+
Returns:
|
431
|
+
dict: A dictionary containing validation information.
|
432
|
+
In case of an error, returns the error information.
|
433
|
+
"""
|
434
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "IsValidConnectionString",
|
435
|
+
"params": [{"qId": "", "qName": connect_name, "qConnectionString": connect_string,
|
436
|
+
"qType": connect_type, "qUserName": user_name, "qPassword": password,
|
437
|
+
"qModifiedDate": mod_date, "qMeta": meta, "qLogOn": sso_passthrough}]})
|
438
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
308
439
|
try:
|
309
440
|
return response['result'] # Returns an array of databases
|
310
441
|
except KeyError:
|
@@ -312,10 +443,15 @@ class EngineGlobalApi:
|
|
312
443
|
|
313
444
|
# GetOdbcDsns: List all the ODBC connectors installed on the Sense server machine in Windows # NOQA
|
314
445
|
def get_odbc_dsns(self):
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
446
|
+
"""
|
447
|
+
Retrieves a list of all ODBC connectors installed on the Qlik Sense server.
|
448
|
+
|
449
|
+
Returns:
|
450
|
+
dict: A dictionary containing the details of the ODBC connectors installed.
|
451
|
+
In case of an error, returns the error information.
|
452
|
+
"""
|
453
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetOdbcDsns", "params": {}})
|
454
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
319
455
|
try:
|
320
456
|
return response['result']
|
321
457
|
except KeyError:
|
@@ -323,8 +459,14 @@ class EngineGlobalApi:
|
|
323
459
|
|
324
460
|
# GetOleDbProviders: Returns the list of the OLEDB providers installed on the system. # NOQA
|
325
461
|
def get_ole_dbs(self):
|
326
|
-
|
327
|
-
|
462
|
+
"""
|
463
|
+
Retrieves a list of all OLEDB providers installed on the Qlik Sense server.
|
464
|
+
|
465
|
+
Returns:
|
466
|
+
dict: A dictionary containing the details of the OLEDB providers installed.
|
467
|
+
In case of an error, returns the error information.
|
468
|
+
"""
|
469
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetOleDbProviders", "params": {}})
|
328
470
|
response = json.loads(
|
329
471
|
self.engine_socket.send_call(self.engine_socket, msg))
|
330
472
|
try:
|
@@ -338,10 +480,19 @@ class EngineGlobalApi:
|
|
338
480
|
# returned but information like when the request started and finished is not returned. # NOQA
|
339
481
|
|
340
482
|
def get_progress(self, request_id):
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
483
|
+
"""
|
484
|
+
Provides information about the progress of DoReload and DoSave calls.
|
485
|
+
|
486
|
+
Parameters:
|
487
|
+
request_id (int): Identifier of the DoReload or DoSave request.
|
488
|
+
If set to 0, only limited information is provided.
|
489
|
+
|
490
|
+
Returns:
|
491
|
+
dict: A dictionary containing progress messages and error messages.
|
492
|
+
If request_id is 0, detailed information like start and end times is not provided.
|
493
|
+
"""
|
494
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "GetProgress", "params": {}})
|
495
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
345
496
|
try:
|
346
497
|
return response['result']
|
347
498
|
except KeyError:
|
@@ -351,19 +502,20 @@ class EngineGlobalApi:
|
|
351
502
|
# in Qlik Sense Desktop.
|
352
503
|
# No parameters
|
353
504
|
def is_desktop_mode(self, request_id):
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
505
|
+
"""
|
506
|
+
Checks if the user is working in Qlik Sense Desktop mode.
|
507
|
+
|
508
|
+
Returns:
|
509
|
+
dict: A dictionary indicating whether the user is in desktop mode.
|
510
|
+
In case of an error, returns the error information.
|
511
|
+
"""
|
512
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": -1, "method": "IsDesktopMode", "params": {}})
|
513
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
358
514
|
try:
|
359
515
|
return response['result']
|
360
516
|
except KeyError:
|
361
517
|
return response['error']
|
362
518
|
|
363
|
-
@staticmethod
|
364
|
-
def get_doc_handle(doc_object):
|
365
|
-
return doc_object['qHandle']
|
366
|
-
|
367
519
|
# ## NOT IMPLEMENTED, perceived out of use case scope: ## CreateDocEx, GetBaseBNFHash, GetBaseBNF, GetBNF, # NOQA
|
368
520
|
# GetCustomConnectors, GetDefaultAppFolder, GetFunctions, GetInteract, GetLogicalDriveStrings, # NOQA
|
369
521
|
# ## GetStreamList, GetSupportedCodePages, GetUniqueID, InteractDone, IsPersonalMode (deprecated), OSVersion, # NOQA
|