pyegeria 1.5.1.0.3__tar.gz → 1.5.1.0.4__tar.gz

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 (106) hide show
  1. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/PKG-INFO +1 -1
  2. pyegeria-1.5.1.0.4/commands/cat/list_deployed_catalogs.py +187 -0
  3. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_deployed_database_schemas.py +37 -13
  4. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/egeria.py +57 -0
  5. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/egeria_cat.py +39 -0
  6. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/egeria_tech.py +18 -1
  7. pyegeria-1.5.1.0.4/commands/tech/list_gov_action_processes.py +139 -0
  8. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/automated_curation_omvs.py +2 -2
  9. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/classification_manager_omvs.py +2 -4
  10. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyproject.toml +5 -2
  11. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/LICENSE +0 -0
  12. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/README.md +0 -0
  13. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/README.md +0 -0
  14. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/__init__.py +0 -0
  15. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/get_asset_graph.py +0 -0
  16. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/get_collection.py +0 -0
  17. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/get_project_dependencies.py +0 -0
  18. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/get_project_structure.py +0 -0
  19. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/get_tech_type_elements.py +0 -0
  20. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/get_tech_type_template.py +0 -0
  21. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_archives.py +0 -0
  22. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_assets.py +0 -0
  23. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_cert_types.py +0 -0
  24. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_deployed_databases.py +0 -0
  25. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_glossary.py +0 -0
  26. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_projects.py +0 -0
  27. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_relationships.py +0 -0
  28. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_tech_types.py +0 -0
  29. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_todos.py +0 -0
  30. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cat/list_user_ids.py +0 -0
  31. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/__init__.py +0 -0
  32. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/egeria_my.py +0 -0
  33. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/egeria_ops.py +0 -0
  34. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/cli/ops_config.py +0 -0
  35. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/README.md +0 -0
  36. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/__init__.py +0 -0
  37. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/list_my_profile.py +0 -0
  38. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/list_my_roles.py +0 -0
  39. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/monitor_my_todos.py +0 -0
  40. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/monitor_open_todos.py +0 -0
  41. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/my/todo_actions.py +0 -0
  42. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/README.md +0 -0
  43. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/__init__.py +0 -0
  44. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/engine_actions.py +0 -0
  45. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/gov_server_actions.py +0 -0
  46. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/list_catalog_targets.py +0 -0
  47. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/load_archive.py +0 -0
  48. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_asset_events.py +0 -0
  49. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_engine_activity.py +0 -0
  50. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_engine_activity_c.py +0 -0
  51. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_gov_eng_status.py +0 -0
  52. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_integ_daemon_status.py +0 -0
  53. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_platform_status.py +0 -0
  54. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_server_startup.py +0 -0
  55. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/monitor_server_status.py +0 -0
  56. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/orig_monitor_server_list.py +0 -0
  57. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/orig_monitor_server_status.py +0 -0
  58. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/refresh_integration_daemon.py +0 -0
  59. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/ops/restart_integration_daemon.py +0 -0
  60. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/README.md +0 -0
  61. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/__init__.py +0 -0
  62. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/get_element_graph.py +0 -0
  63. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/get_element_info.py +0 -0
  64. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/get_guid_info.py +0 -0
  65. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/get_tech_details.py +0 -0
  66. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_asset_types.py +0 -0
  67. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_elements.py +0 -0
  68. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_elements_for_classification.py +0 -0
  69. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_elements_x.py +0 -0
  70. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_registered_services.py +0 -0
  71. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_related_elements.py +0 -0
  72. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_related_specification.py +0 -0
  73. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_relationship_types.py +0 -0
  74. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_tech_templates.py +0 -0
  75. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/list_valid_metadata_values.py +0 -0
  76. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/commands/tech/x_list_related_elements.py +0 -0
  77. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/README.md +0 -0
  78. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/__init__.py +0 -0
  79. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/_client.py +0 -0
  80. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/_deprecated_gov_engine.py +0 -0
  81. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/_exceptions.py +0 -0
  82. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/_globals.py +0 -0
  83. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/_validators.py +0 -0
  84. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/asset_catalog_omvs.py +0 -0
  85. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/collection_manager_omvs.py +0 -0
  86. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/core_omag_server_config.py +0 -0
  87. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/create_tech_guid_lists.py +0 -0
  88. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/egeria_cat_client.py +0 -0
  89. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/egeria_client.py +0 -0
  90. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/egeria_config_client.py +0 -0
  91. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/egeria_my_client.py +0 -0
  92. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/egeria_tech_client.py +0 -0
  93. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/feedback_manager_omvs.py +0 -0
  94. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/full_omag_server_config.py +0 -0
  95. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/glossary_browser_omvs.py +0 -0
  96. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/glossary_manager_omvs.py +0 -0
  97. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/mermaid_utilities.py +0 -0
  98. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/my_profile_omvs.py +0 -0
  99. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/platform_services.py +0 -0
  100. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/project_manager_omvs.py +0 -0
  101. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/registered_info.py +0 -0
  102. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/runtime_manager_omvs.py +0 -0
  103. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/server_operations.py +0 -0
  104. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/utils.py +0 -0
  105. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/valid_metadata_omvs.py +0 -0
  106. {pyegeria-1.5.1.0.3 → pyegeria-1.5.1.0.4}/pyegeria/x_action_author_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.0.3
3
+ Version: 1.5.1.0.4
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -0,0 +1,187 @@
1
+ """This creates a templates guid file from the core metadata archive"""
2
+ from rich.markdown import Markdown
3
+ from rich.prompt import Prompt
4
+ import os
5
+ import argparse
6
+ import time
7
+ import sys
8
+ from rich import box
9
+ from rich.console import Console
10
+ from rich.table import Table
11
+
12
+ from pyegeria import (
13
+ InvalidParameterException,
14
+ PropertyServerException,
15
+ UserNotAuthorizedException,
16
+ print_exception_response,
17
+ EgeriaTech,
18
+ )
19
+
20
+
21
+ console = Console()
22
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
23
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
24
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
25
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
26
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
27
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
28
+ )
29
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
30
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
31
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
32
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
33
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
34
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
35
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
36
+
37
+
38
+ def check_if_template(header: dict) -> bool:
39
+ """Check if the the template classification is set"""
40
+ classifications = header.get("classifications", None)
41
+ if classifications is None:
42
+ return False
43
+ for c in classifications:
44
+ if c["type"]["typeName"] == "Template":
45
+ return True
46
+ return False
47
+
48
+
49
+ def list_deployed_catalogs(
50
+ uc_server_name: str,
51
+ server: str,
52
+ url: str,
53
+ username: str,
54
+ password: str,
55
+ jupyter: bool = EGERIA_JUPYTER,
56
+ width: int = EGERIA_WIDTH,
57
+ ):
58
+ c_client = EgeriaTech(server, url, user_id=username, user_pwd=password)
59
+ token = c_client.create_egeria_bearer_token()
60
+
61
+ def generate_table() -> Table:
62
+ """Make a new table."""
63
+ table = Table(
64
+ caption=f"Databases found: {url} - {server} @ {time.asctime()}",
65
+ style="bold bright_white on black",
66
+ row_styles=["bold bright_white on black"],
67
+ header_style="white on dark_blue",
68
+ title_style="bold bright_white on black",
69
+ caption_style="white on black",
70
+ show_lines=True,
71
+ box=box.ROUNDED,
72
+ # title=f"Elements for Open Metadata Type: '{om_type}' ",
73
+ expand=True,
74
+ # width=500
75
+ )
76
+
77
+ table.add_column("Catalog Name/GUID", width=38, no_wrap=True)
78
+ table.add_column("Catalog Server")
79
+ table.add_column("Properties")
80
+ table.add_column("Catalog Schemas")
81
+
82
+ om_type = "DeployedDatabaseSchema"
83
+
84
+ cats = c_client.get_elements_by_classification("Anchors", "Catalog")
85
+ if type(cats) is list:
86
+ for cat in cats:
87
+ header = cat["elementHeader"]
88
+
89
+ if check_if_template(header):
90
+ continue
91
+ el_guid = header["guid"]
92
+ el_name = cat["properties"].get("name", "---")
93
+ el_id = f"{el_name}\n{el_guid}"
94
+ el_home = header["origin"]["homeMetadataCollectionName"]
95
+
96
+ el_anchors_md = ""
97
+ class_info = header["classifications"]
98
+ for class_i in class_info:
99
+ class_prop = class_i.get("classificationProperties", None)
100
+ if class_prop:
101
+ for anchor in class_prop.keys():
102
+ if anchor == "anchorGUID":
103
+ server_guid = class_prop[anchor]
104
+ el_anchors_md += f"* **{anchor}**: {class_prop[anchor]}\n"
105
+ el_anchors_out = Markdown(el_anchors_md)
106
+
107
+ el_props_md = ""
108
+ for prop in cat["properties"].keys():
109
+ el_props_md += f"* **{prop}**: {cat['properties'][prop]}\n"
110
+ el_props_out = Markdown(el_props_md)
111
+
112
+ schemas = c_client.get_elements_by_classification_with_property_value(
113
+ "Anchors", el_guid, ["anchorGUID"], "DeployedDatabaseSchema"
114
+ )
115
+ schemas_md = ""
116
+ if type(schemas) is list:
117
+ for schema in schemas:
118
+ schema_md = ""
119
+ schema_props = schema["properties"]
120
+ for key in schema_props.keys():
121
+ schema_md += f"* **{key}**: {schema_props[key]}\n"
122
+ schemas_md += schema_md
123
+ schemas_md_out = Markdown(schemas_md)
124
+
125
+ element_info = c_client.get_element_by_guid(server_guid)
126
+ element_info_md = ""
127
+ for key in element_info["properties"].keys():
128
+ element_info_md += (
129
+ f"* **{key}**: {element_info['properties'][key]}\n"
130
+ )
131
+ element_info_out = Markdown(element_info_md)
132
+
133
+ table.add_row(
134
+ el_id,
135
+ element_info_out,
136
+ el_props_out,
137
+ schemas_md_out,
138
+ )
139
+
140
+ return table
141
+ else:
142
+ print("No instances found")
143
+ sys.exit(1)
144
+
145
+ try:
146
+ console = Console(width=width, force_terminal=not jupyter)
147
+
148
+ with console.pager(styles=True):
149
+ console.print(generate_table())
150
+
151
+ except (
152
+ InvalidParameterException,
153
+ PropertyServerException,
154
+ UserNotAuthorizedException,
155
+ ) as e:
156
+ print_exception_response(e)
157
+ print("\n\nPerhaps the type name isn't known")
158
+ finally:
159
+ c_client.close_session()
160
+
161
+
162
+ def main():
163
+ parser = argparse.ArgumentParser()
164
+ parser.add_argument("--server", help="Name of the server to display status for")
165
+ parser.add_argument("--url", help="URL Platform to connect to")
166
+ parser.add_argument("--userid", help="User Id")
167
+ parser.add_argument("--password", help="Password")
168
+
169
+ args = parser.parse_args()
170
+
171
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
172
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
173
+ userid = args.userid if args.userid is not None else EGERIA_USER
174
+ password = args.password if args.password is not None else EGERIA_USER_PASSWORD
175
+
176
+ try:
177
+ # uc_server_name = Prompt.ask(
178
+ # "Enter the name of a server to retrieve schemas for", default="*"
179
+ # )
180
+ uc_server_name = None
181
+ list_deployed_catalogs(uc_server_name, server, url, userid, password)
182
+ except KeyboardInterrupt:
183
+ pass
184
+
185
+
186
+ if __name__ == "__main__":
187
+ main()
@@ -74,19 +74,25 @@ def list_deployed_database_schemas(
74
74
  # width=500
75
75
  )
76
76
 
77
- table.add_column("Name")
78
- table.add_column("Type")
79
- table.add_column("Created", width=23)
80
- table.add_column("Home Store")
81
- table.add_column("GUID", width=38, no_wrap=True)
82
- table.add_column("Properties")
83
- table.add_column("Tables")
77
+ table.add_column("Schema in Catalog")
78
+ table.add_column("Schema Properties")
79
+
80
+ # table.add_column("Home Store")
81
+ # table.add_column("GUID", width=38, no_wrap=True)
82
+ # table.add_column("Properties")
83
+ table.add_column("Cataloged Resource")
84
84
 
85
85
  om_type = "DeployedDatabaseSchema"
86
+
87
+ # get the guid for the database or catalog
88
+
86
89
  if db_name in (None, "*"):
87
90
  dbs = c_client.get_elements(om_type)
88
91
  else:
89
- dbs = c_client.get_elements_by_property_value(db_name, "name", om_type)
92
+ db_guid = c_client.get_guid_for_name(db_name)
93
+ dbs = c_client.get_elements_by_classification_with_property_value(
94
+ "Anchors", db_guid, ["anchorGUID"], om_type
95
+ )
90
96
 
91
97
  if type(dbs) is list:
92
98
  for element in dbs:
@@ -108,6 +114,24 @@ def list_deployed_database_schemas(
108
114
 
109
115
  el_guid = header["guid"]
110
116
 
117
+ el_classification = header["classifications"]
118
+ for c in el_classification:
119
+ if c["type"]["typeName"] == "Anchors":
120
+ el_anchor_guid = c["classificationProperties"]["anchorGUID"]
121
+ el_anchor_type_name = c["classificationProperties"][
122
+ "anchorTypeName"
123
+ ]
124
+ if el_anchor_type_name == "Catalog":
125
+ el_cat = c_client.get_element_by_guid(el_anchor_guid)
126
+ el_cat_name = el_cat["properties"].get("name", None)
127
+ if el_cat_name is None:
128
+ el_cat_name = el_cat["properties"].get(
129
+ "qualifiedName", "---"
130
+ )
131
+ el_cat_guid = el_cat["elementHeader"]["guid"]
132
+ el_schema_id = (
133
+ f"{el_name}\n{el_guid}\n\n\t\tin\n\n{el_cat_name}\n{el_cat_guid}"
134
+ )
111
135
  el_props_md = ""
112
136
  for prop in element["properties"].keys():
113
137
  el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
@@ -139,11 +163,11 @@ def list_deployed_database_schemas(
139
163
  rel_el_out = Markdown(rel_el_md)
140
164
 
141
165
  table.add_row(
142
- el_name,
143
- el_type,
144
- el_created_out,
145
- el_home,
146
- el_guid,
166
+ el_schema_id,
167
+ # el_type,
168
+ # el_created_out,
169
+ # el_home,
170
+ # el_guid,
147
171
  el_props_out,
148
172
  rel_el_out,
149
173
  )
@@ -32,6 +32,9 @@ from commands.my.list_my_profile import display_my_profile
32
32
  from commands.my.list_my_roles import display_my_roles
33
33
  from commands.my.monitor_my_todos import display_my_todos
34
34
  from commands.my.monitor_open_todos import display_todos
35
+ from commands.cat.list_deployed_database_schemas import list_deployed_database_schemas
36
+ from commands.cat.list_deployed_catalogs import list_deployed_catalogs
37
+
35
38
 
36
39
  from commands.ops.gov_server_actions import (
37
40
  add_catalog_target,
@@ -71,6 +74,7 @@ from commands.tech.list_related_specification import (
71
74
  from commands.tech.list_relationship_types import display_relationship_types
72
75
  from commands.tech.list_tech_templates import display_templates_spec
73
76
  from commands.tech.list_valid_metadata_values import display_metadata_values
77
+ from commands.tech.list_gov_action_processes import display_gov_processes
74
78
 
75
79
 
76
80
  @tui()
@@ -540,6 +544,23 @@ def tech_template_spec(ctx, search_string):
540
544
  )
541
545
 
542
546
 
547
+ @show.command("gov-action-processes")
548
+ @click.pass_context
549
+ @click.option("--search-string", default="*", help="Search string")
550
+ def gov_action_processes(ctx, search_string):
551
+ """Display available governance action processes."""
552
+ c = ctx.obj
553
+ display_gov_processes(
554
+ search_string,
555
+ c.view_server,
556
+ c.view_server_url,
557
+ c.userid,
558
+ c.password,
559
+ c.jupyter,
560
+ c.width,
561
+ )
562
+
563
+
543
564
  @show.command("valid-metadata-values")
544
565
  @click.pass_context
545
566
  @click.option("--property", default="projectHealth", help="Metadata property to query")
@@ -888,6 +909,42 @@ def list_archives(ctx):
888
909
  )
889
910
 
890
911
 
912
+ @show.command("list-deployed-schemas")
913
+ @click.option("--search-string", default="*", help="What database or catalog to search")
914
+ @click.pass_context
915
+ def list_deployed_schemas(search_string, ctx):
916
+ """Display a tree graph of information about an asset"""
917
+ c = ctx.obj
918
+ list_deployed_database_schemas(
919
+ search_string,
920
+ c.view_server,
921
+ c.view_server_url,
922
+ c.userid,
923
+ c.password,
924
+ None,
925
+ c.jupyter,
926
+ c.width,
927
+ )
928
+
929
+
930
+ @show.command("list-catalogs")
931
+ # @click.option("--search-string", default="*", help="What database or catalog to search")
932
+ @click.pass_context
933
+ def list_catalogs(ctx):
934
+ """Display a tree graph of information about an asset"""
935
+ c = ctx.obj
936
+ list_deployed_catalogs(
937
+ " ",
938
+ c.view_server,
939
+ c.view_server_url,
940
+ c.userid,
941
+ c.password,
942
+ None,
943
+ c.jupyter,
944
+ c.width,
945
+ )
946
+
947
+
891
948
  #
892
949
  # Catalog User: Tell
893
950
  #
@@ -27,6 +27,9 @@ from commands.cat.list_cert_types import display_certifications
27
27
  from commands.cat.list_relationships import list_relationships
28
28
  from commands.cat.list_user_ids import list_user_ids
29
29
  from commands.cat.list_archives import display_archive_list
30
+ from commands.cat.list_deployed_database_schemas import list_deployed_database_schemas
31
+ from commands.cat.list_deployed_catalogs import list_deployed_catalogs
32
+
30
33
 
31
34
  # from pyegeria import ServerOps
32
35
  from commands.cli.ops_config import Config
@@ -486,6 +489,42 @@ def list_archives(ctx):
486
489
  )
487
490
 
488
491
 
492
+ @show.command("list-deployed-schemas")
493
+ @click.option("--search-string", default="*", help="What database or catalog to search")
494
+ @click.pass_context
495
+ def list_deployed_schemas(search_string, ctx):
496
+ """Display a tree graph of information about an asset"""
497
+ c = ctx.obj
498
+ list_deployed_database_schemas(
499
+ search_string,
500
+ c.view_server,
501
+ c.view_server_url,
502
+ c.userid,
503
+ c.password,
504
+ None,
505
+ c.jupyter,
506
+ c.width,
507
+ )
508
+
509
+
510
+ @show.command("list-catalogs")
511
+ # @click.option("--search-string", default="*", help="What database or catalog to search")
512
+ @click.pass_context
513
+ def list_catalogs(ctx):
514
+ """Display a tree graph of information about an asset"""
515
+ c = ctx.obj
516
+ list_deployed_catalogs(
517
+ " ",
518
+ c.view_server,
519
+ c.view_server_url,
520
+ c.userid,
521
+ c.password,
522
+ None,
523
+ c.jupyter,
524
+ c.width,
525
+ )
526
+
527
+
489
528
  #
490
529
  # Tell
491
530
  #
@@ -29,7 +29,7 @@ from commands.tech.list_related_specification import (
29
29
  )
30
30
  from commands.tech.list_related_elements import list_related_elements
31
31
  from commands.tech.list_elements_for_classification import list_classified_elements
32
-
32
+ from commands.tech.list_gov_action_processes import display_gov_processes
33
33
 
34
34
  # from pyegeria import ServerOps
35
35
 
@@ -429,6 +429,23 @@ def tech_template_spec(ctx, search_string):
429
429
  )
430
430
 
431
431
 
432
+ @show.command("gov-action-processes")
433
+ @click.pass_context
434
+ @click.option("--search-string", default="*", help="Search string")
435
+ def gov_action_processes(ctx, search_string):
436
+ """Display available governance action processes."""
437
+ c = ctx.obj
438
+ display_gov_processes(
439
+ search_string,
440
+ c.view_server,
441
+ c.view_server_url,
442
+ c.userid,
443
+ c.password,
444
+ c.jupyter,
445
+ c.width,
446
+ )
447
+
448
+
432
449
  @show.command("valid-metadata-values")
433
450
  @click.pass_context
434
451
  @click.option("--property", default="projectHealth", help="Metadata property to query")
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-Lic
4
+ ense-Identifier: Apache-2.0
5
+ Copyright Contributors to the ODPi Egeria project.
6
+
7
+
8
+ List the currently loaded Governance Action Processes.
9
+ """
10
+ import argparse
11
+ import os
12
+ import sys
13
+ import time
14
+
15
+ from rich import box
16
+ from rich import print
17
+ from rich.console import Console
18
+ from rich.prompt import Prompt
19
+ from rich.table import Table
20
+
21
+ from pyegeria import (
22
+ InvalidParameterException,
23
+ PropertyServerException,
24
+ UserNotAuthorizedException,
25
+ print_exception_response,
26
+ EgeriaTech,
27
+ )
28
+ from pyegeria import ValidMetadataManager
29
+
30
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
31
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
32
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
33
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
34
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
35
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
36
+ )
37
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
38
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
39
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
40
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
41
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
42
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
43
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
44
+
45
+
46
+ def display_gov_processes(
47
+ type_name: str,
48
+ server: str,
49
+ url: str,
50
+ username: str,
51
+ user_pass: str,
52
+ jupyter: bool = EGERIA_JUPYTER,
53
+ width: int = EGERIA_WIDTH,
54
+ ) -> Table:
55
+ p_client = EgeriaTech(server, url, user_id=username, user_pwd=user_pass)
56
+ token = p_client.create_egeria_bearer_token(username, user_pass)
57
+
58
+ def generate_table(type_name: str) -> Table:
59
+ """Make a new table."""
60
+ table = Table(
61
+ title=f"Available Governance Action Processes @ {time.asctime()}",
62
+ style="bold white on black",
63
+ row_styles=["bold white on black"],
64
+ header_style="white on dark_blue",
65
+ title_style="bold white on black",
66
+ caption_style="white on black",
67
+ show_lines=True,
68
+ box=box.ROUNDED,
69
+ caption=f"list for Server '{server}' @ Platform - {url}",
70
+ expand=True,
71
+ )
72
+
73
+ table.add_column(
74
+ "Name",
75
+ no_wrap=True,
76
+ )
77
+ table.add_column("Qualified Name")
78
+ table.add_column(
79
+ "GUID",
80
+ no_wrap=True,
81
+ )
82
+ table.add_column("Description")
83
+
84
+ process_list = p_client.find_gov_action_processes(type_name)
85
+
86
+ if type(process_list) is str:
87
+ print("No Governance Processes found matching the type name\n")
88
+ sys.exit(1)
89
+
90
+ for proc in process_list:
91
+ guid = proc["elementHeader"]["guid"]
92
+ props = proc["processProperties"]
93
+ name = props[("displayName" "")]
94
+ qualified_name = props["qualifiedName"]
95
+ description = props.get("description", "---")
96
+
97
+ table.add_row(name, qualified_name, guid, description)
98
+
99
+ p_client.close_session()
100
+ return table
101
+
102
+ try:
103
+ console = Console(width=width, force_terminal=not jupyter, record=True)
104
+ with console.pager(styles=True):
105
+ console.print(generate_table(type_name))
106
+
107
+ except (
108
+ InvalidParameterException,
109
+ PropertyServerException,
110
+ UserNotAuthorizedException,
111
+ ValueError,
112
+ ) as e:
113
+ if type(e) is str:
114
+ print(e)
115
+ else:
116
+ print_exception_response(e)
117
+
118
+
119
+ def main():
120
+ parser = argparse.ArgumentParser()
121
+ parser.add_argument("--server", help="Name of the server to display status for")
122
+ parser.add_argument("--url", help="URL Platform to connect to")
123
+ parser.add_argument("--userid", help="User Id")
124
+ parser.add_argument("--password", help="User Password")
125
+ parser.add_argument("--save-output", help="Save output to file?")
126
+
127
+ args = parser.parse_args()
128
+
129
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
130
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
131
+ userid = args.userid if args.userid is not None else EGERIA_USER
132
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
133
+ type_name = Prompt.ask("Enter the Type Name to retrieve:", default="*")
134
+
135
+ display_gov_processes(type_name, server, url, userid, user_pass)
136
+
137
+
138
+ if __name__ == "__main__":
139
+ main()
@@ -2439,11 +2439,11 @@ class AutomatedCuration(Client):
2439
2439
 
2440
2440
  body = {
2441
2441
  "class": "InitiateGovernanceActionTypeRequestBody",
2442
- "governanceActionTypeQualifiedName": "survey-postgres-database",
2442
+ "governanceActionTypeQualifiedName": "AssetSurvey:survey-postgres-database",
2443
2443
  "actionTargets": [
2444
2444
  {
2445
2445
  "class": "NewActionTarget",
2446
- "actionTargetName": "serverToSurvey",
2446
+ "actionTargetName": "postgresDatabase",
2447
2447
  "actionTargetGUID": postgres_database_guid,
2448
2448
  }
2449
2449
  ],
@@ -442,10 +442,8 @@ class ClassificationManager(Client):
442
442
  "POST", url, body_slimmer(body), time_out=time_out
443
443
  )
444
444
 
445
- elements = response.json().get("elements", "No elements found")
446
- if type(elements) is list:
447
- if len(elements) == 0:
448
- return "No elements found"
445
+ elements = response.json().get("element", "No elements found")
446
+
449
447
  return elements
450
448
 
451
449
  def get_element_by_guid(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "1.5.1.0.3"
3
+ version = "1.5.1.0.4"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
@@ -67,6 +67,8 @@ pytest = "^8.2.2"
67
67
  list_relationships = "commands.cat.list_relationships:main"
68
68
  list_user_ids = "commands.cat.list_user_ids:main"
69
69
  list_archives = "commands.cat.list_archives:main"
70
+ list_deployed_catalogs = "commands.cat.list_deployed_catalogs:main"
71
+ list_deployed_schemas = "commands.cat.list_deployed_database_schemas:main"
70
72
 
71
73
  monitor_asset_events = "commands.ops.monitor_asset_events:main"
72
74
  monitor_coco_status = "commands.ops.monitor_coco_status:main"
@@ -120,4 +122,5 @@ pytest = "^8.2.2"
120
122
  list_related_elements = "commands.tech.list_related_elements:main"
121
123
 
122
124
  list_valid_metadata_values = "commands.tech.list_valid_metadata_values:main"
123
- list_element_graph = "commands.tech.get_element_graph:main"
125
+ list_element_graph = "commands.tech.get_element_graph:main"
126
+ list_gov_action_processes = "commands.tech.list_gov_action_processes:main"
File without changes
File without changes