pyegeria 0.8.4.31__py3-none-any.whl → 0.8.4.32__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.
- commands/cat/list_glossary.py +2 -2
- commands/ops/load_archive.py +5 -2
- pyegeria/asset_catalog_omvs.py +35 -105
- pyegeria/automated_curation_omvs.py +212 -486
- pyegeria/runtime_manager_omvs.py +370 -163
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.32.dist-info}/METADATA +1 -1
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.32.dist-info}/RECORD +10 -10
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.32.dist-info}/LICENSE +0 -0
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.32.dist-info}/WHEEL +0 -0
- {pyegeria-0.8.4.31.dist-info → pyegeria-0.8.4.32.dist-info}/entry_points.txt +0 -0
pyegeria/runtime_manager_omvs.py
CHANGED
@@ -9,7 +9,13 @@ import asyncio
|
|
9
9
|
|
10
10
|
from requests import Response
|
11
11
|
|
12
|
-
from pyegeria import
|
12
|
+
from pyegeria import (
|
13
|
+
Client,
|
14
|
+
max_paging_size,
|
15
|
+
body_slimmer,
|
16
|
+
InvalidParameterException,
|
17
|
+
default_time_out,
|
18
|
+
)
|
13
19
|
|
14
20
|
|
15
21
|
class RuntimeManager(Client):
|
@@ -41,8 +47,10 @@ class RuntimeManager(Client):
|
|
41
47
|
user_id: str,
|
42
48
|
user_pwd: str = None,
|
43
49
|
token: str = None,
|
50
|
+
time_out: int = default_time_out,
|
44
51
|
):
|
45
52
|
self.view_server = view_server
|
53
|
+
self.time_out = time_out
|
46
54
|
Client.__init__(self, view_server, platform_url, user_id, user_pwd, token=token)
|
47
55
|
self.cur_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/runtime-manager"
|
48
56
|
self.platform_guid = "44bf319f-1e41-4da1-b771-2753b92b631a" # this is platform @ 9443 from the core content archive
|
@@ -50,13 +58,60 @@ class RuntimeManager(Client):
|
|
50
58
|
"Default Local OMAG Server Platform" # this from the core content archive
|
51
59
|
)
|
52
60
|
|
61
|
+
async def __async__get_guid__(
|
62
|
+
self, guid: str = None, name: str = None, property_name: str = "name"
|
63
|
+
) -> str:
|
64
|
+
"""Helper function to return a server_guid - one of server_guid or server_name should
|
65
|
+
contain information. If both are None, an exception will be thrown. If both contain
|
66
|
+
values, server_guid will be used. Async version.
|
67
|
+
"""
|
68
|
+
if guid:
|
69
|
+
return guid
|
70
|
+
if name:
|
71
|
+
body = {
|
72
|
+
"class": "NameRequestBody",
|
73
|
+
"name": name,
|
74
|
+
"namePropertyName": property_name,
|
75
|
+
"forLineage": False,
|
76
|
+
"forDuplicateProcessing": False,
|
77
|
+
"effectiveTime": None,
|
78
|
+
}
|
79
|
+
url = (
|
80
|
+
f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
|
81
|
+
f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
|
82
|
+
)
|
83
|
+
|
84
|
+
response: Response = await self._async_make_request(
|
85
|
+
"POST", url, body_slimmer(body), time_out=self.time_out
|
86
|
+
)
|
87
|
+
|
88
|
+
return response.json().get("guid", "No elements found")
|
89
|
+
else:
|
90
|
+
raise InvalidParameterException(
|
91
|
+
"Neither server_guid nor server_name were provided - please provide."
|
92
|
+
)
|
93
|
+
|
94
|
+
def __get_guid__(
|
95
|
+
self, guid: str = None, name: str = None, property_name: str = "name"
|
96
|
+
) -> str:
|
97
|
+
"""Helper function to return a server_guid - one of server_guid or server_name should
|
98
|
+
contain information. If both are None, an exception will be thrown. If both contain
|
99
|
+
values, server_guid will be used.
|
100
|
+
"""
|
101
|
+
loop = asyncio.get_event_loop()
|
102
|
+
result = loop.run_until_complete(
|
103
|
+
self.__async__get_guid__(guid, name, property_name)
|
104
|
+
)
|
105
|
+
return result
|
106
|
+
|
53
107
|
#
|
54
108
|
# Cohorts
|
55
109
|
#
|
56
110
|
async def _async_connect_to_cohort(
|
57
111
|
self,
|
58
|
-
server_guid: str,
|
59
112
|
cohort_name: str,
|
113
|
+
server_guid: str = None,
|
114
|
+
server_name: str = None,
|
60
115
|
) -> None:
|
61
116
|
"""A new server needs to register the metadataCollectionId for its metadata repository with the other servers
|
62
117
|
in the open metadata repository. It only needs to do this once and uses a timestamp to record that the
|
@@ -67,8 +122,10 @@ class RuntimeManager(Client):
|
|
67
122
|
|
68
123
|
Parameters
|
69
124
|
----------
|
70
|
-
server_guid : str
|
71
|
-
Identity of the server to act on.
|
125
|
+
server_guid : str, default = None
|
126
|
+
Identity of the server to act on. If not specified, server_name must be.
|
127
|
+
server_name: str, default = None
|
128
|
+
Name of server to act on. If not specified, server_guid must be.
|
72
129
|
cohort_name : str
|
73
130
|
Name of the cohort to join
|
74
131
|
|
@@ -83,7 +140,7 @@ class RuntimeManager(Client):
|
|
83
140
|
UserNotAuthorizedException
|
84
141
|
|
85
142
|
"""
|
86
|
-
|
143
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
87
144
|
url = (
|
88
145
|
f"{self.cur_command_root}/cohort-members/"
|
89
146
|
f"{server_guid}/cohorts/{cohort_name}/connect"
|
@@ -92,9 +149,7 @@ class RuntimeManager(Client):
|
|
92
149
|
return
|
93
150
|
|
94
151
|
def connect_to_cohort(
|
95
|
-
self,
|
96
|
-
server_guid: str,
|
97
|
-
cohort_name: str,
|
152
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None
|
98
153
|
) -> None:
|
99
154
|
"""A new server needs to register the metadataCollectionId for its metadata repository with the other servers
|
100
155
|
in the open metadata repository. It only needs to do this once and uses a timestamp to record that the
|
@@ -105,8 +160,10 @@ class RuntimeManager(Client):
|
|
105
160
|
|
106
161
|
Parameters
|
107
162
|
----------
|
108
|
-
server_guid: str
|
109
|
-
|
163
|
+
server_guid : str, default = None
|
164
|
+
Identity of the server to act on. If not specified, server_name must be.
|
165
|
+
server_name: str, default = None
|
166
|
+
Name of server to act on. If not specified, server_guid must be.
|
110
167
|
cohort_name: str
|
111
168
|
Name of the cohort to join
|
112
169
|
|
@@ -122,13 +179,13 @@ class RuntimeManager(Client):
|
|
122
179
|
|
123
180
|
"""
|
124
181
|
loop = asyncio.get_event_loop()
|
125
|
-
loop.run_until_complete(
|
182
|
+
loop.run_until_complete(
|
183
|
+
self._async_connect_to_cohort(cohort_name, server_guid, server_name)
|
184
|
+
)
|
126
185
|
return
|
127
186
|
|
128
187
|
async def _async_disconnect_from_cohort(
|
129
|
-
self,
|
130
|
-
server_guid: str,
|
131
|
-
cohort_name: str,
|
188
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None
|
132
189
|
) -> None:
|
133
190
|
"""Disconnect communications from a specific cohort. Async version.
|
134
191
|
|
@@ -136,8 +193,10 @@ class RuntimeManager(Client):
|
|
136
193
|
|
137
194
|
Parameters
|
138
195
|
----------
|
139
|
-
server_guid : str
|
140
|
-
Identity of the server to act on.
|
196
|
+
server_guid : str, default = None
|
197
|
+
Identity of the server to act on. If not specified, server_name must be.
|
198
|
+
server_name: str, default = None
|
199
|
+
Name of server to act on. If not specified, server_guid must be.
|
141
200
|
cohort_name : str
|
142
201
|
Name of the cohort to join
|
143
202
|
|
@@ -152,7 +211,7 @@ class RuntimeManager(Client):
|
|
152
211
|
UserNotAuthorizedException
|
153
212
|
|
154
213
|
"""
|
155
|
-
|
214
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
156
215
|
url = (
|
157
216
|
f"{self.cur_command_root}/cohort-members/"
|
158
217
|
f"{server_guid}/cohorts/{cohort_name}/disconnect"
|
@@ -161,9 +220,7 @@ class RuntimeManager(Client):
|
|
161
220
|
return
|
162
221
|
|
163
222
|
def disconnect_from_cohort(
|
164
|
-
self,
|
165
|
-
server_guid: str,
|
166
|
-
cohort_name: str,
|
223
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None
|
167
224
|
) -> None:
|
168
225
|
"""Disconnect communications from a specific cohort.
|
169
226
|
|
@@ -171,8 +228,10 @@ class RuntimeManager(Client):
|
|
171
228
|
|
172
229
|
Parameters
|
173
230
|
----------
|
174
|
-
server_guid: str
|
175
|
-
|
231
|
+
server_guid : str, default = None
|
232
|
+
Identity of the server to act on. If not specified, server_name must be.
|
233
|
+
server_name: str, default = None
|
234
|
+
Name of server to act on. If not specified, server_guid must be.
|
176
235
|
cohort_name: str
|
177
236
|
Name of the cohort to join
|
178
237
|
|
@@ -189,14 +248,12 @@ class RuntimeManager(Client):
|
|
189
248
|
"""
|
190
249
|
loop = asyncio.get_event_loop()
|
191
250
|
loop.run_until_complete(
|
192
|
-
self._async_disconnect_from_cohort(server_guid,
|
251
|
+
self._async_disconnect_from_cohort(cohort_name, server_guid, server_name)
|
193
252
|
)
|
194
253
|
return
|
195
254
|
|
196
255
|
async def _async_unregister_from_cohort(
|
197
|
-
self,
|
198
|
-
server_guid: str,
|
199
|
-
cohort_name: str,
|
256
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None
|
200
257
|
) -> None:
|
201
258
|
"""Unregister from a specific cohort and disconnect from cohort communications. Async version.
|
202
259
|
|
@@ -204,8 +261,10 @@ class RuntimeManager(Client):
|
|
204
261
|
|
205
262
|
Parameters
|
206
263
|
----------
|
207
|
-
|
208
|
-
Identity of the server to act on.
|
264
|
+
server_guid : str, default = None
|
265
|
+
Identity of the server to act on. If not specified, server_name must be.
|
266
|
+
server_name: str, default = None
|
267
|
+
Name of server to act on. If not specified, server_guid must be.
|
209
268
|
cohort_name : str
|
210
269
|
Name of the cohort to join
|
211
270
|
|
@@ -220,7 +279,7 @@ class RuntimeManager(Client):
|
|
220
279
|
UserNotAuthorizedException
|
221
280
|
|
222
281
|
"""
|
223
|
-
|
282
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
224
283
|
url = (
|
225
284
|
f"{self.cur_command_root}/cohort-members/"
|
226
285
|
f"{server_guid}/cohorts/{cohort_name}/unregister"
|
@@ -229,17 +288,17 @@ class RuntimeManager(Client):
|
|
229
288
|
return
|
230
289
|
|
231
290
|
def unregister_from_cohort(
|
232
|
-
self,
|
233
|
-
server_guid: str,
|
234
|
-
cohort_name: str,
|
291
|
+
self, cohort_name: str, server_guid: str = None, server_name: str = None
|
235
292
|
) -> None:
|
236
293
|
"""Unregister from a specific cohort and disconnect from cohort communications.
|
237
294
|
https://egeria-project.org/concepts/cohort-member/
|
238
295
|
|
239
296
|
Parameters
|
240
297
|
----------
|
241
|
-
server_guid: str
|
242
|
-
|
298
|
+
server_guid : str, default = None
|
299
|
+
Identity of the server to act on. If not specified, server_name must be.
|
300
|
+
server_name: str, default = None
|
301
|
+
Name of server to act on. If not specified, server_guid must be.
|
243
302
|
cohort_name: str
|
244
303
|
Name of the cohort to join
|
245
304
|
|
@@ -256,7 +315,7 @@ class RuntimeManager(Client):
|
|
256
315
|
"""
|
257
316
|
loop = asyncio.get_event_loop()
|
258
317
|
loop.run_until_complete(
|
259
|
-
self._async_disconnect_from_cohort(server_guid,
|
318
|
+
self._async_disconnect_from_cohort(cohort_name, server_guid, server_name)
|
260
319
|
)
|
261
320
|
return
|
262
321
|
|
@@ -266,8 +325,9 @@ class RuntimeManager(Client):
|
|
266
325
|
|
267
326
|
async def _async_refresh_gov_eng_config(
|
268
327
|
self,
|
269
|
-
server_guid: str,
|
270
328
|
gov_engine_name: str = None,
|
329
|
+
server_guid: str = None,
|
330
|
+
server_name: str = None,
|
271
331
|
) -> None:
|
272
332
|
"""Request that the governance engine refresh its configuration by calling the metadata server. This request is
|
273
333
|
useful if the metadata server has an outage, particularly while the governance server is initializing.
|
@@ -277,8 +337,12 @@ class RuntimeManager(Client):
|
|
277
337
|
|
278
338
|
Parameters
|
279
339
|
----------
|
280
|
-
server_guid : str
|
281
|
-
Identity of the server to act on.
|
340
|
+
server_guid : str, default = None
|
341
|
+
Identity of the server to act on. If not specified, server_name must be.
|
342
|
+
server_name: str, default = None
|
343
|
+
Name of server to act on. If not specified, server_guid must be.
|
344
|
+
server_name: str, opt, default is None.
|
345
|
+
Identity of the server to act on. Either the server_guid or server_name must be provided.
|
282
346
|
gov_engine_name : str, Opt
|
283
347
|
Name of the governance engine to refresh. If None, then all governance engines will be refreshed.
|
284
348
|
|
@@ -293,7 +357,7 @@ class RuntimeManager(Client):
|
|
293
357
|
UserNotAuthorizedException
|
294
358
|
|
295
359
|
"""
|
296
|
-
|
360
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
297
361
|
url = (
|
298
362
|
f"{self.cur_command_root}/engine-hosts/"
|
299
363
|
f"{server_guid}/governance_engines/{gov_engine_name}/refresh-config"
|
@@ -303,8 +367,9 @@ class RuntimeManager(Client):
|
|
303
367
|
|
304
368
|
def refresh_gov_eng_config(
|
305
369
|
self,
|
306
|
-
server_guid: str,
|
307
370
|
gov_engine_name: str = None,
|
371
|
+
server_guid: str = None,
|
372
|
+
server_name: str = None,
|
308
373
|
) -> None:
|
309
374
|
"""Request that the governance engine refresh its configuration by calling the metadata server. This request is
|
310
375
|
useful if the metadata server has an outage, particularly while the governance server is initializing.
|
@@ -314,8 +379,10 @@ class RuntimeManager(Client):
|
|
314
379
|
|
315
380
|
Parameters
|
316
381
|
----------
|
317
|
-
server_guid : str
|
318
|
-
Identity of the server to act on.
|
382
|
+
server_guid : str, default = None
|
383
|
+
Identity of the server to act on. If not specified, server_name must be.
|
384
|
+
server_name: str, default = None
|
385
|
+
Name of server to act on. If not specified, server_guid must be.
|
319
386
|
gov_engine_name : str
|
320
387
|
Name of the governance engine to refresh. If None, then all governance engines will be refreshed.
|
321
388
|
|
@@ -332,7 +399,9 @@ class RuntimeManager(Client):
|
|
332
399
|
"""
|
333
400
|
loop = asyncio.get_event_loop()
|
334
401
|
loop.run_until_complete(
|
335
|
-
self._async_refresh_gov_eng_config(
|
402
|
+
self._async_refresh_gov_eng_config(
|
403
|
+
gov_engine_name, server_guid, server_name
|
404
|
+
)
|
336
405
|
)
|
337
406
|
return
|
338
407
|
|
@@ -340,9 +409,7 @@ class RuntimeManager(Client):
|
|
340
409
|
# Integration Connector Methods
|
341
410
|
#
|
342
411
|
async def _async_get_integ_connector_config_properties(
|
343
|
-
self,
|
344
|
-
server_guid: str,
|
345
|
-
connector_name: str,
|
412
|
+
self, connector_name: str, server_guid: str = None, server_name: str = None
|
346
413
|
) -> dict | str:
|
347
414
|
"""Retrieve the configuration properties of the named integration connector running in the integration daemon.
|
348
415
|
Async version.
|
@@ -351,8 +418,10 @@ class RuntimeManager(Client):
|
|
351
418
|
|
352
419
|
Parameters
|
353
420
|
----------
|
354
|
-
server_guid : str
|
355
|
-
Identity of the server to act on.
|
421
|
+
server_guid : str, default = None
|
422
|
+
Identity of the server to act on. If not specified, server_name must be.
|
423
|
+
server_name: str, default = None
|
424
|
+
Name of server to act on. If not specified, server_guid must be.
|
356
425
|
connector_name : str
|
357
426
|
Name of the integration connector to retrieve properties for.
|
358
427
|
|
@@ -367,7 +436,7 @@ class RuntimeManager(Client):
|
|
367
436
|
UserNotAuthorizedException
|
368
437
|
|
369
438
|
"""
|
370
|
-
|
439
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
371
440
|
url = (
|
372
441
|
f"{self.cur_command_root}/integration-daemons/"
|
373
442
|
f"{server_guid}/integration-connectors/{connector_name}/configuration-properties"
|
@@ -376,9 +445,7 @@ class RuntimeManager(Client):
|
|
376
445
|
return response.json().get("properties", "No pproperties found")
|
377
446
|
|
378
447
|
def get_integ_connector_config_properties(
|
379
|
-
self,
|
380
|
-
server_guid: str,
|
381
|
-
connector_name: str,
|
448
|
+
self, connector_name: str, server_guid: str = None, server_name: str = None
|
382
449
|
) -> dict | str:
|
383
450
|
"""Retrieve the configuration properties of the named integration connector running in the integration daemon.
|
384
451
|
Async version.
|
@@ -387,8 +454,10 @@ class RuntimeManager(Client):
|
|
387
454
|
|
388
455
|
Parameters
|
389
456
|
----------
|
390
|
-
server_guid : str
|
391
|
-
Identity of the server to act on.
|
457
|
+
server_guid : str, default = None
|
458
|
+
Identity of the server to act on. If not specified, server_name must be.
|
459
|
+
server_name: str, default = None
|
460
|
+
Name of server to act on. If not specified, server_guid must be.
|
392
461
|
connector_name : str
|
393
462
|
Name of the integration connector to retrieve properties for.
|
394
463
|
Returns
|
@@ -405,15 +474,16 @@ class RuntimeManager(Client):
|
|
405
474
|
loop = asyncio.get_event_loop()
|
406
475
|
response = loop.run_until_complete(
|
407
476
|
self._async_get_integ_connector_config_properties(
|
408
|
-
server_guid,
|
477
|
+
connector_name, server_guid, server_name
|
409
478
|
)
|
410
479
|
)
|
411
480
|
return response
|
412
481
|
|
413
482
|
async def _async_update_connector_connection(
|
414
483
|
self,
|
415
|
-
server_guid: str,
|
416
484
|
connector_name: str,
|
485
|
+
server_guid: str = None,
|
486
|
+
server_name: str = None,
|
417
487
|
merge_update: bool = False,
|
418
488
|
config_properties: dict = None,
|
419
489
|
) -> None:
|
@@ -425,8 +495,10 @@ class RuntimeManager(Client):
|
|
425
495
|
|
426
496
|
Parameters
|
427
497
|
----------
|
428
|
-
server_guid : str
|
429
|
-
Identity of the server to act on.
|
498
|
+
server_guid : str, default = None
|
499
|
+
Identity of the server to act on. If not specified, server_name must be.
|
500
|
+
server_name: str, default = None
|
501
|
+
Name of server to act on. If not specified, server_guid must be.
|
430
502
|
connector_name : str
|
431
503
|
Name of the integration connector to retrieve properties for.
|
432
504
|
merge_update : bool, optional, default = False
|
@@ -446,7 +518,7 @@ class RuntimeManager(Client):
|
|
446
518
|
UserNotAuthorizedException
|
447
519
|
|
448
520
|
"""
|
449
|
-
|
521
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
450
522
|
url = (
|
451
523
|
f"{self.cur_command_root}/integration-daemons/"
|
452
524
|
f"{server_guid}/integration-connectors/{connector_name}/configuration-properties"
|
@@ -463,8 +535,9 @@ class RuntimeManager(Client):
|
|
463
535
|
|
464
536
|
def update_connector_connection(
|
465
537
|
self,
|
466
|
-
server_guid: str,
|
467
538
|
connector_name: str,
|
539
|
+
server_guid: str = None,
|
540
|
+
server_name: str = None,
|
468
541
|
merge_update: bool = False,
|
469
542
|
config_properties: dict = None,
|
470
543
|
) -> None:
|
@@ -475,8 +548,10 @@ class RuntimeManager(Client):
|
|
475
548
|
|
476
549
|
Parameters
|
477
550
|
----------
|
478
|
-
server_guid : str
|
479
|
-
Identity of the server to act on.
|
551
|
+
server_guid : str, default = None
|
552
|
+
Identity of the server to act on. If not specified, server_name must be.
|
553
|
+
server_name: str, default = None
|
554
|
+
Name of server to act on. If not specified, server_guid must be.
|
480
555
|
connector_name : str
|
481
556
|
Name of the integration connector to retrieve properties for.
|
482
557
|
merge_update : bool, optional, default = False
|
@@ -499,13 +574,21 @@ class RuntimeManager(Client):
|
|
499
574
|
loop = asyncio.get_event_loop()
|
500
575
|
loop.run_until_complete(
|
501
576
|
self._async_update_connector_connection(
|
502
|
-
|
577
|
+
connector_name,
|
578
|
+
server_guid,
|
579
|
+
server_name,
|
580
|
+
merge_update,
|
581
|
+
config_properties,
|
503
582
|
)
|
504
583
|
)
|
505
584
|
return
|
506
585
|
|
507
586
|
async def _async_update_endpoint_address(
|
508
|
-
self,
|
587
|
+
self,
|
588
|
+
connector_name: str,
|
589
|
+
endpoint_address: str,
|
590
|
+
server_guid: str = None,
|
591
|
+
server_name: str = None,
|
509
592
|
) -> None:
|
510
593
|
"""Update the endpoint network address for a specific integration connector. Typically used for discovery.
|
511
594
|
This update is in memory and will not persist over a server restart. Async version.
|
@@ -514,8 +597,10 @@ class RuntimeManager(Client):
|
|
514
597
|
|
515
598
|
Parameters
|
516
599
|
----------
|
517
|
-
server_guid : str
|
518
|
-
Identity of the server to act on.
|
600
|
+
server_guid : str, default = None
|
601
|
+
Identity of the server to act on. If not specified, server_name must be.
|
602
|
+
server_name: str, default = None
|
603
|
+
Name of server to act on. If not specified, server_guid must be.
|
519
604
|
connector_name : str
|
520
605
|
Name of the integration connector to retrieve properties for.
|
521
606
|
endpoint_address : str
|
@@ -533,7 +618,7 @@ class RuntimeManager(Client):
|
|
533
618
|
UserNotAuthorizedException
|
534
619
|
|
535
620
|
"""
|
536
|
-
|
621
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
537
622
|
url = (
|
538
623
|
f"{self.cur_command_root}/integration-daemons/"
|
539
624
|
f"{server_guid}/integration-connectors/{connector_name}/endpoint-network-address"
|
@@ -547,7 +632,11 @@ class RuntimeManager(Client):
|
|
547
632
|
return
|
548
633
|
|
549
634
|
def update_endpoint_address(
|
550
|
-
self,
|
635
|
+
self,
|
636
|
+
connector_name: str,
|
637
|
+
endpoint_address: str,
|
638
|
+
server_guid: str = None,
|
639
|
+
server_name: str = None,
|
551
640
|
) -> None:
|
552
641
|
"""Update the endpoint network address for a specific integration connector. Typically used for discovery.
|
553
642
|
This update is in memory and will not persist over a server restart. Async version.
|
@@ -556,8 +645,10 @@ class RuntimeManager(Client):
|
|
556
645
|
|
557
646
|
Parameters
|
558
647
|
----------
|
559
|
-
server_guid : str
|
560
|
-
Identity of the server to act on.
|
648
|
+
server_guid : str, default = None
|
649
|
+
Identity of the server to act on. If not specified, server_name must be.
|
650
|
+
server_name: str, default = None
|
651
|
+
Name of server to act on. If not specified, server_guid must be.
|
561
652
|
connector_name : str
|
562
653
|
Name of the integration connector to retrieve properties for.
|
563
654
|
endpoint_address : str
|
@@ -578,13 +669,16 @@ class RuntimeManager(Client):
|
|
578
669
|
loop = asyncio.get_event_loop()
|
579
670
|
loop.run_until_complete(
|
580
671
|
self._async_update_endpoint_address(
|
581
|
-
|
672
|
+
connector_name, endpoint_address, server_guid, server_name
|
582
673
|
)
|
583
674
|
)
|
584
675
|
return
|
585
676
|
|
586
677
|
async def _async_refresh_integration_connectors(
|
587
|
-
self,
|
678
|
+
self,
|
679
|
+
connector_name: str = None,
|
680
|
+
server_guid: str = None,
|
681
|
+
server_name: str = None,
|
588
682
|
) -> None:
|
589
683
|
"""Issue a refresh() request on all connectors running in the integration daemon, or a specific connector if
|
590
684
|
the connector name is specified. Async version.
|
@@ -593,8 +687,10 @@ class RuntimeManager(Client):
|
|
593
687
|
|
594
688
|
Parameters
|
595
689
|
----------
|
596
|
-
server_guid : str
|
597
|
-
Identity of the server to act on.
|
690
|
+
server_guid : str, default = None
|
691
|
+
Identity of the server to act on. If not specified, server_name must be.
|
692
|
+
server_name: str, default = None
|
693
|
+
Name of server to act on. If not specified, server_guid must be.
|
598
694
|
connector_name : str, opt
|
599
695
|
Name of the integration connector to retrieve properties for. If None, all connectors refreshed.
|
600
696
|
|
@@ -609,7 +705,7 @@ class RuntimeManager(Client):
|
|
609
705
|
UserNotAuthorizedException
|
610
706
|
|
611
707
|
"""
|
612
|
-
|
708
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
613
709
|
url = (
|
614
710
|
f"{self.cur_command_root}/integration-daemons/"
|
615
711
|
f"{server_guid}/integration-connectors/refresh"
|
@@ -623,7 +719,10 @@ class RuntimeManager(Client):
|
|
623
719
|
return
|
624
720
|
|
625
721
|
def refresh_integration_connectors(
|
626
|
-
self,
|
722
|
+
self,
|
723
|
+
connector_name: str = None,
|
724
|
+
server_guid: str = None,
|
725
|
+
server_name: str = None,
|
627
726
|
) -> None:
|
628
727
|
"""Issue a refresh() request on all connectors running in the integration daemon, or a specific connector if
|
629
728
|
the connector name is specified.
|
@@ -632,8 +731,10 @@ class RuntimeManager(Client):
|
|
632
731
|
|
633
732
|
Parameters
|
634
733
|
----------
|
635
|
-
server_guid : str
|
636
|
-
Identity of the server to act on.
|
734
|
+
server_guid : str, default = None
|
735
|
+
Identity of the server to act on. If not specified, server_name must be.
|
736
|
+
server_name: str, default = None
|
737
|
+
Name of server to act on. If not specified, server_guid must be.
|
637
738
|
connector_name : str, opt
|
638
739
|
Name of the integration connector to retrieve properties for. If None, all connectors refreshed.
|
639
740
|
|
@@ -650,12 +751,17 @@ class RuntimeManager(Client):
|
|
650
751
|
"""
|
651
752
|
loop = asyncio.get_event_loop()
|
652
753
|
loop.run_until_complete(
|
653
|
-
self._async_refresh_integration_connectors(
|
754
|
+
self._async_refresh_integration_connectors(
|
755
|
+
connector_name, server_guid, server_name
|
756
|
+
)
|
654
757
|
)
|
655
758
|
return
|
656
759
|
|
657
760
|
async def _async_restart_integration_connectors(
|
658
|
-
self,
|
761
|
+
self,
|
762
|
+
connector_name: str = None,
|
763
|
+
server_guid: str = None,
|
764
|
+
server_name: str = None,
|
659
765
|
) -> None:
|
660
766
|
"""Issue a restart() request on all connectors running in the integration daemon, or a specific connector if
|
661
767
|
the connector name is specified. Async version.
|
@@ -664,8 +770,10 @@ class RuntimeManager(Client):
|
|
664
770
|
|
665
771
|
Parameters
|
666
772
|
----------
|
667
|
-
server_guid : str
|
668
|
-
Identity of the server to act on.
|
773
|
+
server_guid : str, default = None
|
774
|
+
Identity of the server to act on. If not specified, server_name must be.
|
775
|
+
server_name: str, default = None
|
776
|
+
Name of server to act on. If not specified, server_guid must be.
|
669
777
|
connector_name : str, opt
|
670
778
|
Name of the integration connector to retrieve properties for. If None, all connectors restarted.
|
671
779
|
|
@@ -680,7 +788,7 @@ class RuntimeManager(Client):
|
|
680
788
|
UserNotAuthorizedException
|
681
789
|
|
682
790
|
"""
|
683
|
-
|
791
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
684
792
|
url = (
|
685
793
|
f"{self.cur_command_root}/integration-daemons/"
|
686
794
|
f"{server_guid}/integration-connectors/restart"
|
@@ -694,7 +802,10 @@ class RuntimeManager(Client):
|
|
694
802
|
return
|
695
803
|
|
696
804
|
def restart_integration_connectors(
|
697
|
-
self,
|
805
|
+
self,
|
806
|
+
connector_name: str = None,
|
807
|
+
server_guid: str = None,
|
808
|
+
server_name: str = None,
|
698
809
|
) -> None:
|
699
810
|
"""Issue a restart() request on all connectors running in the integration daemon, or a specific connector if
|
700
811
|
the connector name is specified.
|
@@ -703,8 +814,10 @@ class RuntimeManager(Client):
|
|
703
814
|
|
704
815
|
Parameters
|
705
816
|
----------
|
706
|
-
server_guid : str
|
707
|
-
Identity of the server to act on.
|
817
|
+
server_guid : str, default = None
|
818
|
+
Identity of the server to act on. If not specified, server_name must be.
|
819
|
+
server_name: str, default = None
|
820
|
+
Name of server to act on. If not specified, server_guid must be.
|
708
821
|
connector_name : str, opt
|
709
822
|
Name of the integration connector to retrieve properties for. If None, all connectors restarted.
|
710
823
|
|
@@ -721,12 +834,17 @@ class RuntimeManager(Client):
|
|
721
834
|
"""
|
722
835
|
loop = asyncio.get_event_loop()
|
723
836
|
loop.run_until_complete(
|
724
|
-
self._async_restart_integration_connectors(
|
837
|
+
self._async_restart_integration_connectors(
|
838
|
+
connector_name, server_guid, server_name
|
839
|
+
)
|
725
840
|
)
|
726
841
|
return
|
727
842
|
|
728
843
|
async def _async_refresh_integ_group_config(
|
729
|
-
self,
|
844
|
+
self,
|
845
|
+
integ_group_name: str = None,
|
846
|
+
server_guid: str = None,
|
847
|
+
server_name: str = None,
|
730
848
|
) -> None:
|
731
849
|
"""Request that the integration group refresh its configuration by calling the metadata access server.
|
732
850
|
Changes to the connector configuration will result in the affected connectors being restarted.
|
@@ -737,8 +855,10 @@ class RuntimeManager(Client):
|
|
737
855
|
|
738
856
|
Parameters
|
739
857
|
----------
|
740
|
-
server_guid : str
|
741
|
-
Identity of the server to act on.
|
858
|
+
server_guid : str, default = None
|
859
|
+
Identity of the server to act on. If not specified, server_name must be.
|
860
|
+
server_name: str, default = None
|
861
|
+
Name of server to act on. If not specified, server_guid must be.
|
742
862
|
integ_group_name : str, opt, default = None
|
743
863
|
Name of the integration group to refresh. If None, all groups are refreshed.
|
744
864
|
|
@@ -753,7 +873,7 @@ class RuntimeManager(Client):
|
|
753
873
|
UserNotAuthorizedException
|
754
874
|
|
755
875
|
"""
|
756
|
-
|
876
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
757
877
|
url = (
|
758
878
|
f"{self.cur_command_root}/integration-daemons/"
|
759
879
|
f"{server_guid}/integration-groups/{integ_group_name}/refresh-config"
|
@@ -763,7 +883,10 @@ class RuntimeManager(Client):
|
|
763
883
|
return
|
764
884
|
|
765
885
|
def refresh_integ_group_config(
|
766
|
-
self,
|
886
|
+
self,
|
887
|
+
integ_group_name: str = None,
|
888
|
+
server_guid: str = None,
|
889
|
+
server_name: str = None,
|
767
890
|
) -> None:
|
768
891
|
"""Request that the integration group refresh its configuration by calling the metadata access server.
|
769
892
|
Changes to the connector configuration will result in the affected connectors being restarted.
|
@@ -774,8 +897,10 @@ class RuntimeManager(Client):
|
|
774
897
|
|
775
898
|
Parameters
|
776
899
|
----------
|
777
|
-
server_guid : str
|
778
|
-
Identity of the server to act on.
|
900
|
+
server_guid : str, default = None
|
901
|
+
Identity of the server to act on. If not specified, server_name must be.
|
902
|
+
server_name: str, default = None
|
903
|
+
Name of server to act on. If not specified, server_guid must be.
|
779
904
|
integ_group_name : str, opt, default = None
|
780
905
|
Name of the integration group to refresh. If None, all groups are refreshed.
|
781
906
|
|
@@ -792,7 +917,9 @@ class RuntimeManager(Client):
|
|
792
917
|
"""
|
793
918
|
loop = asyncio.get_event_loop()
|
794
919
|
loop.run_until_complete(
|
795
|
-
self._async_refresh_integ_group_config(
|
920
|
+
self._async_refresh_integ_group_config(
|
921
|
+
integ_group_name, server_guid, server_name
|
922
|
+
)
|
796
923
|
)
|
797
924
|
return
|
798
925
|
|
@@ -800,7 +927,10 @@ class RuntimeManager(Client):
|
|
800
927
|
# Open Lineage & Archives
|
801
928
|
#
|
802
929
|
async def _async_publish_open_lineage_event(
|
803
|
-
self,
|
930
|
+
self,
|
931
|
+
ol_event: dict,
|
932
|
+
server_guid: str = None,
|
933
|
+
server_name: str = None,
|
804
934
|
) -> None:
|
805
935
|
"""Send an Open Lineage event to the integration daemon. It will pass it on to the integration connectors that
|
806
936
|
have registered a listener for open lineage events. Async version.
|
@@ -809,8 +939,10 @@ class RuntimeManager(Client):
|
|
809
939
|
|
810
940
|
Parameters
|
811
941
|
----------
|
812
|
-
server_guid : str
|
813
|
-
Identity of the server to act on.
|
942
|
+
server_guid : str, default = None
|
943
|
+
Identity of the server to act on. If not specified, server_name must be.
|
944
|
+
server_name: str, default = None
|
945
|
+
Name of server to act on. If not specified, server_guid must be.
|
814
946
|
ol_event : dict
|
815
947
|
Dict containing the user specified Open Lineage event.
|
816
948
|
|
@@ -825,7 +957,7 @@ class RuntimeManager(Client):
|
|
825
957
|
UserNotAuthorizedException
|
826
958
|
|
827
959
|
"""
|
828
|
-
|
960
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
829
961
|
url = (
|
830
962
|
f"{self.cur_command_root}/integration-daemons/"
|
831
963
|
f"{server_guid}/integration-daemons/{server_guid}/open-lineage-events/publish"
|
@@ -834,7 +966,12 @@ class RuntimeManager(Client):
|
|
834
966
|
await self._async_make_request("POST", url, ol_event)
|
835
967
|
return
|
836
968
|
|
837
|
-
def publish_open_lineage_event(
|
969
|
+
def publish_open_lineage_event(
|
970
|
+
self,
|
971
|
+
ol_event: dict,
|
972
|
+
server_guid: str = None,
|
973
|
+
server_name: str = None,
|
974
|
+
) -> None:
|
838
975
|
"""Send an Open Lineage event to the integration daemon. It will pass it on to the integration connectors that
|
839
976
|
have registered a listener for open lineage events.
|
840
977
|
|
@@ -842,8 +979,10 @@ class RuntimeManager(Client):
|
|
842
979
|
|
843
980
|
Parameters
|
844
981
|
----------
|
845
|
-
server_guid : str
|
846
|
-
Identity of the server to act on.
|
982
|
+
server_guid : str, default = None
|
983
|
+
Identity of the server to act on. If not specified, server_name must be.
|
984
|
+
server_name: str, default = None
|
985
|
+
Name of server to act on. If not specified, server_guid must be.
|
847
986
|
ol_event : dict
|
848
987
|
Dict containing the user specified Open Lineage event.
|
849
988
|
|
@@ -860,12 +999,16 @@ class RuntimeManager(Client):
|
|
860
999
|
"""
|
861
1000
|
loop = asyncio.get_event_loop()
|
862
1001
|
loop.run_until_complete(
|
863
|
-
self._async_publish_open_lineage_event(server_guid,
|
1002
|
+
self._async_publish_open_lineage_event(ol_event, server_guid, server_name)
|
864
1003
|
)
|
865
1004
|
return
|
866
1005
|
|
867
1006
|
async def _async_add_archive_content(
|
868
|
-
self,
|
1007
|
+
self,
|
1008
|
+
archive_content: dict,
|
1009
|
+
server_guid: str = None,
|
1010
|
+
server_name: str = None,
|
1011
|
+
time_out: int = 60,
|
869
1012
|
) -> None:
|
870
1013
|
"""An open metadata archive contains metadata types and instances.
|
871
1014
|
This operation loads the supplied open metadata archive into the local repository. It can be used with OMAG
|
@@ -875,8 +1018,10 @@ class RuntimeManager(Client):
|
|
875
1018
|
|
876
1019
|
Parameters
|
877
1020
|
----------
|
878
|
-
server_guid : str
|
879
|
-
Identity of the server to act on.
|
1021
|
+
server_guid : str, default = None
|
1022
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1023
|
+
server_name: str, default = None
|
1024
|
+
Name of server to act on. If not specified, server_guid must be.
|
880
1025
|
archive_content : dict
|
881
1026
|
A dict containing the content of the archive to load.
|
882
1027
|
time_out : int, optional, default = 60 seconds
|
@@ -893,7 +1038,7 @@ class RuntimeManager(Client):
|
|
893
1038
|
UserNotAuthorizedException
|
894
1039
|
|
895
1040
|
"""
|
896
|
-
|
1041
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
897
1042
|
url = (
|
898
1043
|
f"{self.cur_command_root}/metadata-access-stores/{server_guid}/instance/load/open-metadata-archives/"
|
899
1044
|
f"archive-content"
|
@@ -903,7 +1048,11 @@ class RuntimeManager(Client):
|
|
903
1048
|
return
|
904
1049
|
|
905
1050
|
def add_archive_content(
|
906
|
-
self,
|
1051
|
+
self,
|
1052
|
+
archive_content: dict,
|
1053
|
+
server_guid: str = None,
|
1054
|
+
server_name: str = None,
|
1055
|
+
time_out: int = 60,
|
907
1056
|
) -> None:
|
908
1057
|
"""An open metadata archive contains metadata types and instances.
|
909
1058
|
This operation loads the supplied open metadata archive into the local repository. It can be used with OMAG
|
@@ -913,10 +1062,13 @@ class RuntimeManager(Client):
|
|
913
1062
|
|
914
1063
|
Parameters
|
915
1064
|
----------
|
916
|
-
server_guid : str
|
917
|
-
Identity of the server to act on.
|
918
1065
|
archive_content : dict
|
919
1066
|
A dict containing the content of the archive to load.
|
1067
|
+
server_guid : str, default = None
|
1068
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1069
|
+
server_name: str, default = None
|
1070
|
+
Name of server to act on. If not specified, server_guid must be.
|
1071
|
+
|
920
1072
|
time_out : int, optional, default = 60 seconds
|
921
1073
|
Timeout for the REST call.
|
922
1074
|
|
@@ -934,7 +1086,7 @@ class RuntimeManager(Client):
|
|
934
1086
|
loop = asyncio.get_event_loop()
|
935
1087
|
loop.run_until_complete(
|
936
1088
|
self._async_add_archive_content(
|
937
|
-
server_guid,
|
1089
|
+
archive_content, server_guid, server_name, time_out=time_out
|
938
1090
|
)
|
939
1091
|
)
|
940
1092
|
return
|
@@ -942,7 +1094,8 @@ class RuntimeManager(Client):
|
|
942
1094
|
async def _async_add_archive_file(
|
943
1095
|
self,
|
944
1096
|
archive_file: str,
|
945
|
-
server_guid: str,
|
1097
|
+
server_guid: str = None,
|
1098
|
+
server_name: str = None,
|
946
1099
|
time_out: int = 60,
|
947
1100
|
) -> None:
|
948
1101
|
"""Add a new open metadata archive to running OMAG Server's repository.
|
@@ -956,8 +1109,10 @@ class RuntimeManager(Client):
|
|
956
1109
|
----------
|
957
1110
|
archive_file: str
|
958
1111
|
Open metadata archive file to load.
|
959
|
-
server_guid: str
|
960
|
-
|
1112
|
+
server_guid : str, default = None
|
1113
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1114
|
+
server_name: str, default = None
|
1115
|
+
Name of server to act on. If not specified, server_guid must be.
|
961
1116
|
time_out: int, optional
|
962
1117
|
Time out for the rest call.
|
963
1118
|
|
@@ -973,7 +1128,7 @@ class RuntimeManager(Client):
|
|
973
1128
|
UserNotAuthorizedException
|
974
1129
|
|
975
1130
|
"""
|
976
|
-
|
1131
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
977
1132
|
url = f"{self.cur_command_root}/metadata-access-stores/{server_guid}/instance/load/open-metadata-archives/file"
|
978
1133
|
|
979
1134
|
await self._async_make_request(
|
@@ -984,7 +1139,8 @@ class RuntimeManager(Client):
|
|
984
1139
|
def add_archive_file(
|
985
1140
|
self,
|
986
1141
|
archive_file: str,
|
987
|
-
server_guid: str,
|
1142
|
+
server_guid: str = None,
|
1143
|
+
server_name: str = None,
|
988
1144
|
time_out: int = 60,
|
989
1145
|
) -> None:
|
990
1146
|
"""Add a new open metadata archive to running OMAG Server's repository.
|
@@ -997,8 +1153,10 @@ class RuntimeManager(Client):
|
|
997
1153
|
----------
|
998
1154
|
archive_file: str
|
999
1155
|
Open metadata archive file to load.
|
1000
|
-
server_guid: str
|
1001
|
-
|
1156
|
+
server_guid : str, default = None
|
1157
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1158
|
+
server_name: str, default = None
|
1159
|
+
Name of server to act on. If not specified, server_guid must be.
|
1002
1160
|
time_out: int, optional, default = 60 seconds
|
1003
1161
|
|
1004
1162
|
Returns
|
@@ -1016,21 +1174,27 @@ class RuntimeManager(Client):
|
|
1016
1174
|
|
1017
1175
|
loop = asyncio.get_event_loop()
|
1018
1176
|
loop.run_until_complete(
|
1019
|
-
self._async_add_archive_file(
|
1177
|
+
self._async_add_archive_file(
|
1178
|
+
archive_file, server_guid, server_name, time_out
|
1179
|
+
)
|
1020
1180
|
)
|
1021
1181
|
return
|
1022
1182
|
|
1023
1183
|
#
|
1024
1184
|
# Server & Platform admin
|
1025
1185
|
#
|
1026
|
-
async def _async_shutdown_and_unregister_server(
|
1186
|
+
async def _async_shutdown_and_unregister_server(
|
1187
|
+
self, server_guid: str = None, server_name: str = None
|
1188
|
+
) -> None:
|
1027
1189
|
"""Shutdown the named OMAG server. The server will also be removed from any open metadata repository cohorts
|
1028
1190
|
it has registered with. Async version.
|
1029
1191
|
|
1030
1192
|
Parameters
|
1031
1193
|
----------
|
1032
|
-
server_guid : str
|
1033
|
-
Identity of the server to act on.
|
1194
|
+
server_guid : str, default = None
|
1195
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1196
|
+
server_name: str, default = None
|
1197
|
+
Name of server to act on. If not specified, server_guid must be.
|
1034
1198
|
|
1035
1199
|
Returns
|
1036
1200
|
-------
|
@@ -1044,21 +1208,25 @@ class RuntimeManager(Client):
|
|
1044
1208
|
UserNotAuthorizedException
|
1045
1209
|
|
1046
1210
|
"""
|
1047
|
-
|
1211
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
1048
1212
|
url = f"{self.cur_command_root}/omag-servers/{server_guid}"
|
1049
1213
|
|
1050
1214
|
await self._async_make_request("DELETE", url)
|
1051
1215
|
|
1052
1216
|
return
|
1053
1217
|
|
1054
|
-
def shutdown_and_unregister_server(
|
1218
|
+
def shutdown_and_unregister_server(
|
1219
|
+
self, server_guid: str = None, server_name: str = None
|
1220
|
+
) -> None:
|
1055
1221
|
"""Shutdown the named OMAG server. The server will also be removed from any open metadata repository cohorts
|
1056
1222
|
it has registered with.
|
1057
1223
|
|
1058
1224
|
Parameters
|
1059
1225
|
----------
|
1060
|
-
server_guid : str
|
1061
|
-
Identity of the server to act on.
|
1226
|
+
server_guid : str, default = None
|
1227
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1228
|
+
server_name: str, default = None
|
1229
|
+
Name of server to act on. If not specified, server_guid must be.
|
1062
1230
|
|
1063
1231
|
Returns
|
1064
1232
|
-------
|
@@ -1073,10 +1241,14 @@ class RuntimeManager(Client):
|
|
1073
1241
|
|
1074
1242
|
"""
|
1075
1243
|
loop = asyncio.get_event_loop()
|
1076
|
-
loop.run_until_complete(
|
1244
|
+
loop.run_until_complete(
|
1245
|
+
self._async_shutdown_and_unregister_server(server_guid, server_name)
|
1246
|
+
)
|
1077
1247
|
return
|
1078
1248
|
|
1079
|
-
async def _async_activate_server_with_stored_config(
|
1249
|
+
async def _async_activate_server_with_stored_config(
|
1250
|
+
self, server_guid: str = None, server_name: str = None
|
1251
|
+
) -> None:
|
1080
1252
|
"""Activate the named OMAG server using the appropriate configuration document found in the
|
1081
1253
|
configuration store. Async version.
|
1082
1254
|
|
@@ -1084,8 +1256,10 @@ class RuntimeManager(Client):
|
|
1084
1256
|
|
1085
1257
|
Parameters
|
1086
1258
|
----------
|
1087
|
-
server_guid : str
|
1088
|
-
Identity of the server to act on.
|
1259
|
+
server_guid : str, default = None
|
1260
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1261
|
+
server_name: str, default = None
|
1262
|
+
Name of server to act on. If not specified, server_guid must be.
|
1089
1263
|
|
1090
1264
|
Returns
|
1091
1265
|
-------
|
@@ -1098,13 +1272,15 @@ class RuntimeManager(Client):
|
|
1098
1272
|
UserNotAuthorizedException
|
1099
1273
|
|
1100
1274
|
"""
|
1101
|
-
|
1275
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
1102
1276
|
url = f"{self.cur_command_root}/omag-servers/{server_guid}/instance"
|
1103
1277
|
|
1104
1278
|
await self._async_make_request("POST", url)
|
1105
1279
|
return
|
1106
1280
|
|
1107
|
-
def activate_server_with_stored_config(
|
1281
|
+
def activate_server_with_stored_config(
|
1282
|
+
self, server_guid: str = None, server_name: str = None
|
1283
|
+
) -> None:
|
1108
1284
|
"""Activate the named OMAG server using the appropriate configuration document found in the
|
1109
1285
|
configuration store.
|
1110
1286
|
|
@@ -1112,8 +1288,10 @@ class RuntimeManager(Client):
|
|
1112
1288
|
|
1113
1289
|
Parameters
|
1114
1290
|
----------
|
1115
|
-
server_guid : str
|
1116
|
-
Identity of the server to act on.
|
1291
|
+
server_guid : str, default = None
|
1292
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1293
|
+
server_name: str, default = None
|
1294
|
+
Name of server to act on. If not specified, server_guid must be.
|
1117
1295
|
|
1118
1296
|
Returns
|
1119
1297
|
-------
|
@@ -1128,17 +1306,21 @@ class RuntimeManager(Client):
|
|
1128
1306
|
"""
|
1129
1307
|
loop = asyncio.get_event_loop()
|
1130
1308
|
loop.run_until_complete(
|
1131
|
-
self._async_activate_server_with_stored_config(server_guid)
|
1309
|
+
self._async_activate_server_with_stored_config(server_guid, server_name)
|
1132
1310
|
)
|
1133
1311
|
return
|
1134
1312
|
|
1135
|
-
async def _async_shutdown_server(
|
1313
|
+
async def _async_shutdown_server(
|
1314
|
+
self, server_guid: str = None, server_name: str = None
|
1315
|
+
) -> None:
|
1136
1316
|
"""Temporarily shutdown the named OMAG server. This server can be restarted as a later time. Async version.
|
1137
1317
|
|
1138
1318
|
Parameters
|
1139
1319
|
----------
|
1140
|
-
server_guid : str
|
1141
|
-
Identity of the server to act on.
|
1320
|
+
server_guid : str, default = None
|
1321
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1322
|
+
server_name: str, default = None
|
1323
|
+
Name of server to act on. If not specified, server_guid must be.
|
1142
1324
|
|
1143
1325
|
Returns
|
1144
1326
|
-------
|
@@ -1152,20 +1334,22 @@ class RuntimeManager(Client):
|
|
1152
1334
|
UserNotAuthorizedException
|
1153
1335
|
|
1154
1336
|
"""
|
1155
|
-
|
1337
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
1156
1338
|
url = f"{self.cur_command_root}/omag-servers/{server_guid}/instance"
|
1157
1339
|
|
1158
1340
|
await self._async_make_request("DELETE", url)
|
1159
1341
|
|
1160
1342
|
return
|
1161
1343
|
|
1162
|
-
def shutdown_server(self, server_guid: str) -> None:
|
1344
|
+
def shutdown_server(self, server_guid: str = None, server_name: str = None) -> None:
|
1163
1345
|
"""Temporarily shutdown the named OMAG server. This server can be restarted as a later time.
|
1164
1346
|
|
1165
1347
|
Parameters
|
1166
1348
|
----------
|
1167
|
-
server_guid : str
|
1168
|
-
Identity of the server to act on.
|
1349
|
+
server_guid : str, default = None
|
1350
|
+
Identity of the server to act on. If not specified, server_name must be.
|
1351
|
+
server_name: str, default = None
|
1352
|
+
Name of server to act on. If not specified, server_guid must be.
|
1169
1353
|
|
1170
1354
|
Returns
|
1171
1355
|
-------
|
@@ -1180,7 +1364,7 @@ class RuntimeManager(Client):
|
|
1180
1364
|
|
1181
1365
|
"""
|
1182
1366
|
loop = asyncio.get_event_loop()
|
1183
|
-
loop.run_until_complete(self._async_shutdown_server(server_guid))
|
1367
|
+
loop.run_until_complete(self._async_shutdown_server(server_guid, server_name))
|
1184
1368
|
return
|
1185
1369
|
|
1186
1370
|
def get_platforms_by_name(
|
@@ -1461,13 +1645,17 @@ class RuntimeManager(Client):
|
|
1461
1645
|
)
|
1462
1646
|
return response
|
1463
1647
|
|
1464
|
-
async def _async_get_platform_report(
|
1648
|
+
async def _async_get_platform_report(
|
1649
|
+
self, platform_guid: str = None, platform_name: str = None
|
1650
|
+
) -> str | list:
|
1465
1651
|
"""Returns details about the running platform. Async version.
|
1466
1652
|
|
1467
1653
|
Parameters
|
1468
1654
|
----------
|
1469
1655
|
platform_guid : str
|
1470
|
-
The unique identifier for the platform.
|
1656
|
+
The unique identifier for the platform. If not specified, platform_name must be.
|
1657
|
+
platform_name: str, default = None
|
1658
|
+
Name of server to act on. If not specified, platform_guid must be.
|
1471
1659
|
|
1472
1660
|
Returns
|
1473
1661
|
-------
|
@@ -1481,21 +1669,24 @@ class RuntimeManager(Client):
|
|
1481
1669
|
UserNotAuthorizedException
|
1482
1670
|
|
1483
1671
|
"""
|
1484
|
-
|
1672
|
+
platform_guid = self.__get_guid__(platform_guid, platform_name)
|
1485
1673
|
url = f"{self.cur_command_root}/platforms/{platform_guid}/report"
|
1486
1674
|
|
1487
1675
|
response = await self._async_make_request("GET", url)
|
1488
1676
|
|
1489
1677
|
return response.json().get("element", "No platforms found")
|
1490
1678
|
|
1491
|
-
def get_platform_report(
|
1679
|
+
def get_platform_report(
|
1680
|
+
self, platform_guid: str = None, platform_name: str = None
|
1681
|
+
) -> str | list:
|
1492
1682
|
"""Returns details about the running platform.
|
1493
1683
|
|
1494
1684
|
Parameters
|
1495
1685
|
----------
|
1496
1686
|
platform_guid : str
|
1497
|
-
The unique identifier for the platform.
|
1498
|
-
|
1687
|
+
The unique identifier for the platform. If not specified, platform_name must be.
|
1688
|
+
platform_name: str, default = None
|
1689
|
+
Name of server to act on. If not specified, platform_guid must be.
|
1499
1690
|
Returns
|
1500
1691
|
-------
|
1501
1692
|
Response
|
@@ -1510,7 +1701,7 @@ class RuntimeManager(Client):
|
|
1510
1701
|
"""
|
1511
1702
|
loop = asyncio.get_event_loop()
|
1512
1703
|
response = loop.run_until_complete(
|
1513
|
-
self._async_get_platform_report(platform_guid)
|
1704
|
+
self._async_get_platform_report(platform_guid, platform_name)
|
1514
1705
|
)
|
1515
1706
|
return response
|
1516
1707
|
|
@@ -1580,7 +1771,10 @@ class RuntimeManager(Client):
|
|
1580
1771
|
return response
|
1581
1772
|
|
1582
1773
|
async def _async_get_server_by_guid(
|
1583
|
-
self,
|
1774
|
+
self,
|
1775
|
+
server_guid: str = None,
|
1776
|
+
server_name: str = None,
|
1777
|
+
effective_time: str = None,
|
1584
1778
|
) -> str | dict:
|
1585
1779
|
"""Returns details about the server's catalog entry (asset). Async version.
|
1586
1780
|
|
@@ -1603,7 +1797,7 @@ class RuntimeManager(Client):
|
|
1603
1797
|
UserNotAuthorizedException
|
1604
1798
|
|
1605
1799
|
"""
|
1606
|
-
|
1800
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
1607
1801
|
url = f"{self.cur_command_root}/software-servers/{server_guid}"
|
1608
1802
|
|
1609
1803
|
if effective_time is not None:
|
@@ -1616,7 +1810,10 @@ class RuntimeManager(Client):
|
|
1616
1810
|
return response.json().get("elements", "No server found")
|
1617
1811
|
|
1618
1812
|
def get_server_by_guid(
|
1619
|
-
self,
|
1813
|
+
self,
|
1814
|
+
server_guid: str = None,
|
1815
|
+
server_name: str = None,
|
1816
|
+
effective_time: str = None,
|
1620
1817
|
) -> str | dict:
|
1621
1818
|
"""Returns details about the platform's catalog entry (asset).
|
1622
1819
|
|
@@ -1641,7 +1838,7 @@ class RuntimeManager(Client):
|
|
1641
1838
|
"""
|
1642
1839
|
loop = asyncio.get_event_loop()
|
1643
1840
|
response = loop.run_until_complete(
|
1644
|
-
self._async_get_server_by_guid(server_guid, effective_time)
|
1841
|
+
self._async_get_server_by_guid(server_guid, server_name, effective_time)
|
1645
1842
|
)
|
1646
1843
|
return response
|
1647
1844
|
|
@@ -1690,7 +1887,7 @@ class RuntimeManager(Client):
|
|
1690
1887
|
body = {"filter": filter, "effective_time": effective_time}
|
1691
1888
|
response = await self._async_make_request("POST", url, body)
|
1692
1889
|
|
1693
|
-
return response.json().get("elements", "No
|
1890
|
+
return response.json().get("elements", "No servers found")
|
1694
1891
|
|
1695
1892
|
def get_servers_by_name(
|
1696
1893
|
self, filter: str, effective_time: str = None
|
@@ -1909,13 +2106,17 @@ class RuntimeManager(Client):
|
|
1909
2106
|
)
|
1910
2107
|
return response
|
1911
2108
|
|
1912
|
-
async def _async_get_server_report(
|
2109
|
+
async def _async_get_server_report(
|
2110
|
+
self, server_guid: str = None, server_name: str = None
|
2111
|
+
) -> str | list:
|
1913
2112
|
"""Returns details about the running server. Async version.
|
1914
2113
|
|
1915
2114
|
Parameters
|
1916
2115
|
----------
|
1917
|
-
server_guid: str
|
1918
|
-
Identity of the server to
|
2116
|
+
server_guid : str, default = None
|
2117
|
+
Identity of the server to act on. If not specified, server_name must be.
|
2118
|
+
server_name: str, default = None
|
2119
|
+
Name of server to act on. If not specified, server_guid must be.
|
1919
2120
|
|
1920
2121
|
Returns
|
1921
2122
|
-------
|
@@ -1929,20 +2130,24 @@ class RuntimeManager(Client):
|
|
1929
2130
|
UserNotAuthorizedException
|
1930
2131
|
|
1931
2132
|
"""
|
1932
|
-
|
2133
|
+
server_guid = self.__get_guid__(server_guid, server_name)
|
1933
2134
|
url = f"{self.cur_command_root}/omag-servers/{server_guid}/instance/report"
|
1934
2135
|
|
1935
2136
|
response = await self._async_make_request("GET", url)
|
1936
2137
|
|
1937
2138
|
return response.json().get("element", "No server found")
|
1938
2139
|
|
1939
|
-
def get_server_report(
|
2140
|
+
def get_server_report(
|
2141
|
+
self, server_guid: str = None, server_name: str = None
|
2142
|
+
) -> str | list:
|
1940
2143
|
"""Returns details about the running server.
|
1941
2144
|
|
1942
2145
|
Parameters
|
1943
2146
|
----------
|
1944
|
-
server_guid: str
|
1945
|
-
Identity of the server to
|
2147
|
+
server_guid : str, default = None
|
2148
|
+
Identity of the server to act on. If not specified, server_name must be.
|
2149
|
+
server_name: str, default = None
|
2150
|
+
Name of server to act on. If not specified, server_guid must be.
|
1946
2151
|
|
1947
2152
|
Returns
|
1948
2153
|
-------
|
@@ -1957,7 +2162,9 @@ class RuntimeManager(Client):
|
|
1957
2162
|
|
1958
2163
|
"""
|
1959
2164
|
loop = asyncio.get_event_loop()
|
1960
|
-
response = loop.run_until_complete(
|
2165
|
+
response = loop.run_until_complete(
|
2166
|
+
self._async_get_server_report(server_guid, server_name)
|
2167
|
+
)
|
1961
2168
|
return response
|
1962
2169
|
|
1963
2170
|
|