diff --git a/pyegeria/commands/README.md b/pyegeria/commands/README.md index a08baa8..b081541 100644 --- a/pyegeria/commands/README.md +++ b/pyegeria/commands/README.md @@ -2,7 +2,8 @@ The Commands in this directory provide a simple but useful command line interface for the Egeria environment. They -are built with the **Rich** python package and demonstrate the use of **pyegeria** . +are built with the **Rich** python package and demonstrate the use of **pyegeria**. More detailed documentation can be +found in the `doc` folder. The commands can either be invoked from one of the command line interfaces or executed directly as python scripts. To invoke the commands directly, install them with pipx by invoking: diff --git a/pyegeria/commands/cat/__init__.py b/pyegeria/commands/cat/__init__.py index b29ed89..5c60c2c 100644 --- a/pyegeria/commands/cat/__init__.py +++ b/pyegeria/commands/cat/__init__.py @@ -1,5 +1 @@ -# from .list_glossaries import display_glossaries -# from .list_terms import display_glossary_terms -# from .list_deployed_catalogs import list_deployed_catalogs -# from .list_deployed_database_schemas import list_deployed_database_schemas -# from .list_deployed_databases import list_deployed_databases +""" Placeholder """ diff --git a/pyegeria/commands/cat/exp_list_glossaries.py b/pyegeria/commands/cat/exp_list_glossaries.py index bfb3398..ed38bca 100755 --- a/pyegeria/commands/cat/exp_list_glossaries.py +++ b/pyegeria/commands/cat/exp_list_glossaries.py @@ -39,7 +39,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/get_asset_graph.py b/pyegeria/commands/cat/get_asset_graph.py index 2dca147..8c1a518 100644 --- a/pyegeria/commands/cat/get_asset_graph.py +++ b/pyegeria/commands/cat/get_asset_graph.py @@ -30,7 +30,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/cat/get_collection.py b/pyegeria/commands/cat/get_collection.py index fba47a6..e9ccae3 100755 --- a/pyegeria/commands/cat/get_collection.py +++ b/pyegeria/commands/cat/get_collection.py @@ -33,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/get_project_dependencies.py b/pyegeria/commands/cat/get_project_dependencies.py index 7e3fd4c..9e0b9e0 100755 --- a/pyegeria/commands/cat/get_project_dependencies.py +++ b/pyegeria/commands/cat/get_project_dependencies.py @@ -35,7 +35,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/get_project_structure.py b/pyegeria/commands/cat/get_project_structure.py index c61c76d..c58d7a3 100755 --- a/pyegeria/commands/cat/get_project_structure.py +++ b/pyegeria/commands/cat/get_project_structure.py @@ -35,7 +35,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/get_tech_type_elements.py b/pyegeria/commands/cat/get_tech_type_elements.py index c1c790a..1d4aa8a 100644 --- a/pyegeria/commands/cat/get_tech_type_elements.py +++ b/pyegeria/commands/cat/get_tech_type_elements.py @@ -37,7 +37,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") @@ -163,7 +163,7 @@ def main(): user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD try: tech_name = Prompt.ask( - "Enter the Asset Name to view:", default="Apache Kafka Server" + "Enter the Asset Name to view:", default="PostgreSQL Server" ) tech_viewer(tech_name, server, url, userid, user_pass) except KeyboardInterrupt: diff --git a/pyegeria/commands/cat/glossary_actions.py b/pyegeria/commands/cat/glossary_actions.py index d25e0bf..3e46ee1 100644 --- a/pyegeria/commands/cat/glossary_actions.py +++ b/pyegeria/commands/cat/glossary_actions.py @@ -37,7 +37,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) @@ -47,6 +47,7 @@ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 200) EGERIA_JUPYTER = os.environ.get("EGERIA_JUPYTER", False) +EGERIA_HOME_GLOSSARY_GUID = os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None) @click.command("create-glossary") @@ -125,7 +126,7 @@ def create_glossary( @click.option("--userid", default=EGERIA_USER, help="Egeria user") @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password") @click.option("--timeout", default=60, help="Number of seconds to wait") -@click.argument("glossary-guid") +@click.argument("glossary-guid", default=EGERIA_HOME_GLOSSARY_GUID) def delete_glossary(server, url, userid, password, timeout, glossary_guid): """Delete the glossary specified""" m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password) @@ -317,7 +318,12 @@ def import_terms( @click.command("export-terms") -@click.option("--glossary-guid", help="GUID of Glossary to export", required=True) +@click.option( + "--glossary-guid", + default=EGERIA_HOME_GLOSSARY_GUID, + help="GUID of Glossary to export", + required=True, +) @click.option("--file-name", help="Path of CSV file", required=True) @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use") @click.option( diff --git a/pyegeria/commands/cat/list_assets.py b/pyegeria/commands/cat/list_assets.py index 781e7ad..b1b2667 100755 --- a/pyegeria/commands/cat/list_assets.py +++ b/pyegeria/commands/cat/list_assets.py @@ -33,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_cert_types.py b/pyegeria/commands/cat/list_cert_types.py index a83af1b..83299ca 100755 --- a/pyegeria/commands/cat/list_cert_types.py +++ b/pyegeria/commands/cat/list_cert_types.py @@ -36,7 +36,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_collections.py b/pyegeria/commands/cat/list_collections.py index 27a1c9d..b9cbd93 100755 --- a/pyegeria/commands/cat/list_collections.py +++ b/pyegeria/commands/cat/list_collections.py @@ -32,7 +32,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_deployed_catalogs.py b/pyegeria/commands/cat/list_deployed_catalogs.py index 169c31d..ec791cc 100644 --- a/pyegeria/commands/cat/list_deployed_catalogs.py +++ b/pyegeria/commands/cat/list_deployed_catalogs.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_deployed_database_schemas.py b/pyegeria/commands/cat/list_deployed_database_schemas.py index c44ad29..fd0a12b 100644 --- a/pyegeria/commands/cat/list_deployed_database_schemas.py +++ b/pyegeria/commands/cat/list_deployed_database_schemas.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_deployed_databases.py b/pyegeria/commands/cat/list_deployed_databases.py index 612a57a..3e26da4 100644 --- a/pyegeria/commands/cat/list_deployed_databases.py +++ b/pyegeria/commands/cat/list_deployed_databases.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_glossaries.py b/pyegeria/commands/cat/list_glossaries.py index 0da7241..a390727 100755 --- a/pyegeria/commands/cat/list_glossaries.py +++ b/pyegeria/commands/cat/list_glossaries.py @@ -36,7 +36,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cat/list_projects.py b/pyegeria/commands/cat/list_projects.py index 1c29bba..bcfc09a 100755 --- a/pyegeria/commands/cat/list_projects.py +++ b/pyegeria/commands/cat/list_projects.py @@ -35,7 +35,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/cat/list_servers_deployed_imp.py b/pyegeria/commands/cat/list_servers_deployed_imp.py index 24a2541..d6d493f 100755 --- a/pyegeria/commands/cat/list_servers_deployed_imp.py +++ b/pyegeria/commands/cat/list_servers_deployed_imp.py @@ -37,7 +37,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/cat/list_tech_type_elements.py b/pyegeria/commands/cat/list_tech_type_elements.py new file mode 100644 index 0000000..1f85b40 --- /dev/null +++ b/pyegeria/commands/cat/list_tech_type_elements.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python3 +""" +SPDX-License-Identifier: Apache-2.0 +Copyright Contributors to the ODPi Egeria project. + +Display the status of cataloged platforms and servers. +""" +import argparse +import os +import sys +import time + +import rich.box as box +from rich import print +from rich.console import Console +from rich.markdown import Markdown +from rich.panel import Panel +from rich.prompt import Prompt +from rich.table import Table + +from pyegeria import ( + InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException, + print_exception_response, + AutomatedCuration, +) + +EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") +EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092") +EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443") +EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server") +EGERIA_VIEW_SERVER_URL = os.environ.get( + "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" +) +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") +EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") +EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) +EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200")) + + +disable_ssl_warnings = True +console = Console(width=200) + +guid_list = [] + + +def list_tech_elements( + tech_name: str, + server_name: str, + platform_url: str, + user: str, + user_pass: str, + jupyter: bool = EGERIA_JUPYTER, + width: int = EGERIA_WIDTH, +): + console = Console(width=width, force_terminal=not jupyter) + + a_client = AutomatedCuration(server_name, platform_url, user_id=user) + token = a_client.create_egeria_bearer_token(user, user_pass) + + def build_classifications(classification: dict) -> Markdown: + class_md = "\n" + for c in classification: + c_type = c["classificationName"] + if c_type == "Anchors": + continue + class_md += f"* Classification: {c_type}\n" + class_props = c.get("classificationProperties", None) + if class_props is None: + continue + for prop in class_props.keys(): + class_md += f"\t* {prop}: {class_props[prop]}\n" + if class_md == "-": + output = None + else: + output = class_md + return output + + def generate_table() -> Table: + """Make a new table.""" + table = Table( + title=f"Tech Type Elements for {tech_name} @ {time.asctime()}", + caption=f"{platform_url} - {server_name} @ {time.asctime()}", + style="bold bright_white on black", + row_styles=["bold bright_white on black"], + header_style="white on dark_blue", + title_style="bold bright_white on black", + caption_style="white on black", + show_lines=True, + box=box.ROUNDED, + expand=True, + ) + + table.add_column("Qualified Name/GUID", width=38, no_wrap=True) + table.add_column("Properties", width=40) + table.add_column("Classifications", width=50) + + tech_elements = a_client.get_technology_type_elements( + tech_name, get_templates=False + ) + if type(tech_elements) is str: + console.print(f"No elements found for {tech_name}") + sys.exit(1) + + note: str = " " + for element in tech_elements: + header = element["elementHeader"] + tech_type = header["type"]["typeName"] + tech_collection = header["origin"]["homeMetadataCollectionName"] + tech_created_by = header["versions"]["createdBy"] + tech_created_at = header["versions"]["createTime"] + tech_guid = header["guid"] + tech_classifications = header["classifications"] + class_md = build_classifications(tech_classifications) + + referenceables = element["referenceableProperties"] + tech_qualified_name = referenceables["qualifiedName"] + extended = referenceables["extendedProperties"] + ex_md: str = "" + for key, value in extended.items(): + ex_md += f"* {key}: {value}\n" + + note = ( + f"{ex_md}\n" + f"* Created by: {tech_created_by}\n" + f"* Created at: {tech_created_at}\n" + f"* Home Collection: {tech_collection}\n" + ) + + interfaces = extended.get("connectorInterfaces", None) + if interfaces is not None: + interface_type_name = interfaces["typeName"] + interface_array_cnt = interfaces["arrayCount"] + note += f"* Interface Type: {interface_type_name}\n" + for i in range(0, int(interface_array_cnt)): + note += ( + f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}" + f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n" + ) + note_md = Markdown(note) + qn = Markdown(f"\n{tech_qualified_name}\n \n--- \n\n\n{tech_guid}") + cm = Markdown(class_md) + table.add_row(qn, note_md, cm) + return table + + try: + console = Console(width=width, force_terminal=not jupyter) + + with console.pager(styles=True): + console.print(generate_table()) + + except ( + InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException, + ) as e: + print_exception_response(e) + print("\n\nPerhaps the type name isn't known") + finally: + a_client.close_session() + + +def main(): + parser = argparse.ArgumentParser() + + parser.add_argument("--server", help="Name of the server to display status for") + parser.add_argument("--url", help="URL Platform to connect to") + parser.add_argument("--userid", help="User Id") + parser.add_argument("--password", help="User Password") + args = parser.parse_args() + + server = args.server if args.server is not None else EGERIA_VIEW_SERVER + url = args.url if args.url is not None else EGERIA_PLATFORM_URL + userid = args.userid if args.userid is not None else EGERIA_USER + user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD + try: + tech_name = Prompt.ask( + "Enter the tech type to view:", default="PostgreSQL Server" + ) + list_tech_elements(tech_name, server, url, userid, user_pass) + except KeyboardInterrupt: + pass + + +if __name__ == "__main__": + main() diff --git a/pyegeria/commands/cat/list_tech_types.py b/pyegeria/commands/cat/list_tech_types.py index c83148f..f8a39c4 100755 --- a/pyegeria/commands/cat/list_tech_types.py +++ b/pyegeria/commands/cat/list_tech_types.py @@ -23,28 +23,37 @@ PropertyServerException, UserNotAuthorizedException, print_exception_response, - AutomatedCuration + AutomatedCuration, ) EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") -EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092') -EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443') -EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server') -EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443') -EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon') -EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke') -EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret') -EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview') -EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret') -EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False')) -EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200')) +EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092") +EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443") +EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server") +EGERIA_VIEW_SERVER_URL = os.environ.get( + "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" +) +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") +EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") +EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) +EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200")) disable_ssl_warnings = True -def display_tech_types(search_string:str, server: str, url: str, username: str, user_pass: str, - jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH): +def display_tech_types( + search_string: str, + server: str, + url: str, + username: str, + user_pass: str, + jupyter: bool = EGERIA_JUPYTER, + width: int = EGERIA_WIDTH, +): a_client = AutomatedCuration(server, url, username) token = a_client.create_egeria_bearer_token(username, user_pass) tech_list = a_client.find_technology_types(search_string, page_size=0) @@ -61,7 +70,7 @@ def generate_table() -> Table: show_lines=True, box=box.ROUNDED, caption=f"Technology Types from Server '{server}' @ Platform - {url}", - expand=True + expand=True, ) table.add_column("Name") @@ -69,23 +78,20 @@ def generate_table() -> Table: table.add_column("Category") table.add_column("Description") - name = " " description = " " version = " " super_type = " " if type(tech_list) is list: for item in tech_list: - if 'deployedImplementationType' not in item['qualifiedName']: + if "deployedImplementationType" not in item["qualifiedName"]: continue qualified_name = item.get("qualifiedName", " ") name = item.get("name", "none") category = item.get("category", "none") description = item.get("description", "none") - table.add_row( - name, qualified_name, category, description - ) + table.add_row(name, qualified_name, category, description) return table else: print("Unknown technology type") @@ -96,7 +102,11 @@ def generate_table() -> Table: with console.pager(styles=True): console.print(generate_table()) - except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e: + except ( + InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException, + ) as e: print_exception_response(e) assert e.related_http_code != "200", "Invalid parameters" finally: @@ -118,11 +128,13 @@ def main(): user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD try: - search_string = Prompt.ask("Enter the technology you are searching for:", default="*") + search_string = Prompt.ask( + "Enter the technology you are searching for:", default="*" + ) display_tech_types(search_string, server, url, userid, user_pass) - except (KeyboardInterrupt): + except KeyboardInterrupt: pass if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/pyegeria/commands/cat/list_terms.py b/pyegeria/commands/cat/list_terms.py index b7fcba1..2a8f46b 100755 --- a/pyegeria/commands/cat/list_terms.py +++ b/pyegeria/commands/cat/list_terms.py @@ -25,6 +25,7 @@ UserNotAuthorizedException, EgeriaTech, ) +from pyegeria.commands.cat.glossary_actions import EGERIA_HOME_GLOSSARY_GUID disable_ssl_warnings = True @@ -35,18 +36,19 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200")) +EGERIA_HOME_GLOSSARY_GUID = os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None) def display_glossary_terms( search_string: str = "*", - glossary_guid: str = None, + glossary_guid: str = EGERIA_HOME_GLOSSARY_GUID, glossary_name: str = None, view_server: str = EGERIA_VIEW_SERVER, view_url: str = EGERIA_VIEW_SERVER_URL, @@ -220,7 +222,7 @@ def main(): url = args.url if args.url is not None else EGERIA_PLATFORM_URL userid = args.userid if args.userid is not None else EGERIA_USER user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD - guid = args.guid if args.guid is not None else None + guid = args.guid if args.guid is not None else EGERIA_HOME_GLOSSARY_GUID try: search_string = Prompt.ask("Enter the term you are searching for:", default="*") diff --git a/pyegeria/commands/cat/list_todos.py b/pyegeria/commands/cat/list_todos.py index 24bc03d..6eb0f51 100755 --- a/pyegeria/commands/cat/list_todos.py +++ b/pyegeria/commands/cat/list_todos.py @@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/cat/list_user_ids.py b/pyegeria/commands/cat/list_user_ids.py index 7714a95..42f8612 100644 --- a/pyegeria/commands/cat/list_user_ids.py +++ b/pyegeria/commands/cat/list_user_ids.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/cli/egeria.py b/pyegeria/commands/cli/egeria.py index 160cd4a..2dc76dd 100755 --- a/pyegeria/commands/cli/egeria.py +++ b/pyegeria/commands/cli/egeria.py @@ -9,16 +9,19 @@ This is an emerging capability based on the **click** package. Feedback welcome! """ +import os import sys import click from trogon import tui + from pyegeria.commands.cli.egeria_login_tui import login from pyegeria.commands.cat.get_asset_graph import asset_viewer from pyegeria.commands.cat.get_collection import collection_viewer from pyegeria.commands.cat.get_project_dependencies import project_dependency_viewer from pyegeria.commands.cat.get_project_structure import project_structure_viewer from pyegeria.commands.cat.get_tech_type_elements import tech_viewer +from pyegeria.commands.cat.list_tech_type_elements import list_tech_elements from pyegeria.commands.cli.egeria_ops import show_server from pyegeria.commands.tech.get_tech_type_template import template_viewer from pyegeria.commands.cat.list_assets import display_assets @@ -115,87 +118,83 @@ @click.group() @click.option( "--server", - default="active-metadata-store", - envvar="EGERIA_METADATA_STORE", + default=os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store"), help="Egeria metadata store to work with", ) @click.option( "--url", - default="https://localhost:9443", - envvar="EGERIA_PLATFORM_URL", + default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"), help="URL of Egeria metadata store platform to connect to", ) @click.option( - "--integration-daemon", - default="integration-daemon", - envvar="EGERIA_INTEGRATION_DAEMON", + "--integration_daemon", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon"), help="Egeria integration daemon to work with", ) @click.option( "--integration_daemon_url", - default="https://localhost:9443", - envvar="EGERIA_INTEGRATION_DAEMON_URL", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"), help="URL of Egeria integration daemon platform to connect to", ) @click.option( "--view_server", - default="view-server", - envvar="EGERIA_VIEW_SERVER", + default=os.environ.get("EGERIA_VIEW_SERVER", "view-server"), help="Egeria view server to work with", ) @click.option( "--view_server_url", - default="https://localhost:9443", - envvar="EGERIA_VIEW_SERVER_URL", + default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"), help="URL of Egeria view server platform to connect to", ) @click.option( "--engine_host", - default="engine-host", - envvar="EGERIA_ENGINE_HOST", + default=os.environ.get("EGERIA_ENGINE_HOST", "engine-host"), help="Egeria engine host to work with", ) @click.option( "--engine_host_url", - default="https://localhost:9443", - envvar="EGERIA_ENGINE_HOST_URL", + default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"), help="URL of Egeria engine host platform to connect to", ) @click.option( "--admin_user", - default="garygeeke", - envvar="EGERIA_ADMIN_USER", + default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"), help="Egeria admin user", ) @click.option( "--admin_user_password", - default="secret", - envvar="EGERIA_ADMIN_PASSWORD", + default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"), help="Egeria admin password", ) @click.option( - "--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user" + "--userid", + default=os.environ.get("EGERIA_USER", "erinoverview"), + help="Egeria user", ) @click.option( "--password", - default="secret", - envvar="EGERIA_PASSWORD", + default=os.environ.get("EGERIA_USER_PASSWORD", "secret"), help="Egeria user password", ) @click.option("--timeout", default=60, help="Number of seconds to wait") @click.option( "--jupyter", is_flag=True, - default=False, - envvar="EGERIA_JUPYTER", + type=bool, + default=os.environ.get("EGERIA_JUPYTER", False), help="Enable for rendering in a Jupyter terminal", ) @click.option( "--width", - default=200, - envvar="EGERIA_WIDTH", + default=os.environ.get("EGERIA_WIDTH", 200), + type=int, help="Screen width, in characters, to use", ) +@click.option( + "--home_glossary_guid", + default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None), + help="Glossary guid to use as the home glossary", +) @click.pass_context def cli( ctx, @@ -214,6 +213,7 @@ def cli( timeout, jupyter, width, + home_glossary_guid, ): """An Egeria Command Line interface for Operations""" ctx.obj = Config( @@ -232,23 +232,12 @@ def cli( timeout, jupyter, width, + home_glossary_guid, ) - ctx.max_content_width = 200 + ctx.max_content_width = 250 ctx.ensure_object(Config) -# cli.add_command(login) -# @cli.command("login") -# @click.pass_context -# def egeria_login(ctx): -# """Login to Egeria platform""" -# user = login( -# ctx.obj.userid, ctx.obj.password, ctx.obj.view_server, ctx.obj.view_server_url -# ) -# ctx.obj.userid = user -# click.echo(f" user is {ctx.obj.userid}") - - # # my: Show # @@ -408,7 +397,7 @@ def list_anchored_elements(ctx, search_string: str, prop_list: str): sys.exit(4) display_anchored_elements( search_string, - prop_list, + [prop_list], c.view_server, c.view_server_url, c.userid, @@ -537,16 +526,16 @@ def show_registered_services(ctx, services): @show_tech_info.command("relationship-types") @click.option( - "--rel-type", + "--om-type", default="AssetOwner", help="Relationship type to get information about", ) @click.pass_context -def show_relationship_types(ctx, rel_type): +def show_relationship_types(ctx, om_type): """Show information about the specified relationship types""" c = ctx.obj display_relationship_types( - rel_type, + om_type, c.view_server, c.view_server_url, c.userid, @@ -816,7 +805,7 @@ def asset_group(ctx): pass -@asset_group.command("elements-of-type") +@asset_group.command("elements-of-tech-type") @click.option( "--tech_type", default="PostgreSQL Server", @@ -1336,10 +1325,12 @@ def show_asset_graph(ctx, asset_guid): help="Specific tech type to get elements for", ) @click.pass_context -def show_tech_type_elements(ctx, tech_type): +def list_tech_type_elements(ctx, tech_type): """List technology type elements""" c = ctx.obj - tech_viewer(tech_type, c.view_server, c.view_server_url, c.userid, c.password) + list_tech_elements( + tech_type, c.view_server, c.view_server_url, c.userid, c.password + ) @show_project_group.command("projects") @@ -1706,7 +1697,7 @@ def integrations(ctx): ) @click.pass_context def integrations_status(ctx, connector_list, list, sorted): - """Display integration-daemon status information""" + """Display integration_daemon status information""" c = ctx.obj display_integration_daemon_status( [connector_list], @@ -1755,7 +1746,7 @@ def tell_ops(ctx): @tell_ops.group("integration-daemon") @click.pass_context def tell_integration_daemon(ctx): - """Group of commands to an integration-daemon""" + """Group of commands to an integration_daemon""" pass diff --git a/pyegeria/commands/cli/egeria_cat.py b/pyegeria/commands/cli/egeria_cat.py index 71a8f07..13d8f2d 100644 --- a/pyegeria/commands/cli/egeria_cat.py +++ b/pyegeria/commands/cli/egeria_cat.py @@ -9,6 +9,8 @@ This is an emerging capability based on the **click** package. Feedback welcome! """ +import os + import click from trogon import tui @@ -17,6 +19,7 @@ from pyegeria.commands.cat.get_project_dependencies import project_dependency_viewer from pyegeria.commands.cat.get_project_structure import project_structure_viewer from pyegeria.commands.cat.get_tech_type_elements import tech_viewer +from pyegeria.commands.cat.list_tech_type_elements import list_tech_elements from pyegeria.commands.cat.glossary_actions import ( create_glossary, delete_glossary, @@ -41,7 +44,7 @@ from pyegeria.commands.cat.list_user_ids import list_user_ids from pyegeria.commands.cat.list_collections import display_collections -# from pyegeria import ServerOps + from pyegeria.commands.cli.ops_config import Config from pyegeria.commands.my.todo_actions import ( mark_todo_complete, @@ -52,20 +55,6 @@ from pyegeria.commands.tech.list_asset_types import display_asset_types -# class Config(object): -# def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None, -# timeout:int = 30, paging: bool = False): -# self.server = server -# self.url = url -# self.userid = userid -# self.password = password -# self.timeout = timeout -# self.paging = paging -# -# -# pass_config = click.make_pass_decorator(Config) - - # @tui # @tui('menu','menu','A textual command line interface') @tui() @@ -73,87 +62,81 @@ @click.group() @click.option( "--server", - default="active-metadata-store", - envvar="EGERIA_METADATA_STORE", + default=os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store"), help="Egeria metadata store to work with", ) @click.option( "--url", - default="https://localhost:9443", - envvar="EGERIA_PLATFORM_URL", + default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"), help="URL of Egeria metadata store platform to connect to", ) @click.option( "--integration_daemon", - default="integration-daemon", - envvar="EGERIA_INTEGRATION_DAEMON", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon"), help="Egeria integration daemon to work with", ) @click.option( "--integration_daemon_url", - default="https://localhost:9443", - envvar="EGERIA_INTEGRATION_DAEMON_URL", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"), help="URL of Egeria integration daemon platform to connect to", ) @click.option( "--view_server", - default="view-server", - envvar="EGERIA_VIEW_SERVER", + default=os.environ.get("EGERIA_VIEW_SERVER", "view-server"), help="Egeria view server to work with", ) @click.option( "--view_server_url", - default="https://localhost:9443", - envvar="EGERIA_VIEW_SERVER_URL", + default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"), help="URL of Egeria view server platform to connect to", ) @click.option( "--engine_host", - default="engine-host", - envvar="EGERIA_ENGINE_HOST", + default=os.environ.get("EGERIA_ENGINE_HOST", "engine-host"), help="Egeria engine host to work with", ) @click.option( "--engine_host_url", - default="https://localhost:9443", - envvar="EGERIA_ENGINE_HOST_URL", + default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"), help="URL of Egeria engine host platform to connect to", ) @click.option( "--admin_user", - default="garygeeke", - envvar="EGERIA_ADMIN_USER", + default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"), help="Egeria admin user", ) @click.option( "--admin_user_password", - default="secret", - envvar="EGERIA_ADMIN_PASSWORD", + default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"), help="Egeria admin password", ) @click.option( - "--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user" + "--userid", + default=os.environ.get("EGERIA_USER", "peterprofile"), + help="Egeria user", ) @click.option( "--password", - default="secret", - envvar="EGERIA_PASSWORD", + default=os.environ.get("EGERIA_USER_PASSWORD", "secret"), help="Egeria user password", ) @click.option("--timeout", default=60, help="Number of seconds to wait") @click.option( "--jupyter", is_flag=True, - default=False, - envvar="EGERIA_JUPYTER", + default=os.environ.get("EGERIA_JUPYTER", "False"), help="Enable for rendering in a Jupyter terminal", ) @click.option( "--width", - default=200, - envvar="EGERIA_WIDTH", + default=os.environ.get("EGERIA_WIDTH", "200"), help="Screen width, in characters, to use", ) +@click.option( + "--home_glossary_guid", + default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None), + help="Glossary guid to use as the home glossary", +) @click.pass_context def cli( ctx, @@ -172,6 +155,7 @@ def cli( timeout, jupyter, width, + home_glossary_guid, ): """An Egeria Command Line interface for Operations""" ctx.obj = Config( @@ -190,8 +174,9 @@ def cli( timeout, jupyter, width, + home_glossary_guid, ) - ctx.max_content_width = 200 + ctx.max_content_width = 250 ctx.ensure_object(Config) @@ -244,6 +229,21 @@ def asset_group(ctx): help="Specific tech type to get elements for", ) @click.pass_context +def list_tech_type_elements(ctx, tech_type): + """List technology type elements""" + c = ctx.obj + list_tech_elements( + tech_type, c.view_server, c.view_server_url, c.userid, c.password + ) + + +@asset_group.command("elements-of-tech-type") +@click.option( + "--tech_type", + default="PostgreSQL Server", + help="Specific tech type to get elements for", +) +@click.pass_context def show_tech_type_elements(ctx, tech_type): """List technology type elements""" c = ctx.obj @@ -311,7 +311,7 @@ def glossary_group(ctx): ) @click.option( "--glossary-guid", - default=None, + default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID"), help="Optionally restrict search to glossary with the specified guid", ) @click.option( diff --git a/pyegeria/commands/cli/egeria_login_tui.py b/pyegeria/commands/cli/egeria_login_tui.py index 701c5fd..e42cdc6 100644 --- a/pyegeria/commands/cli/egeria_login_tui.py +++ b/pyegeria/commands/cli/egeria_login_tui.py @@ -44,7 +44,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/pyegeria/commands/cli/egeria_my.py b/pyegeria/commands/cli/egeria_my.py index d4cbc61..199aeff 100644 --- a/pyegeria/commands/cli/egeria_my.py +++ b/pyegeria/commands/cli/egeria_my.py @@ -9,6 +9,8 @@ This is an emerging capability based on the **click** package. Feedback welcome! """ +import os + import click from trogon import tui @@ -47,87 +49,81 @@ @click.group() @click.option( "--server", - default="active-metadata-store", - envvar="EGERIA_METADATA_STORE", + default=os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store"), help="Egeria metadata store to work with", ) @click.option( "--url", - default="https://localhost:9443", - envvar="EGERIA_PLATFORM_URL", + default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"), help="URL of Egeria metadata store platform to connect to", ) @click.option( - "--integration-daemon", - default="integration-daemon", - envvar="EGERIA_INTEGRATION_DAEMON", + "--integration_daemon", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon"), help="Egeria integration daemon to work with", ) @click.option( "--integration_daemon_url", - default="https://localhost:9443", - envvar="EGERIA_INTEGRATION_DAEMON_URL", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"), help="URL of Egeria integration daemon platform to connect to", ) @click.option( "--view_server", - default="view-server", - envvar="EGERIA_VIEW_SERVER", + default=os.environ.get("EGERIA_VIEW_SERVER", "view-server"), help="Egeria view server to work with", ) @click.option( "--view_server_url", - default="https://localhost:9443", - envvar="EGERIA_VIEW_SERVER_URL", + default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"), help="URL of Egeria view server platform to connect to", ) @click.option( "--engine_host", - default="engine-host", - envvar="EGERIA_ENGINE_HOST", + default=os.environ.get("EGERIA_ENGINE_HOST", "engine-host"), help="Egeria engine host to work with", ) @click.option( "--engine_host_url", - default="https://localhost:9443", - envvar="EGERIA_ENGINE_HOST_URL", + default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"), help="URL of Egeria engine host platform to connect to", ) @click.option( "--admin_user", - default="garygeeke", - envvar="EGERIA_ADMIN_USER", + default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"), help="Egeria admin user", ) @click.option( "--admin_user_password", - default="secret", - envvar="EGERIA_ADMIN_PASSWORD", + default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"), help="Egeria admin password", ) @click.option( - "--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user" + "--userid", + default=os.environ.get("EGERIA_USER", "peterprofile"), + help="Egeria user", ) @click.option( "--password", - default="secret", - envvar="EGERIA_PASSWORD", + default=os.environ.get("EGERIA_USER_PASSWORD", "secret"), help="Egeria user password", ) @click.option("--timeout", default=60, help="Number of seconds to wait") @click.option( "--jupyter", is_flag=True, - default=False, - envvar="EGERIA_JUPYTER", + default=os.environ.get("EGERIA_JUPYTER", "False"), help="Enable for rendering in a Jupyter terminal", ) @click.option( "--width", - default=200, - envvar="EGERIA_WIDTH", + default=os.environ.get("EGERIA_WIDTH", "200"), help="Screen width, in characters, to use", ) +@click.option( + "--home_glossary_guid", + default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None), + help="Glossary guid to use as the home glossary", +) @click.pass_context def cli( ctx, diff --git a/pyegeria/commands/cli/egeria_ops.py b/pyegeria/commands/cli/egeria_ops.py index 798bd15..3b4a419 100644 --- a/pyegeria/commands/cli/egeria_ops.py +++ b/pyegeria/commands/cli/egeria_ops.py @@ -9,6 +9,8 @@ This is an emerging capability based on the **click** package. Feedback welcome! """ +import os + import click from trogon import tui @@ -63,85 +65,81 @@ @click.group() @click.option( "--server", - default="active-metadata-store", - envvar="EGERIA_METADATA_STORE", + default=os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store"), help="Egeria metadata store to work with", ) @click.option( "--url", - default="https://localhost:9443", - envvar="EGERIA_PLATFORM_URL", + default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"), help="URL of Egeria metadata store platform to connect to", ) @click.option( - "--integration-daemon", - default="integration-daemon", - envvar="EGERIA_INTEGRATION_DAEMON", + "--integration_daemon", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon"), help="Egeria integration daemon to work with", ) @click.option( "--integration_daemon_url", - default="https://localhost:9443", - envvar="EGERIA_INTEGRATION_DAEMON_URL", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"), help="URL of Egeria integration daemon platform to connect to", ) @click.option( "--view_server", - default="view-server", - envvar="EGERIA_VIEW_SERVER", + default=os.environ.get("EGERIA_VIEW_SERVER", "view-server"), help="Egeria view server to work with", ) @click.option( "--view_server_url", - default="https://localhost:9443", - envvar="EGERIA_VIEW_SERVER_URL", + default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"), help="URL of Egeria view server platform to connect to", ) @click.option( "--engine_host", - default="engine-host", - envvar="EGERIA_ENGINE_HOST", + default=os.environ.get("EGERIA_ENGINE_HOST", "engine-host"), help="Egeria engine host to work with", ) @click.option( "--engine_host_url", - default="https://localhost:9443", - envvar="EGERIA_ENGINE_HOST_URL", + default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"), help="URL of Egeria engine host platform to connect to", ) @click.option( "--admin_user", - default="garygeeke", - envvar="EGERIA_ADMIN_USER", + default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"), help="Egeria admin user", ) @click.option( "--admin_user_password", - default="secret", - envvar="EGERIA_ADMIN_PASSWORD", + default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"), help="Egeria admin password", ) -@click.option("--userid", default="garygeeke", envvar="EGERIA_USER", help="Egeria user") +@click.option( + "--userid", + default=os.environ.get("EGERIA_USER", "peterprofile"), + help="Egeria user", +) @click.option( "--password", - default="secret", - envvar="EGERIA_USER_PASSWORD", + default=os.environ.get("EGERIA_USER_PASSWORD", "secret"), help="Egeria user password", ) @click.option("--timeout", default=60, help="Number of seconds to wait") @click.option( "--jupyter", is_flag=True, - default=False, - envvar="EGERIA_JUPYTER", + default=os.environ.get("EGERIA_JUPYTER", "False"), help="Enable for rendering in a Jupyter terminal", ) @click.option( "--width", - default=200, - envvar="EGERIA_WIDTH", + default=os.environ.get("EGERIA_WIDTH", "200"), help="Screen width, in characters, to use", ) +@click.option( + "--home_glossary_guid", + default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None), + help="Glossary guid to use as the home glossary", +) @click.pass_context def cli( ctx, @@ -373,7 +371,7 @@ def integrations(ctx): ) @click.pass_context def integrations_status(ctx, connector_list, list): - """Display integration-daemon status information""" + """Display integration_daemon status information""" c = ctx.obj display_integration_daemon_status( [connector_list], @@ -432,7 +430,7 @@ def servers(ctx): @tell.group("integration-daemon") @click.pass_context def integration_daemon(ctx): - """Group of commands to an integration-daemon""" + """Group of commands to an integration_daemon""" pass diff --git a/pyegeria/commands/cli/egeria_tech.py b/pyegeria/commands/cli/egeria_tech.py index 4606538..472eb0e 100644 --- a/pyegeria/commands/cli/egeria_tech.py +++ b/pyegeria/commands/cli/egeria_tech.py @@ -9,6 +9,7 @@ This is an emerging capability based on the **click** package. Feedback welcome! """ +import os import sys import click @@ -63,87 +64,81 @@ @click.group() @click.option( "--server", - default="active-metadata-store", - envvar="EGERIA_METADATA_STORE", + default=os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store"), help="Egeria metadata store to work with", ) @click.option( "--url", - default="https://localhost:9443", - envvar="EGERIA_PLATFORM_URL", + default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"), help="URL of Egeria metadata store platform to connect to", ) @click.option( - "--integration-daemon", - default="integration-daemon", - envvar="EGERIA_INTEGRATION_DAEMON", + "--integration_daemon", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon"), help="Egeria integration daemon to work with", ) @click.option( "--integration_daemon_url", - default="https://localhost:9443", - envvar="EGERIA_INTEGRATION_DAEMON_URL", + default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"), help="URL of Egeria integration daemon platform to connect to", ) @click.option( "--view_server", - default="view-server", - envvar="EGERIA_VIEW_SERVER", + default=os.environ.get("EGERIA_VIEW_SERVER", "view-server"), help="Egeria view server to work with", ) @click.option( "--view_server_url", - default="https://localhost:9443", - envvar="EGERIA_VIEW_SERVER_URL", + default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"), help="URL of Egeria view server platform to connect to", ) @click.option( "--engine_host", - default="engine-host", - envvar="EGERIA_ENGINE_HOST", + default=os.environ.get("EGERIA_ENGINE_HOST", "engine-host"), help="Egeria engine host to work with", ) @click.option( "--engine_host_url", - default="https://localhost:9443", - envvar="EGERIA_ENGINE_HOST_URL", + default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"), help="URL of Egeria engine host platform to connect to", ) @click.option( "--admin_user", - default="garygeeke", - envvar="EGERIA_ADMIN_USER", + default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"), help="Egeria admin user", ) @click.option( "--admin_user_password", - default="secret", - envvar="EGERIA_ADMIN_PASSWORD", + default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"), help="Egeria admin password", ) @click.option( - "--userid", default="peterprofile", envvar="EGERIA_USER", help="Egeria user" + "--userid", + default=os.environ.get("EGERIA_USER", "peterprofile"), + help="Egeria user", ) @click.option( "--password", - default="secret", - envvar="EGERIA_PASSWORD", + default=os.environ.get("EGERIA_USER_PASSWORD", "secret"), help="Egeria user password", ) @click.option("--timeout", default=60, help="Number of seconds to wait") @click.option( "--jupyter", is_flag=True, - default=False, - envvar="EGERIA_JUPYTER", + default=os.environ.get("EGERIA_JUPYTER", "False"), help="Enable for rendering in a Jupyter terminal", ) @click.option( "--width", - default=200, - envvar="EGERIA_WIDTH", + default=os.environ.get("EGERIA_WIDTH", "200"), help="Screen width, in characters, to use", ) +@click.option( + "--home_glossary_guid", + default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None), + help="Glossary guid to use as the home glossary", +) @click.pass_context def cli( ctx, @@ -386,7 +381,7 @@ def show_registered_services(ctx, services): @show_info.command("relationship-types") @click.option( - "--rel-type", + "--om-type", default="AssetOwner", help="Relationship type to get information about", ) diff --git a/pyegeria/commands/cli/ops_config.py b/pyegeria/commands/cli/ops_config.py index 0da9553..2f8f8b8 100644 --- a/pyegeria/commands/cli/ops_config.py +++ b/pyegeria/commands/cli/ops_config.py @@ -8,7 +8,7 @@ def __init__( url: str = None, view_server: str = "view-server", view_server_url: str = "https://localhost:9443", - integration_daemon: str = "integration-daemon", + integration_daemon: str = "integration_daemon", integration_daemon_url: str = "https://localhost:9443", engine_host: str = "engine-host", engine_host_url: str = "https://localhost:9443", @@ -19,6 +19,7 @@ def __init__( timeout: int = 30, jupyter: bool = False, width: int = 200, + home_glossary_guid: str = None, ): self.metadata_store = server self.metadata_store_url = url @@ -37,6 +38,7 @@ def __init__( self.width = width self.server = server self.url = url + self.home_glossary_guid = home_glossary_guid pass_config = click.make_pass_decorator(Config) diff --git a/pyegeria/commands/doc/command-overview.md b/pyegeria/commands/doc/README.md similarity index 85% rename from pyegeria/commands/doc/command-overview.md rename to pyegeria/commands/doc/README.md index f39393c..f068434 100644 --- a/pyegeria/commands/doc/command-overview.md +++ b/pyegeria/commands/doc/README.md @@ -1,44 +1,60 @@ + # Overview -**hey_egeria** is a command line interface (CLI) for Egeria with both a scriptable component and a textual user interface to guide + +**hey_egeria** is a friendly, easy to use, command line interface (CLI) for Egeria with both a scriptable component and a textual user +interface to guide users through the different commands and options. This interface is being actively maintained and enhanced. There are currently about 70 commands in the interface and new ones are added based on perceived need and community feedback. -The CLI is written in python using the [click](https://click.palletsprojects.com/en/stable/) package with [trogon](https://github.com/Textualize/trogon) -providing the textual user interface. The commands are written using [pyegeria](https://github.com/odpi/egeria-python) or -https://pypi.org/project/pyegeria/. The commands are also available standalone. Simple standalone installation instructions are +The CLI is written in python using the [click](https://click.palletsprojects.com/en/stable/) package +with [trogon](https://github.com/Textualize/trogon) +providing the textual user interface. The commands are written using [pyegeria](https://github.com/odpi/egeria-python) +or +https://pypi.org/project/pyegeria/. Commands are also available standalone. Simple standalone installation instructions +are documented at [pyegeria](https://egeria-project.org/concepts/pyegeria). pyegeria and hey_egeria are pre-installed within the **Egeria Workspaces** environment - [Egeria Workspaces](https://github.com/odpi/egeria-workspaces). - - # Command Line Interfaces - -A command line interface provides a simple language for users to invoke commands. In the case of **hey_egeria**, once it is installed, you can +## Commands +A command line interface provides a simple language for users to invoke commands. In the case of **hey_egeria**, once it +is installed, you can start simply by typing `hey_egeria` on the command line and it will provide a list of options and commands that you can -use to interact with it. Commands are often arranged hierarchically - so, for instance if we type just `hey_egeria`, the +use to interact with it. Commands are often arranged hierarchically - so, for instance if we type just `hey_egeria`, the command options presented to us are: ```aiignore Commands: - cat Commands for the more tech user - login Login to Egeria platform - my Work with my information - ops Commands to understand and manage operations - tech Commands for tech Users - tui Open Textual TUI. + cat Commands for all users + my Work with my information + ops Commands to understand and manage operations + tech Commands for tech Users + tui Open Textual TUI ``` -## hey_egeria +"cat", "my", "ops", and "tech" represent groups of commands oriented towards particular roles. If a user wants to only +use commands from a single role they can use a variant of hey_egeria that follows the pattern `hey_egeria_xxx`. So, +for example, `hey_egeria_cat` is the entry point for general catalog users. -## hey_egeria_cat +Within each of these categories, commands are further split between **show** and **tell**. **Show** commands display +information to the user on the terminal and **tell** commands instruct Egeria to take some action. Commands may be further +sub-divided into topics. -## hey_egeria_my +So for example the command to display the status of the Egeria Platform is: -## hey_egeria_ops +`hey_egeria ops show platforms status` -## hey_egeria_tech +And the command to list all glossaries is: + +`hey_egeria cat show glossary glossaries` + +## Options & Parameters + +Each command has a number of optional, and often some mandatory parameters. There are really two groups of options. +* General options - that are present for every command. Sensible defaults based on environment variables are set for each. +* Command specific optons & parameters # Command Reference @@ -121,6 +137,9 @@ Commands: | start_daemon | Start or restart an OMAG server from its known configuration | | | ✓ | | | | stop_daemon | Stop an OMAG server daemon | | | ✓ | | | + +# Visual Command Reference +A visual command reference of all the `hey_egeria` **show** commands can be found in ---- License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), Copyright Contributors to the Egeria project. \ No newline at end of file diff --git a/pyegeria/commands/doc/Visual Command Reference/README.md b/pyegeria/commands/doc/Visual Command Reference/README.md new file mode 100644 index 0000000..9aa9e2f --- /dev/null +++ b/pyegeria/commands/doc/Visual Command Reference/README.md @@ -0,0 +1,511 @@ + + +# **hey_egeria:** A Visual Reference Summary + +This summary has embeds links and commentary for the Egeria CLI (**hey_egeria**). +It is organized in the same manner as the CLI itself to simplify learning how to navigate the CLI. + +The commands and the structure of **hey_egeria** continue to evolve and expand based on the needs of the community. +For this reason, each screenshot is time-stamped. A visual time-line of each command will be kept in the directories below +but this document will continue to refer to only the current version. + +You will note that in most screenshots, the command used to generate the screenshot is displayed (usually in purple) with +a purple arrow pointing to it. + +As always, we welcome your feedback and contributions to this work. + + --- + + +* [**hey_egeria:** A Visual Reference Summary](#hey_egeria-a-visual-reference-summary) + * [1. Top level](#1-top-level) + * [2. cat: Commands for the catalog user](#2-cat-commands-for-the-catalog-user) + * [2.1 assets: display information about assets](#21-assets-display-information-about-assets) + * [2.1.1 asset-graph - displays information about the asset and the elements related to it](#211-asset-graph---displays-information-about-the-asset-and-the-elements-related-to-it) + * [2.1.2 assets-in-domain - search for occurrences of search-string in the asset domain](#212-assets-in-domain---search-for-occurrences-of-search-string-in-the-asset-domain) + * [2.1.3 elements-of-type - display elements for a specified technology type](#213-elements-of-type---display-elements-for-a-specified-technology-type) + * [2.1.4 tech-type-elements - list the elements of the specified technology type](#214-tech-type-elements---list-the-elements-of-the-specified-technology-type) + * [2.2 deployed-data: display information about deployed data resources Egeria has been told about](#22-deployed-data-display-information-about-deployed-data-resources-egeria-has-been-told-about) + * [2.2.1 deployed-data-catalogs - lists the known deployed catalogs](#221-deployed-data-catalogs---lists-the-known-deployed-catalogs) + * [2.2.2 deployed-schemas: lists information about schemas, optionally filtered by catalog name](#222-deployed-schemas-lists-information-about-schemas-optionally-filtered-by-catalog-name) + * [2.2.3 deployed-servers: lists the deployed software servers](#223-deployed-servers-lists-the-deployed-software-servers) + * [2.2.4 deployed-databases: lists the known, deployed databases](#224-deployed-databases-lists-the-known-deployed-databases) + * [2.3 glossary: display information about glossaries and glossary terms](#23-glossary-display-information-about-glossaries-and-glossary-terms) + * [2.3.1 list-glossaries: lists the known glossaries](#231-list-glossaries-lists-the-known-glossaries) + * [2.3.2 list-glossary-terms: lists glossary terms, optionally filtered by glossary](#232-list-glossary-terms-lists-glossary-terms-optionally-filtered-by-glossary) + * [2,4 info: a mix of other information and Egeria structures](#24-info-a-mix-of-other-information-and-egeria-structures) + * [2.4.1 asset-types: list the types of assets Egeria knows about](#241-asset-types-list-the-types-of-assets-egeria-knows-about) + * [2.4.2 certification-types: list the types of certifications that have been defined](#242-certification-types-list-the-types-of-certifications-that-have-been-defined) + * [2.4.3 collection-graph: display a graph of collection from a specified root collection](#243-collection-graph-display-a-graph-of-collection-from-a-specified-root-collection) + * [2.4.4 collections: lists collections filtered by the optional search string](#244-collections-lists-collections-filtered-by-the-optional-search-string) + * [2.4.5 to-dos: list to-do items optionally filtered by a search string](#245-to-dos-list-to-do-items-optionally-filtered-by-a-search-string) + * [2.4.6 user-ids: list all known user ids](#246-user-ids-list-all-known-user-ids) + * [2.4.7 tech-types: list technology types optionally filtered by a search-string](#247-tech-types-list-technology-types-optionally-filtered-by-a-search-string) + * [2.5 projects: information about projects that Egeria represents](#25-projects-information-about-projects-that-egeria-represents) + * [2.5.1 project-dependencies: display a dependency graph of projects starting from the specified project](#251-project-dependencies-display-a-dependency-graph-of-projects-starting-from-the-specified-project) + * [2.5.2 project-structure: display the structure of the project specified, including sub-projects and relationships](#252-project-structure-display-the-structure-of-the-project-specified-including-sub-projects-and-relationships) + * [2.5.3 projects: display a list of projects optionally filtered by a search string](#253-projects-display-a-list-of-projects-optionally-filtered-by-a-search-string) + * [3.0 my: a personal view](#30-my-a-personal-view) + * [3.0.1 my-profile: displays the profile of the user identity the command runs under](#301-my-profile-displays-the-profile-of-the-user-identity-the-command-runs-under) + * [3.0.2 my-roles: displays the roles of the user identity the command runs under](#302-my-roles-displays-the-roles-of-the-user-identity-the-command-runs-under) + * [3.03 my-to-dos: displays to-do items that have been assigned to the current user identity](#303-my-to-dos-displays-to-do-items-that-have-been-assigned-to-the-current-user-identity) + * [3.04 open-to-dos: displays a list of all open to-do items](#304-open-to-dos-displays-a-list-of-all-open-to-do-items) + * [4.0 ops - information about Egeria operations and configurations](#40-ops---information-about-egeria-operations-and-configurations) + * [4.1 engines](#41-engines) + * [4.1.1 activity: display the current engine activity as a static, paged list in a compressed view](#411-activity-display-the-current-engine-activity-as-a-static-paged-list-in-a-compressed-view) + * [4.1.2 activity: display the current engine activity as a live monitor in a compressed view](#412-activity-display-the-current-engine-activity-as-a-live-monitor-in-a-compressed-view) + * [4.1.3 activity: display the current engine activity as a live monitor](#413-activity-display-the-current-engine-activity-as-a-live-monitor-) + * [4.1.4 status: display the current status of governance engines either as a live monitor or as a static, paged list](#414-status-display-the-current-status-of-governance-engines-either-as-a-live-monitor-or-as-a-static-paged-list) + * [4.2 integrations](#42-integrations) + * [4.2.1 status: display the integration daemon status either as a live monitor or as a static, paged list](#421-status-display-the-integration-daemon-status-either-as-a-live-monitor-or-as-a-static-paged-list) + * [4.2.2 targets: display a list of catalog targets and their details](#422-targets-display-a-list-of-catalog-targets-and-their-details) + * [4.3 platforms](#43-platforms) + * [4.3.1 status: display the platform status as a live monitor](#431-status-display-the-platform-status-as-a-live-monitor) + * [4.4 servers](#44-servers) + * [4.4.1 status: show the status of servers running on the default platform with full details](#441-status-show-the-status-of-servers-running-on-the-default-platform-with-full-details) + * [4.4.2 status: show the status of servers running on the default platform with only status](#442-status-show-the-status-of-servers-running-on-the-default-platform-with-only-status) + * [4.4.3 startup: display a summary server status view using direct platform information.](#443-startup-display-a-summary-server-status-view-using-direct-platform-information) + * [5.0 tech: information for technologists](#50-tech-information-for-technologists) + * [5.1 elements: different ways to explore and display metadata elements managed by Egeria](#51-elements-different-ways-to-explore-and-display-metadata-elements-managed-by-egeria) + * [5.1.1 anchored_elements: List anchored elements that match a specified value for a property.](#511-anchored_elements-list-anchored-elements-that-match-a-specified-value-for-a-property) + * [5.1.2 elements: List of elements of the specified Egeria Open Metadata type](#512-elements-list-of-elements-of-the-specified-egeria-open-metadata-type) + * [5.1.3 elements - extended: List of elements of the specified Egeria Open Metadata type with the extended columns](#513-elements---extended-list-of-elements-of-the-specified-egeria-open-metadata-type-with-the-extended-columns) + * [5.1.4 elements of om_type by classification](#514-elements-of-om_type-by-classification) + * [5.1.5 get_elements: a list of elements of the specified om_type](#515-get_elements-a-list-of-elements-of-the-specified-om_type) + * [5.1.6 guid-info: information about the element identified by the supplied GUID](#516-guid-info-information-about-the-element-identified-by-the-supplied-guid) + * [5.1.7 related-elements: lists elements related to specified element](#517-related-elements-lists-elements-related-to-specified-element) + * [5.1.8 related-specifications: display template specification parameters](#518-related-specifications-display-template-specification-parameters) + * [5.2 tech-info](#52-tech-info) + * [5.2.1 asset-types: List defined asset types](#521-asset-types-list-defined-asset-types) + * [5.2.2 gov-action-processes: displays details about identified governance action processes](#522-gov-action-processes-displays-details-about-identified-governance-action-processes) + * [5.2.3 processes: lists all governance action processes](#523-processes-lists-all-governance-action-processes) + * [5.2.4 registered-services: lists the services registered with the Egeria OMAG Platform](#524-registered-services-lists-the-services-registered-with-the-egeria-omag-platform) + * [5.2.5 relationship-types: lists the relationship types from the specified Egeria Open Metadata type](#525-relationship-types-lists-the-relationship-types-from-the-specified-egeria-open-metadata-type) + * [5.2.6 relationships ](#526-relationships-placeholder) + * [5.2.7 valid-metadata-values: display valid metadata value for the specified property of a type](#527-valid-metadata-values-display-valid-metadata-value-for-the-specified-property-of-a-type) + * [5.3 tech-types](#53-tech-types) + * [5.3.1 details - Display details for the specified technology type.](#531-details---display-details-for-the-specified-technology-type) + * [5.3.2 list - list the deployed technology types specified by the search string](#532-list---list-the-deployed-technology-types-specified-by-the-search-string) + * [5.3.3 template-spec - list the template specification details for the specified technology type](#533-template-spec---list-the-template-specification-details-for-the-specified-technology-type) + * [5.3.4 templates - display details of technology type templates for the specified technology type](#534-templates---display-details-of-technology-type-templates-for-the-specified-technology-type) + + + --- + +## 1. Top level +This image is a composite of screenshots showing the full list and organization of **hey_egeria** commands. + +![hey_egeria tui 2024-12-16 at 16.58.22@2x.png](hey_egeria%20tui%202024-12-16%20at%2016.58.22%402x.png) + + +## 2. cat: Commands for the catalog user + +### 2.1 assets: display information about assets +#### 2.1.1 asset-graph - displays information about the asset and the elements related to it +Input: +* asset-guid (required): the unique identity (GUID) of the asset to start from. +![asset-graph 2024-11-20 at 15.56.42.png](cat/show/assets/Asset-graph%202024-11-20%20at%2015.56.42.png) + +#### 2.1.2 assets-in-domain - search for occurrences of search-string in the asset domain +Input: +* search_string (required): the string to search for; matches will be displayed. + +![assets-in-domain 2024-11-20 at 15.49.55@2x.png](cat/show/assets/Assets-in-domain%202024-11-20%20at%2015.49.55%402x.png) + +#### 2.1.3 elements-of-type - display elements for a specified technology type +Input: +* tech_type (required) - technology type to search elements for; default is 'PostgreSQL Server'. + +Note: Technology type artifacts are generally loaded from open-metadata archives. You may need to load the right +archive file, if it hasn't already been loaded, before finding a specific technology type. + +![elements-of-type 2024-11-20 at 16.01.35.png](cat/show/assets/elements-of-type%202024-11-20%20at%2016.01.35.png) + +#### 2.1.4 tech-type-elements - list the elements of the specified technology type +Input: +* tech_type (required) - technology type to search elements for; default is 'PostgreSQL Server' + +![tech-type-elements 2024-11-20 at 16.05.05.png](cat/show/assets/tech-type-elements%202024-11-20%20at%2016.05.05.png) + +### 2.2 deployed-data: display information about deployed data resources Egeria has been told about + +#### 2.2.1 deployed-data-catalogs - lists the known deployed catalogs +Input: +* search_server - optionally filter results by this server name, default is '*' (all) +Notes: This shows the properties for each server found as well as the catalog schemas it contains. + +![deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png](cat/show/deployed-data/deployed-data-catalogs%202024-12-17%20at%2015.43.27%402x.png) + +#### 2.2.2 deployed-schemas: lists information about schemas, optionally filtered by catalog name +Input: +* search_catalog - optionally filter results by this catalog name, default is '*' (all) +Notes: This shows the schemas for catalogs as well as data resources within the schema. + +![deployed-schemas 2024-12-17 at 15.48.38@2x.png](cat/show/deployed-data/deployed-schemas%202024-12-17%20at%2015.48.38%402x.png) + +#### 2.2.3 deployed-servers: lists the deployed software servers +Input: +* search_string - optionally filters by the search string, default is '*' (all). + +![deployed-servers 2024-12-17 at 15.52.16@2x.png](cat/show/deployed-data/deployed-servers%202024-12-17%20at%2015.52.16%402x.png) + +#### 2.2.4 deployed-databases: lists the known, deployed databases +Input: +* server - optionally filter the databases by the name of the database servers. + +![deployed_databases 2024-12-16 at 16.40.31@2x.png](cat/show/deployed-data/deployed_databases%202024-12-16%20at%2016.40.31%402x.png) + + +### 2.3 glossary: display information about glossaries and glossary terms + +#### 2.3.1 list-glossaries: lists the known glossaries +Input: +* search_string - optionally filters by the search string, default is '*' (all). + +* ![list-glossaries 2024-11-25 at 20.30.02.png](cat/show/glossary/list-glossaries%202024-11-25%20at%2020.30.02.png) + +#### 2.3.2 list-glossary-terms: lists glossary terms, optionally filtered by glossary +Input: +* search-string - optionally filters terms by the search string, default is '*' (all). +* glossary-guid - optionally restricts the search to just the glossary specified by the GUID, default is EGERIA_HOME_GLOSSARY_GUID. +* glossary-name - optionally restricts the search to just the glossary specified by the name, default is '*' (all). + +Note: +If both glossary-guid and glossary-name have values, glossary-guid will take precedence. + +![list-terms 2024-11-25 at 20.32.11.png](cat/show/glossary/list-terms%202024-11-25%20at%2020.32.11.png) + +### 2,4 info: a mix of other information and Egeria structures + +As we get more commands in particular topic areas, we will sub-divide this further. + +#### 2.4.1 asset-types: list the types of assets Egeria knows about + +![asset-types 2024-11-25 at 20.34.19@2x.png](cat/show/info/asset-types%202024-11-25%20at%2020.34.19%402x.png) + +#### 2.4.2 certification-types: list the types of certifications that have been defined +Input: +* search-string - optionally filters certifications by the search string, default is '*' (all). + +![certification-types 2024-11-25 at 20.37.07.png](cat/show/info/certification-types%202024-11-25%20at%2020.37.07.png) + +#### 2.4.3 collection-graph: display a graph of collection from a specified root collection +Input: +* root_collection (required) - collection to use as the root of the graph; nested collections will be displayed, default root collection is 'Coco Pharmaceuticals Governance Domains'. +![collection-graph 2024-12-12 at 11.33.18@2x.png](cat/show/info/collection-graph%202024-12-12%20at%2011.33.18%402x.png) + +#### 2.4.4 collections: lists collections filtered by the optional search string +Input: +* collection - optionally filter collections by the string specified, default is "*" (all). + +![list-collections 2024-12-10 at 14.25.51@2x.png](cat/show/info/list-collections%202024-12-10%20at%2014.25.51%402x.png) + +#### 2.4.5 to-dos: list to-do items optionally filtered by a search string +Input: +* search-string - optionally filters todo items by the search string, default is '*' (all). + +![list-todos 2024-12-12 at 11.46.30@2x.png](cat/show/info/list-todos%202024-12-12%20at%2011.46.30%402x.png) + +#### 2.4.6 user-ids: list all known user ids + +![list-user-ids 2024-12-12 at 11.51.09@2x.png](cat/show/info/list-user-ids%202024-12-12%20at%2011.51.09%402x.png) + +#### 2.4.7 tech-types: list technology types optionally filtered by a search-string +Input: +* tech_type: optionally filters list by the search string, default is '*' (all). +![tech-types 2024-12-12 at 11.37.20@2x.png](cat/show/info/tech-types%202024-12-12%20at%2011.37.20%402x.png) + + +### 2.5 projects: information about projects that Egeria represents + +#### 2.5.1 project-dependencies: display a dependency graph of projects starting from the specified project +Input: +* project (required) - base project to show dependencies from, default is "Clinical Trials Management" + +![project_dependencies 2024-12-14 at 16.24.39@2x.png](cat/show/projects/project_dependencies%202024-12-14%20at%2016.24.39%402x.png) + +#### 2.5.2 project-structure: display the structure of the project specified, including sub-projects and relationships +Input: +* project (required) - base project to show dependencies from, default is "Clinical Trials Management" + +![project_structure 2024-12-14 at 16.21.35@2x.png](cat/show/projects/project_structure%202024-12-14%20at%2016.21.35%402x.png) + +#### 2.5.3 projects: display a list of projects optionally filtered by a search string +Input: +* search-string - optionally filters projects by the search string, default is '*' (all). + +![projects 2024-12-14 at 16.18.10@2x.png](cat/show/projects/projects%202024-12-14%20at%2016.18.10%402x.png) + + + +## 3.0 my: a personal view +#### 3.0.1 my-profile: displays the profile of the user identity the command runs under +Input: +* userid (required) - default is "erinoverview", one of the fictitious Coco Pharmaceuticals employees. + +Note: +Set the EGERIA_USER and EGERIA_USER_PASSWORD environment variables for your desired default user. + +![my_profile 2024-12-14 at 16.29.27@2x.png](my/show/my_profile%20%202024-12-14%20at%2016.29.27%402x.png) + +#### 3.0.2 my-roles: displays the roles of the user identity the command runs under +Input: + userid (required) - default is "erinoverview", one of the fictitious Coco Pharmaceuticals employees. + +Note: +Set the EGERIA_USER and EGERIA_USER_PASSWORD environment variables for your desired default user. + +![my_roles 2024-12-14 at 16.32.10@2x.png](my/show/my_roles%202024-12-14%20at%2016.32.10%402x.png) + +#### 3.03 my-to-dos: displays to-do items that have been assigned to the current user identity + +Input: + userid (required) - default is "erinoverview", one of the fictitious Coco Pharmaceuticals employees. + +Note: +Set the EGERIA_USER and EGERIA_USER_PASSWORD environment variables for your desired default user. + +![my_todos 2024-12-15 at 16.24.13@2x.png](my/show/my_todos%20%202024-12-15%20at%2016.24.13%402x.png) + +#### 3.04 open-to-dos: displays a list of all open to-do items + +![open_todos 2024-12-14 at 16.36.12@2x.png](my/show/open_todos%202024-12-14%20at%2016.36.12%402x.png) + + + + +## 4.0 ops - information about Egeria operations and configurations + +### 4.1 engines + +#### 4.1.1 activity: display the current engine activity as a static, paged list in a compressed view +Input: +* rowlimit - limits the number of rows to display, default is 0, which means return all rows. +* list (checkbox) - if checked, a paging version of the display is provided, if unchecked this will be a live, continuously updated version; default is not checked. +* compressed (checkbox) - if checked, a compressed version of the display is provided, default is not checked. + +Note: +To exit a live monitor you type "ctrl-c"; to exit a paged list you type "q" + +![list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png](ops/show/engines/list_engine_activity%20compressed%202024-12-15%20at%2016.48.48%402x.png) + +#### 4.1.2 activity: display the current engine activity as a live monitor in a compressed view +Input: +* rowlimit - limits the number of rows to display, default is 0, which means return all rows. +* list (checkbox) - if checked, a paging version of the display is provided, if unchecked this will be a live, continuously updated version; default is not checked. +* compressed (checkbox) - if checked, a compressed version of the display is provided, default is not checked. + +Note: +To exit a live monitor you type "ctrl-c"; to exit a paged list you type "q" + + + +![monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png](ops/show/engines/monitor_engine_activity%20compressed%20%202024-12-15%20at%2016.38.29%402x.png) +#### 4.1.3 activity: display the current engine activity as a live monitor +Input: +* rowlimit - limits the number of rows to display, default is 0, which means return all rows. +* list (checkbox) - if checked, a paging version of the display is provided, if unchecked this will be a live, continuously updated version; default is not checked. +* compressed (checkbox) - if checked, a compressed version of the display is provided, default is not checked. + +Note: +To exit a live monitor you type "ctrl-c"; to exit a paged list you type "q" +![monitor_engine_activity 2024-12-15 at 16.32.55@2x.png](ops/show/engines/monitor_engine_activity%20%202024-12-15%20at%2016.32.55%402x.png) + +#### 4.1.4 status: display the current status of governance engines either as a live monitor or as a static, paged list +Input: +* engine-list - list of engines to include in the display, default is "*" (all) +* list (checkbox) - if checked, a paging version of the display is provided, if unchecked this will be a live, continuously updated version; default is not checked. + + +Note: +To exit a live monitor you type "ctrl-c"; to exit a paged list you type "q" +![monitor_engine_status 2024-12-15 at 16.51.26.jpeg](ops/show/engines/monitor_engine_status%202024-12-15%20at%2016.51.26.jpeg) + + + +### 4.2 integrations + +#### 4.2.1 status: display the integration daemon status either as a live monitor or as a static, paged list +Input: +* connector-list - list of connectors to include in the display, default is "*" (all) +* list (checkbox) - if checked, a paging version of the display is provided, if unchecked this will be a live, continuously updated version; default is not checked. +* sorted (checkbox) - if checked, the list of connectors will be sorted; default is checked. + +![monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png](ops/show/integrations/monitor_integration_daemon_status%20%202024-12-15%20at%2016.57.12%402x.png) + + +#### 4.2.2 targets: display a list of catalog targets and their details +Input: +* connector (required) - a valid connector name must be provided - typically selected using the previous 'integration daemon status' command. + + +![monitor_integration_targets 2024-12-15 at 17.02.19@2x.png](ops/show/integrations/monitor_integration_targets%20%202024-12-15%20at%2017.02.19%402x.png) + +### 4.3 platforms +#### 4.3.1 status: display the platform status as a live monitor + +![monitor_platform_status 2024-12-15 at 19.53.18@2x.png](ops/show/platforms/monitor_platform_status%20%202024-12-15%20at%2019.53.18%402x.png) + + + +### 4.4 servers + +#### 4.4.1 status: show the status of servers running on the default platform with full details +Input: +* full (checkbox) - if check shows a full description of the servers, otherwise just the status is displayed; default is unchecked. +* url - the url of the Egeria OMAG Server Platform to get the server status for; default is derived from the EGERIA_PLATFORM_URL environment variable. + +![monitor_server_status full 2024-12-15 at 20.01.57@2x.png](ops/show/servers/monitor_server_status%20full%202024-12-15%20at%2020.01.57%402x.png) + +#### 4.4.2 status: show the status of servers running on the default platform with only status +Input: +* full (checkbox) - if check shows a full description of the servers, otherwise just the status is displayed; default is unchecked. +* url - the url of the Egeria OMAG Server Platform to get the server status for; default is derived from the EGERIA_PLATFORM_URL environment variable. + +![monitor_server_status 2024-12-15 at 19.59.39@2x.png](ops/show/servers/monitor_server_status%20%202024-12-15%20at%2019.59.39%402x.png) + +#### 4.4.3 startup: display a summary server status view using direct platform information. +Input: +* url - the url of the Egeria OMAG Server Platform to get the server status for; default is derived from the EGERIA_PLATFORM_URL environment variable. + + +![monitor_startup_servers 2024-12-15 at 19.56.07@2x.png](ops/show/servers/monitor_startup_servers%202024-12-15%20at%2019.56.07%402x.png) + + + + +## 5.0 tech: information for technologists + +### 5.1 elements: different ways to explore and display metadata elements managed by Egeria + +#### 5.1.1 anchored_elements: List anchored elements that match a specified value for a property. +Input: +* search-string (required) - value to search for, default is "DeployedDatabaseSchema" +* prop-list (required) - properties to search for the the above search-string. This is a list of strings separated by comma. Default is "anchorTypeName". + +![get_anchored_elements 2024-12-15 at 21.25.41@2x.png](tech/show/elements/get_anchored_elements%202024-12-15%20at%2021.25.41%402x.png) + + +#### 5.1.2 elements: List of elements of the specified Egeria Open Metadata type +Input: +* extended (checkbox) - if checked additional feedback columns are displayed; default is unchecked. +* om_type (required) - the Egeria Open Metadata type to return elements for; default is "Organization" + +![list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png](tech/show/elements/list_elements_by_om-type%20%202024-12-16%20at%2014.24.18%402x.png) + +#### 5.1.3 elements - extended: List of elements of the specified Egeria Open Metadata type with the extended columns +Input: +* extended (checkbox) - if checked additional feedback columns are displayed; default is unchecked. +* om_type (required) - the Egeria Open Metadata type to return elements for; default is "Organization" + +![list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png](tech/show/elements/list_elements_by_om-type%20extended%20%202024-12-16%20at%2014.28.46%402x.png) + +#### 5.1.4 elements of om_type by classification +Input: +* om_type (required) - Egeria Open Metadata type to search for; default is "Project". +* classification - Egeria classification to search within; default is "GovernanceProject". + +![list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png](tech/show/elements/list_elements_of_om_type_by_classification%20%202024-12-16%20at%2014.35.26%402x.png) + +#### 5.1.5 get_elements: a list of elements of the specified om_type +Input: +* om_type (required) - Egeria Open Metadata type to search for; default is "Project". +![get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png](tech/show/elements/get_elements_of_om_type%20%202024-12-16%20at%2014.39.59%402x.png) + + +#### 5.1.6 guid-info: information about the element identified by the supplied GUID +Input: +* guid (required) - the unique identifier of the element to return information about. + +![info_for_guid 2024-12-16 at 11.35.29@2x.png](tech/show/elements/info_for_guid%20%202024-12-16%20at%2011.35.29%402x.png) + +#### 5.1.7 related-elements: lists elements related to specified element +Input: +* guid (required) - the unique identifier of the element to return information about. +* om_type (required) - Egeria Open Metadata type to search for; default is "Project". +* rel_type (requited) - Egeria relationship type to filter by; default is "Certification". +![related_elements 2024-12-16 at 14.55.01@2x.png](tech/show/elements/related_elements%202024-12-16%20at%2014.55.01%402x.png) + + +#### 5.1.8 related-specifications: display template specification parameters +Input: +* guid (required) - the unique identifier of the element to return information about. + +![show_related_specifications 2024-12-16 at 15.04.55@2x.png](tech/show/elements/show_related_specifications%202024-12-16%20at%2015.04.55%402x.png) + +### 5.2 tech-info +#### 5.2.1 asset-types: List defined asset types + +![asset_types 2024-12-16 at 15.10.16@2x.png](tech/show/tech-info/asset_types%202024-12-16%20at%2015.10.16%402x.png) + +#### 5.2.2 gov-action-processes: displays details about identified governance action processes +Input: +* search-string (required) - value to search for, default is "*" (all) + +![detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png](tech/show/tech-info/detailed_governance_action_processes%20%202024-12-16%20at%2015.16.26%402x.png) + +#### 5.2.3 processes: lists all governance action processes +![governance_action_processes 2024-12-16 at 15.13.01@2x.png](tech/show/tech-info/governance_action_processes%202024-12-16%20at%2015.13.01%402x.png) + +#### 5.2.4 registered-services: lists the services registered with the Egeria OMAG Platform +Input: +* services: one of all, access-services, common-services, engine-services, governance-services, integration-services, view-services; default is "all". +![registered_services 2024-12-16 at 16.44.54@2x.png](tech/show/tech-info/registered_services%202024-12-16%20at%2016.44.54%402x.png) + +#### 5.2.5 relationship-types: lists the relationship types from the specified Egeria Open Metadata type +Input: + +* om_type (required) - Egeria Open Metadata type to search for; default is "AssetOwner". + +![relationship_types 2024-12-19 at 10.51.54@2x.png](tech/show/tech-info/relationship_types%202024-12-19%20at%2010.51.54%402x.png) + +#### 5.2.6 relationships +Input: + +* relationships (reqired) - relationship to search for; default is "Certification". + + +#### 5.2.7 valid-metadata-values: display valid metadata value for the specified property of a type +Input: + +* property (required) - valid value property to return the value for; default is "projectHealth". +* type-name (required) - metadata type to search the valid values for; default is "Project" + +![valid_metadata_values 2024-12-16 at 15.31.56@2x.png](tech/show/tech-info/valid_metadata_values%202024-12-16%20at%2015.31.56%402x.png) + + + +### 5.3 tech-types + +#### 5.3.1 details - Display details for the specified technology type. +Input: + +* tech_name (required) - technology name to get details for. + +![tech_type_details 2024-12-16 at 15.37.21@2x.png](tech/show/tech-types/tech_type_details%202024-12-16%20at%2015.37.21%402x.png) + + +#### 5.3.2 list - list the deployed technology types specified by the search string +Input: +* search-string - search for technology types containing the search-string; default is "*" (all). + +[list_technology_types 2024-12-16 at 15.39.20@2x.png](tech/show/tech-types/list_technology_types%202024-12-16%20at%2015.39.20%402x.png) + +#### 5.3.3 template-spec - list the template specification details for the specified technology type + +Input: +* search-string - search for templates associated with technology types containing the search-string; default is "*" (all). + +![list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png](tech/show/tech-types/list_tech_type_template_specs%20%202024-12-16%20at%2016.03.22%402x.png) + +#### 5.3.4 templates - display details of technology type templates for the specified technology type +Input: +* tech-type - name of the technology type to display templates for; default is "PostgreSQL Server" + +![tech_type_templates 2024-12-16 at 16.11.48@2x.png](tech/show/tech-types/tech_type_templates%202024-12-16%20at%2016.11.48%402x.png) + + + +---- +License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), +Copyright Contributors to the Egeria project. \ No newline at end of file diff --git a/pyegeria/commands/doc/Visual Command Reference/cat/show/assets/Asset-graph 2024-11-20 at 15.56.42.png b/pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png similarity index 100% rename from pyegeria/commands/doc/Visual Command Reference/cat/show/assets/Asset-graph 2024-11-20 at 15.56.42.png rename to pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png diff --git a/pyegeria/commands/doc/Visual Command Reference/cat/show/assets/Assets-in-domain 2024-11-20 at 15.49.55@2x.png b/pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png similarity index 100% rename from pyegeria/commands/doc/Visual Command Reference/cat/show/assets/Assets-in-domain 2024-11-20 at 15.49.55@2x.png rename to pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png diff --git a/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png b/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png new file mode 100644 index 0000000..6d68470 Binary files /dev/null and b/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png differ diff --git a/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png b/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png new file mode 100644 index 0000000..ba7cc23 Binary files /dev/null and b/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png differ diff --git a/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png b/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png new file mode 100644 index 0000000..0fc17ac Binary files /dev/null and b/pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png differ diff --git a/pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/list_relationship_types 2024-12-16 at 16.20.34@2x.png b/pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png similarity index 100% rename from pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/list_relationship_types 2024-12-16 at 16.20.34@2x.png rename to pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png diff --git a/pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png b/pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png new file mode 100644 index 0000000..44c08ef Binary files /dev/null and b/pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png differ diff --git a/pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/hey_egeria: overview.md b/pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/hey_egeria: overview.md index 6a1b057..711dc48 100644 --- a/pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/hey_egeria: overview.md +++ b/pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/hey_egeria: overview.md @@ -271,7 +271,7 @@ Here is a list of the variables and their defaults: | EGERIA_ADMIN_PASSWORD | secret | --admin_user_password | Admin password | | EGERIA_ENGINE_HOST | engine-host | --engine_host | Egeria Engine host to use for governance actions/processes | | EGERIA_ENGINE_HOST_URL | https://localhost:9443 | --engine_host_url | Platform URL where Engine host is running | -| EGERIA_INTEGRATION_DAEMON | integration-daemon | --integration-daemon | Egeria integration daemon to use | +| EGERIA_INTEGRATION_DAEMON | integration-daemon | --integration_daemon | Egeria integration daemon to use | | EGERIA_INTEGRATION_DAEMON_URL | https://localhost:9443 | --integration_daemon_url | Platform URL where Integration daemon is running | | EGERIA_VIEW_SERVER | view-server | --view_server | Egeria view server to use | | EGERIA_VIEW_SERVER_URL | https://localhost:9443 | --view_server_url | Platform URL where view server is running | diff --git a/pyegeria/commands/my/list_my_profile.py b/pyegeria/commands/my/list_my_profile.py index c892b3b..6e5b48d 100755 --- a/pyegeria/commands/my/list_my_profile.py +++ b/pyegeria/commands/my/list_my_profile.py @@ -36,7 +36,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/my/list_my_roles.py b/pyegeria/commands/my/list_my_roles.py index 576ab91..0715d45 100755 --- a/pyegeria/commands/my/list_my_roles.py +++ b/pyegeria/commands/my/list_my_roles.py @@ -33,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/my/monitor_my_todos.py b/pyegeria/commands/my/monitor_my_todos.py index 360f613..ae6d74b 100755 --- a/pyegeria/commands/my/monitor_my_todos.py +++ b/pyegeria/commands/my/monitor_my_todos.py @@ -33,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/my/monitor_open_todos.py b/pyegeria/commands/my/monitor_open_todos.py index 6eb1d93..d4c1ace 100755 --- a/pyegeria/commands/my/monitor_open_todos.py +++ b/pyegeria/commands/my/monitor_open_todos.py @@ -37,7 +37,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/my/todo_actions.py b/pyegeria/commands/my/todo_actions.py index 631b84f..1e87838 100644 --- a/pyegeria/commands/my/todo_actions.py +++ b/pyegeria/commands/my/todo_actions.py @@ -31,7 +31,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/list_archives.py b/pyegeria/commands/ops/list_archives.py index 7860c03..8102f8f 100755 --- a/pyegeria/commands/ops/list_archives.py +++ b/pyegeria/commands/ops/list_archives.py @@ -35,7 +35,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/list_catalog_targets.py b/pyegeria/commands/ops/list_catalog_targets.py index 12054ba..8b6ace6 100755 --- a/pyegeria/commands/ops/list_catalog_targets.py +++ b/pyegeria/commands/ops/list_catalog_targets.py @@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/ops/load_archive.py b/pyegeria/commands/ops/load_archive.py index 79c787a..0033c69 100644 --- a/pyegeria/commands/ops/load_archive.py +++ b/pyegeria/commands/ops/load_archive.py @@ -25,7 +25,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/monitor_asset_events.py b/pyegeria/commands/ops/monitor_asset_events.py index 38cd5b6..5e91735 100755 --- a/pyegeria/commands/ops/monitor_asset_events.py +++ b/pyegeria/commands/ops/monitor_asset_events.py @@ -18,20 +18,22 @@ from confluent_kafka import Consumer, KafkaException EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") -EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9192') -EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443') -EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server') -EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443') -EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon') -EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke') -EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret') -EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview') -EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret') -EGERIA_JUPYTER = os.environ.get('EGERIA_JUPYTER', False) -EGERIA_WIDTH = os.environ.get('EGERIA_WIDTH', 200) +EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9192") +EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443") +EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server") +EGERIA_VIEW_SERVER_URL = os.environ.get( + "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" +) +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") +EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") +EGERIA_JUPYTER = os.environ.get("EGERIA_JUPYTER", False) +EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 200) -def main(ep: str = EGERIA_KAFKA_ENDPOINT): +def main(ep: str = EGERIA_KAFKA_ENDPOINT): disable_ssl_warnings = True console = Console(width=200) now = datetime.now() @@ -41,16 +43,18 @@ def main(ep: str = EGERIA_KAFKA_ENDPOINT): # Define the Kafka consumer configuration. config = { - 'bootstrap.servers': ep, # replace with your Kafka broker(s) - 'group.id': f"view_asset_events:{current_time}", # replace with your consumer group - 'auto.offset.reset': earliest_latest # can be set to 'earliest' or 'latest' + "bootstrap.servers": ep, # replace with your Kafka broker(s) + "group.id": f"view_asset_events:{current_time}", # replace with your consumer group + "auto.offset.reset": earliest_latest, # can be set to 'earliest' or 'latest' } print(f"Kafka config is {json.dumps(config)}") # Initialize a Kafka consumer. consumer = Consumer(config) # Subscribe to a Kafka topic. - consumer.subscribe(['egeria.omag.server.active-metadata-store.omas.assetconsumer.outTopic']) # replace with your Kafka topic + consumer.subscribe( + ["egeria.omag.server.active-metadata-store.omas.assetconsumer.outTopic"] + ) # replace with your Kafka topic try: while True: @@ -75,11 +79,11 @@ def main(ep: str = EGERIA_KAFKA_ENDPOINT): for key in element_properties_keys: value = element_properties[key] props += f"* {key}: {value}\n" - console.rule(style= "[bold red]") - console.rule(f"\tMessage TimeStamp: {event_time}\t eventType: {event_type}\t typeName: {type_name}\t guid: {guid}") - msg = ( - - f"properties: \n[bright white on black]{props}\n\n") + console.rule(style="[bold red]") + console.rule( + f"\tMessage TimeStamp: {event_time}\t eventType: {event_type}\t typeName: {type_name}\t guid: {guid}" + ) + msg = f"properties: \n[bright white on black]{props}\n\n" msg = Markdown(msg) console.print(msg) @@ -91,6 +95,7 @@ def main(ep: str = EGERIA_KAFKA_ENDPOINT): # Close down consumer to commit final offsets. consumer.close() + if __name__ == "__main__": parser = argparse.ArgumentParser() @@ -99,4 +104,4 @@ def main(ep: str = EGERIA_KAFKA_ENDPOINT): ep = args.ep if args.ep is not None else EGERIA_KAFKA_ENDPOINT - main(ep) \ No newline at end of file + main(ep) diff --git a/pyegeria/commands/ops/monitor_engine_activity.py b/pyegeria/commands/ops/monitor_engine_activity.py index 5dffb3a..e33ec3a 100755 --- a/pyegeria/commands/ops/monitor_engine_activity.py +++ b/pyegeria/commands/ops/monitor_engine_activity.py @@ -39,7 +39,7 @@ EGERIA_ENGINE_HOST_URL = os.environ.get( "INTEGRATION_ENGINE_HOST_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/ops/monitor_engine_activity_c.py b/pyegeria/commands/ops/monitor_engine_activity_c.py index 0e6e235..b497f51 100755 --- a/pyegeria/commands/ops/monitor_engine_activity_c.py +++ b/pyegeria/commands/ops/monitor_engine_activity_c.py @@ -41,7 +41,7 @@ "EGERIA_ENGINE_HOST_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get( - "EGERIA_INTEGRATION_DAEMON", "integration-daemon" + "EGERIA_INTEGRATION_DAEMON", "integration_daemon" ) EGERIA_ADMIN_USER = os.environ.get("EGERIA_ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("EGERIA_ADMIN_PASSWORD", "secret") diff --git a/pyegeria/commands/ops/monitor_gov_eng_status.py b/pyegeria/commands/ops/monitor_gov_eng_status.py index fbd6e93..0397cc0 100755 --- a/pyegeria/commands/ops/monitor_gov_eng_status.py +++ b/pyegeria/commands/ops/monitor_gov_eng_status.py @@ -34,7 +34,7 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get( - "EGERIA_INTEGRATION_DAEMON", "integration-daemon" + "EGERIA_INTEGRATION_DAEMON", "integration_daemon" ) EGERIA_ENGINE_HOST = os.environ.get("EGERIA_ENGINE_HOST", "engine-host") EGERIA_ENGINE_HOST_URL = os.environ.get( diff --git a/pyegeria/commands/ops/monitor_integ_daemon_status.py b/pyegeria/commands/ops/monitor_integ_daemon_status.py index e339d26..7ee97ae 100755 --- a/pyegeria/commands/ops/monitor_integ_daemon_status.py +++ b/pyegeria/commands/ops/monitor_integ_daemon_status.py @@ -36,7 +36,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/monitor_platform_status.py b/pyegeria/commands/ops/monitor_platform_status.py index 9b1195d..abb6f98 100755 --- a/pyegeria/commands/ops/monitor_platform_status.py +++ b/pyegeria/commands/ops/monitor_platform_status.py @@ -30,7 +30,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/monitor_server_startup.py b/pyegeria/commands/ops/monitor_server_startup.py index 31aad83..f282256 100755 --- a/pyegeria/commands/ops/monitor_server_startup.py +++ b/pyegeria/commands/ops/monitor_server_startup.py @@ -30,7 +30,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/ops/monitor_server_status.py b/pyegeria/commands/ops/monitor_server_status.py index 5bc14e7..ff4f1fd 100755 --- a/pyegeria/commands/ops/monitor_server_status.py +++ b/pyegeria/commands/ops/monitor_server_status.py @@ -36,7 +36,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/orig_monitor_server_list.py b/pyegeria/commands/ops/orig_monitor_server_list.py index 1ae69dc..3d11b72 100755 --- a/pyegeria/commands/ops/orig_monitor_server_list.py +++ b/pyegeria/commands/ops/orig_monitor_server_list.py @@ -33,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/ops/orig_monitor_server_status.py b/pyegeria/commands/ops/orig_monitor_server_status.py index 1cb2e87..931d819 100755 --- a/pyegeria/commands/ops/orig_monitor_server_status.py +++ b/pyegeria/commands/ops/orig_monitor_server_status.py @@ -20,26 +20,36 @@ PropertyServerException, UserNotAuthorizedException, print_exception_response, - ServerOps + ServerOps, ) EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") -EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092') -EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443') -EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server') -EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443') -EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon') -EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443') -EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke') -EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret') -EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview') -EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret') -EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False')) -EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200')) - - -def display_status(server: str, url: str, username: str, user_pass: str, jupyter: bool = EGERIA_JUPYTER, - width: int = EGERIA_WIDTH): +EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092") +EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443") +EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server") +EGERIA_VIEW_SERVER_URL = os.environ.get( + "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" +) +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") +EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( + "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" +) +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") +EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") +EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) +EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200")) + + +def display_status( + server: str, + url: str, + username: str, + user_pass: str, + jupyter: bool = EGERIA_JUPYTER, + width: int = EGERIA_WIDTH, +): p_client = ServerOps(server, url, username, user_pass) def generate_table() -> Table: @@ -69,9 +79,10 @@ def generate_table() -> Table: else: status = "Inactive" - table.add_row(server, - "[red]Inactive" if status == "Inactive" else "[green]Active", - ) + table.add_row( + server, + "[red]Inactive" if status == "Inactive" else "[green]Active", + ) # p_client.close_session() return table @@ -81,7 +92,11 @@ def generate_table() -> Table: time.sleep(2) live.update(generate_table()) - except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e: + except ( + InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException, + ) as e: print_exception_response(e) except KeyboardInterrupt: pass diff --git a/pyegeria/commands/ops/refresh_integration_daemon.py b/pyegeria/commands/ops/refresh_integration_daemon.py index 72dea25..dde6288 100644 --- a/pyegeria/commands/ops/refresh_integration_daemon.py +++ b/pyegeria/commands/ops/refresh_integration_daemon.py @@ -25,7 +25,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) @@ -44,7 +44,7 @@ def refresh_connector( statement = "ALL connectors" else: statement = f"the {connector} " - server = "integration-daemon" if server is None else server + server = "integration_daemon" if server is None else server s_client.refresh_integration_connectors( connector_name=connector, server_guid=None, display_name=server diff --git a/pyegeria/commands/ops/restart_integration_daemon.py b/pyegeria/commands/ops/restart_integration_daemon.py index d46124f..63a81ae 100644 --- a/pyegeria/commands/ops/restart_integration_daemon.py +++ b/pyegeria/commands/ops/restart_integration_daemon.py @@ -25,7 +25,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) @@ -45,7 +45,7 @@ def restart_connector( statement = "ALL connectors" else: statement = f"the {connector} " - server = "integration-daemon" if server is None else server + server = "integration_daemon" if server is None else server s_client.restart_integration_connectors(connector, None, server) diff --git a/pyegeria/commands/ops/table_integ_daemon_status.py b/pyegeria/commands/ops/table_integ_daemon_status.py index 8a69e79..54ead47 100755 --- a/pyegeria/commands/ops/table_integ_daemon_status.py +++ b/pyegeria/commands/ops/table_integ_daemon_status.py @@ -32,7 +32,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) diff --git a/pyegeria/commands/tech/get_element_info.py b/pyegeria/commands/tech/get_element_info.py index a48c4ca..782f971 100644 --- a/pyegeria/commands/tech/get_element_info.py +++ b/pyegeria/commands/tech/get_element_info.py @@ -37,7 +37,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/get_guid_info.py b/pyegeria/commands/tech/get_guid_info.py index d98985e..76e19da 100755 --- a/pyegeria/commands/tech/get_guid_info.py +++ b/pyegeria/commands/tech/get_guid_info.py @@ -36,7 +36,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/get_tech_details.py b/pyegeria/commands/tech/get_tech_details.py index 8bb96f9..737ac99 100755 --- a/pyegeria/commands/tech/get_tech_details.py +++ b/pyegeria/commands/tech/get_tech_details.py @@ -17,47 +17,63 @@ from rich.text import Text from rich.tree import Tree -from pyegeria import (UserNotAuthorizedException, PropertyServerException, - InvalidParameterException, AutomatedCuration) +from pyegeria import ( + UserNotAuthorizedException, + PropertyServerException, + InvalidParameterException, + AutomatedCuration, +) from pyegeria._exceptions import ( print_exception_response, ) EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") -EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092') -EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443') -EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server') -EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443') -EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon') -EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke') -EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret') -EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview') -EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret') -EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False')) -EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200')) +EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092") +EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443") +EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server") +EGERIA_VIEW_SERVER_URL = os.environ.get( + "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" +) +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") +EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") +EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) +EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200")) # nest_asyncio.apply() disable_ssl_warnings = True -def tech_details_viewer(tech: str, server_name: str, platform_url: str, user: str, user_password: str, - jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH): +def tech_details_viewer( + tech: str, + server_name: str, + platform_url: str, + user: str, + user_password: str, + jupyter: bool = EGERIA_JUPYTER, + width: int = EGERIA_WIDTH, +): console = Console(width=width, force_terminal=not jupyter) + # print(f"tech is {tech} of type {type(tech)}") # sys.exit(0) - def view_tech_details(a_client: AutomatedCuration, root_collection_name: str, tree: Tree) -> Tree: + def view_tech_details( + a_client: AutomatedCuration, root_collection_name: str, tree: Tree + ) -> Tree: l2: Tree = None tech_details = a_client.get_technology_type_detail(tech) if (type(tech_details) is dict) and (len(tech_details) > 0): - name = tech_details.get('name', '---') - qualified_name = tech_details.get('qualifiedName', "---") - category = tech_details.get('category', '---') - description = tech_details.get('description', '---') + name = tech_details.get("name", "---") + qualified_name = tech_details.get("qualifiedName", "---") + category = tech_details.get("category", "---") + description = tech_details.get("description", "---") style = "bold bright_white on black" - bas_md = f"* **Name**: {name}\n" + bas_md = f"* **Name**: {name}\n" bas_md += f"* **QualifiedName**: {qualified_name}\n" bas_md += f"* **Category**: {category}\n" bas_md += f"* **Technology Description**: {description}\n" @@ -65,49 +81,68 @@ def view_tech_details(a_client: AutomatedCuration, root_collection_name: str, tr bas_out = Markdown(bas_md) l2 = tree.add(Panel(bas_out)) - ext_ref = tech_details.get('externalReferences', None) + ext_ref = tech_details.get("externalReferences", None) if ext_ref is not None: uri = ext_ref[0]["properties"].get("uri", "---") # console.print(f" {type(ext_ref)}, {len(ext_ref)}") - l2 = tree.add(Panel(Markdown(f'* URI: {uri}', style))) + l2 = tree.add(Panel(Markdown(f"* URI: {uri}", style))) - resource_list = tech_details.get('resourceList', None) + resource_list = tech_details.get("resourceList", None) if resource_list: t_r = tree.add(Panel("Resource List[bold red]")) for resource in resource_list: - resource_use = Text(f"[bold bright_white]{resource.get('resourceUse', '---')}") - resource_use_description = Text(f"[bold bright_white]{resource.get('resourceUseDescription', '---')}") - type_name = Text(f"[bold bright_white]{resource['relatedElement']['type'].get('typeName', '---')}") - unique_name = Text(f"[bold bright_white]{resource['relatedElement'].get('uniqueName', '---')}") - related_guid = Text(f"[bold bright_white]{resource['relatedElement'].get('guid', '---')}") - resource_text = (f"[bold red]Resource\n" - f"[white]Resource use: {resource_use}[white]\nDescription: " - f"{resource_use_description}\n[white]Type Name: {type_name}\n" - f"[white]Unique Name: {unique_name}\n[white]Related GUID: {related_guid}\n") + resource_use = Text( + f"[bold bright_white]{resource.get('resourceUse', '---')}" + ) + resource_use_description = Text( + f"[bold bright_white]{resource.get('resourceUseDescription', '---')}" + ) + type_name = Text( + f"[bold bright_white]{resource['relatedElement']['type'].get('typeName', '---')}" + ) + unique_name = Text( + f"[bold bright_white]{resource['relatedElement'].get('uniqueName', '---')}" + ) + related_guid = Text( + f"[bold bright_white]{resource['relatedElement'].get('guid', '---')}" + ) + resource_text = ( + f"[bold red]Resource\n" + f"[white]Resource use: {resource_use}[white]\nDescription: " + f"{resource_use_description}\n[white]Type Name: {type_name}\n" + f"[white]Unique Name: {unique_name}\n[white]Related GUID: {related_guid}\n" + ) p = Panel.fit(resource_text) tt = t_r.add(p, style=style) else: tt = tree.add(Panel(f"Resource details for {tech} where not found")) else: - tt = tree.add(Panel(f"Tech type {tech} was not found - please check the tech type name")) + tt = tree.add( + Panel( + f"Tech type {tech} was not found - please check the tech type name" + ) + ) return tt try: - tree = Tree(f"{tech}", style="bold bright_white on black", guide_style="bold bright_blue") - a_client = AutomatedCuration(server_name, platform_url, - user_id=user) + tree = Tree( + f"{tech}", + style="bold bright_white on black", + guide_style="bold bright_blue", + ) + a_client = AutomatedCuration(server_name, platform_url, user_id=user) token = a_client.create_egeria_bearer_token(user, user_password) view_tech_details(a_client, tech, tree) print(tree) except ( - InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException, ) as e: print_exception_response(e) @@ -126,9 +161,11 @@ def main(): userid = args.userid if args.userid is not None else EGERIA_USER user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD try: - tech = Prompt.ask("Enter the Technology to start from:", default="PostgreSQL Server") + tech = Prompt.ask( + "Enter the Technology to start from:", default="PostgreSQL Server" + ) tech_details_viewer(tech, server, url, userid, user_pass) - except(KeyboardInterrupt): + except KeyboardInterrupt: pass diff --git a/pyegeria/commands/tech/get_tech_type_template.py b/pyegeria/commands/tech/get_tech_type_template.py index 20dd7c0..188e4a1 100644 --- a/pyegeria/commands/tech/get_tech_type_template.py +++ b/pyegeria/commands/tech/get_tech_type_template.py @@ -20,21 +20,23 @@ PropertyServerException, UserNotAuthorizedException, print_exception_response, - AutomatedCuration + AutomatedCuration, ) EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") -EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092') -EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443') -EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server') -EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443') -EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon') -EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke') -EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret') -EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview') -EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret') -EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False')) -EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200')) +EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092") +EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443") +EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server") +EGERIA_VIEW_SERVER_URL = os.environ.get( + "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" +) +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") +EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") +EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) +EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200")) disable_ssl_warnings = True @@ -42,12 +44,18 @@ guid_list = [] -def template_viewer(tech_name: str, server_name:str, platform_url:str, user:str, user_pass:str, - jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH): +def template_viewer( + tech_name: str, + server_name: str, + platform_url: str, + user: str, + user_pass: str, + jupyter: bool = EGERIA_JUPYTER, + width: int = EGERIA_WIDTH, +): def build_classifications(classification: dict) -> Markdown: - - class_md = ("\n") + class_md = "\n" for c in classification: c_type = c["classificationName"] if c_type == "Anchors": @@ -65,53 +73,59 @@ def build_classifications(classification: dict) -> Markdown: return output try: - console = Console(width=width, force_terminal=not jupyter) - a_client = AutomatedCuration(server_name, platform_url, - user_id=user) + a_client = AutomatedCuration(server_name, platform_url, user_id=user) token = a_client.create_egeria_bearer_token(user, user_pass) - tech_elements = a_client.get_technology_type_elements(tech_name, get_templates=True) + tech_elements = a_client.get_technology_type_elements( + tech_name, get_templates=True + ) if (len(tech_elements) >= 1) and (type(tech_elements) is list): - tree = Tree(f"Deployed Technology Type: {tech_name}", style="bold bright_white", guide_style="bold bright_blue") - note: str =" " + tree = Tree( + f"Deployed Technology Type: {tech_name}", + style="bold bright_white", + guide_style="bold bright_blue", + ) + note: str = " " for element in tech_elements: - header = element['elementHeader'] + header = element["elementHeader"] tech_type = header["type"]["typeName"] - tech_collection = header["origin"]['homeMetadataCollectionName'] - tech_created_by = header['versions']['createdBy'] - tech_created_at = header['versions']['createTime'] - tech_guid = header['guid'] - tech_classifications = header['classifications'] + tech_collection = header["origin"]["homeMetadataCollectionName"] + tech_created_by = header["versions"]["createdBy"] + tech_created_at = header["versions"]["createTime"] + tech_guid = header["guid"] + tech_classifications = header["classifications"] class_md = build_classifications(tech_classifications) - referenceables = element['referenceableProperties'] - tech_qualified_name = referenceables['qualifiedName'] - extended = referenceables['extendedProperties'] - ex_md:str = "" + referenceables = element["referenceableProperties"] + tech_qualified_name = referenceables["qualifiedName"] + extended = referenceables["extendedProperties"] + ex_md: str = "" for key, value in extended.items(): ex_md += f"* {key}: {value}\n" - note = (f"* Qualified Name: {tech_qualified_name}\n" - f"* GUID: {tech_guid}\n" - f"* Createdy by: {tech_created_by}\n" - f"* Created at: {tech_created_at}\n" - f"* Home Collection: {tech_collection}\n" - f"{class_md}\n" - f"{ex_md}\n" - ) - - interfaces = extended.get('connectorInterfaces', None) + note = ( + f"* Qualified Name: {tech_qualified_name}\n" + f"* GUID: {tech_guid}\n" + f"* Createdy by: {tech_created_by}\n" + f"* Created at: {tech_created_at}\n" + f"* Home Collection: {tech_collection}\n" + f"{class_md}\n" + f"{ex_md}\n" + ) + + interfaces = extended.get("connectorInterfaces", None) if interfaces is not None: - interface_type_name = interfaces['typeName'] - interface_array_cnt = interfaces['arrayCount'] + interface_type_name = interfaces["typeName"] + interface_array_cnt = interfaces["arrayCount"] note += f"* Interface Type: {interface_type_name}\n" for i in range(0, int(interface_array_cnt)): - note += (f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}" - f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n" - ) - note_md = Panel.fit(Markdown(note), style = 'bold bright_white on black') + note += ( + f"\t* Type: {interfaces['arrayValues']['propertyValueMap'][str(i)]['typeName']}" + f"\tName: {interfaces['arrayValues']['propertiesAsStrings'][str(i)]}\n" + ) + note_md = Panel.fit(Markdown(note), style="bold bright_white on black") t = tree.add(note_md) else: @@ -120,7 +134,7 @@ def build_classifications(classification: dict) -> Markdown: except ( InvalidParameterException, PropertyServerException, - UserNotAuthorizedException + UserNotAuthorizedException, ) as e: print_exception_response(e) @@ -140,11 +154,13 @@ def main(): user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD try: - tech_name = Prompt.ask("Enter the Asset Name to view:", default="Apache Kafka Server") - template_viewer(tech_name,server, url, userid, user_pass) - except(KeyboardInterrupt): + tech_name = Prompt.ask( + "Enter the Asset Name to view:", default="Apache Kafka Server" + ) + template_viewer(tech_name, server, url, userid, user_pass) + except KeyboardInterrupt: pass if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/pyegeria/commands/tech/list_anchored_elements.py b/pyegeria/commands/tech/list_anchored_elements.py index 9004e5b..780be33 100755 --- a/pyegeria/commands/tech/list_anchored_elements.py +++ b/pyegeria/commands/tech/list_anchored_elements.py @@ -3,8 +3,6 @@ SPDX-License-Identifier: Apache-2.0 Copyright Contributors to the ODPi Egeria project. -Unit tests for the Utils helper functions using the Pytest framework. - Retrieve elements based on a search of a specified properties. """ @@ -34,7 +32,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") @@ -48,7 +46,7 @@ def display_anchored_elements( search_string: str, - prop_list: [str], + prop_list: list[str], server: str, url: str, username: str, @@ -65,6 +63,7 @@ def display_anchored_elements( sys.exit(3) g_client = EgeriaTech(server, url, username, user_password) token = g_client.create_egeria_bearer_token() + print(f"search string is {search_string} and prop_list is {prop_list}\n") def generate_table(search_string: str, prop_list: [str]) -> Table: """Make a new table.""" diff --git a/pyegeria/commands/tech/list_asset_types.py b/pyegeria/commands/tech/list_asset_types.py index 60bc17f..6c7f3ca 100755 --- a/pyegeria/commands/tech/list_asset_types.py +++ b/pyegeria/commands/tech/list_asset_types.py @@ -31,7 +31,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_elements.py b/pyegeria/commands/tech/list_elements.py index ff73eab..c8035ab 100644 --- a/pyegeria/commands/tech/list_elements.py +++ b/pyegeria/commands/tech/list_elements.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_elements_for_classification.py b/pyegeria/commands/tech/list_elements_for_classification.py index ab2536d..a67c0c4 100644 --- a/pyegeria/commands/tech/list_elements_for_classification.py +++ b/pyegeria/commands/tech/list_elements_for_classification.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_elements_x.py b/pyegeria/commands/tech/list_elements_x.py index 98cfa0e..0a62df7 100644 --- a/pyegeria/commands/tech/list_elements_x.py +++ b/pyegeria/commands/tech/list_elements_x.py @@ -28,7 +28,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_gov_action_processes.py b/pyegeria/commands/tech/list_gov_action_processes.py index 2885acc..471b56d 100755 --- a/pyegeria/commands/tech/list_gov_action_processes.py +++ b/pyegeria/commands/tech/list_gov_action_processes.py @@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_registered_services.py b/pyegeria/commands/tech/list_registered_services.py index 715cd24..1f3e264 100755 --- a/pyegeria/commands/tech/list_registered_services.py +++ b/pyegeria/commands/tech/list_registered_services.py @@ -31,7 +31,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_related_elements.py b/pyegeria/commands/tech/list_related_elements.py index b0b6491..eaae829 100644 --- a/pyegeria/commands/tech/list_related_elements.py +++ b/pyegeria/commands/tech/list_related_elements.py @@ -26,7 +26,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_related_specification.py b/pyegeria/commands/tech/list_related_specification.py index 7e259bf..74939f8 100644 --- a/pyegeria/commands/tech/list_related_specification.py +++ b/pyegeria/commands/tech/list_related_specification.py @@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_relationship_types.py b/pyegeria/commands/tech/list_relationship_types.py index 8389113..94f24fc 100755 --- a/pyegeria/commands/tech/list_relationship_types.py +++ b/pyegeria/commands/tech/list_relationship_types.py @@ -14,6 +14,7 @@ from rich import box from rich import print from rich.console import Console +from rich.markdown import Markdown from rich.prompt import Prompt from rich.table import Table @@ -32,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") @@ -69,16 +70,11 @@ def generate_table(type_name: str) -> Table: expand=True, ) - table.add_column("Status") table.add_column("Name") - # table.add_column("GUID", no_wrap=True,) - + table.add_column("Status") table.add_column("Description") - table.add_column("Attrib Name") - table.add_column("Attrib Status") - table.add_column("Attrib Type") - table.add_column("Attrib Description") table.add_column("Description Wiki", no_wrap=True) + table.add_column("Attributes", min_width=50) types_list = p_client.get_valid_relationship_types(type_name) @@ -99,27 +95,27 @@ def generate_table(type_name: str) -> Table: description = types["description"] description_wiki = types.get("descriptionWiki", " ") attribute_defs = types.get("attributeDefinitions") + + att_table = Table(show_lines=True) + att_table.add_column("Name") + att_table.add_column("Description") + att_table.add_column("Status") + att_table.add_column("Type") + if attribute_defs: + att_md = True for attr in attribute_defs: attr_name = attr["attributeName"] attr_desc = attr["attributeDescription"] attr_status = attr["attributeStatus"] attr_type = attr["attributeType"]["name"] - table.add_row( - status, - name, - description, - attr_name, - attr_status, - attr_type, - attr_desc, - description_wiki, - ) + att_table.add_row(attr_name, attr_desc, attr_status, attr_type) + else: - table.add_row( - status, name, description, description_wiki, " ", " ", " ", " " - ) + att_md = False + att_out = att_table if att_md else " " + table.add_row(name, status, description, description_wiki, att_out) p_client.close_session() return table @@ -157,7 +153,9 @@ def main(): userid = args.userid if args.userid is not None else EGERIA_USER user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD save_output = args.save_output if args.save_output is not None else False - type_name = Prompt.ask("Enter the Type Name to retrieve:", default="AssetOwner") + type_name = Prompt.ask( + "Enter the OM Type Name to retrieve relationships for:", default="AssetOwner" + ) display_relationship_types(type_name, server, url, userid, user_pass, save_output) diff --git a/pyegeria/commands/tech/list_relationships.py b/pyegeria/commands/tech/list_relationships.py index 2133b71..2a0d11e 100755 --- a/pyegeria/commands/tech/list_relationships.py +++ b/pyegeria/commands/tech/list_relationships.py @@ -16,6 +16,7 @@ from rich import box from rich.console import Console from rich.markdown import Markdown +from rich.prompt import Prompt from rich.table import Table from pyegeria import ( @@ -23,6 +24,7 @@ PropertyServerException, UserNotAuthorizedException, ClassificationManager, + max_paging_size, ) EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store") @@ -32,7 +34,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") @@ -87,7 +89,7 @@ def generate_table(search_string: str = None) -> Table: table.add_column("Properties", min_width=40) rel_list = g_client.get_relationships( - search_string, page_size=100, time_out=time_out + search_string, page_size=max_paging_size, time_out=time_out ) if type(rel_list) is str: return table @@ -164,8 +166,10 @@ def main(): user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD time_out = args.time_out if args.time_out is not None else 60 try: - # search_string = Prompt.ask("Enter an asset search string:", default="*") - search_string = "Certification" + search_string = Prompt.ask( + "Enter an asset search string:", default="Certification" + ) + list_relationships(search_string, server, url, userid, user_pass, time_out) except KeyboardInterrupt: pass diff --git a/pyegeria/commands/tech/list_tech_templates.py b/pyegeria/commands/tech/list_tech_templates.py index 9f4520b..9929c2d 100644 --- a/pyegeria/commands/tech/list_tech_templates.py +++ b/pyegeria/commands/tech/list_tech_templates.py @@ -29,7 +29,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/list_valid_metadata_values.py b/pyegeria/commands/tech/list_valid_metadata_values.py index 1812beb..45fe60a 100755 --- a/pyegeria/commands/tech/list_valid_metadata_values.py +++ b/pyegeria/commands/tech/list_valid_metadata_values.py @@ -35,7 +35,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/table_tech_templates.py b/pyegeria/commands/tech/table_tech_templates.py index 7de7d42..5f8a2dd 100644 --- a/pyegeria/commands/tech/table_tech_templates.py +++ b/pyegeria/commands/tech/table_tech_templates.py @@ -31,7 +31,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/commands/tech/x_list_related_elements.py b/pyegeria/commands/tech/x_list_related_elements.py index 848f5e5..e2f8505 100644 --- a/pyegeria/commands/tech/x_list_related_elements.py +++ b/pyegeria/commands/tech/x_list_related_elements.py @@ -34,7 +34,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/create_tech_guid_lists.py b/pyegeria/create_tech_guid_lists.py index bf5843a..6f68148 100644 --- a/pyegeria/create_tech_guid_lists.py +++ b/pyegeria/create_tech_guid_lists.py @@ -82,10 +82,10 @@ def build_global_guid_lists( ) # # Ok - now lets harvest integration connectors using get_integration_daemon_status from ServerOps - # Assume that integration daemon called integration-daemon + # Assume that integration daemon called integration_daemon # s_client = ServerOps( - "integration-daemon", url, user_id=user_id, user_pwd=user_pwd + "integration_daemon", url, user_id=user_id, user_pwd=user_pwd ) integ_status = s_client.get_integration_daemon_status() diff --git a/pyegeria/mermaid_utilities.py b/pyegeria/mermaid_utilities.py index ee55a53..c585e77 100644 --- a/pyegeria/mermaid_utilities.py +++ b/pyegeria/mermaid_utilities.py @@ -33,7 +33,7 @@ EGERIA_VIEW_SERVER_URL = os.environ.get( "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) -EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon") +EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration_daemon") EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") diff --git a/pyegeria/server_operations.py b/pyegeria/server_operations.py index d580392..ae3cabd 100644 --- a/pyegeria/server_operations.py +++ b/pyegeria/server_operations.py @@ -354,7 +354,7 @@ async def _async_get_integration_daemon_status( if server is None: server = self.server_name - url = f"{self.platform_url}/servers/{server}/open-metadata/integration-daemon/users/{self.user_id}/status" + url = f"{self.platform_url}/servers/{server}/open-metadata/integration_daemon/users/{self.user_id}/status" response = await self._async_make_request("GET", url) return response.json().get("integrationDaemonStatus", "No Integration Groups") # return response.json() @@ -377,7 +377,7 @@ async def _async_get_connector_config( validate_name(connector_name) url = ( - f"{self.platform_url}/servers/{server}/open-metadata/integration-daemon/users/{self.user_id}/" + f"{self.platform_url}/servers/{server}/open-metadata/integration_daemon/users/{self.user_id}/" f"integration-connectors/{connector_name}/configuration-properties" ) @@ -411,7 +411,7 @@ async def _async_restart_integration_connector( server = self.server_name url = ( - f"{self.platform_url}/servers/{server}/open-metadata/integration-daemon/users/" + f"{self.platform_url}/servers/{server}/open-metadata/integration_daemon/users/" f"{self.user_id}/integration-connectors/restart" ) body = {"class": "NameRequestBody", "name": connector_name} @@ -439,7 +439,7 @@ async def _async_refresh_integration_connectors( connector_name = None url = ( - f"{self.platform_url}/servers/{server}/open-metadata/integration-daemon/users/" + f"{self.platform_url}/servers/{server}/open-metadata/integration_daemon/users/" f"{self.user_id}/integration-connectors/refresh" ) if connector_name: diff --git a/pyproject.toml b/pyproject.toml index c03956a..341b26d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyegeria" -version = "5.2.0.40" +version = "5.2.0.42" license = 'Apache 2.0' authors = ["Dan Wolfson "] readme = "README.md" @@ -61,6 +61,7 @@ pytest = "^8.2.2" get_collection = "pyegeria.commands.cat.get_collection:main" list_terms = "pyegeria.commands.cat.list_terms:main" get_tech_type_elements = "pyegeria.commands.cat.get_tech_type_elements:main" + list_tech_type_elements = "pyegeria.commands.cat.list_tech_type_elements:main" list_projects = "pyegeria.commands.cat.list_projects:main" list_todos = "pyegeria.commands.cat.list_todos:main" list_cert_types = "pyegeria.commands.cat.list_cert_types:main" diff --git a/tests/test_classification_manager_omvs.py b/tests/test_classification_manager_omvs.py index 0761443..e59edc9 100644 --- a/tests/test_classification_manager_omvs.py +++ b/tests/test_classification_manager_omvs.py @@ -320,7 +320,9 @@ def test_get_elements_by_classification_with_property_value(): # open_metadata_type_name = "Project" open_metadata_type_name = None classification = "Anchors" - property_value = "Collection" + # property_value = "Collection" + # property_names = ["anchorTypeName"] + property_value = "DeployedDatabaseSchema" property_names = ["anchorTypeName"] try: c_client = ClassificationManager(view_server, platform_url) @@ -358,15 +360,20 @@ def test_find_elements_by_classification_with_property_value(): classification = "Anchors" # open_metadata_type_name = "DeployedDatabaseSchema" open_metadata_type_name = None - property_value = "Unity Catalog 1" - property_names = ["name", "qualifiedName"] + property_value = "SoftwareCapability" + property_names = ["anchorDomainName"] c_client = ClassificationManager(view_server, platform_url) bearer_token = c_client.create_egeria_bearer_token(user, password) + + start_time = time.perf_counter() response = c_client.find_elements_by_classification_with_property_value( classification, property_value, property_names, open_metadata_type_name ) - + duration = time.perf_counter() - start_time + print( + f"\n\tDuration was {duration:.2f} seconds, Type: {type(response)}, Element count is {len(response)}" + ) if type(response) is list: print_json(data=response) elif type(response) is str: @@ -404,7 +411,7 @@ def test_get_all_related_elements(): # element_guid = "d156faa6-90cf-4be8-b3c1-c002f3e9a0e5" # branch database # element_guid = "8b9cce34-ff42-4f9d-b4b3-6317c8a767c3" # Retail schema # element_guid = "8dca6e76-d454-4344-9c93-faa837a1a898" - + element_guid = "41bc6c53-effe-4dd4-9fef-ee8d86fa6b42" bearer_token = c_client.create_egeria_bearer_token(user, password) response = c_client.get_related_elements( element_guid, None, open_metadata_type_name