pyegeria 0.3.9__py3-none-any.whl → 0.4.1__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.
- pyegeria/Xfeedback_manager_omvs.py +2 -15
- pyegeria/__init__.py +11 -4
- pyegeria/_globals.py +3 -1
- pyegeria/{Xasset_catalog_omvs.py → asset_catalog_omvs.py} +242 -109
- pyegeria/automated_curation_omvs.py +324 -61
- pyegeria/core_guids.py +128 -0
- pyegeria/core_omag_server_config.py +1 -1
- pyegeria/{Xglossary_manager_omvs.py → glossary_manager_omvs.py} +70 -69
- pyegeria/runtime_manager_omvs.py +967 -0
- pyegeria/valid_metadata_omvs.py +193 -20
- pyegeria-0.4.1.data/scripts/get_guid_info.py +86 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/get_tech_details.py +1 -37
- pyegeria-0.4.1.data/scripts/get_tech_type_elements.py +137 -0
- pyegeria-0.4.1.data/scripts/get_tech_type_template.py +137 -0
- pyegeria-0.4.1.data/scripts/list_assets.py +138 -0
- pyegeria-0.3.9.data/scripts/project_list_viewer.py → pyegeria-0.4.1.data/scripts/list_projects.py +1 -1
- pyegeria-0.3.9.data/scripts/get_relationship_types.py → pyegeria-0.4.1.data/scripts/list_relationship_types.py +9 -8
- pyegeria-0.4.1.data/scripts/list_tech_templates.py +134 -0
- pyegeria-0.3.9.data/scripts/find_todos.py → pyegeria-0.4.1.data/scripts/list_todos.py +2 -1
- pyegeria-0.4.1.data/scripts/list_valid_metadata_values.py +144 -0
- pyegeria-0.4.1.data/scripts/view_asset_graph.py +245 -0
- pyegeria-0.3.9.data/scripts/coco_status.py → pyegeria-0.4.1.data/scripts/view_coco_status.py +10 -9
- pyegeria-0.3.9.data/scripts/engine_action_status.py → pyegeria-0.4.1.data/scripts/view_eng_action_status.py +8 -3
- pyegeria-0.4.1.data/scripts/view_integ_daemon_status.py +140 -0
- pyegeria-0.4.1.data/scripts/view_platform_status.py +123 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/METADATA +5 -2
- pyegeria-0.4.1.dist-info/RECORD +58 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/WHEEL +1 -1
- pyegeria-0.3.9.data/scripts/integration_daemon_status.py +0 -130
- pyegeria-0.3.9.data/scripts/multi-server_status.py +0 -120
- pyegeria-0.3.9.dist-info/RECORD +0 -49
- /pyegeria/{Xaction_author_omvs.py → action_author_omvs.py} +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/Create_Collection_Sample.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/Create_Sustainability_Collection_Sample.py +0 -0
- /pyegeria-0.3.9.data/scripts/view_my_profile.py → /pyegeria-0.4.1.data/scripts/get_my_profile.py +0 -0
- {pyegeria-0.3.9.data → pyegeria-0.4.1.data}/scripts/list_asset_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_registered_services.py → /pyegeria-0.4.1.data/scripts/list_registered_services.py +0 -0
- /pyegeria-0.3.9.data/scripts/get_tech_types.py → /pyegeria-0.4.1.data/scripts/list_tech_types.py +0 -0
- /pyegeria-0.3.9.data/scripts/collection_viewer.py → /pyegeria-0.4.1.data/scripts/view_collection.py +0 -0
- /pyegeria-0.3.9.data/scripts/glossary_view.py → /pyegeria-0.4.1.data/scripts/view_glossary.py +0 -0
- /pyegeria-0.3.9.data/scripts/gov_engine_status.py → /pyegeria-0.4.1.data/scripts/view_gov_eng_status.py +0 -0
- /pyegeria-0.3.9.data/scripts/my_todos.py → /pyegeria-0.4.1.data/scripts/view_my_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/open_todos.py → /pyegeria-0.4.1.data/scripts/view_open_todos.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status_widget.py → /pyegeria-0.4.1.data/scripts/view_server_list.py +0 -0
- /pyegeria-0.3.9.data/scripts/server_status.py → /pyegeria-0.4.1.data/scripts/view_server_status.py +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/LICENSE +0 -0
- {pyegeria-0.3.9.dist-info → pyegeria-0.4.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,967 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
Runtime manager is a view service that supports user interaction with the running platforms.
|
6
|
+
|
7
|
+
"""
|
8
|
+
import asyncio
|
9
|
+
from requests import Response
|
10
|
+
|
11
|
+
from pyegeria._exceptions import (
|
12
|
+
InvalidParameterException,
|
13
|
+
)
|
14
|
+
from pyegeria import Client, AutomatedCuration, max_paging_size, body_slimmer
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
class RuntimeManager(Client):
|
19
|
+
"""
|
20
|
+
Client to issue Runtime status requests.
|
21
|
+
|
22
|
+
Attributes:
|
23
|
+
|
24
|
+
server_name: str
|
25
|
+
Name of the server to use.
|
26
|
+
platform_url : str
|
27
|
+
URL of the server platform to connect to
|
28
|
+
user_id : str
|
29
|
+
The identity of the user calling the method - this sets a default optionally used by the methods
|
30
|
+
when the user doesn't pass the user_id on a method call.
|
31
|
+
user_pwd: str
|
32
|
+
The password associated with the user_id. Defaults to None
|
33
|
+
verify_flag: bool
|
34
|
+
Flag to indicate if SSL Certificates should be verified in the HTTP requests.
|
35
|
+
Defaults to False.
|
36
|
+
|
37
|
+
Methods:
|
38
|
+
|
39
|
+
"""
|
40
|
+
|
41
|
+
def __init__(
|
42
|
+
self,
|
43
|
+
server_name: str,
|
44
|
+
platform_url: str,
|
45
|
+
user_id: str,
|
46
|
+
user_pwd: str = None,
|
47
|
+
verify_flag: bool = False,
|
48
|
+
):
|
49
|
+
Client.__init__(self, server_name, platform_url, user_id,
|
50
|
+
user_pwd, verify_flag)
|
51
|
+
self.cur_command_root = f"{platform_url}/servers/"
|
52
|
+
self.platform_guid = "44bf319f-1e41-4da1-b771-2753b92b631a" # this is platform @ 9443 from the core content archive
|
53
|
+
self.default_platform_name = "Default Local OMAG Server Platform" # this from the core content archive
|
54
|
+
|
55
|
+
async def _async_get_platforms_by_name(self, filter: str = None, server:str = None, effective_time: str = None,
|
56
|
+
start_from: int = 0, page_size: int = max_paging_size )-> str | list:
|
57
|
+
""" Returns the list of platforms with a particular name. The name is specified in the filter. Async version.
|
58
|
+
Parameters
|
59
|
+
----------
|
60
|
+
filter : str, opt
|
61
|
+
Filter specifies the display name or qualified name of the platforms to return information for. If the
|
62
|
+
value is None, we will default to the default_platform_name that comes from the core content pack.
|
63
|
+
|
64
|
+
server : str, optional
|
65
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
66
|
+
will be used.
|
67
|
+
|
68
|
+
start_from : int, optional
|
69
|
+
The index from which to start fetching the engine actions. Default is 0.
|
70
|
+
|
71
|
+
page_size : int, optional
|
72
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
73
|
+
|
74
|
+
Returns
|
75
|
+
-------
|
76
|
+
Response
|
77
|
+
A lit of json dict with the platform reports.
|
78
|
+
|
79
|
+
Raises
|
80
|
+
------
|
81
|
+
InvalidParameterException
|
82
|
+
PropertyServerException
|
83
|
+
UserNotAuthorizedException
|
84
|
+
|
85
|
+
"""
|
86
|
+
if server is None:
|
87
|
+
server = self.server_name
|
88
|
+
|
89
|
+
if filter is None:
|
90
|
+
filter = self.default_platform_name
|
91
|
+
|
92
|
+
|
93
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/platforms/by-name?"
|
94
|
+
f"startFrom={start_from}&pageSize={page_size}")
|
95
|
+
if effective_time is not None:
|
96
|
+
body = {
|
97
|
+
"filter" : filter,
|
98
|
+
"effectiveTime" : effective_time
|
99
|
+
}
|
100
|
+
else:
|
101
|
+
body = {
|
102
|
+
"filter": filter
|
103
|
+
}
|
104
|
+
|
105
|
+
response = await self._async_make_request("POST", url, body)
|
106
|
+
|
107
|
+
return response.json().get('elementList','No platforms found')
|
108
|
+
|
109
|
+
|
110
|
+
def get_platforms_by_name(self, filter: str = None, server: str = None, effective_time: str = None,
|
111
|
+
start_from: int = 0, page_size: int = max_paging_size) -> str | list:
|
112
|
+
""" Returns the list of platforms with a particular name. The name is specified in the filter.
|
113
|
+
|
114
|
+
Parameters
|
115
|
+
----------
|
116
|
+
filter : str, opt
|
117
|
+
Filter specifies the display name or qualified name of the platforms to return information for. If the
|
118
|
+
value is None, we will default to the default_platform_name that comes from the core content pack.
|
119
|
+
|
120
|
+
server : str, optional
|
121
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
122
|
+
will be used.
|
123
|
+
|
124
|
+
start_from : int, optional
|
125
|
+
The index from which to start fetching the engine actions. Default is 0.
|
126
|
+
|
127
|
+
|
128
|
+
page_size : int, optional
|
129
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
130
|
+
|
131
|
+
Returns
|
132
|
+
-------
|
133
|
+
Response
|
134
|
+
A lit of json dict with the platform reports.
|
135
|
+
|
136
|
+
Raises
|
137
|
+
------
|
138
|
+
InvalidParameterException
|
139
|
+
PropertyServerException
|
140
|
+
UserNotAuthorizedException
|
141
|
+
"""
|
142
|
+
loop = asyncio.get_event_loop()
|
143
|
+
response = loop.run_until_complete(self._async_get_platforms_by_name(filter, server,
|
144
|
+
effective_time,
|
145
|
+
start_from, page_size))
|
146
|
+
return response
|
147
|
+
|
148
|
+
async def _async_get_platforms_by_type(self, filter: str = None, server:str = None, effective_time: str = None,
|
149
|
+
start_from: int = 0, page_size: int = max_paging_size )-> str | list:
|
150
|
+
""" Returns the list of platforms with a particular deployed implementation type. The value is specified in
|
151
|
+
the filter. If it is null, or no request body is supplied, all platforms are returned. Async version.
|
152
|
+
|
153
|
+
Parameters
|
154
|
+
----------
|
155
|
+
filter : str, opt
|
156
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
157
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
158
|
+
|
159
|
+
server : str, optional
|
160
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
161
|
+
will be used.
|
162
|
+
|
163
|
+
start_from : int, optional
|
164
|
+
The index from which to start fetching the engine actions. Default is 0.
|
165
|
+
|
166
|
+
page_size : int, optional
|
167
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
168
|
+
|
169
|
+
Returns
|
170
|
+
-------
|
171
|
+
Response
|
172
|
+
A lit of json dict with the platform reports.
|
173
|
+
|
174
|
+
Raises
|
175
|
+
------
|
176
|
+
InvalidParameterException
|
177
|
+
PropertyServerException
|
178
|
+
UserNotAuthorizedException
|
179
|
+
|
180
|
+
"""
|
181
|
+
if server is None:
|
182
|
+
server = self.server_name
|
183
|
+
|
184
|
+
if filter is None:
|
185
|
+
filter = "OMAG Server Platform"
|
186
|
+
|
187
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/platforms/"
|
188
|
+
f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}")
|
189
|
+
|
190
|
+
if effective_time is not None:
|
191
|
+
body = {
|
192
|
+
"filter": filter,
|
193
|
+
"effectiveTime": effective_time
|
194
|
+
}
|
195
|
+
else:
|
196
|
+
body = {
|
197
|
+
"filter": filter
|
198
|
+
}
|
199
|
+
|
200
|
+
response = await self._async_make_request("POST", url, body)
|
201
|
+
return response.json().get('elementList','No platforms found')
|
202
|
+
|
203
|
+
def get_platforms_by_type(self, filter: str = None, server:str = None, effective_time: str = None,
|
204
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
205
|
+
""" Returns the list of platforms with a particular deployed implementation type. The value is specified in
|
206
|
+
the filter. If it is null, or no request body is supplied, all platforms are returned.
|
207
|
+
|
208
|
+
Parameters
|
209
|
+
----------
|
210
|
+
filter : str, opt
|
211
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
212
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
213
|
+
|
214
|
+
server : str, optional
|
215
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
216
|
+
will be used.
|
217
|
+
|
218
|
+
start_from : int, optional
|
219
|
+
The index from which to start fetching the engine actions. Default is 0.
|
220
|
+
|
221
|
+
|
222
|
+
page_size : int, optional
|
223
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
224
|
+
|
225
|
+
Returns
|
226
|
+
-------
|
227
|
+
Response
|
228
|
+
A lit of json dict with the platform reports.
|
229
|
+
|
230
|
+
Raises
|
231
|
+
------
|
232
|
+
InvalidParameterException
|
233
|
+
PropertyServerException
|
234
|
+
UserNotAuthorizedException
|
235
|
+
|
236
|
+
"""
|
237
|
+
loop = asyncio.get_event_loop()
|
238
|
+
response = loop.run_until_complete(self._async_get_platforms_by_type(filter, server, effective_time,
|
239
|
+
start_from, page_size))
|
240
|
+
return response
|
241
|
+
|
242
|
+
async def _async_get_platform_templates_by_type(self, filter: str = None, server:str = None, effective_time: str = None,
|
243
|
+
start_from: int = 0, page_size: int = max_paging_size )-> str | list:
|
244
|
+
""" Returns the list of platform templates for a particular deployed implementation type. The value is
|
245
|
+
specified in the filter. If it is null, or no request body is supplied, all platforms are returned.
|
246
|
+
Async version.
|
247
|
+
|
248
|
+
Parameters
|
249
|
+
----------
|
250
|
+
filter : str, opt
|
251
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
252
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
253
|
+
|
254
|
+
server : str, optional
|
255
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
256
|
+
will be used.
|
257
|
+
|
258
|
+
start_from : int, optional
|
259
|
+
The index from which to start fetching the engine actions. Default is 0.
|
260
|
+
|
261
|
+
page_size : int, optional
|
262
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
263
|
+
|
264
|
+
Returns
|
265
|
+
-------
|
266
|
+
Response
|
267
|
+
A lit of json dict with the platform reports.
|
268
|
+
|
269
|
+
Raises
|
270
|
+
------
|
271
|
+
InvalidParameterException
|
272
|
+
PropertyServerException
|
273
|
+
UserNotAuthorizedException
|
274
|
+
|
275
|
+
"""
|
276
|
+
if server is None:
|
277
|
+
server = self.server_name
|
278
|
+
|
279
|
+
if filter is None:
|
280
|
+
filter = "OMAG Server Platform"
|
281
|
+
|
282
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/platforms/"
|
283
|
+
f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}&getTemplates=true")
|
284
|
+
|
285
|
+
if effective_time is not None:
|
286
|
+
body = {
|
287
|
+
"filter": filter,
|
288
|
+
"effectiveTime": effective_time
|
289
|
+
}
|
290
|
+
else:
|
291
|
+
body = {
|
292
|
+
"filter": filter
|
293
|
+
}
|
294
|
+
|
295
|
+
response = await self._async_make_request("POST", url, body)
|
296
|
+
return response.json().get('elementList','No platforms found')
|
297
|
+
|
298
|
+
|
299
|
+
def get_platform_templates_by_type(self, filter: str = None, server:str = None, effective_time: str = None,
|
300
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
301
|
+
""" Returns the list of platform templates with a particular deployed implementation type. The value is
|
302
|
+
specified in the filter. If it is null, or no request body is supplied, all platforms are returned.
|
303
|
+
|
304
|
+
Parameters
|
305
|
+
----------
|
306
|
+
filter : str, opt
|
307
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
308
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
309
|
+
|
310
|
+
server : str, optional
|
311
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
312
|
+
will be used.
|
313
|
+
|
314
|
+
start_from : int, optional
|
315
|
+
The index from which to start fetching the engine actions. Default is 0.
|
316
|
+
|
317
|
+
|
318
|
+
page_size : int, optional
|
319
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
320
|
+
|
321
|
+
Returns
|
322
|
+
-------
|
323
|
+
Response
|
324
|
+
A lit of json dict with the platform reports.
|
325
|
+
|
326
|
+
Raises
|
327
|
+
------
|
328
|
+
InvalidParameterException
|
329
|
+
PropertyServerException
|
330
|
+
UserNotAuthorizedException
|
331
|
+
|
332
|
+
"""
|
333
|
+
loop = asyncio.get_event_loop()
|
334
|
+
response = loop.run_until_complete(self._async_get_platforms_by_type(filter, server, effective_time,
|
335
|
+
start_from, page_size))
|
336
|
+
return response
|
337
|
+
|
338
|
+
async def _async_get_platform_report(self, platform_guid: str = None, server:str = None) -> str | list:
|
339
|
+
""" Returns details about the running platform. Async version.
|
340
|
+
|
341
|
+
Parameters
|
342
|
+
----------
|
343
|
+
platform_guid : str
|
344
|
+
The unique identifier for the platform.
|
345
|
+
|
346
|
+
server : str, optional
|
347
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
348
|
+
will be used.
|
349
|
+
|
350
|
+
Returns
|
351
|
+
-------
|
352
|
+
Response
|
353
|
+
A json dict with the platform report.
|
354
|
+
|
355
|
+
Raises
|
356
|
+
------
|
357
|
+
InvalidParameterException
|
358
|
+
PropertyServerException
|
359
|
+
UserNotAuthorizedException
|
360
|
+
|
361
|
+
"""
|
362
|
+
if server is None:
|
363
|
+
server = self.server_name
|
364
|
+
|
365
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/platforms/{platform_guid}/report")
|
366
|
+
|
367
|
+
response = await self._async_make_request("GET", url)
|
368
|
+
|
369
|
+
return response.json().get('element','No platforms found')
|
370
|
+
|
371
|
+
def get_platform_report(self, platform_guid: str = None, server: str = None) -> str | list:
|
372
|
+
""" Returns details about the running platform.
|
373
|
+
|
374
|
+
Parameters
|
375
|
+
----------
|
376
|
+
platform_guid : str
|
377
|
+
The unique identifier for the platform.
|
378
|
+
|
379
|
+
server : str, optional
|
380
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
381
|
+
will be used.
|
382
|
+
|
383
|
+
|
384
|
+
Returns
|
385
|
+
-------
|
386
|
+
Response
|
387
|
+
A json dict with the platform report.
|
388
|
+
|
389
|
+
Raises
|
390
|
+
------
|
391
|
+
InvalidParameterException
|
392
|
+
PropertyServerException
|
393
|
+
UserNotAuthorizedException
|
394
|
+
|
395
|
+
"""
|
396
|
+
loop = asyncio.get_event_loop()
|
397
|
+
response = loop.run_until_complete(self._async_get_platform_report(platform_guid, server))
|
398
|
+
return response
|
399
|
+
|
400
|
+
async def _async_get_platform_by_guid(self, platform_guid: str = None, server:str = None,
|
401
|
+
effective_time: str = None) -> str | list:
|
402
|
+
""" Returns details about the platform's catalog entry (asset). Async version.
|
403
|
+
|
404
|
+
Parameters
|
405
|
+
----------
|
406
|
+
filter : str, opt
|
407
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
408
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
409
|
+
|
410
|
+
server : str, optional
|
411
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
412
|
+
will be used.
|
413
|
+
|
414
|
+
start_from : int, optional
|
415
|
+
The index from which to start fetching the engine actions. Default is 0.
|
416
|
+
|
417
|
+
|
418
|
+
page_size : int, optional
|
419
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
420
|
+
|
421
|
+
Returns
|
422
|
+
-------
|
423
|
+
Response
|
424
|
+
A lit of json dict with the platform reports.
|
425
|
+
|
426
|
+
"""
|
427
|
+
if server is None:
|
428
|
+
server = self.server_name
|
429
|
+
|
430
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/platforms/{platform_guid}")
|
431
|
+
|
432
|
+
if effective_time is not None:
|
433
|
+
body = {
|
434
|
+
"effectiveTime": effective_time
|
435
|
+
}
|
436
|
+
response = await self._async_make_request("POST", url, body)
|
437
|
+
|
438
|
+
else:
|
439
|
+
response = await self._async_make_request("POST", url)
|
440
|
+
|
441
|
+
return response.json().get('elementList','No platforms found')
|
442
|
+
|
443
|
+
def get_platform_by_guid(self, platform_guid: str = None, server: str = None,
|
444
|
+
effective_time: str = None) -> str | list:
|
445
|
+
""" Returns details about the platform's catalog entry (asset).
|
446
|
+
|
447
|
+
Parameters
|
448
|
+
----------
|
449
|
+
filter : str, opt
|
450
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
451
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
452
|
+
|
453
|
+
server : str, optional
|
454
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
455
|
+
will be used.
|
456
|
+
|
457
|
+
start_from : int, optional
|
458
|
+
The index from which to start fetching the engine actions. Default is 0.
|
459
|
+
|
460
|
+
|
461
|
+
page_size : int, optional
|
462
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
463
|
+
|
464
|
+
Returns
|
465
|
+
-------
|
466
|
+
Response
|
467
|
+
A lit of json dict with the platform reports.
|
468
|
+
|
469
|
+
Raises
|
470
|
+
------
|
471
|
+
InvalidParameterException
|
472
|
+
PropertyServerException
|
473
|
+
UserNotAuthorizedException
|
474
|
+
|
475
|
+
"""
|
476
|
+
loop = asyncio.get_event_loop()
|
477
|
+
response = loop.run_until_complete(self._async_get_platforms_by_guid(platform_guid, server,
|
478
|
+
effective_time))
|
479
|
+
return response
|
480
|
+
|
481
|
+
async def _async_get_server_by_guid(self, server_guid: str, server:str = None,
|
482
|
+
effective_time: str = None) -> str | dict:
|
483
|
+
""" Returns details about the server's catalog entry (asset). Async version.
|
484
|
+
|
485
|
+
Parameters
|
486
|
+
----------
|
487
|
+
server_guid : str
|
488
|
+
The unique identifier for the platform.
|
489
|
+
|
490
|
+
server : str, optional
|
491
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
492
|
+
will be used.
|
493
|
+
|
494
|
+
Returns
|
495
|
+
-------
|
496
|
+
Response
|
497
|
+
A lit of json dict with the platform reports.
|
498
|
+
|
499
|
+
Raises
|
500
|
+
------
|
501
|
+
InvalidParameterException
|
502
|
+
PropertyServerException
|
503
|
+
UserNotAuthorizedException
|
504
|
+
|
505
|
+
"""
|
506
|
+
if server is None:
|
507
|
+
server = self.server_name
|
508
|
+
|
509
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/{server_guid}")
|
510
|
+
|
511
|
+
if effective_time is not None:
|
512
|
+
body = {
|
513
|
+
"effectiveTime": effective_time
|
514
|
+
}
|
515
|
+
response = await self._async_make_request("POST", url, body)
|
516
|
+
|
517
|
+
else:
|
518
|
+
response = await self._async_make_request("POST", url)
|
519
|
+
|
520
|
+
return response.json().get('elementList','No server found')
|
521
|
+
|
522
|
+
def get_server_by_guid(self, server_guid: str, server: str = None,
|
523
|
+
effective_time: str = None) -> str | dict:
|
524
|
+
""" Returns details about the platform's catalog entry (asset).
|
525
|
+
|
526
|
+
Parameters
|
527
|
+
----------
|
528
|
+
server_guid : str
|
529
|
+
The unique identifier for the platform.
|
530
|
+
|
531
|
+
server : str, optional
|
532
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
533
|
+
will be used.
|
534
|
+
|
535
|
+
Returns
|
536
|
+
-------
|
537
|
+
Response
|
538
|
+
A lit of json dict with the platform reports.
|
539
|
+
|
540
|
+
Raises
|
541
|
+
------
|
542
|
+
InvalidParameterException
|
543
|
+
PropertyServerException
|
544
|
+
UserNotAuthorizedException
|
545
|
+
|
546
|
+
"""
|
547
|
+
loop = asyncio.get_event_loop()
|
548
|
+
response = loop.run_until_complete(self._async_get_server_by_guid(server_guid, server, effective_time))
|
549
|
+
return response
|
550
|
+
|
551
|
+
|
552
|
+
async def _async_get_servers_by_name(self, filter: str, server:str = None, effective_time: str = None,
|
553
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
554
|
+
""" Returns the list of servers with a particular name. The name is specified in the filter. Async version.
|
555
|
+
|
556
|
+
Parameters
|
557
|
+
----------
|
558
|
+
filter : str, opt
|
559
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
560
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
561
|
+
|
562
|
+
server : str, optional
|
563
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
564
|
+
will be used.
|
565
|
+
|
566
|
+
start_from : int, optional
|
567
|
+
The index from which to start fetching the engine actions. Default is 0.
|
568
|
+
|
569
|
+
|
570
|
+
page_size : int, optional
|
571
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
572
|
+
|
573
|
+
Returns
|
574
|
+
-------
|
575
|
+
Response
|
576
|
+
A lit of json dict with the platform reports.
|
577
|
+
|
578
|
+
Raises
|
579
|
+
------
|
580
|
+
InvalidParameterException
|
581
|
+
PropertyServerException
|
582
|
+
UserNotAuthorizedException
|
583
|
+
|
584
|
+
"""
|
585
|
+
if server is None:
|
586
|
+
server = self.server_name
|
587
|
+
|
588
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/by-name?"
|
589
|
+
f"startFrom={start_from}&pageSize={page_size}")
|
590
|
+
|
591
|
+
if effective_time is None:
|
592
|
+
body = {
|
593
|
+
"filter": filter
|
594
|
+
}
|
595
|
+
else:
|
596
|
+
body = {
|
597
|
+
"filter": filter,
|
598
|
+
"effective_time": effective_time
|
599
|
+
}
|
600
|
+
response = await self._async_make_request("POST", url, body)
|
601
|
+
|
602
|
+
return response.json().get('elementList','No platforms found')
|
603
|
+
|
604
|
+
def get_servers_by_name(self, filter: str, server: str = None) -> str | list:
|
605
|
+
""" Returns the list of servers with a particular name. The name is specified in the filter.
|
606
|
+
|
607
|
+
Parameters
|
608
|
+
----------
|
609
|
+
filter : str, opt
|
610
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
611
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
612
|
+
|
613
|
+
server : str, optional
|
614
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
615
|
+
will be used.
|
616
|
+
|
617
|
+
start_from : int, optional
|
618
|
+
The index from which to start fetching the engine actions. Default is 0.
|
619
|
+
|
620
|
+
|
621
|
+
page_size : int, optional
|
622
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
623
|
+
|
624
|
+
Returns
|
625
|
+
-------
|
626
|
+
Response
|
627
|
+
A lit of json dict with the platform reports.
|
628
|
+
|
629
|
+
Raises
|
630
|
+
------
|
631
|
+
InvalidParameterException
|
632
|
+
PropertyServerException
|
633
|
+
UserNotAuthorizedException
|
634
|
+
|
635
|
+
"""
|
636
|
+
loop = asyncio.get_event_loop()
|
637
|
+
response = loop.run_until_complete(self._async_get_servers_by_name(filter, server))
|
638
|
+
return response
|
639
|
+
|
640
|
+
async def _async_get_servers_by_dep_impl_type(self, filter: str = "*", server:str = None, effective_time: str = None,
|
641
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
642
|
+
""" Returns the list of servers with a particular deployed implementation type. The value is specified
|
643
|
+
in the filter. If it is null, or no request body is supplied, all servers are returned.
|
644
|
+
Async version.
|
645
|
+
|
646
|
+
Parameters
|
647
|
+
----------
|
648
|
+
filter : str, opt
|
649
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
650
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
651
|
+
|
652
|
+
server : str, optional
|
653
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
654
|
+
will be used.
|
655
|
+
|
656
|
+
start_from : int, optional
|
657
|
+
The index from which to start fetching the engine actions. Default is 0.
|
658
|
+
|
659
|
+
|
660
|
+
page_size : int, optional
|
661
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
662
|
+
|
663
|
+
Returns
|
664
|
+
-------
|
665
|
+
Response
|
666
|
+
A lit of json dict with the platform reports.
|
667
|
+
|
668
|
+
Raises
|
669
|
+
------
|
670
|
+
InvalidParameterException
|
671
|
+
PropertyServerException
|
672
|
+
UserNotAuthorizedException
|
673
|
+
|
674
|
+
"""
|
675
|
+
if server is None:
|
676
|
+
server = self.server_name
|
677
|
+
|
678
|
+
if filter == '*':
|
679
|
+
filter = None
|
680
|
+
|
681
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/"
|
682
|
+
f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}")
|
683
|
+
|
684
|
+
body = body_slimmer({ "filter": filter, "effective_time": effective_time})
|
685
|
+
|
686
|
+
response = await self._async_make_request("POST", url, body)
|
687
|
+
|
688
|
+
return response.json().get('elementList','No platforms found')
|
689
|
+
|
690
|
+
def get_servers_by_dep_impl_type(self, filter: str = "*", server:str = None, effective_time: str = None,
|
691
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
692
|
+
""" Returns the list of servers with a particular deployed implementation type.
|
693
|
+
The value is specified in the filter. If it is null, or no request body is supplied,
|
694
|
+
all servers are returned.
|
695
|
+
|
696
|
+
Parameters
|
697
|
+
----------
|
698
|
+
filter : str, opt
|
699
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
700
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
701
|
+
|
702
|
+
server : str, optional
|
703
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
704
|
+
will be used.
|
705
|
+
|
706
|
+
start_from : int, optional
|
707
|
+
The index from which to start fetching the engine actions. Default is 0.
|
708
|
+
|
709
|
+
|
710
|
+
page_size : int, optional
|
711
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
712
|
+
|
713
|
+
Returns
|
714
|
+
-------
|
715
|
+
Response
|
716
|
+
A lit of json dict with the platform reports.
|
717
|
+
|
718
|
+
Raises
|
719
|
+
------
|
720
|
+
InvalidParameterException
|
721
|
+
PropertyServerException
|
722
|
+
UserNotAuthorizedException
|
723
|
+
|
724
|
+
"""
|
725
|
+
loop = asyncio.get_event_loop()
|
726
|
+
response = loop.run_until_complete(self._async_get_servers_by_dep_impl_type(filter, server, effective_time,
|
727
|
+
start_from, page_size))
|
728
|
+
return response
|
729
|
+
|
730
|
+
async def _async_get_server_templates_by_dep_impl_type(self, filter: str = "*", server:str = None, effective_time: str = None,
|
731
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
732
|
+
""" Returns the list of server templates with a particular deployed implementation type. The value is
|
733
|
+
specified in the filter. If it is null, or no request body is supplied, all servers are returned.
|
734
|
+
Async version.
|
735
|
+
|
736
|
+
Parameters
|
737
|
+
----------
|
738
|
+
filter : str, opt
|
739
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
740
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
741
|
+
|
742
|
+
server : str, optional
|
743
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
744
|
+
will be used.
|
745
|
+
|
746
|
+
start_from : int, optional
|
747
|
+
The index from which to start fetching the engine actions. Default is 0.
|
748
|
+
|
749
|
+
|
750
|
+
page_size : int, optional
|
751
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
752
|
+
|
753
|
+
Returns
|
754
|
+
-------
|
755
|
+
Response
|
756
|
+
A lit of json dict with the platform reports.
|
757
|
+
|
758
|
+
Raises
|
759
|
+
------
|
760
|
+
InvalidParameterException
|
761
|
+
PropertyServerException
|
762
|
+
UserNotAuthorizedException
|
763
|
+
|
764
|
+
"""
|
765
|
+
if server is None:
|
766
|
+
server = self.server_name
|
767
|
+
|
768
|
+
if filter == '*':
|
769
|
+
filter = None
|
770
|
+
|
771
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/"
|
772
|
+
f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}&getTemplates=true")
|
773
|
+
|
774
|
+
body = body_slimmer({ "filter": filter, "effective_time": effective_time})
|
775
|
+
|
776
|
+
response = await self._async_make_request("POST", url, body)
|
777
|
+
|
778
|
+
return response.json().get('elementList','No platforms found')
|
779
|
+
|
780
|
+
def get_server_templates_by_dep_impl_type(self, filter: str = "*", server:str = None, effective_time: str = None,
|
781
|
+
start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
|
782
|
+
""" Returns the list of server templates with a particular deployed implementation type.
|
783
|
+
The value is specified in the filter. If it is null, or no request body is supplied,
|
784
|
+
all servers are returned.
|
785
|
+
|
786
|
+
Parameters
|
787
|
+
----------
|
788
|
+
filter : str, opt
|
789
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
790
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
791
|
+
|
792
|
+
server : str, optional
|
793
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
794
|
+
will be used.
|
795
|
+
|
796
|
+
start_from : int, optional
|
797
|
+
The index from which to start fetching the engine actions. Default is 0.
|
798
|
+
|
799
|
+
|
800
|
+
page_size : int, optional
|
801
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
802
|
+
|
803
|
+
Returns
|
804
|
+
-------
|
805
|
+
Response
|
806
|
+
A lit of json dict with the platform reports.
|
807
|
+
|
808
|
+
Raises
|
809
|
+
------
|
810
|
+
InvalidParameterException
|
811
|
+
PropertyServerException
|
812
|
+
UserNotAuthorizedException
|
813
|
+
|
814
|
+
"""
|
815
|
+
loop = asyncio.get_event_loop()
|
816
|
+
response = loop.run_until_complete(self._async_get_server_templates_by_dep_impl_type(filter, server, effective_time,
|
817
|
+
start_from, page_size))
|
818
|
+
return response
|
819
|
+
|
820
|
+
|
821
|
+
async def _async_get_server_by_guid(self, server_guid: str = None, server:str = None,
|
822
|
+
effective_time: str = None) -> str | list:
|
823
|
+
""" Returns details about the server's catalog entry (asset). Async version.
|
824
|
+
|
825
|
+
Parameters
|
826
|
+
----------
|
827
|
+
filter : str, opt
|
828
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
829
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
830
|
+
|
831
|
+
server : str, optional
|
832
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
833
|
+
will be used.
|
834
|
+
|
835
|
+
start_from : int, optional
|
836
|
+
The index from which to start fetching the engine actions. Default is 0.
|
837
|
+
|
838
|
+
|
839
|
+
page_size : int, optional
|
840
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
841
|
+
|
842
|
+
Returns
|
843
|
+
-------
|
844
|
+
Response
|
845
|
+
A lit of json dict with the platform reports.
|
846
|
+
|
847
|
+
Raises
|
848
|
+
------
|
849
|
+
InvalidParameterException
|
850
|
+
PropertyServerException
|
851
|
+
UserNotAuthorizedException
|
852
|
+
|
853
|
+
"""
|
854
|
+
if server is None:
|
855
|
+
server = self.server_name
|
856
|
+
|
857
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/{server_guid}")
|
858
|
+
|
859
|
+
if effective_time is not None:
|
860
|
+
body = {
|
861
|
+
"effectiveTime": effective_time
|
862
|
+
}
|
863
|
+
response = await self._async_make_request("POST", url, body)
|
864
|
+
|
865
|
+
else:
|
866
|
+
response = await self._async_make_request("POST", url)
|
867
|
+
|
868
|
+
return response.json().get('element','No servers found')
|
869
|
+
|
870
|
+
def get_server_by_guid(self, server_guid: str = None, server: str = None,
|
871
|
+
effective_time: str = None) -> str | list:
|
872
|
+
""" Returns details about the server's catalog entry (asset). Async version.
|
873
|
+
|
874
|
+
Parameters
|
875
|
+
----------
|
876
|
+
filter : str, opt
|
877
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
878
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
879
|
+
|
880
|
+
server : str, optional
|
881
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
882
|
+
will be used.
|
883
|
+
|
884
|
+
start_from : int, optional
|
885
|
+
The index from which to start fetching the engine actions. Default is 0.
|
886
|
+
|
887
|
+
|
888
|
+
page_size : int, optional
|
889
|
+
The maximum number of engine actions to fetch in a single request. Default is `max_paging_size`.
|
890
|
+
|
891
|
+
Returns
|
892
|
+
-------
|
893
|
+
Response
|
894
|
+
A lit of json dict with the platform reports.
|
895
|
+
|
896
|
+
"""
|
897
|
+
loop = asyncio.get_event_loop()
|
898
|
+
response = loop.run_until_complete(self._async_get_server_by_guid(server_guid, server,
|
899
|
+
effective_time))
|
900
|
+
return response
|
901
|
+
|
902
|
+
|
903
|
+
async def _async_get_server_report(self, server_guid: str = None, server: str = None) -> str | list:
|
904
|
+
""" Returns details about the running server. Async version.
|
905
|
+
|
906
|
+
Parameters
|
907
|
+
----------
|
908
|
+
filter : str, opt
|
909
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
910
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
911
|
+
|
912
|
+
server : str, optional
|
913
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
914
|
+
will be used.
|
915
|
+
|
916
|
+
|
917
|
+
Returns
|
918
|
+
-------
|
919
|
+
Response
|
920
|
+
A lit of json dict with the platform reports.
|
921
|
+
|
922
|
+
Raises
|
923
|
+
------
|
924
|
+
InvalidParameterException
|
925
|
+
PropertyServerException
|
926
|
+
UserNotAuthorizedException
|
927
|
+
|
928
|
+
"""
|
929
|
+
if server is None:
|
930
|
+
server = self.server_name
|
931
|
+
|
932
|
+
url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/{server_guid}/report")
|
933
|
+
|
934
|
+
response = await self._async_make_request("GET", url)
|
935
|
+
|
936
|
+
return response.json().get('elementList', 'No server found')
|
937
|
+
|
938
|
+
|
939
|
+
def get_server_report(self, server_guid: str = None, server: str = None) -> str | list:
|
940
|
+
""" Returns details about the running server.
|
941
|
+
|
942
|
+
Parameters
|
943
|
+
----------
|
944
|
+
filter : str, opt
|
945
|
+
Filter specifies the kind of deployed implementation type of the platforms to return information for.
|
946
|
+
If the value is None, we will default to the "OMAG Server Platform".
|
947
|
+
|
948
|
+
server : str, optional
|
949
|
+
The name of the server to get governance engine summaries from. If not provided, the default server name
|
950
|
+
will be used.
|
951
|
+
|
952
|
+
Returns
|
953
|
+
-------
|
954
|
+
Response
|
955
|
+
A lit of json dict with the platform reports.
|
956
|
+
|
957
|
+
Raises
|
958
|
+
------
|
959
|
+
InvalidParameterException
|
960
|
+
PropertyServerException
|
961
|
+
UserNotAuthorizedException
|
962
|
+
|
963
|
+
"""
|
964
|
+
loop = asyncio.get_event_loop()
|
965
|
+
response = loop.run_until_complete(self._async_get_server_report(server_guid, server))
|
966
|
+
return response
|
967
|
+
|