pyegeria 5.4.0.26__py3-none-any.whl → 5.4.0.28__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 (46) hide show
  1. commands/cat/debug_log +868 -7794
  2. commands/cat/debug_log.2025-08-18_11-34-38_088636.zip +0 -0
  3. commands/cat/list_collections.py +1 -1
  4. commands/cat/list_format_set.py +6 -8
  5. commands/cli/egeria.py +2 -2
  6. commands/cli/egeria_cat.py +3 -2
  7. commands/ops/load_archive.py +2 -2
  8. md_processing/data/commands.json +7 -7
  9. md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +7 -7
  10. md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +36 -31
  11. md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:22-dr_egeria_intro_part1.md +312 -0
  12. md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:23-dr_egeria_intro_part1.md +265 -0
  13. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:06-dr_egeria_intro_part1.md +230 -0
  14. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:30-dr_egeria_intro_part1.md +296 -0
  15. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:31-dr_egeria_intro_part1.md +253 -0
  16. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:08-dr_egeria_intro_part2.md +343 -0
  17. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:12-dr_egeria_intro_part2.md +343 -0
  18. md_processing/md_commands/glossary_commands.py +888 -951
  19. md_processing/md_commands/product_manager_commands.py +8 -270
  20. md_processing/md_commands/project_commands.py +1 -1
  21. md_processing/md_processing_utils/common_md_proc_utils.py +138 -64
  22. md_processing/md_processing_utils/common_md_utils.py +2 -1
  23. pyegeria/__init__.py +2 -3
  24. pyegeria/_client_new.py +4 -3
  25. pyegeria/_output_formats.py +5 -3
  26. pyegeria/collection_manager.py +32 -29
  27. pyegeria/{load_config.py → config.py} +7 -2
  28. pyegeria/data_designer.py +154 -194
  29. pyegeria/egeria_cat_client.py +46 -28
  30. pyegeria/egeria_client.py +71 -72
  31. pyegeria/egeria_config_client.py +37 -7
  32. pyegeria/egeria_my_client.py +45 -10
  33. pyegeria/egeria_tech_client.py +68 -57
  34. pyegeria/glossary_manager.py +495 -124
  35. pyegeria/governance_officer.py +2 -2
  36. pyegeria/logging_configuration.py +1 -4
  37. pyegeria/models.py +1 -1
  38. pyegeria/project_manager.py +359 -511
  39. pyegeria/utils.py +1 -3
  40. {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/METADATA +1 -1
  41. {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/RECORD +44 -38
  42. md_processing/md_processing_utils/solution_architect_log.log +0 -0
  43. pyegeria/glossary_browser.py +0 -1259
  44. {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/LICENSE +0 -0
  45. {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/WHEEL +0 -0
  46. {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/entry_points.txt +0 -0
@@ -9,27 +9,16 @@ Copyright Contributors to the ODPi Egeria project.
9
9
 
10
10
  import asyncio
11
11
 
12
- from loguru import logger
13
-
14
12
  from pyegeria._client_new import Client2
15
- from pyegeria.load_config import get_app_config
13
+ from pyegeria.config import settings as app_settings
16
14
  from pyegeria.models import (SearchStringRequestBody, FilterRequestBody, GetRequestBody, NewElementRequestBody,
17
- TemplateRequestBody, UpdateElementRequestBody, DeleteRequestBody,
18
- NewRelationshipRequestBody)
15
+ TemplateRequestBody)
19
16
  from pyegeria.utils import body_slimmer, dynamic_catch
20
- from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
21
- from pyegeria.output_formatter import (generate_output,
22
- _extract_referenceable_properties,
23
- populate_columns_from_properties,
24
- get_required_relationships)
25
17
 
26
- app_settings = get_app_config()
27
18
  EGERIA_LOCAL_QUALIFIER = app_settings.User_Profile.egeria_local_qualifier
28
19
  from pyegeria._globals import NO_ELEMENTS_FOUND, NO_PROJECTS_FOUND
29
20
 
30
21
  PROJECT_TYPES = ["Project", "Campaign", "StudyProject", "Task", "PersonalProject"]
31
- PROJECT_PROPERTIES_LIST = ["ProjectProperties", "CampaignProperties", "StudyProjectProperties", "TaskProperties",
32
- "PersonalProjectProperties"]
33
22
 
34
23
  class ProjectManager(Client2):
35
24
  """
@@ -67,93 +56,18 @@ class ProjectManager(Client2):
67
56
  Client2.__init__(self, view_server, platform_url, user_id, user_pwd, token)
68
57
 
69
58
 
70
- def _extract_project_properties(self, element: dict, columns_struct: dict) -> dict:
71
- """
72
- Populate columns_struct values for a Project element using the standardized approach from collection_manager.
73
- - Populate from element.properties
74
- - Overlay header-derived values
75
- - Derive classifications list
76
- - Populate relationship-based columns generically
77
- - Include mermaid graph if requested
78
- """
79
- col_data = populate_columns_from_properties(element, columns_struct)
80
- columns_list = col_data.get("formats", {}).get("columns", [])
81
-
82
- # Header-derived values
83
- header_props = _extract_referenceable_properties(element)
84
- for column in columns_list:
85
- key = column.get('key')
86
- if key in header_props:
87
- column['value'] = header_props.get(key)
88
- elif isinstance(key, str) and key.lower() == 'guid':
89
- column['value'] = header_props.get('GUID')
90
-
91
- # Classifications
92
- cl_names = []
93
- for c in element.get('elementHeader', {}).get('classifications', []) or []:
94
- nm = c.get('classificationName')
95
- if nm:
96
- cl_names.append(nm)
97
- if cl_names:
98
- for column in columns_list:
99
- if column.get('key') == 'classifications':
100
- column['value'] = ", ".join(cl_names)
101
- break
102
-
103
- # Relationships
104
- col_data = get_required_relationships(element, col_data)
105
-
106
- # Mermaid
107
- mermaid_val = element.get('mermaidGraph', "") or ""
108
- for column in columns_list:
109
- if column.get('key') == 'mermaid':
110
- column['value'] = mermaid_val
111
- break
112
-
113
- return col_data
114
-
115
- def _generate_project_output(self, elements: dict | list[dict], filter: str = None,
116
- element_type_name: str | None = None,
117
- output_format: str = 'DICT',
118
- output_format_set: str | dict = None) -> str | list[dict]:
119
- """
120
- Generate output for projects using selectable output format sets.
121
- """
122
- entity_type = element_type_name or 'Project'
123
-
124
- # Resolve output formats
125
- if output_format_set:
126
- if isinstance(output_format_set, str):
127
- output_formats = select_output_format_set(output_format_set, output_format)
128
- elif isinstance(output_format_set, dict):
129
- output_formats = get_output_format_type_match(output_format_set, output_format)
130
- elif element_type_name:
131
- output_formats = select_output_format_set(element_type_name, output_format)
132
- else:
133
- output_formats = select_output_format_set(entity_type, output_format)
134
- if output_formats is None:
135
- output_formats = select_output_format_set('Default', output_format)
136
-
137
- return generate_output(
138
- elements,
139
- filter,
140
- entity_type,
141
- output_format,
142
- self._extract_project_properties,
143
- None,
144
- output_formats,
145
- )
59
+ def _generate_project_output(self):
60
+ pass
146
61
  #
147
62
  # Retrieving Projects= Information - https://egeria-project.org/concepts/project
148
63
  #
149
64
  async def _async_get_linked_projects(
150
65
  self,
151
66
  parent_guid: str,
152
- filter_string: str = None,
153
- classification_names: list[str] = None,
154
- body: dict | FilterRequestBody = None,
155
- start_from: int = 0, page_size: int = None,
156
- output_format: str = "json", output_format_set: str | dict = None,
67
+ project_status: str = None,
68
+ effective_time: str = None,
69
+ start_from: int = 0,
70
+ page_size: int = None,
157
71
  ) -> list | str:
158
72
  """Returns the list of projects that are linked off of the supplied element. Any relationship will do.
159
73
  The request body is optional, but if supplied acts as a filter on project status. Async version.
@@ -190,51 +104,82 @@ class ProjectManager(Client2):
190
104
 
191
105
  """
192
106
 
107
+ if page_size is None:
108
+ page_size = self.page_size
109
+
110
+ body = {
111
+ "filter": project_status,
112
+ "effectiveTime": effective_time,
113
+ }
114
+ body_s = body_slimmer(body)
193
115
  url = (
194
116
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/"
195
- f"metadata-elements/{parent_guid}/projects"
117
+ f"metadata-elements/{parent_guid}/projects?startFrom={start_from}&pageSize={page_size}"
196
118
  )
197
119
 
198
- response = await self._async_get_name_request(url, _type="Project",
199
- _gen_output=self._generate_project_output,
200
- filter_string=filter_string,
201
- classification_names=classification_names,
202
- start_from=start_from, page_size=page_size,
203
- output_format=output_format, output_format_set=output_format_set,
204
- body=body)
205
-
206
- return response
120
+ resp = await self._async_make_request("POST", url, body_s)
121
+ return resp.json().get("elements", "No linked projects found")
207
122
 
208
123
  def get_linked_projects(
209
124
  self,
210
125
  parent_guid: str,
211
- filter_string: str = None,
212
- classification_names: list[str] = None,
213
- body: dict | FilterRequestBody = None,
214
- start_from: int = 0, page_size: int = None,
215
- output_format: str = "json", output_format_set: str | dict = None,
126
+ project_status: str = None,
127
+ effective_time: str = None,
128
+ start_from: int = 0,
129
+ page_size: int = None,
216
130
  ) -> list | str:
217
- loop = asyncio.get_event_loop()
218
- resp = loop.run_until_complete(
219
- self._async_get_linked_projects(parent_guid, filter_string, classification_names,
220
- body, start_from,page_size,output_format, output_format_set)
221
- )
131
+ """Returns the list of projects that are linked off of the supplied element. Any relationship will do.
132
+ The request body is optional, but if supplied acts as a filter on project status.
222
133
 
223
- return resp
134
+ Parameters
135
+ ----------
136
+ parent_guid: str
137
+ The identity of the parent to find linked projects from
138
+ project_status: str, optional
139
+ Optionally, filter results by project status.
140
+ effective_time: str, optional
141
+ Time at which to query for projects. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
224
142
 
143
+ start_from: int, [default=0], optional
144
+ When multiple pages of results are available, the page number to start from.
145
+ page_size: int, [default=None]
146
+ The number of items to return in a single page. If not specified, the default will be taken from
147
+ the class instance.
148
+ Returns
149
+ -------
150
+ List | str
225
151
 
152
+ A list of projects linked off of the supplied element filtered by project status and effective time.
226
153
 
154
+ Raises
155
+ ------
227
156
 
157
+ InvalidParameterException
158
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
159
+ PropertyServerException
160
+ Raised by the server when an issue arises in processing a valid request
161
+ NotAuthorizedException
162
+ The principle specified by the user_id does not have authorization for the requested action
228
163
 
164
+ """
165
+ loop = asyncio.get_event_loop()
166
+ resp = loop.run_until_complete(
167
+ self._async_get_linked_projects(
168
+ parent_guid,
169
+ project_status,
170
+ effective_time,
171
+ start_from,
172
+ page_size,
173
+ )
174
+ )
175
+ return resp
229
176
 
230
177
  async def _async_get_classified_projects(
231
178
  self,
232
179
  project_classification: str,
233
- classification_names: list[str] = None,
234
- body: dict | FilterRequestBody = None,
235
- start_from: int = 0, page_size: int = 0,
236
- output_format: str = "json", output_format_set: str | dict = None,
237
-
180
+ effective_time: str = None,
181
+ start_from: int = 0,
182
+ page_size: int = None,
238
183
  ) -> list | str:
239
184
  """Returns the list of projects with a particular classification. The name of the classification is
240
185
  supplied in the request body. Examples of these classifications include StudyProject, PersonalProject,
@@ -270,30 +215,28 @@ class ProjectManager(Client2):
270
215
 
271
216
  """
272
217
 
218
+ if page_size is None:
219
+ page_size = self.page_size
273
220
 
221
+ body = {
222
+ "filter": project_classification,
223
+ "effectiveTime": effective_time,
224
+ }
225
+ body_s = body_slimmer(body)
274
226
  url = (
275
227
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/"
276
- f"projects/by-classifications"
228
+ f"projects/by-classifications?startFrom={start_from}&pageSize={page_size}"
277
229
  )
278
- response = await self._async_get_name_request(url, _type="Project",
279
- _gen_output=self._generate_project_output,
280
- filter_string=project_classification,
281
- classification_names=classification_names,
282
- start_from=start_from, page_size=page_size,
283
- output_format=output_format, output_format_set=output_format_set,
284
- body=body)
285
-
286
- return response
287
230
 
231
+ resp = await self._async_make_request("POST", url, body_s)
232
+ return resp.json()
288
233
 
289
234
  def get_classified_projects(
290
235
  self,
291
236
  project_classification: str,
292
- classification_names: list[str] = None,
293
- body: dict | FilterRequestBody = None,
294
- start_from: int = 0, page_size: int = 0,
295
- output_format: str = "json", output_format_set: str | dict = None,
296
-
237
+ effective_time: str = None,
238
+ start_from: int = 0,
239
+ page_size: int = None,
297
240
  ) -> list | str:
298
241
  """Returns the list of projects with a particular classification. The name of the classification is
299
242
  supplied in the request body. Examples of these classifications include StudyProject, PersonalProject,
@@ -332,11 +275,9 @@ class ProjectManager(Client2):
332
275
  resp = loop.run_until_complete(
333
276
  self._async_get_classified_projects(
334
277
  project_classification,
335
- classification_names,
336
- body, start_from,
278
+ effective_time,
279
+ start_from,
337
280
  page_size,
338
- output_format,
339
- output_format_set,
340
281
  )
341
282
  )
342
283
  return resp
@@ -345,10 +286,9 @@ class ProjectManager(Client2):
345
286
  self,
346
287
  project_guid: str,
347
288
  team_role: str = None,
348
- classification_names: list[str] = None,
349
- body: dict | FilterRequestBody = None,
350
- start_from: int = 0, page_size: int = None,
351
- output_format: str = "json", output_format_set: str | dict = None,
289
+ effective_time: str = None,
290
+ start_from: int = 0,
291
+ page_size: int = None,
352
292
  ) -> list | str:
353
293
  """Returns the list of actors that are linked off of the project. This includes the project managers.
354
294
  The optional request body allows a teamRole to be specified as a filter. To filter out the project managers,
@@ -387,29 +327,28 @@ class ProjectManager(Client2):
387
327
  -----
388
328
  """
389
329
 
330
+ if page_size is None:
331
+ page_size = self.page_size
390
332
 
333
+ body = {effective_time: effective_time, "filter": team_role}
334
+ body_s = body_slimmer(body)
391
335
  url = (
392
336
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
393
- f"{project_guid}/team"
337
+ f"{project_guid}/team?startFrom={start_from}&pageSize={page_size}"
394
338
  )
395
- response = await self._async_get_name_request(url, _type="Project",
396
- _gen_output=self._generate_project_output,
397
- filter_string=team_role,
398
- classification_names=classification_names,
399
- start_from=start_from, page_size=page_size,
400
- output_format=output_format, output_format_set=output_format_set,
401
- body=body)
402
339
 
403
- return response
340
+ resp = await self._async_make_request("POST", url, body_s)
341
+
342
+ result = resp.json().get("elements", NO_ELEMENTS_FOUND)
343
+ return result
404
344
 
405
345
  def get_project_team(
406
346
  self,
407
347
  project_guid: str,
408
348
  team_role: str = None,
409
- classification_names: list[str] = None,
410
- body: dict | FilterRequestBody = None,
411
- start_from: int = 0, page_size: int = None,
412
- output_format: str = "json", output_format_set: str | dict = None,
349
+ effective_time: str = None,
350
+ start_from: int = 0,
351
+ page_size: int = None,
413
352
  ) -> list | str:
414
353
  """Returns the list of actors that are linked off of the project. This includes the project managers.
415
354
  The optional request body allows a teamRole to be specified as a filter. To filter out the project managers,
@@ -452,11 +391,9 @@ class ProjectManager(Client2):
452
391
  self._async_get_project_team(
453
392
  project_guid,
454
393
  team_role,
455
- classification_names,
456
- body, start_from,
394
+ effective_time,
395
+ start_from,
457
396
  page_size,
458
- output_format,
459
- output_format_set,
460
397
  )
461
398
  )
462
399
  return resp
@@ -611,8 +548,8 @@ class ProjectManager(Client2):
611
548
  output_format_set: str | dict = None) -> list | str:
612
549
  url = f"{self.project_command_base}/by-name"
613
550
 
614
- response = await self._async_get_name_request(url, _type="Project",
615
- _gen_output=self._generate_project_output,
551
+ response = await self._async_get_name_request(url, _type="Projects",
552
+ _gen_output=self._generate_projects_output,
616
553
  filter_string=filter_string,
617
554
  classification_names=classification_names,
618
555
  start_from=start_from, page_size=page_size,
@@ -652,34 +589,35 @@ class ProjectManager(Client2):
652
589
 
653
590
  Parameters
654
591
  ----------
655
- project_guid: str
656
- Unique identifier of the project to retrieve.
657
- element_type: str, optional, default = None
658
- Metadata element type name to guide output formatting (defaults to "Project").
592
+ project_guid: str,
593
+ unique identifier of the collection.
594
+ element_type: str, default = None, optional
595
+ type of collection - Collection, DataSpec, Agreement, etc.
659
596
  body: dict | GetRequestBody, optional, default = None
660
- Full request body for advanced options (effective time, lineage, etc.).
661
- output_format: str, optional, default = "JSON"
662
- One of "DICT", "LIST", "MD", "FORM", "REPORT", "MERMAID" or "JSON".
597
+ full request body.
598
+ output_format: str, default = "JSON"
599
+ - one of "DICT", "MERMAID" or "JSON"
663
600
  output_format_set: str | dict, optional, default = None
664
- The desired output columns/fields definition or a label referring to a predefined set.
601
+ The desired output columns/fields to include.
665
602
 
666
603
  Returns
667
604
  -------
668
605
  dict | str
669
- JSON dict representing the specified project when output_format == "JSON";
670
- otherwise a formatted string (or list) according to output_format.
606
+
607
+ A JSON dict representing the specified collection. Returns a string if none found.
671
608
 
672
609
  Raises
673
610
  ------
611
+
674
612
  InvalidParameterException
675
- If the client passes incorrect parameters on the request (bad URLs/values)
613
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
676
614
  PropertyServerException
677
- Raised by the server when an issue arises in processing a valid request
615
+ Raised by the server when an issue arises in processing a valid request
678
616
  NotAuthorizedException
679
- The requesting user is not authorized to issue this request
617
+ The principle specified by the user_id does not have authorization for the requested action
680
618
 
681
619
  Notes
682
- -----
620
+ ----
683
621
  Body sample:
684
622
  {
685
623
  "class": "GetRequestBody",
@@ -692,10 +630,10 @@ class ProjectManager(Client2):
692
630
 
693
631
  url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
694
632
  f"{project_guid}")
695
- type = element_type if element_type else "Project"
633
+ type = element_type if element_type else "Collection"
696
634
 
697
635
  response = await self._async_get_guid_request(url, _type=type,
698
- _gen_output=self._generate_project_output,
636
+ _gen_output=self._generate_collection_output,
699
637
  output_format=output_format, output_format_set=output_format_set,
700
638
  body=body)
701
639
 
@@ -710,34 +648,35 @@ class ProjectManager(Client2):
710
648
 
711
649
  Parameters
712
650
  ----------
713
- project_guid: str
714
- Unique identifier of the project to retrieve.
715
- element_type: str, optional, default = None
716
- Metadata element type name to guide output formatting (defaults to "Project").
651
+ project_guid: str,
652
+ unique identifier of the collection.
653
+ element_type: str, default = None, optional
654
+ type of collection - Collection, DataSpec, Agreement, etc.
717
655
  body: dict | GetRequestBody, optional, default = None
718
- Full request body for advanced options (effective time, lineage, etc.).
719
- output_format: str, optional, default = "JSON"
720
- One of "DICT", "LIST", "MD", "FORM", "REPORT", "MERMAID" or "JSON".
656
+ full request body.
657
+ output_format: str, default = "JSON"
658
+ - one of "DICT", "MERMAID" or "JSON"
721
659
  output_format_set: str | dict, optional, default = None
722
- The desired output columns/fields definition or a label referring to a predefined set.
660
+ The desired output columns/fields to include.
723
661
 
724
662
  Returns
725
663
  -------
726
664
  dict | str
727
- JSON dict representing the specified project when output_format == "JSON";
728
- otherwise a formatted string (or list) according to output_format.
665
+
666
+ A JSON dict representing the specified collection. Returns a string if none found.
729
667
 
730
668
  Raises
731
669
  ------
670
+
732
671
  InvalidParameterException
733
- If the client passes incorrect parameters on the request (bad URLs/values)
672
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
734
673
  PropertyServerException
735
- Raised by the server when an issue arises in processing a valid request
674
+ Raised by the server when an issue arises in processing a valid request
736
675
  NotAuthorizedException
737
- The requesting user is not authorized to issue this request
676
+ The principle specified by the user_id does not have authorization for the requested action
738
677
 
739
678
  Notes
740
- -----
679
+ ----
741
680
  Body sample:
742
681
  {
743
682
  "class": "GetRequestBody",
@@ -763,35 +702,29 @@ class ProjectManager(Client2):
763
702
  output_format: str = 'JSON',
764
703
  output_format_set: str | dict = None,
765
704
  ) -> dict | str:
766
- """Return the mermaid graph or formatted details of a specific project. Async version.
705
+ """Return the mermaid graph of a specific project. Async version.
767
706
 
768
707
  Parameters
769
708
  ----------
770
- project_guid: str
771
- Unique identifier of the project.
772
- element_type: str, optional, default = None
773
- Metadata element type name to guide output formatting (defaults to "Project").
709
+ project_guid: str,
710
+ unique identifier of the project.
774
711
  body: dict | GetRequestBody, optional, default = None
775
- Full request body for advanced options (effective time, lineage, etc.).
776
- output_format: str, optional, default = "JSON"
777
- One of "DICT", "LIST", "MD", "FORM", "REPORT", "MERMAID" or "JSON".
778
- output_format_set: str | dict, optional, default = None
779
- The desired output columns/fields definition or a label referring to a predefined set.
712
+ full request body.
780
713
 
781
714
  Returns
782
715
  -------
783
- dict | str
784
- JSON dict when output_format == "JSON"; otherwise a formatted string according to output_format
785
- (for example, a Mermaid markdown string when output_format == "MERMAID").
716
+ str
786
717
 
718
+ A mermaid markdown string representing the graph of the project.
787
719
  Raises
788
720
  ------
721
+
789
722
  InvalidParameterException
790
- If the client passes incorrect parameters on the request (bad URLs/values)
723
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
791
724
  PropertyServerException
792
- Raised by the server when an issue arises in processing a valid request
725
+ Raised by the server when an issue arises in processing a valid request
793
726
  NotAuthorizedException
794
- The requesting user is not authorized to issue this request
727
+ The principle specified by the user_id does not have authorization for the requested action
795
728
 
796
729
  """
797
730
 
@@ -799,7 +732,7 @@ class ProjectManager(Client2):
799
732
  url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/pr"
800
733
  f"ojects/{project_guid}/graph")
801
734
 
802
- response = await self._async_get_guid_request(url, _type=element_type or 'Project',
735
+ response = await self._async_get_guid_request(url, _type=element_type,
803
736
  _gen_output=self._generate_project_output,
804
737
  output_format=output_format, output_format_set=output_format_set,
805
738
  body=body)
@@ -815,35 +748,29 @@ class ProjectManager(Client2):
815
748
  output_format: str = 'JSON',
816
749
  output_format_set: str | dict = None,
817
750
  ) -> dict | str:
818
- """Return the mermaid graph or formatted details of a specific project.
751
+ """Return the mermaid graph of a specific project. Async version.
819
752
 
820
753
  Parameters
821
754
  ----------
822
- project_guid: str
823
- Unique identifier of the project.
824
- element_type: str, optional, default = None
825
- Metadata element type name to guide output formatting (defaults to "Project").
755
+ project_guid: str,
756
+ unique identifier of the project.
826
757
  body: dict | GetRequestBody, optional, default = None
827
- Full request body for advanced options (effective time, lineage, etc.).
828
- output_format: str, optional, default = "JSON"
829
- One of "DICT", "LIST", "MD", "FORM", "REPORT", "MERMAID" or "JSON".
830
- output_format_set: str | dict, optional, default = None
831
- The desired output columns/fields definition or a label referring to a predefined set.
758
+ full request body.
832
759
 
833
760
  Returns
834
761
  -------
835
- dict | str
836
- JSON dict when output_format == "JSON"; otherwise a formatted string according to output_format
837
- (for example, a Mermaid markdown string when output_format == "MERMAID").
762
+ str
838
763
 
764
+ A mermaid markdown string representing the graph of the project.
839
765
  Raises
840
766
  ------
767
+
841
768
  InvalidParameterException
842
- If the client passes incorrect parameters on the request (bad URLs/values)
769
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
843
770
  PropertyServerException
844
- Raised by the server when an issue arises in processing a valid request
771
+ Raised by the server when an issue arises in processing a valid request
845
772
  NotAuthorizedException
846
- The requesting user is not authorized to issue this request
773
+ The principle specified by the user_id does not have authorization for the requested action
847
774
 
848
775
  """
849
776
  loop = asyncio.get_event_loop()
@@ -927,14 +854,13 @@ class ProjectManager(Client2):
927
854
  """Create project: https://egeria-project.org/concepts/project
928
855
 
929
856
  Parameters
930
- ----------
931
- body: dict | NewElementRequestBody
932
- A dict or NewElementRequestBody representing the details of the project to create.
857
+ ----------.
858
+ body: dict
859
+ A dict representing the details of the project to create.
933
860
 
934
861
  Returns
935
862
  -------
936
- str
937
- The GUID of the created project.
863
+ str - the guid of the created collection
938
864
 
939
865
  Raises
940
866
  ------
@@ -1098,7 +1024,6 @@ class ProjectManager(Client2):
1098
1024
  resp = loop.run_until_complete(self._async_create_project_from_template(body))
1099
1025
  return resp
1100
1026
 
1101
-
1102
1027
  #
1103
1028
  #
1104
1029
  #
@@ -1106,20 +1031,47 @@ class ProjectManager(Client2):
1106
1031
  async def _async_update_project(
1107
1032
  self,
1108
1033
  project_guid: str,
1109
- body: dict | UpdateElementRequestBody,
1034
+ qualified_name: str = None,
1035
+ identifier: str = None,
1036
+ display_name: str = None,
1037
+ description: str = None,
1038
+ project_status: str = None,
1039
+ project_phase: str = None,
1040
+ project_health: str = None,
1041
+ start_date: str = None,
1042
+ planned_end_date: str = None,
1043
+ replace_all_props: bool = False,
1110
1044
  ) -> None:
1111
- """Update the properties of a project. Async version.
1045
+ """Update the properties of a project. Async Version.
1112
1046
 
1113
1047
  Parameters
1114
1048
  ----------
1115
1049
  project_guid: str
1116
- Unique identifier of the project to update.
1117
- body: dict | UpdateElementRequestBody
1118
- The update payload specifying properties to change.
1050
+ Unique identifier for the project.
1051
+ qualified_name: str, optional, defaults to None
1052
+ The unique identifier of the project.
1053
+ identifier: str
1054
+ A project identifier.
1055
+ display_name: str
1056
+ The display name of the element. Will also be used as the basis of the qualified_name.
1057
+ description: str
1058
+ A description of the collection.
1059
+ project_status: str, optional
1060
+ The project status
1061
+ project_phase: str, optional
1062
+ Project phase as defined in valid values
1063
+ project_health: str, optional
1064
+ Project health as defined in valid values
1065
+ start_date: str, optional, defaults to None
1066
+ Start date of the project in ISO 8601 string format.
1067
+ planned_end_date: str, optional, defaults to None
1068
+ Planned completion date in ISO 8601 string format.
1069
+ replace_all_props: bool, optional, defaults to False
1070
+ If True, then all the properties of the project will be replaced with the specified properties.
1119
1071
 
1120
1072
  Returns
1121
1073
  -------
1122
- None
1074
+ str - the guid of the created project task
1123
1075
 
1124
1076
  Raises
1125
1077
  ------
@@ -1131,28 +1083,72 @@ class ProjectManager(Client2):
1131
1083
  The principle specified by the user_id does not have authorization for the requested action
1132
1084
  """
1133
1085
 
1086
+ replace_all_props_s = str(replace_all_props).lower()
1134
1087
  url = (
1135
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/update"
1088
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1089
+ f"update?replaceAllProperties={replace_all_props_s}"
1136
1090
  )
1137
1091
 
1138
- await self._async_update_element_body_request(url, PROJECT_PROPERTIES_LIST, body)
1092
+ body = {
1093
+ "class": "ProjectProperties",
1094
+ "qualifiedName": qualified_name,
1095
+ "identifier": identifier,
1096
+ "name": display_name,
1097
+ "description": description,
1098
+ "projectStatus": project_status,
1099
+ "projectPhase": project_phase,
1100
+ "projectHealth": project_health,
1101
+ "startDate": start_date,
1102
+ "plannedEndDate": planned_end_date,
1103
+ }
1104
+ body_s = body_slimmer(body)
1105
+ await self._async_make_request("POST", url, body_s)
1106
+ return
1139
1107
 
1140
1108
  def update_project(
1141
1109
  self,
1142
1110
  project_guid: str,
1143
- body: dict | UpdateElementRequestBody ) -> None:
1111
+ qualified_name: str = None,
1112
+ identifier: str = None,
1113
+ display_name: str = None,
1114
+ description: str = None,
1115
+ project_status: str = None,
1116
+ project_phase: str = None,
1117
+ project_health: str = None,
1118
+ start_date: str = None,
1119
+ planned_end_date: str = None,
1120
+ replace_all_props: bool = False,
1121
+ ) -> None:
1144
1122
  """Update the properties of a project.
1145
1123
 
1146
1124
  Parameters
1147
1125
  ----------
1148
1126
  project_guid: str
1149
- Unique identifier of the project to update.
1150
- body: dict | UpdateElementRequestBody
1151
- The update payload specifying properties to change.
1127
+ Unique identifier for the project.
1128
+ qualified_name: str, optional, defaults to None
1129
+ The unique identifier of the project.
1130
+ identifier: str
1131
+ A project identifier.
1132
+ display_name: str
1133
+ The display name of the element. Will also be used as the basis of the qualified_name.
1134
+ description: str
1135
+ A description of the collection.
1136
+ project_status: str, optional
1137
+ The project status
1138
+ project_phase: str, optional
1139
+ Project phase as defined in valid values
1140
+ project_health: str, optional
1141
+ Project health as defined in valid values
1142
+ start_date: str, optional, defaults to None
1143
+ Start date of the project in ISO 8601 string format.
1144
+ planned_end_date: str, optional, defaults to None
1145
+ Planned completion date in ISO 8601 string format.
1146
+ replace_all_props: bool, optional, defaults to False
1147
+ If True, then all the properties of the project will be replaced with the specified properties.
1152
1148
 
1153
1149
  Returns
1154
1150
  -------
1155
- None
1151
+ str - the guid of the created project task
1156
1152
 
1157
1153
  Raises
1158
1154
  ------
@@ -1167,30 +1163,36 @@ class ProjectManager(Client2):
1167
1163
  loop.run_until_complete(
1168
1164
  self._async_update_project(
1169
1165
  project_guid,
1170
- body
1166
+ qualified_name,
1167
+ identifier,
1168
+ display_name,
1169
+ description,
1170
+ project_status,
1171
+ project_phase,
1172
+ project_health,
1173
+ start_date,
1174
+ planned_end_date,
1175
+ replace_all_props,
1171
1176
  )
1172
1177
  )
1173
1178
  return
1174
1179
 
1175
1180
  async def _async_delete_project(
1176
1181
  self,
1177
- project_guid: str, cascade_delete: bool = False,
1178
- body: dict | DeleteRequestBody = None
1182
+ project_guid: str, cascade: bool = False
1179
1183
  ) -> None:
1180
- """Delete a project. Async version.
1184
+ """Delete a project. It is detected from all parent elements. Async version
1181
1185
 
1182
1186
  Parameters
1183
1187
  ----------
1184
1188
  project_guid: str
1185
- The GUID of the project to delete.
1186
- cascade_delete: bool, optional, default = False
1187
- If True, then all anchored elements will be deleted.
1188
- body: dict | DeleteRequestBody, optional, default = None
1189
- Request body for additional options.
1189
+ The guid of the project to update.
1190
+ cascade: bool, optional, defaults to False
1191
+ If true, then all anchored elements will be deleted.
1190
1192
 
1191
1193
  Returns
1192
1194
  -------
1193
- None
1195
+ Nothing
1194
1196
 
1195
1197
  Raises
1196
1198
  ------
@@ -1202,33 +1204,36 @@ class ProjectManager(Client2):
1202
1204
  The principle specified by the user_id does not have authorization for the requested action
1203
1205
 
1204
1206
  """
1205
-
1207
+ cascade_s = str(cascade).lower()
1206
1208
  url = (
1207
1209
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
1208
- f"{project_guid}/delete"
1210
+ f"{project_guid}/delete?cascadedDelete={cascade_s}"
1209
1211
  )
1210
- await self._async_delete_request(url, body, cascade_delete)
1211
- logger.info(f"Deleted project {project_guid} with cascade {cascade_delete}")
1212
+
1213
+ body = {"class": "NullRequestBody"}
1214
+
1215
+ await self._async_make_request("POST", url, body)
1216
+ return
1212
1217
 
1213
1218
  def delete_project(
1214
1219
  self,
1215
- project_guid: str, cascade_delete: bool = False,
1216
- body: dict |DeleteRequestBody = None
1220
+ project_guid: str, cascade: bool = False
1217
1221
  ) -> None:
1218
- """Delete a project.
1222
+ """Delete a project. It is detected from all parent elements.
1219
1223
 
1220
1224
  Parameters
1221
1225
  ----------
1222
1226
  project_guid: str
1223
- The GUID of the project to delete.
1224
- cascade_delete: bool, optional, default = False
1225
- If True, then all anchored elements will be deleted.
1226
- body: dict | DeleteRequestBody, optional, default = None
1227
- Request body for additional options.
1227
+ The guid of the collection to update.
1228
+ cascade: bool, optional, defaults to False
1229
+ If true, then all anchored elements will be deleted.
1230
+
1228
1231
 
1232
+ cascade: bool, optional, defaults to False
1233
+ If true, then all anchored elements will be deleted.
1229
1234
  Returns
1230
1235
  -------
1231
- None
1236
+ Nothing
1232
1237
 
1233
1238
  Raises
1234
1239
  ------
@@ -1242,25 +1247,32 @@ class ProjectManager(Client2):
1242
1247
 
1243
1248
  """
1244
1249
  loop = asyncio.get_event_loop()
1245
- loop.run_until_complete(self._async_delete_project(project_guid, cascade_delete, body))
1246
-
1250
+ loop.run_until_complete(self._async_delete_project(project_guid, cascade))
1251
+ return
1247
1252
 
1248
1253
  async def _async_add_to_project_team(
1249
1254
  self,
1250
1255
  project_guid: str,
1251
1256
  actor_guid: str,
1252
- body: dict | NewRelationshipRequestBody = None,
1257
+ team_role: str = None,
1258
+ effective_from: str = None,
1259
+ effective_to: str = None,
1253
1260
  ) -> None:
1254
- """Add an actor to a project. Async version.
1261
+ """Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
1262
+ the actor plays in the project. Async version.
1255
1263
 
1256
1264
  Parameters
1257
1265
  ----------
1258
1266
  project_guid: str
1259
- Identity of the project to update.
1267
+ identity of the project to update.
1260
1268
  actor_guid: str
1261
- Identity of the actor to add.
1262
- body: dict | NewRelationshipRequestBody, optional, default = None
1263
- Optional relationship properties (for example, role name, effective times).
1269
+ identity of the actor to add.
1270
+ team_role: str, optional, defaults to None
1271
+ Name of the role the actor plays in the project.
1272
+ effective_from: str, optional, defaults to None
1273
+ Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
1274
+ effective_to: str, optional, defaults to None
1275
+ Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
1264
1276
 
1265
1277
  Returns
1266
1278
  -------
@@ -1282,25 +1294,42 @@ class ProjectManager(Client2):
1282
1294
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1283
1295
  f"members/{actor_guid}/attach"
1284
1296
  )
1285
- await self._async_new_relationship_request(url, "AssignmentScopeProperties", body)
1286
- logger.info(f"Added actor {actor_guid} to project {project_guid}")
1297
+ body = {
1298
+ "class": "ProjectTeamProperties",
1299
+ "teamRole": team_role,
1300
+ "effectiveFrom": effective_from,
1301
+ "effectiveTo": effective_to,
1302
+ }
1303
+ body_s = body_slimmer(body)
1304
+ if body_s is None:
1305
+ await self._async_make_request("POST", url)
1306
+ else:
1307
+ await self._async_make_request("POST", url, body_s)
1308
+ return
1287
1309
 
1288
1310
  def add_to_project_team(
1289
1311
  self,
1290
1312
  project_guid: str,
1291
1313
  actor_guid: str,
1292
- body: dict | NewRelationshipRequestBody = None,
1314
+ team_role: str = None,
1315
+ effective_from: str = None,
1316
+ effective_to: str = None,
1293
1317
  ) -> None:
1294
- """Add an actor to a project.
1318
+ """Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
1319
+ the actor plays in the project.
1295
1320
 
1296
1321
  Parameters
1297
1322
  ----------
1298
1323
  project_guid: str
1299
- Identity of the project to update.
1324
+ identity of the project to update.
1300
1325
  actor_guid: str
1301
- Identity of the actor to add.
1302
- body: dict | NewRelationshipRequestBody, optional, default = None
1303
- Optional relationship properties (for example, role name, effective times).
1326
+ identity of the actor to add.
1327
+ team_role: str, optional, defaults to None
1328
+ Name of the role the actor plays in the project.
1329
+ effective_from: str, optional, defaults to None
1330
+ Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
1331
+ effective_to: str, optional, defaults to None
1332
+ Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
1304
1333
 
1305
1334
  Returns
1306
1335
  -------
@@ -1322,30 +1351,26 @@ class ProjectManager(Client2):
1322
1351
  self._async_add_to_project_team(
1323
1352
  project_guid,
1324
1353
  actor_guid,
1325
- body
1354
+ team_role,
1355
+ effective_from,
1356
+ effective_to,
1326
1357
  )
1327
1358
  )
1328
-
1359
+ return
1329
1360
 
1330
1361
  async def _async_remove_from_project_team(
1331
1362
  self,
1332
1363
  project_guid: str,
1333
1364
  actor_guid: str,
1334
- body: dict | DeleteRequestBody = None,
1335
- cascade_delete: bool = False,
1336
1365
  ) -> None:
1337
1366
  """Remove an actor from a project. Async version.
1338
1367
 
1339
1368
  Parameters
1340
1369
  ----------
1341
1370
  project_guid: str
1342
- Identity of the project to remove members from.
1371
+ identity of the project to remove members from.
1343
1372
  actor_guid: str
1344
- Identity of the actor to remove.
1345
- body: dict | DeleteRequestBody, optional, default = None
1346
- Optional relationship properties.
1347
- cascade_delete: bool, optional, default = False
1348
- If True, deletes related anchored elements as applicable.
1373
+ identity of the actor to remove.
1349
1374
 
1350
1375
  Returns
1351
1376
  -------
@@ -1367,106 +1392,24 @@ class ProjectManager(Client2):
1367
1392
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1368
1393
  f"members/{actor_guid}/detach"
1369
1394
  )
1370
- await self._async_delete_request(url, body, cascade_delete)
1371
- logger.info(f"Removed actor {actor_guid} from project {project_guid}")
1372
1395
 
1396
+ body = {"class": "NullRequestBody"}
1397
+ await self._async_make_request("POST", url, body)
1398
+ return
1373
1399
 
1374
1400
  def remove_from_project_team(
1375
1401
  self,
1376
1402
  project_guid: str,
1377
1403
  actor_guid: str,
1378
- body: dict | DeleteRequestBody = None,
1379
- cascade_delete: bool = False,
1380
1404
  ) -> None:
1381
1405
  """Remove an actor from a project.
1382
1406
 
1383
1407
  Parameters
1384
1408
  ----------
1385
1409
  project_guid: str
1386
- Identity of the project.
1410
+ identity of the project.
1387
1411
  actor_guid: str
1388
- Identity of the actor to remove.
1389
- body: dict | DeleteRequestBody, optional, default = None
1390
- Optional relationship properties.
1391
- cascade_delete: bool, optional, default = False
1392
- If True, deletes related anchored elements as applicable.
1393
-
1394
- Returns
1395
- -------
1396
- None
1397
-
1398
- Raises
1399
- ------
1400
-
1401
- InvalidParameterException
1402
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1403
- PropertyServerException
1404
- Raised by the server when an issue arises in processing a valid request
1405
- NotAuthorizedException
1406
- The principle specified by the user_id does not have authorization for the requested action
1407
-
1408
- """
1409
- loop = asyncio.get_event_loop()
1410
- loop.run_until_complete(
1411
- self._async_remove_from_project_team(project_guid, actor_guid, body, cascade_delete)
1412
- )
1413
-
1414
-
1415
- async def _async_setup_project_dependency(
1416
- self,
1417
- project_guid: str,
1418
- depends_on_project_guid: str,
1419
- body: dict | NewRelationshipRequestBody = None,
1420
- ) -> None:
1421
- """Create a project dependency link from one project to another. Async version.
1422
-
1423
- Parameters
1424
- ----------
1425
- project_guid: str
1426
- Identity of the project that has the dependency.
1427
- depends_on_project_guid: str
1428
- GUID of the project that the first project depends on.
1429
-
1430
-
1431
- Returns
1432
- -------
1433
- None
1434
-
1435
- Raises
1436
- ------
1437
-
1438
- InvalidParameterException
1439
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1440
- PropertyServerException
1441
- Raised by the server when an issue arises in processing a valid request
1442
- NotAuthorizedException
1443
- The principle specified by the user_id does not have authorization for the requested action
1444
-
1445
- """
1446
-
1447
- url = (
1448
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1449
- f"project-dependencies/{depends_on_project_guid}/attach"
1450
- )
1451
- await self._async_new_relationship_request(url, "ProjectDependencyProperties", body)
1452
- logger.info(f"Added dependency between project {project_guid} depending on project {depends_on_project_guid}")
1453
-
1454
-
1455
- def setup_project_dependency(
1456
- self,
1457
- project_guid: str,
1458
- depends_on_project_guid: str,
1459
- body: dict | NewRelationshipRequestBody = None,
1460
- ) -> None:
1461
- """Create a project dependency link from one project to another.
1462
-
1463
- Parameters
1464
- ----------
1465
- project_guid: str
1466
- Identity of the project that has the dependency.
1467
- depends_on_project_guid: str
1468
- GUID of the project that the first project depends on.
1469
-
1412
+ identity of the actor to remove.
1470
1413
 
1471
1414
  Returns
1472
1415
  -------
@@ -1485,25 +1428,24 @@ class ProjectManager(Client2):
1485
1428
  """
1486
1429
  loop = asyncio.get_event_loop()
1487
1430
  loop.run_until_complete(
1488
- self._async_setup_project_dependency( project_guid, depends_on_project_guid, body)
1431
+ self._async_remove_from_project_team(project_guid, actor_guid)
1489
1432
  )
1490
1433
  return
1491
1434
 
1492
- async def _async_clear_project_dependency(
1435
+ async def _async_setup_project_management_role(
1493
1436
  self,
1494
1437
  project_guid: str,
1495
- depends_on_project_guid: str,
1496
- body: dict | DeleteRequestBody = None,
1497
- cascade_delete: bool = False
1438
+ project_role_guid: str,
1498
1439
  ) -> None:
1499
- """Remove a project dependency link between two projects. Async version.
1440
+ """Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
1441
+ the role is a member of the project. Async version.
1500
1442
 
1501
1443
  Parameters
1502
1444
  ----------
1503
1445
  project_guid: str
1504
- Identity of the project that previously had the dependency.
1505
- depends_on_project_guid: str
1506
- GUID of the project that was depended on.
1446
+ identity of the project.
1447
+ project_role_guid: str
1448
+ guid of the role to assign to the project.
1507
1449
 
1508
1450
 
1509
1451
  Returns
@@ -1524,105 +1466,27 @@ class ProjectManager(Client2):
1524
1466
 
1525
1467
  url = (
1526
1468
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1527
- f"project-dependencies/{depends_on_project_guid}/detach"
1469
+ f"project-management-roles/{project_role_guid}/attach"
1528
1470
  )
1529
- await self._async_delete_request(url, body, cascade_delete)
1530
- logger.info(f"Removed project dependency between project {project_guid} and project {depends_on_project_guid}")
1531
-
1532
-
1533
- def clear_project_dependency(
1534
- self,
1535
- project_guid: str,
1536
- depends_on_project_guid: str,
1537
- body: dict | DeleteRequestBody = None,
1538
- cascade_delete: bool = False
1539
- ) -> None:
1540
- """Clear a project dependency link between two projects.
1541
1471
 
1542
- Parameters
1543
- ----------
1544
- project_guid: str
1545
- Identity of the project that previously had the dependency.
1546
- depends_on_project_guid: str
1547
- GUID of the project that was depended on.
1548
-
1549
-
1550
- Returns
1551
- -------
1552
- None
1553
-
1554
- Raises
1555
- ------
1556
-
1557
- InvalidParameterException
1558
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1559
- PropertyServerException
1560
- Raised by the server when an issue arises in processing a valid request
1561
- NotAuthorizedException
1562
- The principle specified by the user_id does not have authorization for the requested action
1563
-
1564
- """
1565
- loop = asyncio.get_event_loop()
1566
- loop.run_until_complete(
1567
- self._async_clear_project_dependency(project_guid, depends_on_project_guid,
1568
- body, cascade_delete)
1569
- )
1472
+ body = {"class": "NullRequestBody"}
1473
+ await self._async_make_request("POST", url, body)
1570
1474
  return
1571
1475
 
1572
- async def _async_setup_project_hierarchy(
1476
+ def setup_project_management_role(
1573
1477
  self,
1574
1478
  project_guid: str,
1575
- managed_project_guid: str,
1576
- body: dict | NewRelationshipRequestBody = None,
1479
+ project_role_guid: str,
1577
1480
  ) -> None:
1578
- """Create a project hierarchy link from a project to a managed (child) project. Async version.
1481
+ """Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
1482
+ the role is a member of the project. Async version.
1579
1483
 
1580
1484
  Parameters
1581
1485
  ----------
1582
1486
  project_guid: str
1583
- Identity of the parent (managing) project.
1584
- managed_project_guid: str
1585
- GUID of the managed (child) project.
1586
-
1587
-
1588
- Returns
1589
- -------
1590
- None
1591
-
1592
- Raises
1593
- ------
1594
-
1595
- InvalidParameterException
1596
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1597
- PropertyServerException
1598
- Raised by the server when an issue arises in processing a valid request
1599
- NotAuthorizedException
1600
- The principle specified by the user_id does not have authorization for the requested action
1601
-
1602
- """
1603
-
1604
- url = (
1605
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1606
- f"project-hierarchies/{managed_project_guid}/attach"
1607
- )
1608
- await self._async_new_relationship_request(url, "ProjectHierarchyProperties", body)
1609
- logger.info(f"Added hierarchy between project {project_guid} abd project {managed_project_guid}")
1610
-
1611
-
1612
- def setup_project_hierarchy(
1613
- self,
1614
- project_guid: str,
1615
- managed_project_guid: str,
1616
- body: dict | NewRelationshipRequestBody = None,
1617
- ) -> None:
1618
- """Create a project hierarchy link from a project to a managed (child) project.
1619
-
1620
- Parameters
1621
- ----------
1622
- project_guid: str
1623
- Identity of the parent (managing) project.
1624
- managed_project_guid: str
1625
- GUID of the managed (child) project.
1487
+ identity of the project.
1488
+ project_role_guid: str
1489
+ guid of the role to assign to the project.
1626
1490
 
1627
1491
 
1628
1492
  Returns
@@ -1642,25 +1506,23 @@ class ProjectManager(Client2):
1642
1506
  """
1643
1507
  loop = asyncio.get_event_loop()
1644
1508
  loop.run_until_complete(
1645
- self._async_setup_project_dependency( project_guid, managed_project_guid, body)
1509
+ self._async_setup_project_management_role(project_guid, project_role_guid)
1646
1510
  )
1647
1511
  return
1648
1512
 
1649
- async def _async_clear_project_hierarchy(
1513
+ async def _async_clear_project_management_role(
1650
1514
  self,
1651
1515
  project_guid: str,
1652
- managed_project_guid: str,
1653
- body: dict | DeleteRequestBody = None,
1654
- cascade_delete: bool = False
1516
+ project_role_guid: str,
1655
1517
  ) -> None:
1656
- """Remove a project hierarchy link between two projects. Async version.
1518
+ """Remove a ProjectManagement relationship between a project and a person role. Async version.
1657
1519
 
1658
1520
  Parameters
1659
1521
  ----------
1660
1522
  project_guid: str
1661
- Identity of the parent (managing) project.
1662
- managed_project_guid: str
1663
- GUID of the managed (child) project.
1523
+ identity of the project.
1524
+ project_role_guid: str
1525
+ guid of the role to assign to the project.
1664
1526
 
1665
1527
 
1666
1528
  Returns
@@ -1681,27 +1543,26 @@ class ProjectManager(Client2):
1681
1543
 
1682
1544
  url = (
1683
1545
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1684
- f"project-hierarchies/{managed_project_guid}/detach"
1546
+ f"project-management-roles/{project_role_guid}/detach"
1685
1547
  )
1686
- await self._async_delete_request(url, body, cascade_delete)
1687
- logger.info(f"Removed project hierarchy link between project {project_guid} and project {managed_project_guid}")
1688
1548
 
1549
+ body = {"class": "NullRequestBody"}
1550
+ await self._async_make_request("POST", url, body)
1551
+ return
1689
1552
 
1690
- def clear_project_hierarchy(
1553
+ def clear_project_management_role(
1691
1554
  self,
1692
1555
  project_guid: str,
1693
- managed_project_guid: str,
1694
- body: dict | DeleteRequestBody = None,
1695
- cascade_delete: bool = False
1556
+ project_role_guid: str,
1696
1557
  ) -> None:
1697
- """Clear a project hierarchy link between two projects.
1558
+ """Clear a ProjectManagement relationship between a project and a person role.
1698
1559
 
1699
1560
  Parameters
1700
1561
  ----------
1701
1562
  project_guid: str
1702
- Identity of the parent (managing) project.
1703
- managed_project_guid: str
1704
- GUID of the managed (child) project.
1563
+ identity of the project.
1564
+ project_role_guid: str
1565
+ guid of the role to assign to the project.
1705
1566
 
1706
1567
 
1707
1568
  Returns
@@ -1721,23 +1582,10 @@ class ProjectManager(Client2):
1721
1582
  """
1722
1583
  loop = asyncio.get_event_loop()
1723
1584
  loop.run_until_complete(
1724
- self._async_clear_project_hierarchy(project_guid, managed_project_guid,
1725
- body, cascade_delete)
1585
+ self._async_clear_project_management_role(project_guid, project_role_guid)
1726
1586
  )
1727
1587
  return
1728
1588
 
1729
1589
 
1730
1590
  if __name__ == "__main__":
1731
1591
  print("Main-Project Manager")
1732
-
1733
-
1734
- # Automatically apply @dynamic_catch to all methods of ProjectManager (excluding dunder methods)
1735
- try:
1736
- for _name, _attr in list(ProjectManager.__dict__.items()):
1737
- if callable(_attr) and not _name.startswith("__"):
1738
- # Avoid double-wrapping if already decorated
1739
- if not getattr(_attr, "__wrapped__", None):
1740
- setattr(ProjectManager, _name, dynamic_catch(_attr))
1741
- except Exception as _e:
1742
- # Be resilient; if anything goes wrong, leave methods as-is
1743
- logger.debug(f"dynamic_catch auto-wrap skipped due to: {_e}")