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.
Files changed (51) hide show
  1. examples/widgets/cat/list_cert_types.py +61 -43
  2. examples/widgets/cat/list_projects.py +1 -1
  3. examples/widgets/cli/egeria.py +18 -2
  4. examples/widgets/cli/egeria_tech.py +299 -98
  5. examples/widgets/my/my_profile_actions.py +51 -32
  6. examples/widgets/ops/engine_actions.py +35 -23
  7. examples/widgets/ops/integration_daemon_actions.py +51 -32
  8. examples/widgets/tech/get_element_info.py +63 -38
  9. examples/widgets/tech/get_guid_info.py +50 -27
  10. examples/widgets/tech/list_asset_types.py +33 -23
  11. examples/widgets/tech/list_elements.py +44 -34
  12. examples/widgets/tech/list_elements_x.py +69 -49
  13. examples/widgets/tech/list_registered_services.py +44 -24
  14. examples/widgets/tech/list_related_specification.py +70 -45
  15. examples/widgets/tech/list_relationship_types.py +50 -31
  16. examples/widgets/tech/list_valid_metadata_values.py +57 -28
  17. examples/widgets/tech/x_list_related_elements.py +54 -34
  18. pyegeria/Xloaded_resources_omvs.py +43 -41
  19. pyegeria/__init__.py +5 -1
  20. pyegeria/_client.py +142 -102
  21. pyegeria/_deprecated_gov_engine.py +218 -167
  22. pyegeria/action_author_omvs.py +107 -88
  23. pyegeria/asset_catalog_omvs.py +467 -395
  24. pyegeria/automated_curation_omvs.py +2 -2
  25. pyegeria/classification_manager_omvs.py +1920 -868
  26. pyegeria/collection_manager_omvs.py +1957 -1519
  27. pyegeria/core_omag_server_config.py +310 -192
  28. pyegeria/egeria_cat_client.py +88 -0
  29. pyegeria/egeria_config_client.py +37 -0
  30. pyegeria/egeria_my_client.py +47 -0
  31. pyegeria/egeria_ops_client.py +67 -0
  32. pyegeria/egeria_tech_client.py +77 -0
  33. pyegeria/feedback_manager_omvs.py +633 -631
  34. pyegeria/full_omag_server_config.py +330 -158
  35. pyegeria/glossary_browser_omvs.py +927 -474
  36. pyegeria/glossary_manager_omvs.py +1033 -543
  37. pyegeria/mermaid_utilities.py +1 -1
  38. pyegeria/my_profile_omvs.py +714 -574
  39. pyegeria/platform_services.py +228 -176
  40. pyegeria/project_manager_omvs.py +1158 -903
  41. pyegeria/registered_info.py +76 -74
  42. pyegeria/runtime_manager_omvs.py +749 -670
  43. pyegeria/server_operations.py +123 -85
  44. pyegeria/valid_metadata_omvs.py +268 -168
  45. {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/METADATA +1 -1
  46. {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/RECORD +49 -46
  47. examples/widgets/tech/list_gov_processes.py +0 -162
  48. pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
  49. {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/LICENSE +0 -0
  50. {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/WHEEL +0 -0
  51. {pyegeria-0.7.45.dist-info → pyegeria-0.8.0.dist-info}/entry_points.txt +0 -0
@@ -37,24 +37,30 @@ class ProjectManager(Client):
37
37
  """
38
38
 
39
39
  def __init__(
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
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, async_mode=sync_mode)
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(self, parent_guid: str, project_status: str = None, effective_time: str = None,
55
- server_name: str = None, start_from: int = 0, page_size: int = None) \
56
- -> list | str:
57
- """ Returns the list of projects that are linked off of the supplied element. Any relationship will do.
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/"
104
- f"metadata-elements/{parent_guid}/projects?startFrom={start_from}&pageSize={page_size}")
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('elements','No linked projects found')
108
-
109
- def get_linked_projects(self, parent_guid: str, project_status: str = None, effective_time: str = None,
110
- server_name: str = None, start_from: int = 0, page_size: int = None) -> list | str:
111
- """ Returns the list of projects that are linked off of the supplied element. Any relationship will do.
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(self._async_get_linked_projects(parent_guid, project_status,
149
- effective_time, server_name,
150
- start_from, page_size))
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(self, project_classification: str, effective_time: str = None,
154
- server_name: str = None, start_from: int = 0, page_size: int = None) \
155
- -> list | str:
156
- """ Returns the list of projects with a particular classification. The name of the classification is
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/"
202
- f"projects/by-classifications?startFrom={start_from}&pageSize={page_size}")
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(self, project_classification: str, effective_time: str = None, server_name: str = None,
208
- start_from: int = 0, page_size: int = None) -> list | str:
209
- """ Returns the list of projects with a particular classification. The name of the classification is
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(self._async_get_classified_projects(project_classification,
246
- effective_time, server_name,
247
- start_from, page_size))
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(self, project_guid: str, team_role: str = None, effective_time: str = None,
251
- server_name: str = None, start_from: int = 0,
252
- page_size: int = None) -> list | str:
253
- """ Returns the list of actors that are linked off of the project. This includes the project managers.
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
302
- f"{project_guid}/team?startFrom={start_from}&pageSize={page_size}")
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('elements', 'No elements found')
352
+ result = resp.json().get("elements", "No elements found")
307
353
  return result
308
354
 
309
- def get_project_team(self, project_guid: str, team_role: str = None, effective_time: str = None,
310
- server_name: str = None, start_from: int = 0, page_size: int = None) -> list | str:
311
- """ Returns the list of actors that are linked off of the project. This includes the project managers.
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(self._async_get_project_team(project_guid, team_role, effective_time,
351
- server_name, start_from, page_size))
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(self, search_string: str, effective_time: str = None, starts_with: bool = False,
355
- ends_with: bool = False, ignore_case: bool = False,
356
- server_name: str = None,
357
- start_from: int = 0, page_size: int = None) -> list | str:
358
- """ Returns the list of projects matching the search string.
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
419
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
420
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
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(self, search_string: str, effective_time: str = None, starts_with: bool = False,
426
- ends_with: bool = False, ignore_case: bool = False, server_name: str = None,
427
- start_from: int = 0, page_size: int = None) -> list | str:
428
- """ Returns the list of projects matching the search string.
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(self._async_find_projects(search_string, effective_time, starts_with,
471
- ends_with, ignore_case,
472
- server_name, start_from, page_size))
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(self, name: str, effective_time: str = None,
477
- server_name: str = None,
478
- start_from: int = 0, page_size: int = None) -> list | str:
479
-
480
- """ Returns the list of projects with a particular name. Async version.
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
526
- f"by-name?startFrom={start_from}&pageSize={page_size}")
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(self, name: str, effective_time: str = None, server_name: str = None,
532
- start_from: int = 0, page_size: int = None) -> list | str:
533
- """ Returns the list of projects with a particular name.
534
-
535
- Parameters
536
- ----------
537
- name: str,
538
- name to use to find matching collections.
539
- effective_time: str, [default=None], optional
540
- Effective time of the query. If not specified will default to any time. ISO 8601 format.
541
- server_name : str, optional
542
- The name of the server to configure.
543
- If not provided, the server name associated with the instance is used.
544
- start_from: int, [default=0], optional
545
- When multiple pages of results are available, the page number to start from.
546
- page_size: int, [default=None]
547
- The number of items to return in a single page. If not specified, the default will be taken from
548
- the class instance.
549
- Returns
550
- -------
551
- List | str
552
-
553
- A list of collections match matching the name. Returns a string if none found.
554
-
555
- Raises
556
- ------
557
-
558
- InvalidParameterException
559
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
560
- PropertyServerException
561
- Raised by the server when an issue arises in processing a valid request
562
- NotAuthorizedException
563
- The principle specified by the user_id does not have authorization for the requested action
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(self._async_get_projects_by_name(name, effective_time,
568
- server_name, start_from, page_size))
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(self, project_guid: str, effective_time: str = None,
573
- server_name: str = None) -> dict | str:
574
- """ Return the properties of a specific project. Async version.
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
- """ Return the properties of a specific project.
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(self._async_get_project(project_guid, server_name))
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(self, body: dict, classification: str = None,
652
- server_name: str = None) -> str:
653
- """ Create project: https://egeria-project.org/concepts/project Async version.
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects?"
708
- f"classificationName={classification}")
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(self, body: dict, classification: str = None, server_name: str = None) -> str:
714
- """ Create project: https://egeria-project.org/concepts/project
715
-
716
- Parameters
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(self._async_create_project_w_body(body, classification, server_name))
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(self, anchor_guid: str, parent_guid: str,
768
- parent_relationship_type_name: str, parent_at_end1: bool, display_name: str,
769
- description: str, classification_name: str = None, identifier: str = None,
770
- is_own_anchor: bool = False, project_status: str = None, project_phase: str = None,
771
- project_health: str = None, start_date: str = None,
772
- planned_end_date: str = None, server_name: str = None) -> str:
773
- """ Create Project: https://egeria-project.org/concepts/project Async version.
774
-
775
- Parameters
776
- ----------
777
- classification_name: str, optional
778
- Type of project to create; "PersonalProject", "Campaign", etc. If not provided, project will not
779
- be classified.
780
- anchor_guid: str
781
- The unique identifier of the element that should be the anchor for the new element. Set to null if no
782
- anchor, or if this collection is to be its own anchor.
783
- parent_guid: str
784
- The optional unique identifier for an element that should be connected to the newly created element.
785
- If this property is specified, parentRelationshipTypeName must also be specified
786
- parent_relationship_type_name: str
787
- The name of the relationship, if any, that should be established between the new element and the parent
788
- element. Examples could be "ResourceList".
789
- parent_at_end1: bool
790
- Identifies which end any parent entity sits on the relationship.
791
- display_name: str
792
- The display name of the element. Will also be used as the basis of the qualified_name.
793
- description: str
794
- A description of the collection.
795
- identifier: str
796
- A project identifier.
797
- is_own_anchor: bool, optional, defaults to False
798
- Indicates if the collection should be classified as its own anchor or not.
799
- project_status: str, optional
800
- The project status
801
- project_phase: str, optional
802
- Project phase as defined in valid values
803
- project_health: str, optional
804
- Project health as defined in valid values
805
- start_date: str, optional, defaults to None
806
- Start date of the project in ISO 8601 string format.
807
- planned_end_date: str, optional, defaults to None
808
- Planned completion date in ISO 8601 string format.
809
- server_name: str, optional, defaults to None
810
- The name of the server to configure. If not provided, the server name associated with the instance is
811
- used.
812
-
813
- Returns
814
- -------
815
- str - the guid of the created project
816
-
817
- Raises
818
- ------
819
- InvalidParameterException
820
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
821
- PropertyServerException
822
- Raised by the server when an issue arises in processing a valid request
823
- NotAuthorizedException
824
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects?"
837
- f"classificationName={classification_name}")
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(self, anchor_guid: str, parent_guid: str,
863
- parent_relationship_type_name: str, parent_at_end1: bool, display_name: str,
864
- description: str, classification_name: str, identifier: str = None, is_own_anchor: bool = False,
865
- project_status: str = None, project_phase: str = None, project_health: str = None,
866
- start_date: str = None, planned_end_date: str = None, server_name: str = None) -> str:
867
- """ Create Project: https://egeria-project.org/concepts/project
868
-
869
- Parameters
870
- ----------
871
- classification_name: str
872
- Type of project to create; "PersonalProject", "Campaign", etc. If not provided, the project will not
873
- have a project classification.
874
- anchor_guid: str
875
- The unique identifier of the element that should be the anchor for the new element. Set to null if no
876
- anchor, or if this collection is to be its own anchor.
877
- parent_guid: str
878
- The optional unique identifier for an element that should be connected to the newly created element.
879
- If this property is specified, parentRelationshipTypeName must also be specified
880
- parent_relationship_type_name: str
881
- The name of the relationship, if any, that should be established between the new element and the parent
882
- element. Examples could be "ResourceList".
883
- parent_at_end1: bool
884
- Identifies which end any parent entity sits on the relationship.
885
- display_name: str
886
- The display name of the element. Will also be used as the basis of the qualified_name.
887
- description: str
888
- A description of the collection.
889
- identifier: str
890
- A project identifier.
891
- is_own_anchor: bool, optional, defaults to False
892
- Indicates if the collection should be classified as its own anchor or not.
893
- project_status: str, optional
894
- The project status
895
- project_phase: str, optional
896
- Project phase as defined in valid values
897
- project_health: str, optional
898
- Project health as defined in valid values
899
- start_date: str, optional, defaults to None
900
- Start date of the project in ISO 8601 string format.
901
- planned_end_date: str, optional, defaults to None
902
- Planned completion date in ISO 8601 string format.
903
- server_name: str, optional, defaults to None
904
- The name of the server to configure. If not provided, the server name associated with the instance is
905
- used.
906
-
907
- Returns
908
- -------
909
- str - the guid of the created project
910
-
911
- Raises
912
- ------
913
- InvalidParameterException
914
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
915
- PropertyServerException
916
- Raised by the server when an issue arises in processing a valid request
917
- NotAuthorizedException
918
- The principle specified by the user_id does not have authorization for the requested action
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(self._async_create_project(anchor_guid, parent_guid,
923
- parent_relationship_type_name, parent_at_end1,
924
- display_name, description,
925
- classification_name, identifier, is_own_anchor,
926
- project_status, project_phase, project_health,
927
- start_date, planned_end_date, server_name))
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(self, project_guid: str, display_name: str, identifier: str = None,
931
- description: str = None, project_status: str = None, project_phase: str = None,
932
- project_health: str = None, start_date: str = None,
933
- planned_end_date: str = None, server_name: str = None) -> str:
934
- """ Create a new project with the Task classification and link it to a project. Async version.
935
-
936
- Parameters
937
- ----------
938
- project_guid: str
939
- The unique identifier of the project to create the task for (the parent).
940
- display_name: str
941
- The display name of the element. Will also be used as the basis of the qualified_name.
942
- identifier: str
943
- A project identifier.
944
- description: str
945
- A description of the collection.
946
- project_status: str, optional, defaults to "OTHER"
947
- The project status
948
- project_phase: str, optional
949
- Project phase as defined in valid values
950
- project_health: str, optional
951
- Project health as defined in valid values
952
- start_date: str, optional, defaults to None
953
- Start date of the project in ISO 8601 string format.
954
- planned_end_date: str, optional, defaults to None
955
- Planned completion date in ISO 8601 string format.
956
- server_name: str, optional, defaults to None
957
- The name of the server to configure. If not provided, the server name associated with the instance is
958
- used.
959
- Returns
960
- -------
961
- str - the guid of the created project task
962
-
963
- Raises
964
- ------
965
- InvalidParameterException
966
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
967
- PropertyServerException
968
- Raised by the server when an issue arises in processing a valid request
969
- NotAuthorizedException
970
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
977
- f"{project_guid}/task")
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(self, project_guid: str, display_name: str, identifier: str = None,
996
- description: str = None, project_status: str = None, project_phase: str = None,
997
- project_health: str = None,
998
- start_date: str = None, planned_end_date: str = None, server_name: str = None) -> str:
999
- """ Create a new project with the Task classification and link it to a project.
1000
-
1001
- Parameters
1002
- ----------
1003
- project_guid: str
1004
- The unique identifier of the project to create the task for.The parent.
1005
- display_name: str
1006
- The display name of the element. Will also be used as the basis of the qualified_name.
1007
- identifier: str
1008
- A project identifier.
1009
- description: str
1010
- A description of the collection.
1011
- project_status: str, optional, defaults to "OTHER"
1012
- The project status
1013
- project_phase: str, optional
1014
- Project phase as defined in valid values
1015
- project_health: str, optional
1016
- Project health as defined in valid values
1017
- start_date: str, optional, defaults to None
1018
- Start date of the project in ISO 8601 string format.
1019
- planned_end_date: str, optional, defaults to None
1020
- Planned completion date in ISO 8601 string format.
1021
- server_name: str, optional, defaults to None
1022
- The name of the server to configure. If not provided, the server name associated with the instance is
1023
- used.
1024
- Returns
1025
- -------
1026
- str - the guid of the created project task
1027
-
1028
- Raises
1029
- ------
1030
- InvalidParameterException
1031
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1032
- PropertyServerException
1033
- Raised by the server when an issue arises in processing a valid request
1034
- NotAuthorizedException
1035
- The principle specified by the user_id does not have authorization for the requested action
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(self._async_create_project_task(project_guid, display_name,
1040
- identifier, description, project_status,
1041
- project_phase, project_health, start_date,
1042
- planned_end_date,
1043
- server_name))
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(self, body: dict, server_name: str = None) -> str:
1047
- """ Create a new metadata element to represent a project using an existing metadata element as a template.
1048
- The template defines additional classifications and relationships that should be added to the new project.
1049
- Async version.
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
- Parameters
1052
- ----------
1053
-
1054
- body: dict
1055
- A dict representing the details of the collection to create.
1056
- server_name: str, optional, defaults to None
1057
- The name of the server to configure. If not provided, the server name associated with the instance
1058
- is used.
1059
-
1060
- Returns
1061
- -------
1062
- str - the guid of the created project.
1063
-
1064
- Raises
1065
- ------
1066
- InvalidParameterException
1067
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1068
- PropertyServerException
1069
- Raised by the server when an issue arises in processing a valid request
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
- """ Create a new metadata element to represent a project using an existing metadata element as a template.
1113
- The template defines additional classifications and relationships that should be added to the new project.
1114
-
1115
- Parameters
1116
- ----------
1117
-
1118
- body: dict
1119
- A dict representing the details of the collection to create.
1120
- server_name: str, optional, defaults to None
1121
- The name of the server to configure. If not provided, the server name associated with the instance
1122
- is used.
1123
-
1124
- Returns
1125
- -------
1126
- str - the guid of the created project.
1127
-
1128
- Raises
1129
- ------
1130
- InvalidParameterException
1131
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1132
- PropertyServerException
1133
- Raised by the server when an issue arises in processing a valid request
1134
- NotAuthorizedException
1135
- The principle specified by the user_id does not have authorization for the requested action
1136
-
1137
- Notes
1138
- -----
1139
- JSON Structure looks like:
1140
- {
1141
- "class": "TemplateRequestBody",
1142
- "anchorGUID": "anchor GUID, if set then isOwnAnchor=false",
1143
- "isOwnAnchor": false,
1144
- "parentGUID": "parent GUID, if set, set all parameters beginning 'parent'",
1145
- "parentRelationshipTypeName": "open metadata type name",
1146
- "parentAtEnd1": true,
1147
- "templateGUID": "template GUID",
1148
- "replacementProperties": {
1149
- "class": "ElementProperties",
1150
- "propertyValueMap" : {
1151
- "propertyName" : {
1152
- "class": "PrimitiveTypePropertyValue",
1153
- "typeName": "string",
1154
- "primitiveTypeCategory" : "OM_PRIMITIVE_TYPE_STRING",
1155
- "primitiveValue" : "value of property"
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(self._async_create_project_from_template(body, server_name))
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(self, project_guid: str, qualified_name: str = None, identifier: str = None,
1170
- display_name: str = None, description: str = None,
1171
- project_status: str = None, project_phase: str = None, project_health: str = None,
1172
- start_date: str = None, planned_end_date: str = None,
1173
- replace_all_props: bool = False, server_name: str = None) -> None:
1174
- """ Update the properties of a project. Async Version.
1175
-
1176
- Parameters
1177
- ----------
1178
- project_guid: str
1179
- Unique identifier for the project.
1180
- qualified_name: str, optional, defaults to None
1181
- The unique identifier of the project.
1182
- identifier: str
1183
- A project identifier.
1184
- display_name: str
1185
- The display name of the element. Will also be used as the basis of the qualified_name.
1186
- description: str
1187
- A description of the collection.
1188
- project_status: str, optional
1189
- The project status
1190
- project_phase: str, optional
1191
- Project phase as defined in valid values
1192
- project_health: str, optional
1193
- Project health as defined in valid values
1194
- start_date: str, optional, defaults to None
1195
- Start date of the project in ISO 8601 string format.
1196
- planned_end_date: str, optional, defaults to None
1197
- Planned completion date in ISO 8601 string format.
1198
- replace_all_props: bool, optional, defaults to False
1199
- If True, then all the properties of the project will be replaced with the specified properties.
1200
- server_name: str, optional, defaults to None
1201
- The name of the server to configure. If not provided, the server name associated with the instance is
1202
- used.
1203
- Returns
1204
- -------
1205
- str - the guid of the created project task
1206
-
1207
- Raises
1208
- ------
1209
- InvalidParameterException
1210
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1211
- PropertyServerException
1212
- Raised by the server when an issue arises in processing a valid request
1213
- NotAuthorizedException
1214
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1220
- f"update?replaceAllProperties={replace_all_props_s}")
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(self, project_guid: str, qualified_name: str = None, identifier: str = None,
1239
- display_name: str = None, description: str = None, project_status: str = None,
1240
- project_phase: str = None, project_health: str = None, start_date: str = None,
1241
- planned_end_date: str = None, replace_all_props: bool = False, server_name: str = None) -> None:
1242
- """ Update the properties of a project.
1243
-
1244
- Parameters
1245
- ----------
1246
- project_guid: str
1247
- Unique identifier for the project.
1248
- qualified_name: str, optional, defaults to None
1249
- The unique identifier of the project.
1250
- identifier: str
1251
- A project identifier.
1252
- display_name: str
1253
- The display name of the element. Will also be used as the basis of the qualified_name.
1254
- description: str
1255
- A description of the collection.
1256
- project_status: str, optional
1257
- The project status
1258
- project_phase: str, optional
1259
- Project phase as defined in valid values
1260
- project_health: str, optional
1261
- Project health as defined in valid values
1262
- start_date: str, optional, defaults to None
1263
- Start date of the project in ISO 8601 string format.
1264
- planned_end_date: str, optional, defaults to None
1265
- Planned completion date in ISO 8601 string format.
1266
- replace_all_props: bool, optional, defaults to False
1267
- If True, then all the properties of the project will be replaced with the specified properties.
1268
- server_name: str, optional, defaults to None
1269
- The name of the server to configure. If not provided, the server name associated with the instance is
1270
- used.
1271
- Returns
1272
- -------
1273
- str - the guid of the created project task
1274
-
1275
- Raises
1276
- ------
1277
- InvalidParameterException
1278
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1279
- PropertyServerException
1280
- Raised by the server when an issue arises in processing a valid request
1281
- NotAuthorizedException
1282
- The principle specified by the user_id does not have authorization for the requested action
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(self._async_update_project(project_guid, qualified_name, identifier,
1286
- display_name, description, project_status,
1287
- project_phase, project_health, start_date,
1288
- planned_end_date,
1289
- replace_all_props, server_name))
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(self, project_guid: str, server_name: str = None) -> None:
1293
- """ Delete a project. It is detected from all parent elements. Async version
1294
-
1295
- Parameters
1296
- ----------
1297
- project_guid: str
1298
- The guid of the project to update.
1299
- server_name: str, optional, defaults to None
1300
- The name of the server to configure. If not provided, the server name associated with the instance
1301
- is used.
1302
-
1303
- Returns
1304
- -------
1305
- Nothing
1306
-
1307
- Raises
1308
- ------
1309
- InvalidParameterException
1310
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1311
- PropertyServerException
1312
- Raised by the server when an issue arises in processing a valid request
1313
- NotAuthorizedException
1314
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
1321
- f"{project_guid}/delete")
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
- """ Delete a project. It is detected from all parent elements.
1332
-
1333
- Parameters
1334
- ----------
1335
- project_guid: str
1336
- The guid of the collection to update.
1337
- server_name: str, optional, defaults to None
1338
- The name of the server to configure. If not provided, the server name associated with the instance
1339
- is used.
1340
-
1341
- Returns
1342
- -------
1343
- Nothing
1344
-
1345
- Raises
1346
- ------
1347
-
1348
- InvalidParameterException
1349
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1350
- PropertyServerException
1351
- Raised by the server when an issue arises in processing a valid request
1352
- NotAuthorizedException
1353
- The principle specified by the user_id does not have authorization for the requested action
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(self, project_guid: str, actor_guid: str, team_role: str = None,
1361
- effective_from: str = None, effective_to: str = None,
1362
- server_name: str = None) -> None:
1363
- """ Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
1364
- the actor plays in the project. Async version.
1365
-
1366
- Parameters
1367
- ----------
1368
- project_guid: str
1369
- identity of the project to update.
1370
- actor_guid: str
1371
- identity of the actor to add.
1372
- team_role: str, optional, defaults to None
1373
- Name of the role the actor plays in the project.
1374
- effective_from: str, optional, defaults to None
1375
- Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
1376
- effective_to: str, optional, defaults to None
1377
- Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
1378
- server_name : str, optional
1379
- The name of the server to use.
1380
- If not provided, the server name associated with the instance is used.
1381
-
1382
- Returns
1383
- -------
1384
- None
1385
-
1386
- Raises
1387
- ------
1388
-
1389
- InvalidParameterException
1390
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1391
- PropertyServerException
1392
- Raised by the server when an issue arises in processing a valid request
1393
- NotAuthorizedException
1394
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1401
- f"members/{actor_guid}/attach")
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(self, project_guid: str, actor_guid: str, team_role: str = None,
1416
- effective_from: str = None, effective_to: str = None,
1417
- server_name: str = None) -> None:
1418
- """ Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
1419
- the actor plays in the project.
1420
-
1421
- Parameters
1422
- ----------
1423
- project_guid: str
1424
- identity of the project to update.
1425
- actor_guid: str
1426
- identity of the actor to add.
1427
- team_role: str, optional, defaults to None
1428
- Name of the role the actor plays in the project.
1429
- effective_from: str, optional, defaults to None
1430
- Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
1431
- effective_to: str, optional, defaults to None
1432
- Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
1433
- server_name : str, optional
1434
- The name of the server to use.
1435
- If not provided, the server name associated with the instance is used.
1436
-
1437
- Returns
1438
- -------
1439
- None
1440
-
1441
- Raises
1442
- ------
1443
-
1444
- InvalidParameterException
1445
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1446
- PropertyServerException
1447
- Raised by the server when an issue arises in processing a valid request
1448
- NotAuthorizedException
1449
- The principle specified by the user_id does not have authorization for the requested action
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(self._async_add_to_project_team(project_guid, actor_guid,
1454
- team_role, effective_from,
1455
- effective_to, server_name))
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(self, project_guid: str, actor_guid: str,
1459
- server_name: str = None) -> None:
1460
- """ Remove an actor from a project. Async version.
1461
-
1462
- Parameters
1463
- ----------
1464
- project_guid: str
1465
- identity of the project to remove members from.
1466
- actor_guid: str
1467
- identity of the actor to remove.
1468
- server_name : str, optional
1469
- The name of the server to use.
1470
- If not provided, the server name associated with the instance is used.
1471
-
1472
- Returns
1473
- -------
1474
- None
1475
-
1476
- Raises
1477
- ------
1478
-
1479
- InvalidParameterException
1480
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1481
- PropertyServerException
1482
- Raised by the server when an issue arises in processing a valid request
1483
- NotAuthorizedException
1484
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1491
- f"members/{actor_guid}/detach")
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(self, project_guid: str, actor_guid: str,
1500
- server_name: str = None) -> None:
1501
- """ Remove an actor from a project.
1502
-
1503
- Parameters
1504
- ----------
1505
- project_guid: str
1506
- identity of the project.
1507
- actor_guid: str
1508
- identity of the actor to remove.
1509
- server_name : str, optional
1510
- The name of the server to use.
1511
- If not provided, the server name associated with the instance is used.
1512
-
1513
- Returns
1514
- -------
1515
- None
1516
-
1517
- Raises
1518
- ------
1519
-
1520
- InvalidParameterException
1521
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1522
- PropertyServerException
1523
- Raised by the server when an issue arises in processing a valid request
1524
- NotAuthorizedException
1525
- The principle specified by the user_id does not have authorization for the requested action
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(self._async_remove_from_project_team(project_guid, actor_guid,
1530
- server_name))
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(self, project_guid: str, project_role_guid: str,
1534
- server_name: str = None) -> None:
1535
- """ Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
1536
- the role is a member of the project. Async version.
1537
-
1538
- Parameters
1539
- ----------
1540
- project_guid: str
1541
- identity of the project.
1542
- project_role_guid: str
1543
- guid of the role to assign to the project.
1544
- server_name : str, optional
1545
- The name of the server to use.
1546
- If not provided, the server name associated with the instance is used.
1547
-
1548
- Returns
1549
- -------
1550
- None
1551
-
1552
- Raises
1553
- ------
1554
-
1555
- InvalidParameterException
1556
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1557
- PropertyServerException
1558
- Raised by the server when an issue arises in processing a valid request
1559
- NotAuthorizedException
1560
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1567
- f"project-management-roles/{project_role_guid}/attach")
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(self, project_guid: str, project_role_guid: str,
1576
- server_name: str = None) -> None:
1577
- """ Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
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(self._async_setup_project_management_role(project_guid, project_role_guid,
1607
- server_name))
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(self, project_guid: str, project_role_guid: str,
1611
- server_name: str = None) -> None:
1612
- """ Remove a ProjectManagement relationship between a project and a person role. Async version.
1613
-
1614
- Parameters
1615
- ----------
1616
- project_guid: str
1617
- identity of the project.
1618
- project_role_guid: str
1619
- guid of the role to assign to the project.
1620
- server_name : str, optional
1621
- The name of the server to use.
1622
- If not provided, the server name associated with the instance is used.
1623
-
1624
- Returns
1625
- -------
1626
- None
1627
-
1628
- Raises
1629
- ------
1630
-
1631
- InvalidParameterException
1632
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1633
- PropertyServerException
1634
- Raised by the server when an issue arises in processing a valid request
1635
- NotAuthorizedException
1636
- The principle specified by the user_id does not have authorization for the requested action
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 = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1643
- f"project-management-roles/{project_role_guid}/detach")
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(self, project_guid: str, project_role_guid: str,
1652
- server_name: str = None) -> None:
1653
- """ Clear a ProjectManagement relationship between a project and a person role.
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(self._async_clear_project_management_role(project_guid, project_role_guid,
1682
- server_name))
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