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