pyegeria 0.8.4.39__py3-none-any.whl → 0.8.4.40__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.
@@ -14,7 +14,7 @@ from pyegeria import (
14
14
  PropertyServerException,
15
15
  UserNotAuthorizedException,
16
16
  print_exception_response,
17
- ClassificationManager,
17
+ EgeriaTech,
18
18
  )
19
19
 
20
20
 
@@ -44,8 +44,15 @@ def list_elements(
44
44
  jupyter: bool = EGERIA_JUPYTER,
45
45
  width: int = EGERIA_WIDTH,
46
46
  ):
47
- c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
47
+ c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
48
48
  token = c_client.create_egeria_bearer_token()
49
+
50
+ om_typedef = c_client.get_typedef_by_name(om_type)
51
+ if type(om_typedef) is str:
52
+ print(
53
+ f"The type name '{om_type}' is not known to the Egeria platform at {url} - {server}"
54
+ )
55
+ sys.exit(1)
49
56
  elements = c_client.get_elements(om_type)
50
57
 
51
58
  def generate_table() -> Table:
@@ -70,6 +77,7 @@ def list_elements(
70
77
  table.add_column("Home Store")
71
78
  table.add_column("GUID", width=38, no_wrap=True)
72
79
  table.add_column("Properties")
80
+ table.add_column("Classifications")
73
81
 
74
82
  if type(elements) is list:
75
83
  for element in elements:
@@ -79,14 +87,36 @@ def list_elements(
79
87
  el_home = header["origin"]["homeMetadataCollectionName"]
80
88
  el_create_time = header["versions"]["createTime"][:-10]
81
89
  el_guid = header["guid"]
90
+ el_class = header.get("classifications", "---")
82
91
 
83
92
  el_props_md = ""
84
93
  for prop in element["properties"].keys():
85
94
  el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
86
-
87
95
  el_props_out = Markdown(el_props_md)
96
+
97
+ c_md = ""
98
+ if type(el_class) is list:
99
+ for classification in el_class:
100
+ classification_name = classification.get(
101
+ "classificationName", "---"
102
+ )
103
+ c_md = f"* **{classification_name}**\n"
104
+ class_props = classification.get(
105
+ "classificationProperties", "---"
106
+ )
107
+ if type(class_props) is dict:
108
+ for prop in class_props.keys():
109
+ c_md += f"* **{prop}**: {class_props[prop]}\n"
110
+ c_md_out = Markdown(c_md)
111
+
88
112
  table.add_row(
89
- el_q_name, el_type, el_create_time, el_home, el_guid, el_props_out
113
+ el_q_name,
114
+ el_type,
115
+ el_create_time,
116
+ el_home,
117
+ el_guid,
118
+ el_props_out,
119
+ c_md_out,
90
120
  )
91
121
 
92
122
  return table
@@ -14,8 +14,9 @@ from pyegeria import (
14
14
  PropertyServerException,
15
15
  UserNotAuthorizedException,
16
16
  print_exception_response,
17
- ClassificationManager,
18
- FeedbackManager,
17
+ # ClassificationManager,
18
+ # FeedbackManager,
19
+ EgeriaTech,
19
20
  )
20
21
 
21
22
 
@@ -45,12 +46,15 @@ def list_elements_x(
45
46
  jupyter: bool = EGERIA_JUPYTER,
46
47
  width: int = EGERIA_WIDTH,
47
48
  ):
48
- c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
49
+ c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
49
50
  token = c_client.create_egeria_bearer_token()
50
- f_client = FeedbackManager(
51
- server, url, user_id=username, user_pwd=password, token=token
52
- )
53
51
 
52
+ om_typedef = c_client.get_typedef_by_name(om_type)
53
+ if type(om_typedef) is str:
54
+ print(
55
+ f"The type name '{om_type}' is not known to the Egeria platform at {url} - {server}"
56
+ )
57
+ sys.exit(1)
54
58
  elements = c_client.get_elements(om_type)
55
59
 
56
60
  def generate_table() -> Table:
@@ -93,7 +97,7 @@ def list_elements_x(
93
97
 
94
98
  el_props_out = Markdown(el_props_md)
95
99
 
96
- tags = f_client.get_attached_tags(el_guid)
100
+ tags = c_client.get_attached_tags(el_guid)
97
101
  tags_md = "Tags:\n"
98
102
  if type(tags) is list:
99
103
  for tag in tags:
@@ -106,7 +110,7 @@ def list_elements_x(
106
110
  else:
107
111
  tags_md = "---"
108
112
 
109
- likes = f_client.get_attached_likes(el_guid)
113
+ likes = c_client.get_attached_likes(el_guid)
110
114
  likes_md = "Likes:\b"
111
115
  if type(likes) is list:
112
116
  for like in likes:
@@ -83,7 +83,7 @@ def element_response(response: dict, element_type: str, detailed_response: bool)
83
83
 
84
84
 
85
85
  def elements_response(response: dict, element_type: str, detailed_response: bool):
86
- print(response)
86
+ # print(response)
87
87
  if detailed_response:
88
88
  return response
89
89
  elif not element_type in response:
@@ -1096,7 +1096,7 @@ class RuntimeManager(Client):
1096
1096
  archive_file: str,
1097
1097
  server_guid: str = None,
1098
1098
  server_name: str = None,
1099
- time_out: int = 60,
1099
+ time_out: int = 120,
1100
1100
  ) -> None:
1101
1101
  """Add a new open metadata archive to running OMAG Server's repository.
1102
1102
  An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
@@ -1141,7 +1141,7 @@ class RuntimeManager(Client):
1141
1141
  archive_file: str,
1142
1142
  server_guid: str = None,
1143
1143
  server_name: str = None,
1144
- time_out: int = 60,
1144
+ time_out: int = 120,
1145
1145
  ) -> None:
1146
1146
  """Add a new open metadata archive to running OMAG Server's repository.
1147
1147
  An open metadata archive contains metadata types and instances. This operation loads an open metadata archive
@@ -1247,7 +1247,7 @@ class RuntimeManager(Client):
1247
1247
  return
1248
1248
 
1249
1249
  async def _async_activate_server_with_stored_config(
1250
- self, server_guid: str = None, server_name: str = None
1250
+ self, server_guid: str = None, server_name: str = None, timeout: int = 120
1251
1251
  ) -> None:
1252
1252
  """Activate the named OMAG server using the appropriate configuration document found in the
1253
1253
  configuration store. Async version.
@@ -1275,11 +1275,11 @@ class RuntimeManager(Client):
1275
1275
  server_guid = self.__get_guid__(server_guid, server_name)
1276
1276
  url = f"{self.runtime_command_root}/omag-servers/{server_guid}/instance"
1277
1277
 
1278
- await self._async_make_request("POST", url)
1278
+ await self._async_make_request("POST", url, time_out=timeout)
1279
1279
  return
1280
1280
 
1281
1281
  def activate_server_with_stored_config(
1282
- self, server_guid: str = None, server_name: str = None
1282
+ self, server_guid: str = None, server_name: str = None, timeout: int = 120
1283
1283
  ) -> None:
1284
1284
  """Activate the named OMAG server using the appropriate configuration document found in the
1285
1285
  configuration store.
@@ -1306,7 +1306,9 @@ class RuntimeManager(Client):
1306
1306
  """
1307
1307
  loop = asyncio.get_event_loop()
1308
1308
  loop.run_until_complete(
1309
- self._async_activate_server_with_stored_config(server_guid, server_name)
1309
+ self._async_activate_server_with_stored_config(
1310
+ server_guid, server_name, timeout
1311
+ )
1310
1312
  )
1311
1313
  return
1312
1314
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.8.4.39
3
+ Version: 0.8.4.40
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -52,8 +52,8 @@ commands/tech/get_element_info.py,sha256=Rauespy7ZfyKtLh_H8XWgYTpPijsqlUGm-zeb7K
52
52
  commands/tech/get_guid_info.py,sha256=HfwcGAFALFIpy4AJAgQHU__Fv1fjprh1G1xB5AjlZ80,4282
53
53
  commands/tech/get_tech_details.py,sha256=p5OgSKep3VOuuZmQXE2OSYhE-kvnI18TBcQ-PU5kEAw,6023
54
54
  commands/tech/list_asset_types.py,sha256=LG7e8yjewQ_SX8SjzEiEii_-hDvmAJKyLN8iDjbch50,4162
55
- commands/tech/list_elements.py,sha256=cafGJMwvWTK5TkUNMPkPdSaTGqws0uQknyA_iywFjNQ,4834
56
- commands/tech/list_elements_x.py,sha256=mVAwl7QLPjiKCN_zWZpJIK4H_bwuT4hla8mUB8bJcgA,6370
55
+ commands/tech/list_elements.py,sha256=QWL465PoaMznSuLS_SV7Ubq_B7nwEPPTNYut2NYiDtQ,5996
56
+ commands/tech/list_elements_x.py,sha256=k5jkekB7wh6cbzjn7FnwL7pKrPFq_oE-x36c_Z1FuSo,6500
57
57
  commands/tech/list_registered_services.py,sha256=QzE_ebdopNkHWMxa-xc902GG6ac4Yw-ln8i8NUsgHVA,6542
58
58
  commands/tech/list_related_specification.py,sha256=mWrKenXOskL4cl0DHjH2Z8M9-FJzjkzK62W-tsx3WDU,5918
59
59
  commands/tech/list_relationship_types.py,sha256=BlVzrPznZXqMVLN2-2vYEVRGeYsiJrqXxIJEikobyoo,5875
@@ -77,7 +77,7 @@ pyegeria/egeria_client.py,sha256=gZjo_Z8n7r05KJnQgJuQibGOvCA90JCDlzyFRGkZV-I,336
77
77
  pyegeria/egeria_config_client.py,sha256=Zm31u4e7o8mXTV93qD0IHluQuG73jYbArPFqypjaMso,1328
78
78
  pyegeria/egeria_my_client.py,sha256=XHwbFmSZXJClKDBFV8_fyK9CWaap2FndurRjywKPQiU,1549
79
79
  pyegeria/egeria_tech_client.py,sha256=7NfqpJFft5GR4NPRDVDw22L9caHbXB8fhx0TAf6qEoo,2440
80
- pyegeria/feedback_manager_omvs.py,sha256=yvZ36nA_AIFsqyU-lysMWHHgqEnucti3ztfkqMxDCT0,152929
80
+ pyegeria/feedback_manager_omvs.py,sha256=B66e3ZCaC_dirb0mcb2Nz3PYh2ZKsoMAYNOb3euNiro,152931
81
81
  pyegeria/full_omag_server_config.py,sha256=LBnqUiz1ofBdlKBzECFs_pQbdJwcWigAukWHGJRR2nU,47340
82
82
  pyegeria/glossary_browser_omvs.py,sha256=AnBRp6KKw0507ABz_WmknVL94zLzYzJ4saXrghFlpmw,93455
83
83
  pyegeria/glossary_manager_omvs.py,sha256=VaPUROcVR5AjgkXeFx63e_10h0QzUeMt3JppHrhlq2M,111926
@@ -86,13 +86,13 @@ pyegeria/my_profile_omvs.py,sha256=DyECbUFEcgokrIbzdMMNljC3bqfqKGXAF2wZEpzvRYs,3
86
86
  pyegeria/platform_services.py,sha256=CJIOYIFEbcIGwdWlApAQcXxZTsdrhFtpJcm4O3p7dG0,41646
87
87
  pyegeria/project_manager_omvs.py,sha256=Y7Lyqh4jIujJrr_Ub7feo904FN_uz4R10T4hKhqE1Uw,67499
88
88
  pyegeria/registered_info.py,sha256=y0-LgDIQXpph0lEWxIOG3_HsqX_Z2iAIb3xu4Aa4B70,6344
89
- pyegeria/runtime_manager_omvs.py,sha256=aDLJauaRKoZP8ike-NiMH71zRVFmLC5-mCZEzM7cgLM,74149
89
+ pyegeria/runtime_manager_omvs.py,sha256=TYFbCpbCfgu-JqAxl2qdVPYZlUiTxeHqd4L8lNap-3I,74248
90
90
  pyegeria/server_operations.py,sha256=ciH890hYT85YQ6OpByn4w7s3a7TtvWZpIG5rkRqbcI0,16766
91
91
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
92
92
  pyegeria/valid_metadata_omvs.py,sha256=raBU_bK0oMhOqjOUTSbU_OZuGKsYqRoiFbtUwz4OtZI,29060
93
93
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
94
- pyegeria-0.8.4.39.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
95
- pyegeria-0.8.4.39.dist-info/METADATA,sha256=E77MPfsyC_PUoY4zSE6pzkmLjUI_UbJku8y23jQZ6_g,2868
96
- pyegeria-0.8.4.39.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
97
- pyegeria-0.8.4.39.dist-info/entry_points.txt,sha256=R8sNzclWZN542SufuVlx9HDia23PlSVnJioUkzCWg4I,3349
98
- pyegeria-0.8.4.39.dist-info/RECORD,,
94
+ pyegeria-0.8.4.40.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
95
+ pyegeria-0.8.4.40.dist-info/METADATA,sha256=S848dKDNgxHA9sXkELQLtCCoYiWltZdhN6XdAP-ydsA,2868
96
+ pyegeria-0.8.4.40.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
97
+ pyegeria-0.8.4.40.dist-info/entry_points.txt,sha256=DUPkeIWOd5H0m7_0Czt2P340RnePXcE-VAcact9B1Hc,3350
98
+ pyegeria-0.8.4.40.dist-info/RECORD,,
@@ -15,7 +15,7 @@ hey_egeria=commands.cli.egeria:cli
15
15
  hey_egeria_cat=commands.cli.egeria_cat:cli
16
16
  hey_egeria_my=commands.cli.egeria_my:cli
17
17
  hey_egeria_ops=commands.cli.egeria_ops:cli
18
- hey_egeria_tech=commands.cli.egeria_cat:cli
18
+ hey_egeria_tech=commands.cli.egeria_tech:cli
19
19
  list_archives=commands.cat.list_archives:main
20
20
  list_asset_types=commands.tech.list_asset_types:main
21
21
  list_assets=commands.cat.list_assets:main