qe-api-client 2.8.0__tar.gz → 3.0.0__tar.gz
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-2.8.0 → qe_api_client-3.0.0}/PKG-INFO +1 -1
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_app_api.py +132 -51
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_generic_object_api.py +45 -6
- qe_api_client-3.0.0/qe_api_client/engine.py +2458 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/structs.py +109 -1
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client.egg-info/PKG-INFO +1 -1
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/setup.py +1 -1
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_app_api.py +1 -1
- qe_api_client-2.8.0/qe_api_client/engine.py +0 -1211
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/LICENSE +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/README.md +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/__init__.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/__init__.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_field_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_generic_dimension_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_generic_measure_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_generic_variable_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_global_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/engine_communicator.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client.egg-info/SOURCES.txt +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client.egg-info/dependency_links.txt +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client.egg-info/requires.txt +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client.egg-info/top_level.txt +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/setup.cfg +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_chart_content.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_field_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_global_api.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_labs.py +0 -0
- {qe_api_client-2.8.0 → qe_api_client-3.0.0}/test/test_pyqlikengine.py +0 -0
@@ -26,7 +26,7 @@ class EngineAppApi:
|
|
26
26
|
"""
|
27
27
|
self.engine_socket = socket
|
28
28
|
|
29
|
-
def get_script(self, doc_handle):
|
29
|
+
def get_script(self, doc_handle: int):
|
30
30
|
"""
|
31
31
|
Retrieves the script of the app identified by the document handle.
|
32
32
|
|
@@ -43,7 +43,7 @@ class EngineAppApi:
|
|
43
43
|
except KeyError:
|
44
44
|
return response['error']
|
45
45
|
|
46
|
-
def set_script(self, doc_handle, script):
|
46
|
+
def set_script(self, doc_handle: int, script):
|
47
47
|
"""
|
48
48
|
Sets the script of the app identified by the document handle.
|
49
49
|
|
@@ -61,7 +61,7 @@ class EngineAppApi:
|
|
61
61
|
except KeyError:
|
62
62
|
return response['error']
|
63
63
|
|
64
|
-
def do_reload(self, doc_handle, param_list=[]):
|
64
|
+
def do_reload(self, doc_handle: int, param_list=[]):
|
65
65
|
"""
|
66
66
|
Triggers a reload of the app identified by the document handle.
|
67
67
|
|
@@ -79,7 +79,7 @@ class EngineAppApi:
|
|
79
79
|
except KeyError:
|
80
80
|
return response['error']
|
81
81
|
|
82
|
-
def do_reload_ex(self, doc_handle, param_list={}):
|
82
|
+
def do_reload_ex(self, doc_handle: int, param_list={}):
|
83
83
|
"""
|
84
84
|
Triggers an extended reload of the app identified by the document handle.
|
85
85
|
|
@@ -98,7 +98,7 @@ class EngineAppApi:
|
|
98
98
|
except KeyError:
|
99
99
|
return response['error']
|
100
100
|
|
101
|
-
def get_app_layout(self, doc_handle):
|
101
|
+
def get_app_layout(self, doc_handle: int):
|
102
102
|
"""
|
103
103
|
Retrieves the layout structure of the app identified by the document handle.
|
104
104
|
|
@@ -115,7 +115,7 @@ class EngineAppApi:
|
|
115
115
|
except KeyError:
|
116
116
|
return response['error']
|
117
117
|
|
118
|
-
def get_object(self, app_handle, object_id):
|
118
|
+
def get_object(self, app_handle: int, object_id: str):
|
119
119
|
"""
|
120
120
|
Retrieves a specific object from the app identified by the document handle.
|
121
121
|
|
@@ -134,7 +134,28 @@ class EngineAppApi:
|
|
134
134
|
except KeyError:
|
135
135
|
return response['error']
|
136
136
|
|
137
|
-
|
137
|
+
|
138
|
+
def get_objects(self, app_handle: int, options: dict):
|
139
|
+
"""
|
140
|
+
Retrieves a specific object from the app identified by the document handle.
|
141
|
+
|
142
|
+
Parameters:
|
143
|
+
app_handle (int): The handle identifying the app document.
|
144
|
+
object_id (str): The ID of the object to retrieve.
|
145
|
+
|
146
|
+
Returns:
|
147
|
+
dict: The retrieved object (qReturn). In case of an error, returns the error information.
|
148
|
+
"""
|
149
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": app_handle, "method": "GetObjects",
|
150
|
+
"params": {"qOptions": options}})
|
151
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
152
|
+
try:
|
153
|
+
return response["result"]["qList"]
|
154
|
+
except KeyError:
|
155
|
+
return response["error"]
|
156
|
+
|
157
|
+
|
158
|
+
def get_field(self, doc_handle: int, field_name, state_name=""):
|
138
159
|
"""
|
139
160
|
Retrieves a specific field from the app identified by the document handle.
|
140
161
|
|
@@ -154,7 +175,7 @@ class EngineAppApi:
|
|
154
175
|
except KeyError:
|
155
176
|
return response['error']
|
156
177
|
|
157
|
-
def create_object(self, doc_handle, prop):
|
178
|
+
def create_object(self, doc_handle: int, prop):
|
158
179
|
"""
|
159
180
|
Creates a new object in the app identified by the document handle.
|
160
181
|
|
@@ -177,7 +198,7 @@ class EngineAppApi:
|
|
177
198
|
# You can create multiple states within a Qlik Sense app and apply these states to specific objects within the app. # NOQA
|
178
199
|
# Objects in a given state are not affected by user selections in the other states. # NOQA
|
179
200
|
# Call GetAppLayout() afterwards to get the latest states
|
180
|
-
def add_alternate_state(self, doc_handle, state_name):
|
201
|
+
def add_alternate_state(self, doc_handle: int, state_name):
|
181
202
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "AddAlternateState",
|
182
203
|
"params": [state_name]})
|
183
204
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -188,7 +209,7 @@ class EngineAppApi:
|
|
188
209
|
|
189
210
|
# AddFieldFromExpression method: Adds a field on the fly. !! The expression of a field on the fly is persisted but # NOQA
|
190
211
|
# not its values. !!
|
191
|
-
def add_field_from_expression(self, doc_handle, field_name, expr_value):
|
212
|
+
def add_field_from_expression(self, doc_handle: int, field_name, expr_value):
|
192
213
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "AddFieldFromExpression",
|
193
214
|
"params": [field_name, expr_value]})
|
194
215
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -199,7 +220,7 @@ class EngineAppApi:
|
|
199
220
|
|
200
221
|
# CheckExpression method: Checks whether an expression is valid or not
|
201
222
|
# qErrorMsg is empty if it's valid
|
202
|
-
def check_expression(self, doc_handle, expr_value):
|
223
|
+
def check_expression(self, doc_handle: int, expr_value):
|
203
224
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CheckExpression",
|
204
225
|
"params": [expr_value]})
|
205
226
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -211,7 +232,7 @@ class EngineAppApi:
|
|
211
232
|
# CheckScriptSyntax method: Checks whether a load script is valid or not
|
212
233
|
# Used AFTER doing SetScript method
|
213
234
|
# errors are displayed in an array discussing positions of characters in script where failing # NOQA
|
214
|
-
def check_script(self, doc_handle):
|
235
|
+
def check_script(self, doc_handle: int):
|
215
236
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CheckScriptSyntax", "params": {}})
|
216
237
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
217
238
|
try:
|
@@ -219,7 +240,7 @@ class EngineAppApi:
|
|
219
240
|
except KeyError:
|
220
241
|
return response['error']
|
221
242
|
|
222
|
-
def clear_all(self, doc_handle, locked_also=False, alt_state=""):
|
243
|
+
def clear_all(self, doc_handle: int, locked_also=False, alt_state=""):
|
223
244
|
"""
|
224
245
|
Clear selections in fields for current state. Locked fields are not cleared by default.
|
225
246
|
|
@@ -239,7 +260,7 @@ class EngineAppApi:
|
|
239
260
|
# CreateConnection method: Creates a connection. A connection indicates from which data source, the data should # NOQA
|
240
261
|
# be taken. The connection can be: an ODBC connection, OLEDB connection, a custom connection, a folder connection # NOQA
|
241
262
|
# (lib connection), an internet connection, Single Sign-On
|
242
|
-
def create_connection(self, doc_handle, connect_name, connect_string, connect_type, user_name, password,
|
263
|
+
def create_connection(self, doc_handle: int, connect_name, connect_string, connect_type, user_name, password,
|
243
264
|
mod_date="", meta="", sso_passthrough="LOG_ON_SERVICE_USER"):
|
244
265
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CreateConnection",
|
245
266
|
"params": [{"qName": connect_name, "qMeta": meta, "qConnectionString": connect_string,
|
@@ -255,7 +276,7 @@ class EngineAppApi:
|
|
255
276
|
# can contain the same dimension.
|
256
277
|
# Parameters:
|
257
278
|
# qProp (MANDATORY: send dim_id, dim_title, dim_grouping, dim_field, dim_label, meta_def (optional) # NOQA
|
258
|
-
def create_dimension(self, doc_handle, prop):
|
279
|
+
def create_dimension(self, doc_handle: int, prop):
|
259
280
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CreateDimension",
|
260
281
|
"params": {"qProp": prop}})
|
261
282
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -265,7 +286,7 @@ class EngineAppApi:
|
|
265
286
|
return response['error']
|
266
287
|
|
267
288
|
# DestroyDimension method: Removes a dimension
|
268
|
-
def destroy_dimension(self, doc_handle, dim_id):
|
289
|
+
def destroy_dimension(self, doc_handle: int, dim_id):
|
269
290
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DestroyDimension",
|
270
291
|
"params": {"qId": dim_id}})
|
271
292
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -275,7 +296,7 @@ class EngineAppApi:
|
|
275
296
|
return response["error"]
|
276
297
|
|
277
298
|
# DestroyMeasure method: Removes a measure
|
278
|
-
def destroy_measure(self, doc_handle, measure_id):
|
299
|
+
def destroy_measure(self, doc_handle: int, measure_id):
|
279
300
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DestroyDimension",
|
280
301
|
"params": [{measure_id}]})
|
281
302
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -285,7 +306,7 @@ class EngineAppApi:
|
|
285
306
|
return response['error']
|
286
307
|
|
287
308
|
# DestroyObject method: Removes an app object. The children of the object (if any) are removed as well. # NOQA
|
288
|
-
def destroy_object(self, doc_handle, object_id):
|
309
|
+
def destroy_object(self, doc_handle: int, object_id):
|
289
310
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DestroyObject",
|
290
311
|
"params": [{object_id}]})
|
291
312
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -295,7 +316,7 @@ class EngineAppApi:
|
|
295
316
|
return response['error']
|
296
317
|
|
297
318
|
# DestroySessionObject method: Removes a session object. The children of the object (if any) are removed as well. # NOQA
|
298
|
-
def destroy_session_object(self, doc_handle, object_id):
|
319
|
+
def destroy_session_object(self, doc_handle: int, object_id):
|
299
320
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DestroySessionObject",
|
300
321
|
"params": [{object_id}]})
|
301
322
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -305,7 +326,7 @@ class EngineAppApi:
|
|
305
326
|
return response['error']
|
306
327
|
|
307
328
|
# DestroySessionVariable method: Removes an transient variable.
|
308
|
-
def destroy_session_variable(self, doc_handle, var_id):
|
329
|
+
def destroy_session_variable(self, doc_handle: int, var_id):
|
309
330
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DestroySessionVariable",
|
310
331
|
"params": [{var_id}]})
|
311
332
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -317,7 +338,7 @@ class EngineAppApi:
|
|
317
338
|
# DestroyVariableById method: Removes a varable..
|
318
339
|
# Script-defined variables cannot be removed using the DestroyVariableById method or the # NOQA
|
319
340
|
# DestroyVariableByName method.
|
320
|
-
def destroy_variable_by_id(self, doc_handle, var_name):
|
341
|
+
def destroy_variable_by_id(self, doc_handle: int, var_name):
|
321
342
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DestroyVariableById",
|
322
343
|
"params": [{var_name}]})
|
323
344
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -331,7 +352,7 @@ class EngineAppApi:
|
|
331
352
|
# can contain the same dimension.
|
332
353
|
# Parameters:
|
333
354
|
# qProp (MANDATORY: send dim_id, dim_title, dim_grouping, dim_field, dim_label, meta_def (optional) # NOQA
|
334
|
-
def create_measure(self, doc_handle, prop):
|
355
|
+
def create_measure(self, doc_handle: int, prop):
|
335
356
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CreateMeasure",
|
336
357
|
"params": {"qProp": prop}})
|
337
358
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -364,9 +385,9 @@ class EngineAppApi:
|
|
364
385
|
# ### Example: The variable x contains the text string Sum(Sales). In a chart, you define the expression $(x)/12. # NOQA
|
365
386
|
# The effect is exactly the same as having the chart expression Sum(Sales)/12. However, if you change the value of the variable x to Sum(Budget), # NOQA
|
366
387
|
# the data in the chart are immediately recalculated with the expression interpreted as Sum(Budget)/12. # NOQA
|
367
|
-
def create_session_variable(self,
|
388
|
+
def create_session_variable(self, app_handle: int, var_id="", var_name="", var_comment="", var_def=""):
|
368
389
|
msg = json.dumps(
|
369
|
-
{"jsonrpc": "2.0", "id": 0, "handle":
|
390
|
+
{"jsonrpc": "2.0", "id": 0, "handle": app_handle,
|
370
391
|
"method": "CreateSessionVariable", "params": [{
|
371
392
|
"qInfo": {
|
372
393
|
"qId": var_id,
|
@@ -393,8 +414,8 @@ class EngineAppApi:
|
|
393
414
|
# The effect is exactly the same as having the chart expression Sum(Sales)/12. # NOQA
|
394
415
|
# However, if you change the value of the variable x to Sum(Budget),
|
395
416
|
# the data in the chart are immediately recalculated with the expression interpreted as Sum(Budget)/12. # NOQA
|
396
|
-
def create_variable(self,
|
397
|
-
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle":
|
417
|
+
def create_variable(self, app_handle: int, var_id="", var_name="", var_comment="", var_def=""):
|
418
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": app_handle,
|
398
419
|
"method": "CreateVariable", "params": [{
|
399
420
|
"qInfo": {
|
400
421
|
"qId": var_id,
|
@@ -435,7 +456,7 @@ class EngineAppApi:
|
|
435
456
|
|
436
457
|
# DoSave method: Saves an app - All objects and data in the data model are saved. # NOQA
|
437
458
|
# Desktop only - server auto saves
|
438
|
-
def do_save(self, doc_handle, file_name=""):
|
459
|
+
def do_save(self, doc_handle: int, file_name=""):
|
439
460
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "DoSave",
|
440
461
|
"params": {"qFileName": file_name}})
|
441
462
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -446,8 +467,8 @@ class EngineAppApi:
|
|
446
467
|
|
447
468
|
# Evaluate method: Evaluates an expression as a string. (Actually uses EvaluateEx, which is better for giving the data type back to python) # NOQA
|
448
469
|
# Parameters: qExpression
|
449
|
-
def expr_eval(self,
|
450
|
-
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle":
|
470
|
+
def expr_eval(self, app_handle: int, expr):
|
471
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": app_handle, "method": "EvaluateEx",
|
451
472
|
"params": {"qExpression": expr}})
|
452
473
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
453
474
|
try:
|
@@ -456,8 +477,8 @@ class EngineAppApi:
|
|
456
477
|
return response['error']
|
457
478
|
|
458
479
|
# GetAllInfos method: Get the identifier and the type of any generic object in an app by using the GetAllInfos method. # NOQA
|
459
|
-
def get_all_infos(self,
|
460
|
-
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle":
|
480
|
+
def get_all_infos(self, app_handle: int):
|
481
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": app_handle, "method": "GetAllInfos", "params": []})
|
461
482
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
462
483
|
try:
|
463
484
|
return response['result']['qInfos']
|
@@ -465,7 +486,7 @@ class EngineAppApi:
|
|
465
486
|
return response['error']
|
466
487
|
|
467
488
|
# GetAppProperties method: Gets the properties of an app.
|
468
|
-
def get_app_properties(self, doc_handle):
|
489
|
+
def get_app_properties(self, doc_handle: int):
|
469
490
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetAppProperties", "params": []})
|
470
491
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
471
492
|
try:
|
@@ -475,7 +496,7 @@ class EngineAppApi:
|
|
475
496
|
|
476
497
|
# GetConnection method: Retrieves a connection and returns: The creation time of the connection, The identifier of # NOQA
|
477
498
|
# the connection, The type of the connection, The name of the connection, The connection string # NOQA
|
478
|
-
def get_connection(self, doc_handle, connection_id):
|
499
|
+
def get_connection(self, doc_handle: int, connection_id):
|
479
500
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetConnection",
|
480
501
|
"params": [connection_id]})
|
481
502
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -485,7 +506,7 @@ class EngineAppApi:
|
|
485
506
|
return response['error']
|
486
507
|
|
487
508
|
# GetConnections method: Lists the connections in an app
|
488
|
-
def get_connections(self, doc_handle):
|
509
|
+
def get_connections(self, doc_handle: int):
|
489
510
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetConnections", "params": []})
|
490
511
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
491
512
|
try:
|
@@ -494,7 +515,7 @@ class EngineAppApi:
|
|
494
515
|
return response['error']
|
495
516
|
|
496
517
|
# GetDatabaseInfo: Get information about an ODBC, OLEDB or CUSTOM connection # NOQA
|
497
|
-
def get_db_info(self, doc_handle, connection_id):
|
518
|
+
def get_db_info(self, doc_handle: int, connection_id):
|
498
519
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetDatabaseInfo",
|
499
520
|
"params": [connection_id]})
|
500
521
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -504,7 +525,7 @@ class EngineAppApi:
|
|
504
525
|
return response['error']
|
505
526
|
|
506
527
|
# GetDatabaseOwners: List the owners of a database for a ODBC, OLEDB or CUSTOM connection # NOQA
|
507
|
-
def get_db_owners(self, doc_handle, connection_id):
|
528
|
+
def get_db_owners(self, doc_handle: int, connection_id):
|
508
529
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetDatabaseOwners",
|
509
530
|
"params": [connection_id]})
|
510
531
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -514,7 +535,7 @@ class EngineAppApi:
|
|
514
535
|
return response['error']
|
515
536
|
|
516
537
|
# GetDatabases: List the databases of a ODBC, OLEDB or CUSTOM connection
|
517
|
-
def get_databases(self, doc_handle, connection_id):
|
538
|
+
def get_databases(self, doc_handle: int, connection_id):
|
518
539
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetDatabases",
|
519
540
|
"params": [connection_id]})
|
520
541
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -525,7 +546,7 @@ class EngineAppApi:
|
|
525
546
|
|
526
547
|
# GetDatabaseTableFields: List the fields in a table for a ODBC, OLEDB or CUSTOM connection # NOQA
|
527
548
|
# Parameters taken are: connection_id (mandatory), db_name, db_owner, table_name (mandatory) # NOQA
|
528
|
-
def get_db_table_fields(self, doc_handle, connection_id, db_name="", db_owner="", table_name=""):
|
549
|
+
def get_db_table_fields(self, doc_handle: int, connection_id, db_name="", db_owner="", table_name=""):
|
529
550
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetDatabaseTableFields",
|
530
551
|
"params": [connection_id, db_name, db_owner, table_name]})
|
531
552
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -536,7 +557,7 @@ class EngineAppApi:
|
|
536
557
|
|
537
558
|
# GetDatabaseTablePreview: Preview the data in the fields in a table for a ODBC, OLEDB or CUSTOM connection # NOQA
|
538
559
|
# Parameters taken are: connection_id (mandatory), db_name, db_owner, table_name (mandatory) # NOQA
|
539
|
-
def get_db_table_preview(self, doc_handle, connection_id, db_name="", db_owner="", table_name=""):
|
560
|
+
def get_db_table_preview(self, doc_handle: int, connection_id, db_name="", db_owner="", table_name=""):
|
540
561
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetDatabaseTablePreview",
|
541
562
|
"params": [connection_id, db_name, db_owner, table_name]})
|
542
563
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -547,7 +568,7 @@ class EngineAppApi:
|
|
547
568
|
|
548
569
|
# GetDatabaseTables: List the tables in a database for a specific owner and for a ODBC, OLEDB or CUSTOM connection # NOQA
|
549
570
|
# Parameters taken are: connection_id (mandatory), db_name, db_owner
|
550
|
-
def get_db_tables(self, doc_handle, connection_id, db_name="", db_owner=""):
|
571
|
+
def get_db_tables(self, doc_handle: int, connection_id, db_name="", db_owner=""):
|
551
572
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetDatabaseTables",
|
552
573
|
"params": [connection_id, db_name, db_owner]})
|
553
574
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -560,7 +581,7 @@ class EngineAppApi:
|
|
560
581
|
# GetEmptyScript: Creates a script that contains one section. This section contains Set statements that give # NOQA
|
561
582
|
# localized information from the regional settings of the computer.
|
562
583
|
# Parameter: none
|
563
|
-
def get_empty_script(self, doc_handle):
|
584
|
+
def get_empty_script(self, doc_handle: int):
|
564
585
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetEmptyScript", "params": []})
|
565
586
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
566
587
|
try:
|
@@ -570,7 +591,7 @@ class EngineAppApi:
|
|
570
591
|
|
571
592
|
# GetFieldDescription: Get the description of a field
|
572
593
|
# Parameter: field name
|
573
|
-
def get_field_descr(self, doc_handle, field_name):
|
594
|
+
def get_field_descr(self, doc_handle: int, field_name):
|
574
595
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetFieldDescription",
|
575
596
|
"params": {"qFieldName": field_name}})
|
576
597
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -585,7 +606,7 @@ class EngineAppApi:
|
|
585
606
|
# qRelativePath: Path of the connection file
|
586
607
|
# qDataFormat: Type of the file
|
587
608
|
# qTable (MOSTLY MANDATORY): Name of the table ***This parameter must be set for XLS, XLSX, HTML and XML files.*** # NOQA
|
588
|
-
def get_file_table_fields(self, doc_handle, connection_id,
|
609
|
+
def get_file_table_fields(self, doc_handle: int, connection_id,
|
589
610
|
rel_path="", data_fmt="", table_name=""):
|
590
611
|
msg = json.dumps(
|
591
612
|
{"jsonrpc": "2.0", "id": 0, "handle": doc_handle,
|
@@ -605,7 +626,7 @@ class EngineAppApi:
|
|
605
626
|
# qRelativePath: Path of the connection file
|
606
627
|
# qDataFormat: Type of the file
|
607
628
|
# qTable (MOSTLY MANDATORY): Name of the table ***This parameter must be set for XLS, XLSX, HTML and XML files.*** # NOQA
|
608
|
-
def get_file_table_preview(self, doc_handle, connection_id, rel_path="", data_fmt="", table_name=""):
|
629
|
+
def get_file_table_preview(self, doc_handle: int, connection_id, rel_path="", data_fmt="", table_name=""):
|
609
630
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetFileTablePreview",
|
610
631
|
"params": [connection_id, rel_path, {"qType": data_fmt}, table_name]})
|
611
632
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -620,7 +641,7 @@ class EngineAppApi:
|
|
620
641
|
# qRelativePath: Path of the connection file
|
621
642
|
# qDataFormat: Type of the file (XML, JSON)
|
622
643
|
# qTable (MOSTLY MANDATORY): Name of the table ***This parameter must be set for XLS, XLSX, HTML and XML files.*** # NOQA
|
623
|
-
def get_file_table_ex(self, doc_handle, connection_id,
|
644
|
+
def get_file_table_ex(self, doc_handle: int, connection_id,
|
624
645
|
rel_path="", data_fmt=""):
|
625
646
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetFileTablesEx",
|
626
647
|
"params": [connection_id, rel_path, {"qType": data_fmt}]})
|
@@ -635,7 +656,7 @@ class EngineAppApi:
|
|
635
656
|
# qConnectionId (MANDATORY): Identifier of the connection.
|
636
657
|
# qRelativePath: Path of the connection file
|
637
658
|
# qDataFormat: Type of the file (XML, JSON)
|
638
|
-
def get_file_tables(self, doc_handle, connection_id, rel_path="", data_fmt=""):
|
659
|
+
def get_file_tables(self, doc_handle: int, connection_id, rel_path="", data_fmt=""):
|
639
660
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetFileTables",
|
640
661
|
"params": [connection_id, rel_path, {"qType": data_fmt}]})
|
641
662
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -646,7 +667,7 @@ class EngineAppApi:
|
|
646
667
|
|
647
668
|
# GetFolderItemsForConnection method: List the items for a folder connection # NOQA
|
648
669
|
# Parameter: connection_id
|
649
|
-
def get_folder_items_for_connection(self, doc_handle, connection_id):
|
670
|
+
def get_folder_items_for_connection(self, doc_handle: int, connection_id):
|
650
671
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetFolderItemsForConnection",
|
651
672
|
"params": [connection_id]})
|
652
673
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -656,7 +677,7 @@ class EngineAppApi:
|
|
656
677
|
return response['error']
|
657
678
|
|
658
679
|
# GetAllInfos method: Get the identifier and the type of any generic object in an app by using the GetAllInfos method. # NOQA
|
659
|
-
def get_lineage(self, doc_handle):
|
680
|
+
def get_lineage(self, doc_handle: int):
|
660
681
|
"""
|
661
682
|
Gets the lineage information of the app. The lineage information includes the LOAD and STORE statements from
|
662
683
|
the data load script associated with this app.
|
@@ -674,7 +695,7 @@ class EngineAppApi:
|
|
674
695
|
except KeyError:
|
675
696
|
return response['error']
|
676
697
|
|
677
|
-
def create_session_object(self, doc_handle, prop):
|
698
|
+
def create_session_object(self, doc_handle: int, prop):
|
678
699
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CreateSessionObject",
|
679
700
|
"params": {"qProp": prop}})
|
680
701
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -683,7 +704,7 @@ class EngineAppApi:
|
|
683
704
|
except KeyError:
|
684
705
|
return response['error']
|
685
706
|
|
686
|
-
def get_set_analysis(self, doc_handle, state_name="", bookmark_id=""):
|
707
|
+
def get_set_analysis(self, doc_handle: int, state_name="", bookmark_id=""):
|
687
708
|
msg = json.dumps({"jsonrpc": "2.0", "id": 3, "handle": doc_handle, "method": "GetSetAnalysis",
|
688
709
|
"params": {"qStateName": state_name, "qBookmarkId": bookmark_id}})
|
689
710
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
@@ -701,7 +722,7 @@ class EngineAppApi:
|
|
701
722
|
except KeyError:
|
702
723
|
return response['error']
|
703
724
|
|
704
|
-
def get_variable_by_id(self, doc_handle, variable_id):
|
725
|
+
def get_variable_by_id(self, doc_handle: int, variable_id):
|
705
726
|
"""
|
706
727
|
Gets the handle of a variable.
|
707
728
|
|
@@ -715,6 +736,66 @@ class EngineAppApi:
|
|
715
736
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetVariableById",
|
716
737
|
"params": {"qId": variable_id}})
|
717
738
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
739
|
+
try:
|
740
|
+
return response['result']['qReturn']
|
741
|
+
except KeyError:
|
742
|
+
return response['error']
|
743
|
+
|
744
|
+
|
745
|
+
def create_bookmark(self, doc_handle: int, prop: dict):
|
746
|
+
"""
|
747
|
+
Creates a bookmark.
|
748
|
+
|
749
|
+
Parameters:
|
750
|
+
doc_handle (int): The handle identifying the document.
|
751
|
+
prop (dict): Bookmark properties.
|
752
|
+
|
753
|
+
Returns:
|
754
|
+
dict: The handle of the generic bookmark.
|
755
|
+
"""
|
756
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "CreateBookmark",
|
757
|
+
"params": {"qProp": prop}})
|
758
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
759
|
+
try:
|
760
|
+
return response['result']['qReturn']
|
761
|
+
except KeyError:
|
762
|
+
return response['error']
|
763
|
+
|
764
|
+
|
765
|
+
def get_bookmarks(self, doc_handle: int, options: dict):
|
766
|
+
"""
|
767
|
+
Returns all bookmarks compatible with options.
|
768
|
+
|
769
|
+
Parameters:
|
770
|
+
doc_handle (int): The handle identifying the document.
|
771
|
+
qOptions (dict): Bookmark type filter and requested properties.
|
772
|
+
|
773
|
+
Returns:
|
774
|
+
list: The resulting list.
|
775
|
+
"""
|
776
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": doc_handle, "method": "GetBookmarks",
|
777
|
+
"params": {"qOptions": options}})
|
778
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
779
|
+
try:
|
780
|
+
return response['result']
|
781
|
+
except KeyError:
|
782
|
+
return response['error']
|
783
|
+
|
784
|
+
|
785
|
+
def get_bookmark(self, app_handle: int, bookmark_id: str):
|
786
|
+
"""
|
787
|
+
Retrieves a specific bookmark from the app identified by the document handle.
|
788
|
+
|
789
|
+
Parameters:
|
790
|
+
app_handle (int): The handle identifying the app document.
|
791
|
+
bookmark_id (str): The ID of the bookmark to retrieve.
|
792
|
+
|
793
|
+
Returns:
|
794
|
+
dict: The retrieved object (qReturn). In case of an error, returns the error information.
|
795
|
+
"""
|
796
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": app_handle, "method": "GetBookmark",
|
797
|
+
"params": {"qId": bookmark_id}})
|
798
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
718
799
|
try:
|
719
800
|
return response['result']['qReturn']
|
720
801
|
except KeyError:
|
{qe_api_client-2.8.0 → qe_api_client-3.0.0}/qe_api_client/api_classes/engine_generic_object_api.py
RENAMED
@@ -124,7 +124,7 @@ class EngineGenericObjectApi:
|
|
124
124
|
except KeyError:
|
125
125
|
return response["error"]
|
126
126
|
|
127
|
-
def get_hypercube_data(self, handle, path
|
127
|
+
def get_hypercube_data(self, handle: int, path: str, pages: list):
|
128
128
|
"""
|
129
129
|
Retrieves the data from a specific hypercube in a generic object.
|
130
130
|
|
@@ -137,14 +137,14 @@ class EngineGenericObjectApi:
|
|
137
137
|
dict: The data from the hypercube. In case of an error, returns the error information.
|
138
138
|
"""
|
139
139
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubeData",
|
140
|
-
"params": {"qPath": path, "qPages":
|
140
|
+
"params": {"qPath": path, "qPages": pages}})
|
141
141
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
142
142
|
try:
|
143
143
|
return response["result"]
|
144
144
|
except KeyError:
|
145
145
|
return response["error"]
|
146
146
|
|
147
|
-
def get_hypercube_pivot_data(self, handle, path
|
147
|
+
def get_hypercube_pivot_data(self, handle: int, path: str, pages: list):
|
148
148
|
"""
|
149
149
|
Retrieves the pivot data from a specific hypercube in a generic object.
|
150
150
|
|
@@ -157,14 +157,14 @@ class EngineGenericObjectApi:
|
|
157
157
|
dict: The pivot data from the hypercube. In case of an error, returns the error information.
|
158
158
|
"""
|
159
159
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubePivotData",
|
160
|
-
"params": {"qPath": path, "qPages":
|
160
|
+
"params": {"qPath": path, "qPages": pages}})
|
161
161
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
162
162
|
try:
|
163
163
|
return response["result"]
|
164
164
|
except KeyError:
|
165
165
|
return response["error"]
|
166
166
|
|
167
|
-
def get_hypercube_stack_data(self, handle, path
|
167
|
+
def get_hypercube_stack_data(self, handle: int, path: str, pages: list, max_no_cells: int = 10000):
|
168
168
|
"""
|
169
169
|
Retrieves the values of a stacked pivot table. It is possible to retrieve specific pages of data.
|
170
170
|
|
@@ -179,7 +179,7 @@ class EngineGenericObjectApi:
|
|
179
179
|
dict: The pivot data from the hypercube. In case of an error, returns the error information.
|
180
180
|
"""
|
181
181
|
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetHyperCubeStackData",
|
182
|
-
"params": {"qPath": path, "qPages":
|
182
|
+
"params": {"qPath": path, "qPages": pages, "qMaxNbrCells": max_no_cells}})
|
183
183
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
184
184
|
try:
|
185
185
|
return response["result"]
|
@@ -224,5 +224,44 @@ class EngineGenericObjectApi:
|
|
224
224
|
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
225
225
|
try:
|
226
226
|
return response["result"]["qProp"]
|
227
|
+
except KeyError:
|
228
|
+
return response["error"]
|
229
|
+
|
230
|
+
|
231
|
+
def embed_snapshot_object(self, handle: int, snapshot_id: str):
|
232
|
+
"""
|
233
|
+
Adds a snapshot to a generic object. Only one snapshot can be embedded in a generic object. If you embed a
|
234
|
+
snapshot in an object that already contains a snapshot, the new snapshot overwrites the previous one.
|
235
|
+
|
236
|
+
Parameters:
|
237
|
+
handle (int): The handle identifying the generic object.
|
238
|
+
snapshot_id (str): The id of the snapshot to be embeded.
|
239
|
+
|
240
|
+
Returns:
|
241
|
+
update
|
242
|
+
"""
|
243
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "EmbedSnapshotObject",
|
244
|
+
"params": {"qId": snapshot_id}})
|
245
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
246
|
+
try:
|
247
|
+
return response["result"]
|
248
|
+
except KeyError:
|
249
|
+
return response["error"]
|
250
|
+
|
251
|
+
|
252
|
+
def get_parent(self, handle: int):
|
253
|
+
"""
|
254
|
+
Returns the type of the object and the corresponding handle to the parent object in the hiearchy.
|
255
|
+
|
256
|
+
Parameters:
|
257
|
+
handle (int): The handle identifying the generic object.
|
258
|
+
|
259
|
+
Returns:
|
260
|
+
{ "qType": "GenericObject", "qHandle": <handle of the object> }
|
261
|
+
"""
|
262
|
+
msg = json.dumps({"jsonrpc": "2.0", "id": 0, "handle": handle, "method": "GetParent", "params": {}})
|
263
|
+
response = json.loads(self.engine_socket.send_call(self.engine_socket, msg))
|
264
|
+
try:
|
265
|
+
return response["result"]["qReturn"]
|
227
266
|
except KeyError:
|
228
267
|
return response["error"]
|