pyegeria 0.7.45__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- examples/widgets/cat/list_cert_types.py +61 -43
- examples/widgets/cat/list_projects.py +1 -1
- examples/widgets/cli/egeria.py +18 -2
- examples/widgets/cli/egeria_tech.py +299 -98
- examples/widgets/my/my_profile_actions.py +51 -32
- examples/widgets/ops/engine_actions.py +35 -23
- examples/widgets/ops/integration_daemon_actions.py +51 -32
- examples/widgets/tech/get_element_info.py +63 -38
- examples/widgets/tech/get_guid_info.py +50 -27
- examples/widgets/tech/list_asset_types.py +33 -23
- examples/widgets/tech/list_elements.py +44 -34
- examples/widgets/tech/list_elements_x.py +69 -49
- examples/widgets/tech/list_registered_services.py +44 -24
- examples/widgets/tech/list_related_specification.py +70 -45
- examples/widgets/tech/list_relationship_types.py +50 -31
- examples/widgets/tech/list_valid_metadata_values.py +57 -28
- examples/widgets/tech/x_list_related_elements.py +54 -34
- pyegeria/Xloaded_resources_omvs.py +43 -41
- pyegeria/__init__.py +5 -1
- pyegeria/_client.py +142 -102
- pyegeria/_deprecated_gov_engine.py +218 -167
- pyegeria/action_author_omvs.py +107 -88
- pyegeria/asset_catalog_omvs.py +467 -395
- pyegeria/automated_curation_omvs.py +2 -2
- pyegeria/classification_manager_omvs.py +1920 -868
- pyegeria/collection_manager_omvs.py +1957 -1519
- pyegeria/core_omag_server_config.py +310 -192
- pyegeria/egeria_cat_client.py +88 -0
- pyegeria/egeria_config_client.py +37 -0
- pyegeria/egeria_my_client.py +47 -0
- pyegeria/egeria_ops_client.py +67 -0
- pyegeria/egeria_tech_client.py +77 -0
- pyegeria/feedback_manager_omvs.py +633 -631
- pyegeria/full_omag_server_config.py +330 -158
- pyegeria/glossary_browser_omvs.py +927 -474
- pyegeria/glossary_manager_omvs.py +1033 -543
- pyegeria/mermaid_utilities.py +1 -1
- pyegeria/my_profile_omvs.py +714 -574
- pyegeria/platform_services.py +228 -176
- pyegeria/project_manager_omvs.py +1158 -903
- pyegeria/registered_info.py +76 -74
- pyegeria/runtime_manager_omvs.py +749 -670
- pyegeria/server_operations.py +123 -85
- pyegeria/valid_metadata_omvs.py +268 -168
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/RECORD +49 -46
- examples/widgets/tech/list_gov_processes.py +0 -162
- pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
- {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
pyegeria/project_manager_omvs.py
CHANGED
@@ -37,24 +37,30 @@ class ProjectManager(Client):
|
|
37
37
|
"""
|
38
38
|
|
39
39
|
def __init__(
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
self,
|
41
|
+
server_name: str,
|
42
|
+
platform_url: str,
|
43
|
+
token: str = None,
|
44
|
+
user_id: str = None,
|
45
|
+
user_pwd: str = None,
|
46
|
+
sync_mode: bool = True,
|
47
47
|
):
|
48
48
|
self.command_base: str = f"/api/open-metadata/project-manager/metadata-elements"
|
49
|
-
Client.__init__(self, server_name, platform_url, user_id=user_id, token=token
|
49
|
+
Client.__init__(self, server_name, platform_url, user_id=user_id, token=token)
|
50
50
|
|
51
51
|
#
|
52
52
|
# Retrieving Projects= Information - https://egeria-project.org/concepts/project
|
53
53
|
#
|
54
|
-
async def _async_get_linked_projects(
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
async def _async_get_linked_projects(
|
55
|
+
self,
|
56
|
+
parent_guid: str,
|
57
|
+
project_status: str = None,
|
58
|
+
effective_time: str = None,
|
59
|
+
server_name: str = None,
|
60
|
+
start_from: int = 0,
|
61
|
+
page_size: int = None,
|
62
|
+
) -> list | str:
|
63
|
+
"""Returns the list of projects that are linked off of the supplied element. Any relationship will do.
|
58
64
|
The request body is optional, but if supplied acts as a filter on project status. Async version.
|
59
65
|
|
60
66
|
Parameters
|
@@ -100,15 +106,24 @@ class ProjectManager(Client):
|
|
100
106
|
"effectiveTime": effective_time,
|
101
107
|
}
|
102
108
|
body_s = body_slimmer(body)
|
103
|
-
url = (
|
104
|
-
|
109
|
+
url = (
|
110
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/"
|
111
|
+
f"metadata-elements/{parent_guid}/projects?startFrom={start_from}&pageSize={page_size}"
|
112
|
+
)
|
105
113
|
|
106
114
|
resp = await self._async_make_request("POST", url, body_s)
|
107
|
-
return resp.json().get(
|
108
|
-
|
109
|
-
def get_linked_projects(
|
110
|
-
|
111
|
-
|
115
|
+
return resp.json().get("elements", "No linked projects found")
|
116
|
+
|
117
|
+
def get_linked_projects(
|
118
|
+
self,
|
119
|
+
parent_guid: str,
|
120
|
+
project_status: str = None,
|
121
|
+
effective_time: str = None,
|
122
|
+
server_name: str = None,
|
123
|
+
start_from: int = 0,
|
124
|
+
page_size: int = None,
|
125
|
+
) -> list | str:
|
126
|
+
"""Returns the list of projects that are linked off of the supplied element. Any relationship will do.
|
112
127
|
The request body is optional, but if supplied acts as a filter on project status.
|
113
128
|
|
114
129
|
Parameters
|
@@ -145,15 +160,27 @@ class ProjectManager(Client):
|
|
145
160
|
|
146
161
|
"""
|
147
162
|
loop = asyncio.get_event_loop()
|
148
|
-
resp = loop.run_until_complete(
|
149
|
-
|
150
|
-
|
163
|
+
resp = loop.run_until_complete(
|
164
|
+
self._async_get_linked_projects(
|
165
|
+
parent_guid,
|
166
|
+
project_status,
|
167
|
+
effective_time,
|
168
|
+
server_name,
|
169
|
+
start_from,
|
170
|
+
page_size,
|
171
|
+
)
|
172
|
+
)
|
151
173
|
return resp
|
152
174
|
|
153
|
-
async def _async_get_classified_projects(
|
154
|
-
|
155
|
-
|
156
|
-
|
175
|
+
async def _async_get_classified_projects(
|
176
|
+
self,
|
177
|
+
project_classification: str,
|
178
|
+
effective_time: str = None,
|
179
|
+
server_name: str = None,
|
180
|
+
start_from: int = 0,
|
181
|
+
page_size: int = None,
|
182
|
+
) -> list | str:
|
183
|
+
"""Returns the list of projects with a particular classification. The name of the classification is
|
157
184
|
supplied in the request body. Examples of these classifications include StudyProject, PersonalProject,
|
158
185
|
Campaign or Task. There is also GlossaryProject and GovernanceProject. Async version.
|
159
186
|
|
@@ -198,15 +225,23 @@ class ProjectManager(Client):
|
|
198
225
|
"effectiveTime": effective_time,
|
199
226
|
}
|
200
227
|
body_s = body_slimmer(body)
|
201
|
-
url = (
|
202
|
-
|
228
|
+
url = (
|
229
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/"
|
230
|
+
f"projects/by-classifications?startFrom={start_from}&pageSize={page_size}"
|
231
|
+
)
|
203
232
|
|
204
233
|
resp = await self._async_make_request("POST", url, body_s)
|
205
234
|
return resp.json()
|
206
235
|
|
207
|
-
def get_classified_projects(
|
208
|
-
|
209
|
-
|
236
|
+
def get_classified_projects(
|
237
|
+
self,
|
238
|
+
project_classification: str,
|
239
|
+
effective_time: str = None,
|
240
|
+
server_name: str = None,
|
241
|
+
start_from: int = 0,
|
242
|
+
page_size: int = None,
|
243
|
+
) -> list | str:
|
244
|
+
"""Returns the list of projects with a particular classification. The name of the classification is
|
210
245
|
supplied in the request body. Examples of these classifications include StudyProject, PersonalProject,
|
211
246
|
Campaign or Task. There is also GlossaryProject and GovernanceProject.
|
212
247
|
|
@@ -242,15 +277,27 @@ class ProjectManager(Client):
|
|
242
277
|
|
243
278
|
"""
|
244
279
|
loop = asyncio.get_event_loop()
|
245
|
-
resp = loop.run_until_complete(
|
246
|
-
|
247
|
-
|
280
|
+
resp = loop.run_until_complete(
|
281
|
+
self._async_get_classified_projects(
|
282
|
+
project_classification,
|
283
|
+
effective_time,
|
284
|
+
server_name,
|
285
|
+
start_from,
|
286
|
+
page_size,
|
287
|
+
)
|
288
|
+
)
|
248
289
|
return resp
|
249
290
|
|
250
|
-
async def _async_get_project_team(
|
251
|
-
|
252
|
-
|
253
|
-
|
291
|
+
async def _async_get_project_team(
|
292
|
+
self,
|
293
|
+
project_guid: str,
|
294
|
+
team_role: str = None,
|
295
|
+
effective_time: str = None,
|
296
|
+
server_name: str = None,
|
297
|
+
start_from: int = 0,
|
298
|
+
page_size: int = None,
|
299
|
+
) -> list | str:
|
300
|
+
"""Returns the list of actors that are linked off of the project. This includes the project managers.
|
254
301
|
The optional request body allows a teamRole to be specified as a filter. To filter out the project managers,
|
255
302
|
specify ProjectManagement as the team role. See https://egeria-project.org/concepts/project for details.
|
256
303
|
Async version.
|
@@ -293,22 +340,28 @@ class ProjectManager(Client):
|
|
293
340
|
if page_size is None:
|
294
341
|
page_size = self.page_size
|
295
342
|
|
296
|
-
body = {
|
297
|
-
effective_time: effective_time,
|
298
|
-
"filter": team_role
|
299
|
-
}
|
343
|
+
body = {effective_time: effective_time, "filter": team_role}
|
300
344
|
body_s = body_slimmer(body)
|
301
|
-
url = (
|
302
|
-
|
345
|
+
url = (
|
346
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
|
347
|
+
f"{project_guid}/team?startFrom={start_from}&pageSize={page_size}"
|
348
|
+
)
|
303
349
|
|
304
350
|
resp = await self._async_make_request("POST", url, body_s)
|
305
351
|
|
306
|
-
result = resp.json().get(
|
352
|
+
result = resp.json().get("elements", "No elements found")
|
307
353
|
return result
|
308
354
|
|
309
|
-
def get_project_team(
|
310
|
-
|
311
|
-
|
355
|
+
def get_project_team(
|
356
|
+
self,
|
357
|
+
project_guid: str,
|
358
|
+
team_role: str = None,
|
359
|
+
effective_time: str = None,
|
360
|
+
server_name: str = None,
|
361
|
+
start_from: int = 0,
|
362
|
+
page_size: int = None,
|
363
|
+
) -> list | str:
|
364
|
+
"""Returns the list of actors that are linked off of the project. This includes the project managers.
|
312
365
|
The optional request body allows a teamRole to be specified as a filter. To filter out the project managers,
|
313
366
|
specify ProjectManagement as the team role. See https://egeria-project.org/concepts/project for details.
|
314
367
|
Async version.
|
@@ -347,15 +400,30 @@ class ProjectManager(Client):
|
|
347
400
|
-----
|
348
401
|
"""
|
349
402
|
loop = asyncio.get_event_loop()
|
350
|
-
resp = loop.run_until_complete(
|
351
|
-
|
403
|
+
resp = loop.run_until_complete(
|
404
|
+
self._async_get_project_team(
|
405
|
+
project_guid,
|
406
|
+
team_role,
|
407
|
+
effective_time,
|
408
|
+
server_name,
|
409
|
+
start_from,
|
410
|
+
page_size,
|
411
|
+
)
|
412
|
+
)
|
352
413
|
return resp
|
353
414
|
|
354
|
-
async def _async_find_projects(
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
415
|
+
async def _async_find_projects(
|
416
|
+
self,
|
417
|
+
search_string: str,
|
418
|
+
effective_time: str = None,
|
419
|
+
starts_with: bool = False,
|
420
|
+
ends_with: bool = False,
|
421
|
+
ignore_case: bool = False,
|
422
|
+
server_name: str = None,
|
423
|
+
start_from: int = 0,
|
424
|
+
page_size: int = None,
|
425
|
+
) -> list | str:
|
426
|
+
"""Returns the list of projects matching the search string.
|
359
427
|
The search string is located in the request body and is interpreted as a plain string.
|
360
428
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
361
429
|
Async version.
|
@@ -407,7 +475,7 @@ class ProjectManager(Client):
|
|
407
475
|
|
408
476
|
validate_search_string(search_string)
|
409
477
|
|
410
|
-
if search_string ==
|
478
|
+
if search_string == "*":
|
411
479
|
search_string = None
|
412
480
|
|
413
481
|
body = {
|
@@ -415,17 +483,27 @@ class ProjectManager(Client):
|
|
415
483
|
"effective_time": effective_time,
|
416
484
|
}
|
417
485
|
body_s = body_slimmer(body)
|
418
|
-
url = (
|
419
|
-
|
420
|
-
|
486
|
+
url = (
|
487
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
|
488
|
+
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
489
|
+
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
|
490
|
+
)
|
421
491
|
|
422
492
|
resp = await self._async_make_request("POST", url, body_s)
|
423
493
|
return resp.json().get("elements", "No elements found")
|
424
494
|
|
425
|
-
def find_projects(
|
426
|
-
|
427
|
-
|
428
|
-
|
495
|
+
def find_projects(
|
496
|
+
self,
|
497
|
+
search_string: str,
|
498
|
+
effective_time: str = None,
|
499
|
+
starts_with: bool = False,
|
500
|
+
ends_with: bool = False,
|
501
|
+
ignore_case: bool = False,
|
502
|
+
server_name: str = None,
|
503
|
+
start_from: int = 0,
|
504
|
+
page_size: int = None,
|
505
|
+
) -> list | str:
|
506
|
+
"""Returns the list of projects matching the search string.
|
429
507
|
The search string is located in the request body and is interpreted as a plain string.
|
430
508
|
The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
|
431
509
|
|
@@ -467,17 +545,30 @@ class ProjectManager(Client):
|
|
467
545
|
|
468
546
|
"""
|
469
547
|
loop = asyncio.get_event_loop()
|
470
|
-
resp = loop.run_until_complete(
|
471
|
-
|
472
|
-
|
548
|
+
resp = loop.run_until_complete(
|
549
|
+
self._async_find_projects(
|
550
|
+
search_string,
|
551
|
+
effective_time,
|
552
|
+
starts_with,
|
553
|
+
ends_with,
|
554
|
+
ignore_case,
|
555
|
+
server_name,
|
556
|
+
start_from,
|
557
|
+
page_size,
|
558
|
+
)
|
559
|
+
)
|
473
560
|
|
474
561
|
return resp
|
475
562
|
|
476
|
-
async def _async_get_projects_by_name(
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
563
|
+
async def _async_get_projects_by_name(
|
564
|
+
self,
|
565
|
+
name: str,
|
566
|
+
effective_time: str = None,
|
567
|
+
server_name: str = None,
|
568
|
+
start_from: int = 0,
|
569
|
+
page_size: int = None,
|
570
|
+
) -> list | str:
|
571
|
+
"""Returns the list of projects with a particular name. Async version.
|
481
572
|
|
482
573
|
Parameters
|
483
574
|
----------
|
@@ -522,56 +613,68 @@ class ProjectManager(Client):
|
|
522
613
|
"effective_time": effective_time,
|
523
614
|
}
|
524
615
|
body_s = body_slimmer(body)
|
525
|
-
url = (
|
526
|
-
|
616
|
+
url = (
|
617
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
|
618
|
+
f"by-name?startFrom={start_from}&pageSize={page_size}"
|
619
|
+
)
|
527
620
|
|
528
621
|
resp = await self._async_make_request("POST", url, body_s)
|
529
622
|
return resp.json().get("elements", "No elements found")
|
530
623
|
|
531
|
-
def get_projects_by_name(
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
624
|
+
def get_projects_by_name(
|
625
|
+
self,
|
626
|
+
name: str,
|
627
|
+
effective_time: str = None,
|
628
|
+
server_name: str = None,
|
629
|
+
start_from: int = 0,
|
630
|
+
page_size: int = None,
|
631
|
+
) -> list | str:
|
632
|
+
"""Returns the list of projects with a particular name.
|
633
|
+
|
634
|
+
Parameters
|
635
|
+
----------
|
636
|
+
name: str,
|
637
|
+
name to use to find matching collections.
|
638
|
+
effective_time: str, [default=None], optional
|
639
|
+
Effective time of the query. If not specified will default to any time. ISO 8601 format.
|
640
|
+
server_name : str, optional
|
641
|
+
The name of the server to configure.
|
642
|
+
If not provided, the server name associated with the instance is used.
|
643
|
+
start_from: int, [default=0], optional
|
644
|
+
When multiple pages of results are available, the page number to start from.
|
645
|
+
page_size: int, [default=None]
|
646
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
647
|
+
the class instance.
|
648
|
+
Returns
|
649
|
+
-------
|
650
|
+
List | str
|
651
|
+
|
652
|
+
A list of collections match matching the name. Returns a string if none found.
|
653
|
+
|
654
|
+
Raises
|
655
|
+
------
|
656
|
+
|
657
|
+
InvalidParameterException
|
658
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
659
|
+
PropertyServerException
|
660
|
+
Raised by the server when an issue arises in processing a valid request
|
661
|
+
NotAuthorizedException
|
662
|
+
The principle specified by the user_id does not have authorization for the requested action
|
564
663
|
|
565
664
|
"""
|
566
665
|
loop = asyncio.get_event_loop()
|
567
|
-
resp = loop.run_until_complete(
|
568
|
-
|
666
|
+
resp = loop.run_until_complete(
|
667
|
+
self._async_get_projects_by_name(
|
668
|
+
name, effective_time, server_name, start_from, page_size
|
669
|
+
)
|
670
|
+
)
|
569
671
|
|
570
672
|
return resp
|
571
673
|
|
572
|
-
async def _async_get_project(
|
573
|
-
|
574
|
-
|
674
|
+
async def _async_get_project(
|
675
|
+
self, project_guid: str, effective_time: str = None, server_name: str = None
|
676
|
+
) -> dict | str:
|
677
|
+
"""Return the properties of a specific project. Async version.
|
575
678
|
|
576
679
|
Parameters
|
577
680
|
----------
|
@@ -613,7 +716,7 @@ class ProjectManager(Client):
|
|
613
716
|
return resp.json()
|
614
717
|
|
615
718
|
def get_project(self, project_guid: str, server_name: str = None) -> dict | str:
|
616
|
-
"""
|
719
|
+
"""Return the properties of a specific project.
|
617
720
|
|
618
721
|
Parameters
|
619
722
|
----------
|
@@ -641,189 +744,210 @@ class ProjectManager(Client):
|
|
641
744
|
|
642
745
|
"""
|
643
746
|
loop = asyncio.get_event_loop()
|
644
|
-
resp = loop.run_until_complete(
|
747
|
+
resp = loop.run_until_complete(
|
748
|
+
self._async_get_project(project_guid, server_name)
|
749
|
+
)
|
645
750
|
|
646
751
|
return resp
|
647
752
|
|
648
753
|
#
|
649
754
|
# Create project methods
|
650
755
|
#
|
651
|
-
async def _async_create_project_w_body(
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
Parameters
|
656
|
-
----------.
|
657
|
-
body: dict
|
658
|
-
A dict representing the details of the project to create.
|
659
|
-
classification: str, optional
|
660
|
-
An optional project classification. See https://egeria-project.org/types/1/0130-Projects for values.
|
661
|
-
server_name: str, optional, defaults to None
|
662
|
-
The name of the server to configure. If not provided, the server name associated with the
|
663
|
-
instance is used.
|
664
|
-
|
665
|
-
Returns
|
666
|
-
-------
|
667
|
-
str - the guid of the created project
|
668
|
-
|
669
|
-
Raises
|
670
|
-
------
|
671
|
-
InvalidParameterException
|
672
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
673
|
-
PropertyServerException
|
674
|
-
Raised by the server when an issue arises in processing a valid request
|
675
|
-
NotAuthorizedException
|
676
|
-
The principle specified by the user_id does not have authorization for the requested action
|
677
|
-
Notes
|
678
|
-
-----
|
679
|
-
|
680
|
-
Body structure like:
|
681
|
-
{
|
682
|
-
"anchorGUID" : "anchor GUID, if set then isOwnAnchor=false",
|
683
|
-
"isOwnAnchor" : False,
|
684
|
-
"parentGUID" : "parent GUID, if set, set all parameters beginning 'parent'",
|
685
|
-
"parentRelationshipTypeName" : "open metadata type name",
|
686
|
-
"parentAtEnd1": True,
|
687
|
-
"projectProperties": {
|
688
|
-
"class" : "ProjectProperties",
|
689
|
-
"qualifiedName": "Must provide a unique name here",
|
690
|
-
"identifier" : "Add business identifier",
|
691
|
-
"name" : "Add display name here",
|
692
|
-
"description" : "Add description of the project here",
|
693
|
-
"projectStatus": "Add appropriate valid value for type",
|
694
|
-
"projectPhase" : "Add appropriate valid value for phase",
|
695
|
-
"projectHealth" : "Add appropriate valid value for health",
|
696
|
-
"startDate" : "date/time",
|
697
|
-
"plannedEndDate" : "date/time"
|
698
|
-
}
|
699
|
-
}
|
756
|
+
async def _async_create_project_w_body(
|
757
|
+
self, body: dict, classification: str = None, server_name: str = None
|
758
|
+
) -> str:
|
759
|
+
"""Create project: https://egeria-project.org/concepts/project Async version.
|
700
760
|
|
701
|
-
|
761
|
+
Parameters
|
762
|
+
----------.
|
763
|
+
body: dict
|
764
|
+
A dict representing the details of the project to create.
|
765
|
+
classification: str, optional
|
766
|
+
An optional project classification. See https://egeria-project.org/types/1/0130-Projects for values.
|
767
|
+
server_name: str, optional, defaults to None
|
768
|
+
The name of the server to configure. If not provided, the server name associated with the
|
769
|
+
instance is used.
|
770
|
+
|
771
|
+
Returns
|
772
|
+
-------
|
773
|
+
str - the guid of the created project
|
774
|
+
|
775
|
+
Raises
|
776
|
+
------
|
777
|
+
InvalidParameterException
|
778
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
779
|
+
PropertyServerException
|
780
|
+
Raised by the server when an issue arises in processing a valid request
|
781
|
+
NotAuthorizedException
|
782
|
+
The principle specified by the user_id does not have authorization for the requested action
|
783
|
+
Notes
|
784
|
+
-----
|
785
|
+
|
786
|
+
Body structure like:
|
787
|
+
{
|
788
|
+
"anchorGUID" : "anchor GUID, if set then isOwnAnchor=false",
|
789
|
+
"isOwnAnchor" : False,
|
790
|
+
"parentGUID" : "parent GUID, if set, set all parameters beginning 'parent'",
|
791
|
+
"parentRelationshipTypeName" : "open metadata type name",
|
792
|
+
"parentAtEnd1": True,
|
793
|
+
"projectProperties": {
|
794
|
+
"class" : "ProjectProperties",
|
795
|
+
"qualifiedName": "Must provide a unique name here",
|
796
|
+
"identifier" : "Add business identifier",
|
797
|
+
"name" : "Add display name here",
|
798
|
+
"description" : "Add description of the project here",
|
799
|
+
"projectStatus": "Add appropriate valid value for type",
|
800
|
+
"projectPhase" : "Add appropriate valid value for phase",
|
801
|
+
"projectHealth" : "Add appropriate valid value for health",
|
802
|
+
"startDate" : "date/time",
|
803
|
+
"plannedEndDate" : "date/time"
|
804
|
+
}
|
805
|
+
}
|
806
|
+
|
807
|
+
"""
|
702
808
|
if server_name is None:
|
703
809
|
server_name = self.server_name
|
704
810
|
if classification is None:
|
705
811
|
url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects"
|
706
812
|
else:
|
707
|
-
url = (
|
708
|
-
|
813
|
+
url = (
|
814
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects?"
|
815
|
+
f"classificationName={classification}"
|
816
|
+
)
|
709
817
|
body_s = body_slimmer(body)
|
710
818
|
resp = await self._async_make_request("POST", url, body_s)
|
711
819
|
return resp.json().get("guid", "No GUID returned")
|
712
820
|
|
713
|
-
def create_project_w_body(
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
----------.
|
718
|
-
body: dict
|
719
|
-
A dict representing the details of the project to create.
|
720
|
-
classification: str, optional
|
721
|
-
An optional project classification. See https://egeria-project.org/types/1/0130-Projects for values.
|
722
|
-
server_name: str, optional, defaults to None
|
723
|
-
The name of the server to configure. If not provided, the server name associated with the instance
|
724
|
-
is used.
|
725
|
-
|
726
|
-
Returns
|
727
|
-
-------
|
728
|
-
str - the guid of the created collection
|
729
|
-
|
730
|
-
Raises
|
731
|
-
------
|
732
|
-
InvalidParameterException
|
733
|
-
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
734
|
-
PropertyServerException
|
735
|
-
Raised by the server when an issue arises in processing a valid request
|
736
|
-
NotAuthorizedException
|
737
|
-
The principle specified by the user_id does not have authorization for the requested action
|
738
|
-
|
739
|
-
Notes
|
740
|
-
-----
|
741
|
-
Body structure like:
|
742
|
-
{
|
743
|
-
"anchorGUID" : "anchor GUID, if set then isOwnAnchor=false",
|
744
|
-
"isOwnAnchor" : False,
|
745
|
-
"parentGUID" : "parent GUID, if set, set all parameters beginning 'parent'",
|
746
|
-
"parentRelationshipTypeName" : "open metadata type name",
|
747
|
-
"parentAtEnd1": True,
|
748
|
-
"projectProperties": {
|
749
|
-
"class" : "ProjectProperties",
|
750
|
-
"qualifiedName": "Must provide a unique name here",
|
751
|
-
"identifier" : "Add business identifier",
|
752
|
-
"name" : "Add display name here",
|
753
|
-
"description" : "Add description of the project here",
|
754
|
-
"projectStatus": "Add appropriate valid value for type",
|
755
|
-
"projectPhase" : "Add appropriate valid value for phase",
|
756
|
-
"projectHealth" : "Add appropriate valid value for health",
|
757
|
-
"startDate" : "date/time",
|
758
|
-
"plannedEndDate" : "date/time"
|
759
|
-
}
|
760
|
-
}
|
821
|
+
def create_project_w_body(
|
822
|
+
self, body: dict, classification: str = None, server_name: str = None
|
823
|
+
) -> str:
|
824
|
+
"""Create project: https://egeria-project.org/concepts/project
|
761
825
|
|
762
|
-
|
826
|
+
Parameters
|
827
|
+
----------.
|
828
|
+
body: dict
|
829
|
+
A dict representing the details of the project to create.
|
830
|
+
classification: str, optional
|
831
|
+
An optional project classification. See https://egeria-project.org/types/1/0130-Projects for values.
|
832
|
+
server_name: str, optional, defaults to None
|
833
|
+
The name of the server to configure. If not provided, the server name associated with the instance
|
834
|
+
is used.
|
835
|
+
|
836
|
+
Returns
|
837
|
+
-------
|
838
|
+
str - the guid of the created collection
|
839
|
+
|
840
|
+
Raises
|
841
|
+
------
|
842
|
+
InvalidParameterException
|
843
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
844
|
+
PropertyServerException
|
845
|
+
Raised by the server when an issue arises in processing a valid request
|
846
|
+
NotAuthorizedException
|
847
|
+
The principle specified by the user_id does not have authorization for the requested action
|
848
|
+
|
849
|
+
Notes
|
850
|
+
-----
|
851
|
+
Body structure like:
|
852
|
+
{
|
853
|
+
"anchorGUID" : "anchor GUID, if set then isOwnAnchor=false",
|
854
|
+
"isOwnAnchor" : False,
|
855
|
+
"parentGUID" : "parent GUID, if set, set all parameters beginning 'parent'",
|
856
|
+
"parentRelationshipTypeName" : "open metadata type name",
|
857
|
+
"parentAtEnd1": True,
|
858
|
+
"projectProperties": {
|
859
|
+
"class" : "ProjectProperties",
|
860
|
+
"qualifiedName": "Must provide a unique name here",
|
861
|
+
"identifier" : "Add business identifier",
|
862
|
+
"name" : "Add display name here",
|
863
|
+
"description" : "Add description of the project here",
|
864
|
+
"projectStatus": "Add appropriate valid value for type",
|
865
|
+
"projectPhase" : "Add appropriate valid value for phase",
|
866
|
+
"projectHealth" : "Add appropriate valid value for health",
|
867
|
+
"startDate" : "date/time",
|
868
|
+
"plannedEndDate" : "date/time"
|
869
|
+
}
|
870
|
+
}
|
871
|
+
|
872
|
+
"""
|
763
873
|
loop = asyncio.get_event_loop()
|
764
|
-
resp = loop.run_until_complete(
|
874
|
+
resp = loop.run_until_complete(
|
875
|
+
self._async_create_project_w_body(body, classification, server_name)
|
876
|
+
)
|
765
877
|
return resp
|
766
878
|
|
767
|
-
async def _async_create_project(
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
879
|
+
async def _async_create_project(
|
880
|
+
self,
|
881
|
+
anchor_guid: str,
|
882
|
+
parent_guid: str,
|
883
|
+
parent_relationship_type_name: str,
|
884
|
+
parent_at_end1: bool,
|
885
|
+
display_name: str,
|
886
|
+
description: str,
|
887
|
+
classification_name: str = None,
|
888
|
+
identifier: str = None,
|
889
|
+
is_own_anchor: bool = False,
|
890
|
+
project_status: str = None,
|
891
|
+
project_phase: str = None,
|
892
|
+
project_health: str = None,
|
893
|
+
start_date: str = None,
|
894
|
+
planned_end_date: str = None,
|
895
|
+
server_name: str = None,
|
896
|
+
) -> str:
|
897
|
+
"""Create Project: https://egeria-project.org/concepts/project Async version.
|
898
|
+
|
899
|
+
Parameters
|
900
|
+
----------
|
901
|
+
classification_name: str, optional
|
902
|
+
Type of project to create; "PersonalProject", "Campaign", etc. If not provided, project will not
|
903
|
+
be classified.
|
904
|
+
anchor_guid: str
|
905
|
+
The unique identifier of the element that should be the anchor for the new element. Set to null if no
|
906
|
+
anchor, or if this collection is to be its own anchor.
|
907
|
+
parent_guid: str
|
908
|
+
The optional unique identifier for an element that should be connected to the newly created element.
|
909
|
+
If this property is specified, parentRelationshipTypeName must also be specified
|
910
|
+
parent_relationship_type_name: str
|
911
|
+
The name of the relationship, if any, that should be established between the new element and the parent
|
912
|
+
element. Examples could be "ResourceList".
|
913
|
+
parent_at_end1: bool
|
914
|
+
Identifies which end any parent entity sits on the relationship.
|
915
|
+
display_name: str
|
916
|
+
The display name of the element. Will also be used as the basis of the qualified_name.
|
917
|
+
description: str
|
918
|
+
A description of the collection.
|
919
|
+
identifier: str
|
920
|
+
A project identifier.
|
921
|
+
is_own_anchor: bool, optional, defaults to False
|
922
|
+
Indicates if the collection should be classified as its own anchor or not.
|
923
|
+
project_status: str, optional
|
924
|
+
The project status
|
925
|
+
project_phase: str, optional
|
926
|
+
Project phase as defined in valid values
|
927
|
+
project_health: str, optional
|
928
|
+
Project health as defined in valid values
|
929
|
+
start_date: str, optional, defaults to None
|
930
|
+
Start date of the project in ISO 8601 string format.
|
931
|
+
planned_end_date: str, optional, defaults to None
|
932
|
+
Planned completion date in ISO 8601 string format.
|
933
|
+
server_name: str, optional, defaults to None
|
934
|
+
The name of the server to configure. If not provided, the server name associated with the instance is
|
935
|
+
used.
|
936
|
+
|
937
|
+
Returns
|
938
|
+
-------
|
939
|
+
str - the guid of the created project
|
940
|
+
|
941
|
+
Raises
|
942
|
+
------
|
943
|
+
InvalidParameterException
|
944
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
945
|
+
PropertyServerException
|
946
|
+
Raised by the server when an issue arises in processing a valid request
|
947
|
+
NotAuthorizedException
|
948
|
+
The principle specified by the user_id does not have authorization for the requested action
|
949
|
+
|
950
|
+
"""
|
827
951
|
if server_name is None:
|
828
952
|
server_name = self.server_name
|
829
953
|
|
@@ -833,8 +957,10 @@ class ProjectManager(Client):
|
|
833
957
|
if classification_name is None:
|
834
958
|
url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects"
|
835
959
|
else:
|
836
|
-
url = (
|
837
|
-
|
960
|
+
url = (
|
961
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects?"
|
962
|
+
f"classificationName={classification_name}"
|
963
|
+
)
|
838
964
|
|
839
965
|
body = {
|
840
966
|
"anchorGUID": anchor_guid,
|
@@ -852,129 +978,166 @@ class ProjectManager(Client):
|
|
852
978
|
"projectPhase": project_phase,
|
853
979
|
"projectHealth": project_health,
|
854
980
|
"startDate": start_date,
|
855
|
-
"plannedEndDate": planned_end_date
|
856
|
-
}
|
981
|
+
"plannedEndDate": planned_end_date,
|
982
|
+
},
|
857
983
|
}
|
858
984
|
body_s = body_slimmer(body)
|
859
985
|
resp = await self._async_make_request("POST", url, body_s)
|
860
986
|
return resp.json().get("guid", "No GUID returned")
|
861
987
|
|
862
|
-
def create_project(
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
988
|
+
def create_project(
|
989
|
+
self,
|
990
|
+
anchor_guid: str,
|
991
|
+
parent_guid: str,
|
992
|
+
parent_relationship_type_name: str,
|
993
|
+
parent_at_end1: bool,
|
994
|
+
display_name: str,
|
995
|
+
description: str,
|
996
|
+
classification_name: str,
|
997
|
+
identifier: str = None,
|
998
|
+
is_own_anchor: bool = False,
|
999
|
+
project_status: str = None,
|
1000
|
+
project_phase: str = None,
|
1001
|
+
project_health: str = None,
|
1002
|
+
start_date: str = None,
|
1003
|
+
planned_end_date: str = None,
|
1004
|
+
server_name: str = None,
|
1005
|
+
) -> str:
|
1006
|
+
"""Create Project: https://egeria-project.org/concepts/project
|
1007
|
+
|
1008
|
+
Parameters
|
1009
|
+
----------
|
1010
|
+
classification_name: str
|
1011
|
+
Type of project to create; "PersonalProject", "Campaign", etc. If not provided, the project will not
|
1012
|
+
have a project classification.
|
1013
|
+
anchor_guid: str
|
1014
|
+
The unique identifier of the element that should be the anchor for the new element. Set to null if no
|
1015
|
+
anchor, or if this collection is to be its own anchor.
|
1016
|
+
parent_guid: str
|
1017
|
+
The optional unique identifier for an element that should be connected to the newly created element.
|
1018
|
+
If this property is specified, parentRelationshipTypeName must also be specified
|
1019
|
+
parent_relationship_type_name: str
|
1020
|
+
The name of the relationship, if any, that should be established between the new element and the parent
|
1021
|
+
element. Examples could be "ResourceList".
|
1022
|
+
parent_at_end1: bool
|
1023
|
+
Identifies which end any parent entity sits on the relationship.
|
1024
|
+
display_name: str
|
1025
|
+
The display name of the element. Will also be used as the basis of the qualified_name.
|
1026
|
+
description: str
|
1027
|
+
A description of the collection.
|
1028
|
+
identifier: str
|
1029
|
+
A project identifier.
|
1030
|
+
is_own_anchor: bool, optional, defaults to False
|
1031
|
+
Indicates if the collection should be classified as its own anchor or not.
|
1032
|
+
project_status: str, optional
|
1033
|
+
The project status
|
1034
|
+
project_phase: str, optional
|
1035
|
+
Project phase as defined in valid values
|
1036
|
+
project_health: str, optional
|
1037
|
+
Project health as defined in valid values
|
1038
|
+
start_date: str, optional, defaults to None
|
1039
|
+
Start date of the project in ISO 8601 string format.
|
1040
|
+
planned_end_date: str, optional, defaults to None
|
1041
|
+
Planned completion date in ISO 8601 string format.
|
1042
|
+
server_name: str, optional, defaults to None
|
1043
|
+
The name of the server to configure. If not provided, the server name associated with the instance is
|
1044
|
+
used.
|
1045
|
+
|
1046
|
+
Returns
|
1047
|
+
-------
|
1048
|
+
str - the guid of the created project
|
1049
|
+
|
1050
|
+
Raises
|
1051
|
+
------
|
1052
|
+
InvalidParameterException
|
1053
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1054
|
+
PropertyServerException
|
1055
|
+
Raised by the server when an issue arises in processing a valid request
|
1056
|
+
NotAuthorizedException
|
1057
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1058
|
+
|
1059
|
+
"""
|
921
1060
|
loop = asyncio.get_event_loop()
|
922
|
-
resp = loop.run_until_complete(
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
1061
|
+
resp = loop.run_until_complete(
|
1062
|
+
self._async_create_project(
|
1063
|
+
anchor_guid,
|
1064
|
+
parent_guid,
|
1065
|
+
parent_relationship_type_name,
|
1066
|
+
parent_at_end1,
|
1067
|
+
display_name,
|
1068
|
+
description,
|
1069
|
+
classification_name,
|
1070
|
+
identifier,
|
1071
|
+
is_own_anchor,
|
1072
|
+
project_status,
|
1073
|
+
project_phase,
|
1074
|
+
project_health,
|
1075
|
+
start_date,
|
1076
|
+
planned_end_date,
|
1077
|
+
server_name,
|
1078
|
+
)
|
1079
|
+
)
|
928
1080
|
return resp
|
929
1081
|
|
930
|
-
async def _async_create_project_task(
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
1082
|
+
async def _async_create_project_task(
|
1083
|
+
self,
|
1084
|
+
project_guid: str,
|
1085
|
+
display_name: str,
|
1086
|
+
identifier: str = None,
|
1087
|
+
description: str = None,
|
1088
|
+
project_status: str = None,
|
1089
|
+
project_phase: str = None,
|
1090
|
+
project_health: str = None,
|
1091
|
+
start_date: str = None,
|
1092
|
+
planned_end_date: str = None,
|
1093
|
+
server_name: str = None,
|
1094
|
+
) -> str:
|
1095
|
+
"""Create a new project with the Task classification and link it to a project. Async version.
|
1096
|
+
|
1097
|
+
Parameters
|
1098
|
+
----------
|
1099
|
+
project_guid: str
|
1100
|
+
The unique identifier of the project to create the task for (the parent).
|
1101
|
+
display_name: str
|
1102
|
+
The display name of the element. Will also be used as the basis of the qualified_name.
|
1103
|
+
identifier: str
|
1104
|
+
A project identifier.
|
1105
|
+
description: str
|
1106
|
+
A description of the collection.
|
1107
|
+
project_status: str, optional, defaults to "OTHER"
|
1108
|
+
The project status
|
1109
|
+
project_phase: str, optional
|
1110
|
+
Project phase as defined in valid values
|
1111
|
+
project_health: str, optional
|
1112
|
+
Project health as defined in valid values
|
1113
|
+
start_date: str, optional, defaults to None
|
1114
|
+
Start date of the project in ISO 8601 string format.
|
1115
|
+
planned_end_date: str, optional, defaults to None
|
1116
|
+
Planned completion date in ISO 8601 string format.
|
1117
|
+
server_name: str, optional, defaults to None
|
1118
|
+
The name of the server to configure. If not provided, the server name associated with the instance is
|
1119
|
+
used.
|
1120
|
+
Returns
|
1121
|
+
-------
|
1122
|
+
str - the guid of the created project task
|
1123
|
+
|
1124
|
+
Raises
|
1125
|
+
------
|
1126
|
+
InvalidParameterException
|
1127
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1128
|
+
PropertyServerException
|
1129
|
+
Raised by the server when an issue arises in processing a valid request
|
1130
|
+
NotAuthorizedException
|
1131
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1132
|
+
|
1133
|
+
"""
|
973
1134
|
if server_name is None:
|
974
1135
|
server_name = self.server_name
|
975
1136
|
|
976
|
-
url = (
|
977
|
-
|
1137
|
+
url = (
|
1138
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
|
1139
|
+
f"{project_guid}/task"
|
1140
|
+
)
|
978
1141
|
|
979
1142
|
body = {
|
980
1143
|
"class": "ProjectProperties",
|
@@ -986,120 +1149,140 @@ class ProjectManager(Client):
|
|
986
1149
|
"projectPhase": project_phase,
|
987
1150
|
"projectHealth": project_health,
|
988
1151
|
"startDate": start_date,
|
989
|
-
"plannedEndDate": planned_end_date
|
1152
|
+
"plannedEndDate": planned_end_date,
|
990
1153
|
}
|
991
1154
|
body_s = body_slimmer(body)
|
992
1155
|
resp = await self._async_make_request("POST", url, body_s)
|
993
1156
|
return resp.json().get("guid", "No GUID Returned")
|
994
1157
|
|
995
|
-
def create_project_task(
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1158
|
+
def create_project_task(
|
1159
|
+
self,
|
1160
|
+
project_guid: str,
|
1161
|
+
display_name: str,
|
1162
|
+
identifier: str = None,
|
1163
|
+
description: str = None,
|
1164
|
+
project_status: str = None,
|
1165
|
+
project_phase: str = None,
|
1166
|
+
project_health: str = None,
|
1167
|
+
start_date: str = None,
|
1168
|
+
planned_end_date: str = None,
|
1169
|
+
server_name: str = None,
|
1170
|
+
) -> str:
|
1171
|
+
"""Create a new project with the Task classification and link it to a project.
|
1172
|
+
|
1173
|
+
Parameters
|
1174
|
+
----------
|
1175
|
+
project_guid: str
|
1176
|
+
The unique identifier of the project to create the task for.The parent.
|
1177
|
+
display_name: str
|
1178
|
+
The display name of the element. Will also be used as the basis of the qualified_name.
|
1179
|
+
identifier: str
|
1180
|
+
A project identifier.
|
1181
|
+
description: str
|
1182
|
+
A description of the collection.
|
1183
|
+
project_status: str, optional, defaults to "OTHER"
|
1184
|
+
The project status
|
1185
|
+
project_phase: str, optional
|
1186
|
+
Project phase as defined in valid values
|
1187
|
+
project_health: str, optional
|
1188
|
+
Project health as defined in valid values
|
1189
|
+
start_date: str, optional, defaults to None
|
1190
|
+
Start date of the project in ISO 8601 string format.
|
1191
|
+
planned_end_date: str, optional, defaults to None
|
1192
|
+
Planned completion date in ISO 8601 string format.
|
1193
|
+
server_name: str, optional, defaults to None
|
1194
|
+
The name of the server to configure. If not provided, the server name associated with the instance is
|
1195
|
+
used.
|
1196
|
+
Returns
|
1197
|
+
-------
|
1198
|
+
str - the guid of the created project task
|
1199
|
+
|
1200
|
+
Raises
|
1201
|
+
------
|
1202
|
+
InvalidParameterException
|
1203
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1204
|
+
PropertyServerException
|
1205
|
+
Raised by the server when an issue arises in processing a valid request
|
1206
|
+
NotAuthorizedException
|
1207
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1208
|
+
|
1209
|
+
"""
|
1038
1210
|
loop = asyncio.get_event_loop()
|
1039
|
-
resp = loop.run_until_complete(
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1211
|
+
resp = loop.run_until_complete(
|
1212
|
+
self._async_create_project_task(
|
1213
|
+
project_guid,
|
1214
|
+
display_name,
|
1215
|
+
identifier,
|
1216
|
+
description,
|
1217
|
+
project_status,
|
1218
|
+
project_phase,
|
1219
|
+
project_health,
|
1220
|
+
start_date,
|
1221
|
+
planned_end_date,
|
1222
|
+
server_name,
|
1223
|
+
)
|
1224
|
+
)
|
1044
1225
|
return resp
|
1045
1226
|
|
1046
|
-
async def _async_create_project_from_template(
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1227
|
+
async def _async_create_project_from_template(
|
1228
|
+
self, body: dict, server_name: str = None
|
1229
|
+
) -> str:
|
1230
|
+
"""Create a new metadata element to represent a project using an existing metadata element as a template.
|
1231
|
+
The template defines additional classifications and relationships that should be added to the new project.
|
1232
|
+
Async version.
|
1233
|
+
|
1234
|
+
Parameters
|
1235
|
+
----------
|
1236
|
+
|
1237
|
+
body: dict
|
1238
|
+
A dict representing the details of the collection to create.
|
1239
|
+
server_name: str, optional, defaults to None
|
1240
|
+
The name of the server to configure. If not provided, the server name associated with the instance
|
1241
|
+
is used.
|
1242
|
+
|
1243
|
+
Returns
|
1244
|
+
-------
|
1245
|
+
str - the guid of the created project.
|
1246
|
+
|
1247
|
+
Raises
|
1248
|
+
------
|
1249
|
+
InvalidParameterException
|
1250
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1251
|
+
PropertyServerException
|
1252
|
+
Raised by the server when an issue arises in processing a valid request
|
1253
|
+
NotAuthorizedException
|
1254
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1050
1255
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
NotAuthorizedException
|
1071
|
-
The principle specified by the user_id does not have authorization for the requested action
|
1072
|
-
|
1073
|
-
Notes
|
1074
|
-
-----
|
1075
|
-
JSON Structure looks like:
|
1076
|
-
{
|
1077
|
-
"class": "TemplateRequestBody",
|
1078
|
-
"anchorGUID": "anchor GUID, if set then isOwnAnchor=false",
|
1079
|
-
"isOwnAnchor": false,
|
1080
|
-
"parentGUID": "parent GUID, if set, set all parameters beginning 'parent'",
|
1081
|
-
"parentRelationshipTypeName": "open metadata type name",
|
1082
|
-
"parentAtEnd1": true,
|
1083
|
-
"templateGUID": "template GUID",
|
1084
|
-
"replacementProperties": {
|
1085
|
-
"class": "ElementProperties",
|
1086
|
-
"propertyValueMap" : {
|
1087
|
-
"propertyName" : {
|
1088
|
-
"class": "PrimitiveTypePropertyValue",
|
1089
|
-
"typeName": "string",
|
1090
|
-
"primitiveTypeCategory" : "OM_PRIMITIVE_TYPE_STRING",
|
1091
|
-
"primitiveValue" : "value of property"
|
1092
|
-
}
|
1093
|
-
}
|
1094
|
-
},
|
1095
|
-
"placeholderPropertyValues" : {
|
1096
|
-
"placeholderProperty1Name" : "property1Value",
|
1097
|
-
"placeholderProperty2Name" : "property2Value"
|
1256
|
+
Notes
|
1257
|
+
-----
|
1258
|
+
JSON Structure looks like:
|
1259
|
+
{
|
1260
|
+
"class": "TemplateRequestBody",
|
1261
|
+
"anchorGUID": "anchor GUID, if set then isOwnAnchor=false",
|
1262
|
+
"isOwnAnchor": false,
|
1263
|
+
"parentGUID": "parent GUID, if set, set all parameters beginning 'parent'",
|
1264
|
+
"parentRelationshipTypeName": "open metadata type name",
|
1265
|
+
"parentAtEnd1": true,
|
1266
|
+
"templateGUID": "template GUID",
|
1267
|
+
"replacementProperties": {
|
1268
|
+
"class": "ElementProperties",
|
1269
|
+
"propertyValueMap" : {
|
1270
|
+
"propertyName" : {
|
1271
|
+
"class": "PrimitiveTypePropertyValue",
|
1272
|
+
"typeName": "string",
|
1273
|
+
"primitiveTypeCategory" : "OM_PRIMITIVE_TYPE_STRING",
|
1274
|
+
"primitiveValue" : "value of property"
|
1098
1275
|
}
|
1099
1276
|
}
|
1277
|
+
},
|
1278
|
+
"placeholderPropertyValues" : {
|
1279
|
+
"placeholderProperty1Name" : "property1Value",
|
1280
|
+
"placeholderProperty2Name" : "property2Value"
|
1281
|
+
}
|
1282
|
+
}
|
1100
1283
|
|
1101
1284
|
|
1102
|
-
|
1285
|
+
"""
|
1103
1286
|
if server_name is None:
|
1104
1287
|
server_name = self.server_name
|
1105
1288
|
|
@@ -1109,115 +1292,129 @@ class ProjectManager(Client):
|
|
1109
1292
|
return resp.json().get("guid", "No GUID Returned")
|
1110
1293
|
|
1111
1294
|
def create_project_from_template(self, body: dict, server_name: str = None) -> str:
|
1112
|
-
"""
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
}
|
1157
|
-
}
|
1158
|
-
},
|
1159
|
-
"placeholderPropertyValues" : {
|
1160
|
-
"placeholderProperty1Name" : "property1Value",
|
1161
|
-
"placeholderProperty2Name" : "property2Value"
|
1295
|
+
"""Create a new metadata element to represent a project using an existing metadata element as a template.
|
1296
|
+
The template defines additional classifications and relationships that should be added to the new project.
|
1297
|
+
|
1298
|
+
Parameters
|
1299
|
+
----------
|
1300
|
+
|
1301
|
+
body: dict
|
1302
|
+
A dict representing the details of the collection to create.
|
1303
|
+
server_name: str, optional, defaults to None
|
1304
|
+
The name of the server to configure. If not provided, the server name associated with the instance
|
1305
|
+
is used.
|
1306
|
+
|
1307
|
+
Returns
|
1308
|
+
-------
|
1309
|
+
str - the guid of the created project.
|
1310
|
+
|
1311
|
+
Raises
|
1312
|
+
------
|
1313
|
+
InvalidParameterException
|
1314
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1315
|
+
PropertyServerException
|
1316
|
+
Raised by the server when an issue arises in processing a valid request
|
1317
|
+
NotAuthorizedException
|
1318
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1319
|
+
|
1320
|
+
Notes
|
1321
|
+
-----
|
1322
|
+
JSON Structure looks like:
|
1323
|
+
{
|
1324
|
+
"class": "TemplateRequestBody",
|
1325
|
+
"anchorGUID": "anchor GUID, if set then isOwnAnchor=false",
|
1326
|
+
"isOwnAnchor": false,
|
1327
|
+
"parentGUID": "parent GUID, if set, set all parameters beginning 'parent'",
|
1328
|
+
"parentRelationshipTypeName": "open metadata type name",
|
1329
|
+
"parentAtEnd1": true,
|
1330
|
+
"templateGUID": "template GUID",
|
1331
|
+
"replacementProperties": {
|
1332
|
+
"class": "ElementProperties",
|
1333
|
+
"propertyValueMap" : {
|
1334
|
+
"propertyName" : {
|
1335
|
+
"class": "PrimitiveTypePropertyValue",
|
1336
|
+
"typeName": "string",
|
1337
|
+
"primitiveTypeCategory" : "OM_PRIMITIVE_TYPE_STRING",
|
1338
|
+
"primitiveValue" : "value of property"
|
1162
1339
|
}
|
1163
1340
|
}
|
1341
|
+
},
|
1342
|
+
"placeholderPropertyValues" : {
|
1343
|
+
"placeholderProperty1Name" : "property1Value",
|
1344
|
+
"placeholderProperty2Name" : "property2Value"
|
1345
|
+
}
|
1346
|
+
}
|
1164
1347
|
"""
|
1165
1348
|
loop = asyncio.get_event_loop()
|
1166
|
-
resp = loop.run_until_complete(
|
1349
|
+
resp = loop.run_until_complete(
|
1350
|
+
self._async_create_project_from_template(body, server_name)
|
1351
|
+
)
|
1167
1352
|
return resp
|
1168
1353
|
|
1169
|
-
async def _async_update_project(
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1354
|
+
async def _async_update_project(
|
1355
|
+
self,
|
1356
|
+
project_guid: str,
|
1357
|
+
qualified_name: str = None,
|
1358
|
+
identifier: str = None,
|
1359
|
+
display_name: str = None,
|
1360
|
+
description: str = None,
|
1361
|
+
project_status: str = None,
|
1362
|
+
project_phase: str = None,
|
1363
|
+
project_health: str = None,
|
1364
|
+
start_date: str = None,
|
1365
|
+
planned_end_date: str = None,
|
1366
|
+
replace_all_props: bool = False,
|
1367
|
+
server_name: str = None,
|
1368
|
+
) -> None:
|
1369
|
+
"""Update the properties of a project. Async Version.
|
1370
|
+
|
1371
|
+
Parameters
|
1372
|
+
----------
|
1373
|
+
project_guid: str
|
1374
|
+
Unique identifier for the project.
|
1375
|
+
qualified_name: str, optional, defaults to None
|
1376
|
+
The unique identifier of the project.
|
1377
|
+
identifier: str
|
1378
|
+
A project identifier.
|
1379
|
+
display_name: str
|
1380
|
+
The display name of the element. Will also be used as the basis of the qualified_name.
|
1381
|
+
description: str
|
1382
|
+
A description of the collection.
|
1383
|
+
project_status: str, optional
|
1384
|
+
The project status
|
1385
|
+
project_phase: str, optional
|
1386
|
+
Project phase as defined in valid values
|
1387
|
+
project_health: str, optional
|
1388
|
+
Project health as defined in valid values
|
1389
|
+
start_date: str, optional, defaults to None
|
1390
|
+
Start date of the project in ISO 8601 string format.
|
1391
|
+
planned_end_date: str, optional, defaults to None
|
1392
|
+
Planned completion date in ISO 8601 string format.
|
1393
|
+
replace_all_props: bool, optional, defaults to False
|
1394
|
+
If True, then all the properties of the project will be replaced with the specified properties.
|
1395
|
+
server_name: str, optional, defaults to None
|
1396
|
+
The name of the server to configure. If not provided, the server name associated with the instance is
|
1397
|
+
used.
|
1398
|
+
Returns
|
1399
|
+
-------
|
1400
|
+
str - the guid of the created project task
|
1401
|
+
|
1402
|
+
Raises
|
1403
|
+
------
|
1404
|
+
InvalidParameterException
|
1405
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1406
|
+
PropertyServerException
|
1407
|
+
Raised by the server when an issue arises in processing a valid request
|
1408
|
+
NotAuthorizedException
|
1409
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1215
1410
|
"""
|
1216
1411
|
if server_name is None:
|
1217
1412
|
server_name = self.server_name
|
1218
1413
|
replace_all_props_s = str(replace_all_props).lower()
|
1219
|
-
url = (
|
1220
|
-
|
1414
|
+
url = (
|
1415
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
|
1416
|
+
f"update?replaceAllProperties={replace_all_props_s}"
|
1417
|
+
)
|
1221
1418
|
|
1222
1419
|
body = {
|
1223
1420
|
"class": "ProjectProperties",
|
@@ -1229,181 +1426,213 @@ class ProjectManager(Client):
|
|
1229
1426
|
"projectPhase": project_phase,
|
1230
1427
|
"projectHealth": project_health,
|
1231
1428
|
"startDate": start_date,
|
1232
|
-
"plannedEndDate": planned_end_date
|
1429
|
+
"plannedEndDate": planned_end_date,
|
1233
1430
|
}
|
1234
1431
|
body_s = body_slimmer(body)
|
1235
1432
|
await self._async_make_request("POST", url, body_s)
|
1236
1433
|
return
|
1237
1434
|
|
1238
|
-
def update_project(
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1435
|
+
def update_project(
|
1436
|
+
self,
|
1437
|
+
project_guid: str,
|
1438
|
+
qualified_name: str = None,
|
1439
|
+
identifier: str = None,
|
1440
|
+
display_name: str = None,
|
1441
|
+
description: str = None,
|
1442
|
+
project_status: str = None,
|
1443
|
+
project_phase: str = None,
|
1444
|
+
project_health: str = None,
|
1445
|
+
start_date: str = None,
|
1446
|
+
planned_end_date: str = None,
|
1447
|
+
replace_all_props: bool = False,
|
1448
|
+
server_name: str = None,
|
1449
|
+
) -> None:
|
1450
|
+
"""Update the properties of a project.
|
1451
|
+
|
1452
|
+
Parameters
|
1453
|
+
----------
|
1454
|
+
project_guid: str
|
1455
|
+
Unique identifier for the project.
|
1456
|
+
qualified_name: str, optional, defaults to None
|
1457
|
+
The unique identifier of the project.
|
1458
|
+
identifier: str
|
1459
|
+
A project identifier.
|
1460
|
+
display_name: str
|
1461
|
+
The display name of the element. Will also be used as the basis of the qualified_name.
|
1462
|
+
description: str
|
1463
|
+
A description of the collection.
|
1464
|
+
project_status: str, optional
|
1465
|
+
The project status
|
1466
|
+
project_phase: str, optional
|
1467
|
+
Project phase as defined in valid values
|
1468
|
+
project_health: str, optional
|
1469
|
+
Project health as defined in valid values
|
1470
|
+
start_date: str, optional, defaults to None
|
1471
|
+
Start date of the project in ISO 8601 string format.
|
1472
|
+
planned_end_date: str, optional, defaults to None
|
1473
|
+
Planned completion date in ISO 8601 string format.
|
1474
|
+
replace_all_props: bool, optional, defaults to False
|
1475
|
+
If True, then all the properties of the project will be replaced with the specified properties.
|
1476
|
+
server_name: str, optional, defaults to None
|
1477
|
+
The name of the server to configure. If not provided, the server name associated with the instance is
|
1478
|
+
used.
|
1479
|
+
Returns
|
1480
|
+
-------
|
1481
|
+
str - the guid of the created project task
|
1482
|
+
|
1483
|
+
Raises
|
1484
|
+
------
|
1485
|
+
InvalidParameterException
|
1486
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1487
|
+
PropertyServerException
|
1488
|
+
Raised by the server when an issue arises in processing a valid request
|
1489
|
+
NotAuthorizedException
|
1490
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1283
1491
|
"""
|
1284
1492
|
loop = asyncio.get_event_loop()
|
1285
|
-
loop.run_until_complete(
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1493
|
+
loop.run_until_complete(
|
1494
|
+
self._async_update_project(
|
1495
|
+
project_guid,
|
1496
|
+
qualified_name,
|
1497
|
+
identifier,
|
1498
|
+
display_name,
|
1499
|
+
description,
|
1500
|
+
project_status,
|
1501
|
+
project_phase,
|
1502
|
+
project_health,
|
1503
|
+
start_date,
|
1504
|
+
planned_end_date,
|
1505
|
+
replace_all_props,
|
1506
|
+
server_name,
|
1507
|
+
)
|
1508
|
+
)
|
1290
1509
|
return
|
1291
1510
|
|
1292
|
-
async def _async_delete_project(
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1511
|
+
async def _async_delete_project(
|
1512
|
+
self, project_guid: str, server_name: str = None
|
1513
|
+
) -> None:
|
1514
|
+
"""Delete a project. It is detected from all parent elements. Async version
|
1515
|
+
|
1516
|
+
Parameters
|
1517
|
+
----------
|
1518
|
+
project_guid: str
|
1519
|
+
The guid of the project to update.
|
1520
|
+
server_name: str, optional, defaults to None
|
1521
|
+
The name of the server to configure. If not provided, the server name associated with the instance
|
1522
|
+
is used.
|
1523
|
+
|
1524
|
+
Returns
|
1525
|
+
-------
|
1526
|
+
Nothing
|
1527
|
+
|
1528
|
+
Raises
|
1529
|
+
------
|
1530
|
+
InvalidParameterException
|
1531
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1532
|
+
PropertyServerException
|
1533
|
+
Raised by the server when an issue arises in processing a valid request
|
1534
|
+
NotAuthorizedException
|
1535
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1315
1536
|
|
1316
1537
|
"""
|
1317
1538
|
if server_name is None:
|
1318
1539
|
server_name = self.server_name
|
1319
1540
|
|
1320
|
-
url = (
|
1321
|
-
|
1541
|
+
url = (
|
1542
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
|
1543
|
+
f"{project_guid}/delete"
|
1544
|
+
)
|
1322
1545
|
|
1323
|
-
body = {
|
1324
|
-
"class": "NullRequestBody"
|
1325
|
-
}
|
1546
|
+
body = {"class": "NullRequestBody"}
|
1326
1547
|
|
1327
1548
|
await self._async_make_request("POST", url, body)
|
1328
1549
|
return
|
1329
1550
|
|
1330
1551
|
def delete_project(self, project_guid: str, server_name: str = None) -> None:
|
1331
|
-
"""
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1552
|
+
"""Delete a project. It is detected from all parent elements.
|
1553
|
+
|
1554
|
+
Parameters
|
1555
|
+
----------
|
1556
|
+
project_guid: str
|
1557
|
+
The guid of the collection to update.
|
1558
|
+
server_name: str, optional, defaults to None
|
1559
|
+
The name of the server to configure. If not provided, the server name associated with the instance
|
1560
|
+
is used.
|
1561
|
+
|
1562
|
+
Returns
|
1563
|
+
-------
|
1564
|
+
Nothing
|
1565
|
+
|
1566
|
+
Raises
|
1567
|
+
------
|
1568
|
+
|
1569
|
+
InvalidParameterException
|
1570
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1571
|
+
PropertyServerException
|
1572
|
+
Raised by the server when an issue arises in processing a valid request
|
1573
|
+
NotAuthorizedException
|
1574
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1354
1575
|
|
1355
1576
|
"""
|
1356
1577
|
loop = asyncio.get_event_loop()
|
1357
1578
|
loop.run_until_complete(self._async_delete_project(project_guid, server_name))
|
1358
1579
|
return
|
1359
1580
|
|
1360
|
-
async def _async_add_to_project_team(
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1581
|
+
async def _async_add_to_project_team(
|
1582
|
+
self,
|
1583
|
+
project_guid: str,
|
1584
|
+
actor_guid: str,
|
1585
|
+
team_role: str = None,
|
1586
|
+
effective_from: str = None,
|
1587
|
+
effective_to: str = None,
|
1588
|
+
server_name: str = None,
|
1589
|
+
) -> None:
|
1590
|
+
"""Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
|
1591
|
+
the actor plays in the project. Async version.
|
1592
|
+
|
1593
|
+
Parameters
|
1594
|
+
----------
|
1595
|
+
project_guid: str
|
1596
|
+
identity of the project to update.
|
1597
|
+
actor_guid: str
|
1598
|
+
identity of the actor to add.
|
1599
|
+
team_role: str, optional, defaults to None
|
1600
|
+
Name of the role the actor plays in the project.
|
1601
|
+
effective_from: str, optional, defaults to None
|
1602
|
+
Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
|
1603
|
+
effective_to: str, optional, defaults to None
|
1604
|
+
Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
|
1605
|
+
server_name : str, optional
|
1606
|
+
The name of the server to use.
|
1607
|
+
If not provided, the server name associated with the instance is used.
|
1608
|
+
|
1609
|
+
Returns
|
1610
|
+
-------
|
1611
|
+
None
|
1612
|
+
|
1613
|
+
Raises
|
1614
|
+
------
|
1615
|
+
|
1616
|
+
InvalidParameterException
|
1617
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1618
|
+
PropertyServerException
|
1619
|
+
Raised by the server when an issue arises in processing a valid request
|
1620
|
+
NotAuthorizedException
|
1621
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1395
1622
|
|
1396
1623
|
"""
|
1397
1624
|
if server_name is None:
|
1398
1625
|
server_name = self.server_name
|
1399
1626
|
|
1400
|
-
url = (
|
1401
|
-
|
1627
|
+
url = (
|
1628
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
|
1629
|
+
f"members/{actor_guid}/attach"
|
1630
|
+
)
|
1402
1631
|
body = {
|
1403
1632
|
"class": "ProjectTeamProperties",
|
1404
1633
|
"teamRole": team_role,
|
1405
1634
|
"effectiveFrom": effective_from,
|
1406
|
-
"effectiveTo": effective_to
|
1635
|
+
"effectiveTo": effective_to,
|
1407
1636
|
}
|
1408
1637
|
body_s = body_slimmer(body)
|
1409
1638
|
if body_s is None:
|
@@ -1412,169 +1641,187 @@ class ProjectManager(Client):
|
|
1412
1641
|
await self._async_make_request("POST", url, body_s)
|
1413
1642
|
return
|
1414
1643
|
|
1415
|
-
def add_to_project_team(
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1644
|
+
def add_to_project_team(
|
1645
|
+
self,
|
1646
|
+
project_guid: str,
|
1647
|
+
actor_guid: str,
|
1648
|
+
team_role: str = None,
|
1649
|
+
effective_from: str = None,
|
1650
|
+
effective_to: str = None,
|
1651
|
+
server_name: str = None,
|
1652
|
+
) -> None:
|
1653
|
+
"""Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
|
1654
|
+
the actor plays in the project.
|
1655
|
+
|
1656
|
+
Parameters
|
1657
|
+
----------
|
1658
|
+
project_guid: str
|
1659
|
+
identity of the project to update.
|
1660
|
+
actor_guid: str
|
1661
|
+
identity of the actor to add.
|
1662
|
+
team_role: str, optional, defaults to None
|
1663
|
+
Name of the role the actor plays in the project.
|
1664
|
+
effective_from: str, optional, defaults to None
|
1665
|
+
Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
|
1666
|
+
effective_to: str, optional, defaults to None
|
1667
|
+
Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
|
1668
|
+
server_name : str, optional
|
1669
|
+
The name of the server to use.
|
1670
|
+
If not provided, the server name associated with the instance is used.
|
1671
|
+
|
1672
|
+
Returns
|
1673
|
+
-------
|
1674
|
+
None
|
1675
|
+
|
1676
|
+
Raises
|
1677
|
+
------
|
1678
|
+
|
1679
|
+
InvalidParameterException
|
1680
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1681
|
+
PropertyServerException
|
1682
|
+
Raised by the server when an issue arises in processing a valid request
|
1683
|
+
NotAuthorizedException
|
1684
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1450
1685
|
|
1451
1686
|
"""
|
1452
1687
|
loop = asyncio.get_event_loop()
|
1453
|
-
loop.run_until_complete(
|
1454
|
-
|
1455
|
-
|
1688
|
+
loop.run_until_complete(
|
1689
|
+
self._async_add_to_project_team(
|
1690
|
+
project_guid,
|
1691
|
+
actor_guid,
|
1692
|
+
team_role,
|
1693
|
+
effective_from,
|
1694
|
+
effective_to,
|
1695
|
+
server_name,
|
1696
|
+
)
|
1697
|
+
)
|
1456
1698
|
return
|
1457
1699
|
|
1458
|
-
async def _async_remove_from_project_team(
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1700
|
+
async def _async_remove_from_project_team(
|
1701
|
+
self, project_guid: str, actor_guid: str, server_name: str = None
|
1702
|
+
) -> None:
|
1703
|
+
"""Remove an actor from a project. Async version.
|
1704
|
+
|
1705
|
+
Parameters
|
1706
|
+
----------
|
1707
|
+
project_guid: str
|
1708
|
+
identity of the project to remove members from.
|
1709
|
+
actor_guid: str
|
1710
|
+
identity of the actor to remove.
|
1711
|
+
server_name : str, optional
|
1712
|
+
The name of the server to use.
|
1713
|
+
If not provided, the server name associated with the instance is used.
|
1714
|
+
|
1715
|
+
Returns
|
1716
|
+
-------
|
1717
|
+
None
|
1718
|
+
|
1719
|
+
Raises
|
1720
|
+
------
|
1721
|
+
|
1722
|
+
InvalidParameterException
|
1723
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1724
|
+
PropertyServerException
|
1725
|
+
Raised by the server when an issue arises in processing a valid request
|
1726
|
+
NotAuthorizedException
|
1727
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1485
1728
|
|
1486
1729
|
"""
|
1487
1730
|
if server_name is None:
|
1488
1731
|
server_name = self.server_name
|
1489
1732
|
|
1490
|
-
url = (
|
1491
|
-
|
1733
|
+
url = (
|
1734
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
|
1735
|
+
f"members/{actor_guid}/detach"
|
1736
|
+
)
|
1492
1737
|
|
1493
|
-
body = {
|
1494
|
-
"class": "NullRequestBody"
|
1495
|
-
}
|
1738
|
+
body = {"class": "NullRequestBody"}
|
1496
1739
|
await self._async_make_request("POST", url, body)
|
1497
1740
|
return
|
1498
1741
|
|
1499
|
-
def remove_from_project_team(
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1742
|
+
def remove_from_project_team(
|
1743
|
+
self, project_guid: str, actor_guid: str, server_name: str = None
|
1744
|
+
) -> None:
|
1745
|
+
"""Remove an actor from a project.
|
1746
|
+
|
1747
|
+
Parameters
|
1748
|
+
----------
|
1749
|
+
project_guid: str
|
1750
|
+
identity of the project.
|
1751
|
+
actor_guid: str
|
1752
|
+
identity of the actor to remove.
|
1753
|
+
server_name : str, optional
|
1754
|
+
The name of the server to use.
|
1755
|
+
If not provided, the server name associated with the instance is used.
|
1756
|
+
|
1757
|
+
Returns
|
1758
|
+
-------
|
1759
|
+
None
|
1760
|
+
|
1761
|
+
Raises
|
1762
|
+
------
|
1763
|
+
|
1764
|
+
InvalidParameterException
|
1765
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1766
|
+
PropertyServerException
|
1767
|
+
Raised by the server when an issue arises in processing a valid request
|
1768
|
+
NotAuthorizedException
|
1769
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1526
1770
|
|
1527
1771
|
"""
|
1528
1772
|
loop = asyncio.get_event_loop()
|
1529
|
-
loop.run_until_complete(
|
1530
|
-
|
1773
|
+
loop.run_until_complete(
|
1774
|
+
self._async_remove_from_project_team(project_guid, actor_guid, server_name)
|
1775
|
+
)
|
1531
1776
|
return
|
1532
1777
|
|
1533
|
-
async def _async_setup_project_management_role(
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1778
|
+
async def _async_setup_project_management_role(
|
1779
|
+
self, project_guid: str, project_role_guid: str, server_name: str = None
|
1780
|
+
) -> None:
|
1781
|
+
"""Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
|
1782
|
+
the role is a member of the project. Async version.
|
1783
|
+
|
1784
|
+
Parameters
|
1785
|
+
----------
|
1786
|
+
project_guid: str
|
1787
|
+
identity of the project.
|
1788
|
+
project_role_guid: str
|
1789
|
+
guid of the role to assign to the project.
|
1790
|
+
server_name : str, optional
|
1791
|
+
The name of the server to use.
|
1792
|
+
If not provided, the server name associated with the instance is used.
|
1793
|
+
|
1794
|
+
Returns
|
1795
|
+
-------
|
1796
|
+
None
|
1797
|
+
|
1798
|
+
Raises
|
1799
|
+
------
|
1800
|
+
|
1801
|
+
InvalidParameterException
|
1802
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1803
|
+
PropertyServerException
|
1804
|
+
Raised by the server when an issue arises in processing a valid request
|
1805
|
+
NotAuthorizedException
|
1806
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1561
1807
|
|
1562
1808
|
"""
|
1563
1809
|
if server_name is None:
|
1564
1810
|
server_name = self.server_name
|
1565
1811
|
|
1566
|
-
url = (
|
1567
|
-
|
1812
|
+
url = (
|
1813
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
|
1814
|
+
f"project-management-roles/{project_role_guid}/attach"
|
1815
|
+
)
|
1568
1816
|
|
1569
|
-
body = {
|
1570
|
-
"class": "NullRequestBody"
|
1571
|
-
}
|
1817
|
+
body = {"class": "NullRequestBody"}
|
1572
1818
|
await self._async_make_request("POST", url, body)
|
1573
1819
|
return
|
1574
1820
|
|
1575
|
-
def setup_project_management_role(
|
1576
|
-
|
1577
|
-
|
1821
|
+
def setup_project_management_role(
|
1822
|
+
self, project_guid: str, project_role_guid: str, server_name: str = None
|
1823
|
+
) -> None:
|
1824
|
+
"""Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
|
1578
1825
|
the role is a member of the project. Async version.
|
1579
1826
|
|
1580
1827
|
Parameters
|
@@ -1603,54 +1850,59 @@ class ProjectManager(Client):
|
|
1603
1850
|
|
1604
1851
|
"""
|
1605
1852
|
loop = asyncio.get_event_loop()
|
1606
|
-
loop.run_until_complete(
|
1607
|
-
|
1853
|
+
loop.run_until_complete(
|
1854
|
+
self._async_setup_project_management_role(
|
1855
|
+
project_guid, project_role_guid, server_name
|
1856
|
+
)
|
1857
|
+
)
|
1608
1858
|
return
|
1609
1859
|
|
1610
|
-
async def _async_clear_project_management_role(
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1860
|
+
async def _async_clear_project_management_role(
|
1861
|
+
self, project_guid: str, project_role_guid: str, server_name: str = None
|
1862
|
+
) -> None:
|
1863
|
+
"""Remove a ProjectManagement relationship between a project and a person role. Async version.
|
1864
|
+
|
1865
|
+
Parameters
|
1866
|
+
----------
|
1867
|
+
project_guid: str
|
1868
|
+
identity of the project.
|
1869
|
+
project_role_guid: str
|
1870
|
+
guid of the role to assign to the project.
|
1871
|
+
server_name : str, optional
|
1872
|
+
The name of the server to use.
|
1873
|
+
If not provided, the server name associated with the instance is used.
|
1874
|
+
|
1875
|
+
Returns
|
1876
|
+
-------
|
1877
|
+
None
|
1878
|
+
|
1879
|
+
Raises
|
1880
|
+
------
|
1881
|
+
|
1882
|
+
InvalidParameterException
|
1883
|
+
If the client passes incorrect parameters on the request - such as bad URLs or invalid values
|
1884
|
+
PropertyServerException
|
1885
|
+
Raised by the server when an issue arises in processing a valid request
|
1886
|
+
NotAuthorizedException
|
1887
|
+
The principle specified by the user_id does not have authorization for the requested action
|
1637
1888
|
|
1638
1889
|
"""
|
1639
1890
|
if server_name is None:
|
1640
1891
|
server_name = self.server_name
|
1641
1892
|
|
1642
|
-
url = (
|
1643
|
-
|
1893
|
+
url = (
|
1894
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
|
1895
|
+
f"project-management-roles/{project_role_guid}/detach"
|
1896
|
+
)
|
1644
1897
|
|
1645
|
-
body = {
|
1646
|
-
"class": "NullRequestBody"
|
1647
|
-
}
|
1898
|
+
body = {"class": "NullRequestBody"}
|
1648
1899
|
await self._async_make_request("POST", url, body)
|
1649
1900
|
return
|
1650
1901
|
|
1651
|
-
def clear_project_management_role(
|
1652
|
-
|
1653
|
-
|
1902
|
+
def clear_project_management_role(
|
1903
|
+
self, project_guid: str, project_role_guid: str, server_name: str = None
|
1904
|
+
) -> None:
|
1905
|
+
"""Clear a ProjectManagement relationship between a project and a person role.
|
1654
1906
|
|
1655
1907
|
Parameters
|
1656
1908
|
----------
|
@@ -1678,6 +1930,9 @@ class ProjectManager(Client):
|
|
1678
1930
|
|
1679
1931
|
"""
|
1680
1932
|
loop = asyncio.get_event_loop()
|
1681
|
-
loop.run_until_complete(
|
1682
|
-
|
1933
|
+
loop.run_until_complete(
|
1934
|
+
self._async_clear_project_management_role(
|
1935
|
+
project_guid, project_role_guid, server_name
|
1936
|
+
)
|
1937
|
+
)
|
1683
1938
|
return
|