pyegeria 0.8.4.36__py3-none-any.whl → 0.8.4.38__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.
@@ -38,14 +38,20 @@ class ProjectManager(Client):
38
38
 
39
39
  def __init__(
40
40
  self,
41
- server_name: str,
41
+ view_server: str,
42
42
  platform_url: str,
43
43
  user_id: str,
44
44
  user_pwd: str = None,
45
45
  token: str = None,
46
46
  ):
47
- self.command_base: str = f"/api/open-metadata/project-manager/metadata-elements"
48
- Client.__init__(self, server_name, platform_url, user_id, user_pwd, token)
47
+ self.view_server = view_server
48
+ self.platform_url = platform_url
49
+ self.user_id = user_id
50
+ self.user_pwd = user_pwd
51
+ self.project_command_base: str = (
52
+ f"/api/open-metadata/project-manager/metadata-elements"
53
+ )
54
+ Client.__init__(self, view_server, platform_url, user_id, user_pwd, token)
49
55
 
50
56
  #
51
57
  # Retrieving Projects= Information - https://egeria-project.org/concepts/project
@@ -55,7 +61,6 @@ class ProjectManager(Client):
55
61
  parent_guid: str,
56
62
  project_status: str = None,
57
63
  effective_time: str = None,
58
- server_name: str = None,
59
64
  start_from: int = 0,
60
65
  page_size: int = None,
61
66
  ) -> list | str:
@@ -70,9 +75,7 @@ class ProjectManager(Client):
70
75
  Optionally, filter results by project status.
71
76
  effective_time: str, optional
72
77
  Time at which to query for projects. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
73
- server_name : str, optional
74
- The name of the server to configure.
75
- If not provided, the server name associated with the instance is used.
78
+
76
79
  start_from: int, [default=0], optional
77
80
  When multiple pages of results are available, the page number to start from.
78
81
  page_size: int, [default=None]
@@ -95,8 +98,7 @@ class ProjectManager(Client):
95
98
  The principle specified by the user_id does not have authorization for the requested action
96
99
 
97
100
  """
98
- if server_name is None:
99
- server_name = self.server_name
101
+
100
102
  if page_size is None:
101
103
  page_size = self.page_size
102
104
 
@@ -106,7 +108,7 @@ class ProjectManager(Client):
106
108
  }
107
109
  body_s = body_slimmer(body)
108
110
  url = (
109
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/"
111
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/"
110
112
  f"metadata-elements/{parent_guid}/projects?startFrom={start_from}&pageSize={page_size}"
111
113
  )
112
114
 
@@ -118,7 +120,6 @@ class ProjectManager(Client):
118
120
  parent_guid: str,
119
121
  project_status: str = None,
120
122
  effective_time: str = None,
121
- server_name: str = None,
122
123
  start_from: int = 0,
123
124
  page_size: int = None,
124
125
  ) -> list | str:
@@ -133,9 +134,7 @@ class ProjectManager(Client):
133
134
  Optionally, filter results by project status.
134
135
  effective_time: str, optional
135
136
  Time at which to query for projects. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
136
- server_name : str, optional
137
- The name of the server to configure.
138
- If not provided, the server name associated with the instance is used.
137
+
139
138
  start_from: int, [default=0], optional
140
139
  When multiple pages of results are available, the page number to start from.
141
140
  page_size: int, [default=None]
@@ -164,7 +163,6 @@ class ProjectManager(Client):
164
163
  parent_guid,
165
164
  project_status,
166
165
  effective_time,
167
- server_name,
168
166
  start_from,
169
167
  page_size,
170
168
  )
@@ -175,7 +173,6 @@ class ProjectManager(Client):
175
173
  self,
176
174
  project_classification: str,
177
175
  effective_time: str = None,
178
- server_name: str = None,
179
176
  start_from: int = 0,
180
177
  page_size: int = None,
181
178
  ) -> list | str:
@@ -189,9 +186,7 @@ class ProjectManager(Client):
189
186
  The project classification to search for.
190
187
  effective_time: str, optional
191
188
  Time at which to query for projects. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
192
- server_name : str, optional
193
- The name of the server to configure.
194
- If not provided, the server name associated with the instance is used.
189
+
195
190
  start_from: int, [default=0], optional
196
191
  When multiple pages of results are available, the page number to start from.
197
192
  page_size: int, [default=None]
@@ -214,8 +209,7 @@ class ProjectManager(Client):
214
209
  The principle specified by the user_id does not have authorization for the requested action
215
210
 
216
211
  """
217
- if server_name is None:
218
- server_name = self.server_name
212
+
219
213
  if page_size is None:
220
214
  page_size = self.page_size
221
215
 
@@ -225,7 +219,7 @@ class ProjectManager(Client):
225
219
  }
226
220
  body_s = body_slimmer(body)
227
221
  url = (
228
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/"
222
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/"
229
223
  f"projects/by-classifications?startFrom={start_from}&pageSize={page_size}"
230
224
  )
231
225
 
@@ -236,7 +230,6 @@ class ProjectManager(Client):
236
230
  self,
237
231
  project_classification: str,
238
232
  effective_time: str = None,
239
- server_name: str = None,
240
233
  start_from: int = 0,
241
234
  page_size: int = None,
242
235
  ) -> list | str:
@@ -250,9 +243,7 @@ class ProjectManager(Client):
250
243
  The project classification to search for.
251
244
  effective_time: str, optional
252
245
  Time at which to query for projects. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
253
- server_name : str, optional
254
- The name of the server to configure.
255
- If not provided, the server name associated with the instance is used.
246
+
256
247
  start_from: int, [default=0], optional
257
248
  When multiple pages of results are available, the page number to start from.
258
249
  page_size: int, [default=None]
@@ -280,7 +271,6 @@ class ProjectManager(Client):
280
271
  self._async_get_classified_projects(
281
272
  project_classification,
282
273
  effective_time,
283
- server_name,
284
274
  start_from,
285
275
  page_size,
286
276
  )
@@ -292,7 +282,6 @@ class ProjectManager(Client):
292
282
  project_guid: str,
293
283
  team_role: str = None,
294
284
  effective_time: str = None,
295
- server_name: str = None,
296
285
  start_from: int = 0,
297
286
  page_size: int = None,
298
287
  ) -> list | str:
@@ -309,9 +298,7 @@ class ProjectManager(Client):
309
298
  team role to filter on. Project managers would be "ProjectManagement".
310
299
  effective_time: str, optional
311
300
  Time at which to query the team role. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
312
- server_name : str, optional
313
- The name of the server to configure.
314
- If not provided, the server name associated with the instance is used.
301
+
315
302
  start_from: int, [default=0], optional
316
303
  When multiple pages of results are available, the page number to start from.
317
304
  page_size: int, [default=None]
@@ -334,15 +321,14 @@ class ProjectManager(Client):
334
321
  Notes
335
322
  -----
336
323
  """
337
- if server_name is None:
338
- server_name = self.server_name
324
+
339
325
  if page_size is None:
340
326
  page_size = self.page_size
341
327
 
342
328
  body = {effective_time: effective_time, "filter": team_role}
343
329
  body_s = body_slimmer(body)
344
330
  url = (
345
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
331
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
346
332
  f"{project_guid}/team?startFrom={start_from}&pageSize={page_size}"
347
333
  )
348
334
 
@@ -356,7 +342,6 @@ class ProjectManager(Client):
356
342
  project_guid: str,
357
343
  team_role: str = None,
358
344
  effective_time: str = None,
359
- server_name: str = None,
360
345
  start_from: int = 0,
361
346
  page_size: int = None,
362
347
  ) -> list | str:
@@ -373,9 +358,7 @@ class ProjectManager(Client):
373
358
  team role to filter on. Project managers would be "ProjectManagement".
374
359
  effective_time: str, optional
375
360
  Time at which to query the team role. Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
376
- server_name : str, optional
377
- The name of the server to configure.
378
- If not provided, the server name associated with the instance is used.
361
+
379
362
  start_from: int, [default=0], optional
380
363
  When multiple pages of results are available, the page number to start from.
381
364
  page_size: int, [default=None]
@@ -404,7 +387,6 @@ class ProjectManager(Client):
404
387
  project_guid,
405
388
  team_role,
406
389
  effective_time,
407
- server_name,
408
390
  start_from,
409
391
  page_size,
410
392
  )
@@ -418,7 +400,6 @@ class ProjectManager(Client):
418
400
  starts_with: bool = False,
419
401
  ends_with: bool = False,
420
402
  ignore_case: bool = False,
421
- server_name: str = None,
422
403
  start_from: int = 0,
423
404
  page_size: int = None,
424
405
  ) -> list | str:
@@ -433,9 +414,7 @@ class ProjectManager(Client):
433
414
  Search string to use to find matching projects. If the search string is '*' then all projects returned.
434
415
  effective_time: str, [default=None], optional
435
416
  Effective time of the query. If not specified will default to any time.
436
- server_name : str, optional
437
- The name of the server to configure.
438
- If not provided, the server name associated with the instance is used.
417
+
439
418
  starts_with : bool, [default=False], optional
440
419
  Starts with the supplied string.
441
420
  ends_with : bool, [default=False], optional
@@ -464,8 +443,7 @@ class ProjectManager(Client):
464
443
  The principle specified by the user_id does not have authorization for the requested action
465
444
 
466
445
  """
467
- if server_name is None:
468
- server_name = self.server_name
446
+
469
447
  if page_size is None:
470
448
  page_size = self.page_size
471
449
  starts_with_s = str(starts_with).lower()
@@ -483,7 +461,7 @@ class ProjectManager(Client):
483
461
  }
484
462
  body_s = body_slimmer(body)
485
463
  url = (
486
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
464
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
487
465
  f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
488
466
  f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
489
467
  )
@@ -498,7 +476,6 @@ class ProjectManager(Client):
498
476
  starts_with: bool = False,
499
477
  ends_with: bool = False,
500
478
  ignore_case: bool = False,
501
- server_name: str = None,
502
479
  start_from: int = 0,
503
480
  page_size: int = None,
504
481
  ) -> list | str:
@@ -512,9 +489,7 @@ class ProjectManager(Client):
512
489
  Search string to use to find matching projects. If the search string is '*' then all projects returned.
513
490
  effective_time: str, [default=None], optional
514
491
  Effective time of the query. If not specified will default to any time.
515
- server_name : str, optional
516
- The name of the server to configure.
517
- If not provided, the server name associated with the instance is used.
492
+
518
493
  starts_with : bool, [default=False], optional
519
494
  Starts with the supplied string.
520
495
  ends_with : bool, [default=False], optional
@@ -551,7 +526,6 @@ class ProjectManager(Client):
551
526
  starts_with,
552
527
  ends_with,
553
528
  ignore_case,
554
- server_name,
555
529
  start_from,
556
530
  page_size,
557
531
  )
@@ -563,7 +537,6 @@ class ProjectManager(Client):
563
537
  self,
564
538
  name: str,
565
539
  effective_time: str = None,
566
- server_name: str = None,
567
540
  start_from: int = 0,
568
541
  page_size: int = None,
569
542
  ) -> list | str:
@@ -575,9 +548,7 @@ class ProjectManager(Client):
575
548
  name to use to find matching collections.
576
549
  effective_time: str, [default=None], optional
577
550
  Effective time of the query. If not specified will default to any time. ISO 8601 format.
578
- server_name : str, optional
579
- The name of the server to configure.
580
- If not provided, the server name associated with the instance is used.
551
+
581
552
  start_from: int, [default=0], optional
582
553
  When multiple pages of results are available, the page number to start from.
583
554
  page_size: int, [default=None]
@@ -600,8 +571,7 @@ class ProjectManager(Client):
600
571
  The principle specified by the user_id does not have authorization for the requested action
601
572
 
602
573
  """
603
- if server_name is None:
604
- server_name = self.server_name
574
+
605
575
  if page_size is None:
606
576
  page_size = self.page_size
607
577
 
@@ -613,7 +583,7 @@ class ProjectManager(Client):
613
583
  }
614
584
  body_s = body_slimmer(body)
615
585
  url = (
616
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
586
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
617
587
  f"by-name?startFrom={start_from}&pageSize={page_size}"
618
588
  )
619
589
 
@@ -624,7 +594,6 @@ class ProjectManager(Client):
624
594
  self,
625
595
  name: str,
626
596
  effective_time: str = None,
627
- server_name: str = None,
628
597
  start_from: int = 0,
629
598
  page_size: int = None,
630
599
  ) -> list | str:
@@ -636,9 +605,7 @@ class ProjectManager(Client):
636
605
  name to use to find matching collections.
637
606
  effective_time: str, [default=None], optional
638
607
  Effective time of the query. If not specified will default to any time. ISO 8601 format.
639
- server_name : str, optional
640
- The name of the server to configure.
641
- If not provided, the server name associated with the instance is used.
608
+
642
609
  start_from: int, [default=0], optional
643
610
  When multiple pages of results are available, the page number to start from.
644
611
  page_size: int, [default=None]
@@ -664,14 +631,16 @@ class ProjectManager(Client):
664
631
  loop = asyncio.get_event_loop()
665
632
  resp = loop.run_until_complete(
666
633
  self._async_get_projects_by_name(
667
- name, effective_time, server_name, start_from, page_size
634
+ name, effective_time, start_from, page_size
668
635
  )
669
636
  )
670
637
 
671
638
  return resp
672
639
 
673
640
  async def _async_get_project(
674
- self, project_guid: str, effective_time: str = None, server_name: str = None
641
+ self,
642
+ project_guid: str,
643
+ effective_time: str = None,
675
644
  ) -> dict | str:
676
645
  """Return the properties of a specific project. Async version.
677
646
 
@@ -681,9 +650,7 @@ class ProjectManager(Client):
681
650
  unique identifier of the project.
682
651
  effective_time: str, [default=None], optional
683
652
  Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
684
- server_name : str, optional
685
- The name of the server to configure.
686
- If not provided, the server name associated with the instance is used.
653
+
687
654
 
688
655
  Returns
689
656
  -------
@@ -702,28 +669,26 @@ class ProjectManager(Client):
702
669
  The principle specified by the user_id does not have authorization for the requested action
703
670
 
704
671
  """
705
- if server_name is None:
706
- server_name = self.server_name
707
672
 
708
673
  validate_guid(project_guid)
709
674
  body = {
710
675
  "effective_time": effective_time,
711
676
  }
712
- url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}"
677
+ url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}"
713
678
 
714
679
  resp = await self._async_make_request("GET", url, body)
715
680
  return resp.json()
716
681
 
717
- def get_project(self, project_guid: str, server_name: str = None) -> dict | str:
682
+ def get_project(self, project_guid: str, effective_time: str = None) -> dict | str:
718
683
  """Return the properties of a specific project.
719
684
 
720
685
  Parameters
721
686
  ----------
722
687
  project_guid: str,
723
688
  unique identifier of the project.
724
- server_name : str, optional
725
- The name of the server to configure.
726
- If not provided, the server name associated with the instance is used.
689
+ effective_time: str, [default=None], optional
690
+ Effective time of the query. If not specified will default to any time. Time in ISO8601 format is assumed.
691
+
727
692
 
728
693
  Returns
729
694
  -------
@@ -744,7 +709,7 @@ class ProjectManager(Client):
744
709
  """
745
710
  loop = asyncio.get_event_loop()
746
711
  resp = loop.run_until_complete(
747
- self._async_get_project(project_guid, server_name)
712
+ self._async_get_project(project_guid, effective_time)
748
713
  )
749
714
 
750
715
  return resp
@@ -753,7 +718,9 @@ class ProjectManager(Client):
753
718
  # Create project methods
754
719
  #
755
720
  async def _async_create_project_w_body(
756
- self, body: dict, classification: str = None, server_name: str = None
721
+ self,
722
+ body: dict,
723
+ classification: str = None,
757
724
  ) -> str:
758
725
  """Create project: https://egeria-project.org/concepts/project Async version.
759
726
 
@@ -804,13 +771,12 @@ class ProjectManager(Client):
804
771
  }
805
772
 
806
773
  """
807
- if server_name is None:
808
- server_name = self.server_name
774
+
809
775
  if classification is None:
810
- url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects"
776
+ url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects"
811
777
  else:
812
778
  url = (
813
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects?"
779
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects?"
814
780
  f"classificationName={classification}"
815
781
  )
816
782
  body_s = body_slimmer(body)
@@ -818,7 +784,9 @@ class ProjectManager(Client):
818
784
  return resp.json().get("guid", "No GUID returned")
819
785
 
820
786
  def create_project_w_body(
821
- self, body: dict, classification: str = None, server_name: str = None
787
+ self,
788
+ body: dict,
789
+ classification: str = None,
822
790
  ) -> str:
823
791
  """Create project: https://egeria-project.org/concepts/project
824
792
 
@@ -871,7 +839,7 @@ class ProjectManager(Client):
871
839
  """
872
840
  loop = asyncio.get_event_loop()
873
841
  resp = loop.run_until_complete(
874
- self._async_create_project_w_body(body, classification, server_name)
842
+ self._async_create_project_w_body(body, classification)
875
843
  )
876
844
  return resp
877
845
 
@@ -891,7 +859,6 @@ class ProjectManager(Client):
891
859
  project_health: str = None,
892
860
  start_date: str = None,
893
861
  planned_end_date: str = None,
894
- server_name: str = None,
895
862
  ) -> str:
896
863
  """Create Project: https://egeria-project.org/concepts/project Async version.
897
864
 
@@ -929,9 +896,7 @@ class ProjectManager(Client):
929
896
  Start date of the project in ISO 8601 string format.
930
897
  planned_end_date: str, optional, defaults to None
931
898
  Planned completion date in ISO 8601 string format.
932
- server_name: str, optional, defaults to None
933
- The name of the server to configure. If not provided, the server name associated with the instance is
934
- used.
899
+
935
900
 
936
901
  Returns
937
902
  -------
@@ -947,17 +912,15 @@ class ProjectManager(Client):
947
912
  The principle specified by the user_id does not have authorization for the requested action
948
913
 
949
914
  """
950
- if server_name is None:
951
- server_name = self.server_name
952
915
 
953
916
  if parent_guid is None:
954
917
  is_own_anchor = False
955
918
 
956
919
  if classification_name is None:
957
- url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects"
920
+ url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects"
958
921
  else:
959
922
  url = (
960
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects?"
923
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects?"
961
924
  f"classificationName={classification_name}"
962
925
  )
963
926
 
@@ -1000,7 +963,6 @@ class ProjectManager(Client):
1000
963
  project_health: str = None,
1001
964
  start_date: str = None,
1002
965
  planned_end_date: str = None,
1003
- server_name: str = None,
1004
966
  ) -> str:
1005
967
  """Create Project: https://egeria-project.org/concepts/project
1006
968
 
@@ -1038,9 +1000,7 @@ class ProjectManager(Client):
1038
1000
  Start date of the project in ISO 8601 string format.
1039
1001
  planned_end_date: str, optional, defaults to None
1040
1002
  Planned completion date in ISO 8601 string format.
1041
- server_name: str, optional, defaults to None
1042
- The name of the server to configure. If not provided, the server name associated with the instance is
1043
- used.
1003
+
1044
1004
 
1045
1005
  Returns
1046
1006
  -------
@@ -1073,7 +1033,6 @@ class ProjectManager(Client):
1073
1033
  project_health,
1074
1034
  start_date,
1075
1035
  planned_end_date,
1076
- server_name,
1077
1036
  )
1078
1037
  )
1079
1038
  return resp
@@ -1089,7 +1048,6 @@ class ProjectManager(Client):
1089
1048
  project_health: str = None,
1090
1049
  start_date: str = None,
1091
1050
  planned_end_date: str = None,
1092
- server_name: str = None,
1093
1051
  ) -> str:
1094
1052
  """Create a new project with the Task classification and link it to a project. Async version.
1095
1053
 
@@ -1113,9 +1071,7 @@ class ProjectManager(Client):
1113
1071
  Start date of the project in ISO 8601 string format.
1114
1072
  planned_end_date: str, optional, defaults to None
1115
1073
  Planned completion date in ISO 8601 string format.
1116
- server_name: str, optional, defaults to None
1117
- The name of the server to configure. If not provided, the server name associated with the instance is
1118
- used.
1074
+
1119
1075
  Returns
1120
1076
  -------
1121
1077
  str - the guid of the created project task
@@ -1130,11 +1086,9 @@ class ProjectManager(Client):
1130
1086
  The principle specified by the user_id does not have authorization for the requested action
1131
1087
 
1132
1088
  """
1133
- if server_name is None:
1134
- server_name = self.server_name
1135
1089
 
1136
1090
  url = (
1137
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
1091
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
1138
1092
  f"{project_guid}/task"
1139
1093
  )
1140
1094
 
@@ -1165,7 +1119,6 @@ class ProjectManager(Client):
1165
1119
  project_health: str = None,
1166
1120
  start_date: str = None,
1167
1121
  planned_end_date: str = None,
1168
- server_name: str = None,
1169
1122
  ) -> str:
1170
1123
  """Create a new project with the Task classification and link it to a project.
1171
1124
 
@@ -1189,9 +1142,7 @@ class ProjectManager(Client):
1189
1142
  Start date of the project in ISO 8601 string format.
1190
1143
  planned_end_date: str, optional, defaults to None
1191
1144
  Planned completion date in ISO 8601 string format.
1192
- server_name: str, optional, defaults to None
1193
- The name of the server to configure. If not provided, the server name associated with the instance is
1194
- used.
1145
+
1195
1146
  Returns
1196
1147
  -------
1197
1148
  str - the guid of the created project task
@@ -1218,13 +1169,13 @@ class ProjectManager(Client):
1218
1169
  project_health,
1219
1170
  start_date,
1220
1171
  planned_end_date,
1221
- server_name,
1222
1172
  )
1223
1173
  )
1224
1174
  return resp
1225
1175
 
1226
1176
  async def _async_create_project_from_template(
1227
- self, body: dict, server_name: str = None
1177
+ self,
1178
+ body: dict,
1228
1179
  ) -> str:
1229
1180
  """Create a new metadata element to represent a project using an existing metadata element as a template.
1230
1181
  The template defines additional classifications and relationships that should be added to the new project.
@@ -1235,9 +1186,7 @@ class ProjectManager(Client):
1235
1186
 
1236
1187
  body: dict
1237
1188
  A dict representing the details of the collection to create.
1238
- server_name: str, optional, defaults to None
1239
- The name of the server to configure. If not provided, the server name associated with the instance
1240
- is used.
1189
+
1241
1190
 
1242
1191
  Returns
1243
1192
  -------
@@ -1282,15 +1231,16 @@ class ProjectManager(Client):
1282
1231
 
1283
1232
 
1284
1233
  """
1285
- if server_name is None:
1286
- server_name = self.server_name
1287
1234
 
1288
- url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/from-template"
1235
+ url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/from-template"
1289
1236
  body_s = body_slimmer(body)
1290
1237
  resp = await self._async_make_request("POST", url, body_s)
1291
1238
  return resp.json().get("guid", "No GUID Returned")
1292
1239
 
1293
- def create_project_from_template(self, body: dict, server_name: str = None) -> str:
1240
+ def create_project_from_template(
1241
+ self,
1242
+ body: dict,
1243
+ ) -> str:
1294
1244
  """Create a new metadata element to represent a project using an existing metadata element as a template.
1295
1245
  The template defines additional classifications and relationships that should be added to the new project.
1296
1246
 
@@ -1299,9 +1249,7 @@ class ProjectManager(Client):
1299
1249
 
1300
1250
  body: dict
1301
1251
  A dict representing the details of the collection to create.
1302
- server_name: str, optional, defaults to None
1303
- The name of the server to configure. If not provided, the server name associated with the instance
1304
- is used.
1252
+
1305
1253
 
1306
1254
  Returns
1307
1255
  -------
@@ -1345,9 +1293,7 @@ class ProjectManager(Client):
1345
1293
  }
1346
1294
  """
1347
1295
  loop = asyncio.get_event_loop()
1348
- resp = loop.run_until_complete(
1349
- self._async_create_project_from_template(body, server_name)
1350
- )
1296
+ resp = loop.run_until_complete(self._async_create_project_from_template(body))
1351
1297
  return resp
1352
1298
 
1353
1299
  async def _async_update_project(
@@ -1363,7 +1309,6 @@ class ProjectManager(Client):
1363
1309
  start_date: str = None,
1364
1310
  planned_end_date: str = None,
1365
1311
  replace_all_props: bool = False,
1366
- server_name: str = None,
1367
1312
  ) -> None:
1368
1313
  """Update the properties of a project. Async Version.
1369
1314
 
@@ -1391,9 +1336,7 @@ class ProjectManager(Client):
1391
1336
  Planned completion date in ISO 8601 string format.
1392
1337
  replace_all_props: bool, optional, defaults to False
1393
1338
  If True, then all the properties of the project will be replaced with the specified properties.
1394
- server_name: str, optional, defaults to None
1395
- The name of the server to configure. If not provided, the server name associated with the instance is
1396
- used.
1339
+
1397
1340
  Returns
1398
1341
  -------
1399
1342
  str - the guid of the created project task
@@ -1407,11 +1350,10 @@ class ProjectManager(Client):
1407
1350
  NotAuthorizedException
1408
1351
  The principle specified by the user_id does not have authorization for the requested action
1409
1352
  """
1410
- if server_name is None:
1411
- server_name = self.server_name
1353
+
1412
1354
  replace_all_props_s = str(replace_all_props).lower()
1413
1355
  url = (
1414
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1356
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1415
1357
  f"update?replaceAllProperties={replace_all_props_s}"
1416
1358
  )
1417
1359
 
@@ -1444,7 +1386,6 @@ class ProjectManager(Client):
1444
1386
  start_date: str = None,
1445
1387
  planned_end_date: str = None,
1446
1388
  replace_all_props: bool = False,
1447
- server_name: str = None,
1448
1389
  ) -> None:
1449
1390
  """Update the properties of a project.
1450
1391
 
@@ -1472,9 +1413,7 @@ class ProjectManager(Client):
1472
1413
  Planned completion date in ISO 8601 string format.
1473
1414
  replace_all_props: bool, optional, defaults to False
1474
1415
  If True, then all the properties of the project will be replaced with the specified properties.
1475
- server_name: str, optional, defaults to None
1476
- The name of the server to configure. If not provided, the server name associated with the instance is
1477
- used.
1416
+
1478
1417
  Returns
1479
1418
  -------
1480
1419
  str - the guid of the created project task
@@ -1502,13 +1441,13 @@ class ProjectManager(Client):
1502
1441
  start_date,
1503
1442
  planned_end_date,
1504
1443
  replace_all_props,
1505
- server_name,
1506
1444
  )
1507
1445
  )
1508
1446
  return
1509
1447
 
1510
1448
  async def _async_delete_project(
1511
- self, project_guid: str, server_name: str = None
1449
+ self,
1450
+ project_guid: str,
1512
1451
  ) -> None:
1513
1452
  """Delete a project. It is detected from all parent elements. Async version
1514
1453
 
@@ -1516,9 +1455,7 @@ class ProjectManager(Client):
1516
1455
  ----------
1517
1456
  project_guid: str
1518
1457
  The guid of the project to update.
1519
- server_name: str, optional, defaults to None
1520
- The name of the server to configure. If not provided, the server name associated with the instance
1521
- is used.
1458
+
1522
1459
 
1523
1460
  Returns
1524
1461
  -------
@@ -1534,11 +1471,9 @@ class ProjectManager(Client):
1534
1471
  The principle specified by the user_id does not have authorization for the requested action
1535
1472
 
1536
1473
  """
1537
- if server_name is None:
1538
- server_name = self.server_name
1539
1474
 
1540
1475
  url = (
1541
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/"
1476
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/"
1542
1477
  f"{project_guid}/delete"
1543
1478
  )
1544
1479
 
@@ -1547,16 +1482,17 @@ class ProjectManager(Client):
1547
1482
  await self._async_make_request("POST", url, body)
1548
1483
  return
1549
1484
 
1550
- def delete_project(self, project_guid: str, server_name: str = None) -> None:
1485
+ def delete_project(
1486
+ self,
1487
+ project_guid: str,
1488
+ ) -> None:
1551
1489
  """Delete a project. It is detected from all parent elements.
1552
1490
 
1553
1491
  Parameters
1554
1492
  ----------
1555
1493
  project_guid: str
1556
1494
  The guid of the collection to update.
1557
- server_name: str, optional, defaults to None
1558
- The name of the server to configure. If not provided, the server name associated with the instance
1559
- is used.
1495
+
1560
1496
 
1561
1497
  Returns
1562
1498
  -------
@@ -1574,7 +1510,7 @@ class ProjectManager(Client):
1574
1510
 
1575
1511
  """
1576
1512
  loop = asyncio.get_event_loop()
1577
- loop.run_until_complete(self._async_delete_project(project_guid, server_name))
1513
+ loop.run_until_complete(self._async_delete_project(project_guid))
1578
1514
  return
1579
1515
 
1580
1516
  async def _async_add_to_project_team(
@@ -1584,7 +1520,6 @@ class ProjectManager(Client):
1584
1520
  team_role: str = None,
1585
1521
  effective_from: str = None,
1586
1522
  effective_to: str = None,
1587
- server_name: str = None,
1588
1523
  ) -> None:
1589
1524
  """Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
1590
1525
  the actor plays in the project. Async version.
@@ -1601,9 +1536,6 @@ class ProjectManager(Client):
1601
1536
  Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
1602
1537
  effective_to: str, optional, defaults to None
1603
1538
  Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
1604
- server_name : str, optional
1605
- The name of the server to use.
1606
- If not provided, the server name associated with the instance is used.
1607
1539
 
1608
1540
  Returns
1609
1541
  -------
@@ -1620,11 +1552,9 @@ class ProjectManager(Client):
1620
1552
  The principle specified by the user_id does not have authorization for the requested action
1621
1553
 
1622
1554
  """
1623
- if server_name is None:
1624
- server_name = self.server_name
1625
1555
 
1626
1556
  url = (
1627
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1557
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1628
1558
  f"members/{actor_guid}/attach"
1629
1559
  )
1630
1560
  body = {
@@ -1647,7 +1577,6 @@ class ProjectManager(Client):
1647
1577
  team_role: str = None,
1648
1578
  effective_from: str = None,
1649
1579
  effective_to: str = None,
1650
- server_name: str = None,
1651
1580
  ) -> None:
1652
1581
  """Add an actor to a project. The request body is optional. If supplied, it contains the name of the role that
1653
1582
  the actor plays in the project.
@@ -1664,9 +1593,6 @@ class ProjectManager(Client):
1664
1593
  Date at which the actor becomes active in the project. Date format is ISO 8601 string format.
1665
1594
  effective_to: str, optional, defaults to None
1666
1595
  Date at which the actor is no longer active in the project. Date format is ISO 8601 string format.
1667
- server_name : str, optional
1668
- The name of the server to use.
1669
- If not provided, the server name associated with the instance is used.
1670
1596
 
1671
1597
  Returns
1672
1598
  -------
@@ -1691,13 +1617,14 @@ class ProjectManager(Client):
1691
1617
  team_role,
1692
1618
  effective_from,
1693
1619
  effective_to,
1694
- server_name,
1695
1620
  )
1696
1621
  )
1697
1622
  return
1698
1623
 
1699
1624
  async def _async_remove_from_project_team(
1700
- self, project_guid: str, actor_guid: str, server_name: str = None
1625
+ self,
1626
+ project_guid: str,
1627
+ actor_guid: str,
1701
1628
  ) -> None:
1702
1629
  """Remove an actor from a project. Async version.
1703
1630
 
@@ -1707,9 +1634,6 @@ class ProjectManager(Client):
1707
1634
  identity of the project to remove members from.
1708
1635
  actor_guid: str
1709
1636
  identity of the actor to remove.
1710
- server_name : str, optional
1711
- The name of the server to use.
1712
- If not provided, the server name associated with the instance is used.
1713
1637
 
1714
1638
  Returns
1715
1639
  -------
@@ -1726,11 +1650,9 @@ class ProjectManager(Client):
1726
1650
  The principle specified by the user_id does not have authorization for the requested action
1727
1651
 
1728
1652
  """
1729
- if server_name is None:
1730
- server_name = self.server_name
1731
1653
 
1732
1654
  url = (
1733
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1655
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1734
1656
  f"members/{actor_guid}/detach"
1735
1657
  )
1736
1658
 
@@ -1739,7 +1661,9 @@ class ProjectManager(Client):
1739
1661
  return
1740
1662
 
1741
1663
  def remove_from_project_team(
1742
- self, project_guid: str, actor_guid: str, server_name: str = None
1664
+ self,
1665
+ project_guid: str,
1666
+ actor_guid: str,
1743
1667
  ) -> None:
1744
1668
  """Remove an actor from a project.
1745
1669
 
@@ -1749,9 +1673,6 @@ class ProjectManager(Client):
1749
1673
  identity of the project.
1750
1674
  actor_guid: str
1751
1675
  identity of the actor to remove.
1752
- server_name : str, optional
1753
- The name of the server to use.
1754
- If not provided, the server name associated with the instance is used.
1755
1676
 
1756
1677
  Returns
1757
1678
  -------
@@ -1770,12 +1691,14 @@ class ProjectManager(Client):
1770
1691
  """
1771
1692
  loop = asyncio.get_event_loop()
1772
1693
  loop.run_until_complete(
1773
- self._async_remove_from_project_team(project_guid, actor_guid, server_name)
1694
+ self._async_remove_from_project_team(project_guid, actor_guid)
1774
1695
  )
1775
1696
  return
1776
1697
 
1777
1698
  async def _async_setup_project_management_role(
1778
- self, project_guid: str, project_role_guid: str, server_name: str = None
1699
+ self,
1700
+ project_guid: str,
1701
+ project_role_guid: str,
1779
1702
  ) -> None:
1780
1703
  """Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
1781
1704
  the role is a member of the project. Async version.
@@ -1786,9 +1709,7 @@ class ProjectManager(Client):
1786
1709
  identity of the project.
1787
1710
  project_role_guid: str
1788
1711
  guid of the role to assign to the project.
1789
- server_name : str, optional
1790
- The name of the server to use.
1791
- If not provided, the server name associated with the instance is used.
1712
+
1792
1713
 
1793
1714
  Returns
1794
1715
  -------
@@ -1805,11 +1726,9 @@ class ProjectManager(Client):
1805
1726
  The principle specified by the user_id does not have authorization for the requested action
1806
1727
 
1807
1728
  """
1808
- if server_name is None:
1809
- server_name = self.server_name
1810
1729
 
1811
1730
  url = (
1812
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1731
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1813
1732
  f"project-management-roles/{project_role_guid}/attach"
1814
1733
  )
1815
1734
 
@@ -1818,7 +1737,9 @@ class ProjectManager(Client):
1818
1737
  return
1819
1738
 
1820
1739
  def setup_project_management_role(
1821
- self, project_guid: str, project_role_guid: str, server_name: str = None
1740
+ self,
1741
+ project_guid: str,
1742
+ project_role_guid: str,
1822
1743
  ) -> None:
1823
1744
  """Create a ProjectManagement relationship between a project and a person role to show that anyone appointed to
1824
1745
  the role is a member of the project. Async version.
@@ -1829,9 +1750,7 @@ class ProjectManager(Client):
1829
1750
  identity of the project.
1830
1751
  project_role_guid: str
1831
1752
  guid of the role to assign to the project.
1832
- server_name : str, optional
1833
- The name of the server to use.
1834
- If not provided, the server name associated with the instance is used.
1753
+
1835
1754
 
1836
1755
  Returns
1837
1756
  -------
@@ -1850,14 +1769,14 @@ class ProjectManager(Client):
1850
1769
  """
1851
1770
  loop = asyncio.get_event_loop()
1852
1771
  loop.run_until_complete(
1853
- self._async_setup_project_management_role(
1854
- project_guid, project_role_guid, server_name
1855
- )
1772
+ self._async_setup_project_management_role(project_guid, project_role_guid)
1856
1773
  )
1857
1774
  return
1858
1775
 
1859
1776
  async def _async_clear_project_management_role(
1860
- self, project_guid: str, project_role_guid: str, server_name: str = None
1777
+ self,
1778
+ project_guid: str,
1779
+ project_role_guid: str,
1861
1780
  ) -> None:
1862
1781
  """Remove a ProjectManagement relationship between a project and a person role. Async version.
1863
1782
 
@@ -1867,9 +1786,7 @@ class ProjectManager(Client):
1867
1786
  identity of the project.
1868
1787
  project_role_guid: str
1869
1788
  guid of the role to assign to the project.
1870
- server_name : str, optional
1871
- The name of the server to use.
1872
- If not provided, the server name associated with the instance is used.
1789
+
1873
1790
 
1874
1791
  Returns
1875
1792
  -------
@@ -1886,11 +1803,9 @@ class ProjectManager(Client):
1886
1803
  The principle specified by the user_id does not have authorization for the requested action
1887
1804
 
1888
1805
  """
1889
- if server_name is None:
1890
- server_name = self.server_name
1891
1806
 
1892
1807
  url = (
1893
- f"{self.platform_url}/servers/{server_name}/api/open-metadata/project-manager/projects/{project_guid}/"
1808
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/project-manager/projects/{project_guid}/"
1894
1809
  f"project-management-roles/{project_role_guid}/detach"
1895
1810
  )
1896
1811
 
@@ -1899,7 +1814,9 @@ class ProjectManager(Client):
1899
1814
  return
1900
1815
 
1901
1816
  def clear_project_management_role(
1902
- self, project_guid: str, project_role_guid: str, server_name: str = None
1817
+ self,
1818
+ project_guid: str,
1819
+ project_role_guid: str,
1903
1820
  ) -> None:
1904
1821
  """Clear a ProjectManagement relationship between a project and a person role.
1905
1822
 
@@ -1909,9 +1826,7 @@ class ProjectManager(Client):
1909
1826
  identity of the project.
1910
1827
  project_role_guid: str
1911
1828
  guid of the role to assign to the project.
1912
- server_name : str, optional
1913
- The name of the server to use.
1914
- If not provided, the server name associated with the instance is used.
1829
+
1915
1830
 
1916
1831
  Returns
1917
1832
  -------
@@ -1930,9 +1845,7 @@ class ProjectManager(Client):
1930
1845
  """
1931
1846
  loop = asyncio.get_event_loop()
1932
1847
  loop.run_until_complete(
1933
- self._async_clear_project_management_role(
1934
- project_guid, project_role_guid, server_name
1935
- )
1848
+ self._async_clear_project_management_role(project_guid, project_role_guid)
1936
1849
  )
1937
1850
  return
1938
1851