pyegeria 1.5.1.1.22__tar.gz → 1.5.1.1.25__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/PKG-INFO +1 -1
  2. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/glossary_actions.py +15 -0
  3. pyegeria-1.5.1.1.25/pyegeria/commands/tech/list_tech_templates.py +360 -0
  4. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/glossary_manager_omvs.py +0 -1
  5. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyproject.toml +1 -1
  6. pyegeria-1.5.1.1.22/pyegeria/commands/tech/list_tech_templates.py +0 -204
  7. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/LICENSE +0 -0
  8. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/README.md +0 -0
  9. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/README.md +0 -0
  10. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/__init__.py +0 -0
  11. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/_client.py +0 -0
  12. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/_deprecated_gov_engine.py +0 -0
  13. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/_exceptions.py +0 -0
  14. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/_globals.py +0 -0
  15. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/_validators.py +0 -0
  16. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/asset_catalog_omvs.py +0 -0
  17. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/automated_curation_omvs.py +0 -0
  18. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/classification_manager_omvs.py +0 -0
  19. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/collection_manager_omvs.py +0 -0
  20. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/.DS_Store +0 -0
  21. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/README.md +0 -0
  22. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/__init__.py +0 -0
  23. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/__pycache__/server_status_widget.cpython-312-pytest-7.4.4.pyc +0 -0
  24. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/README.md +0 -0
  25. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/__init__.py +0 -0
  26. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/get_asset_graph.py +0 -0
  27. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/get_collection.py +0 -0
  28. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/get_project_dependencies.py +0 -0
  29. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/get_project_structure.py +0 -0
  30. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/get_tech_type_elements.py +0 -0
  31. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/get_tech_type_template.py +0 -0
  32. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_archives.py +0 -0
  33. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_assets.py +0 -0
  34. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_cert_types.py +0 -0
  35. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_deployed_catalogs.py +0 -0
  36. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_deployed_database_schemas.py +0 -0
  37. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_deployed_databases.py +0 -0
  38. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_projects.py +0 -0
  39. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_relationships.py +0 -0
  40. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_tech_types.py +0 -0
  41. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_terms.py +0 -0
  42. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_todos.py +0 -0
  43. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cat/list_user_ids.py +0 -0
  44. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/__init__.py +0 -0
  45. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/egeria.py +0 -0
  46. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/egeria_cat.py +0 -0
  47. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/egeria_my.py +0 -0
  48. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/egeria_ops.py +0 -0
  49. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/egeria_tech.py +0 -0
  50. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/cli/ops_config.py +0 -0
  51. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/README.md +0 -0
  52. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/__init__.py +0 -0
  53. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/list_my_profile.py +0 -0
  54. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/list_my_roles.py +0 -0
  55. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/monitor_my_todos.py +0 -0
  56. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/monitor_open_todos.py +0 -0
  57. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/my/todo_actions.py +0 -0
  58. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/README.md +0 -0
  59. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/__init__.py +0 -0
  60. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/engine_actions.py +0 -0
  61. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/gov_server_actions.py +0 -0
  62. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/list_catalog_targets.py +0 -0
  63. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/load_archive.py +0 -0
  64. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_asset_events.py +0 -0
  65. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_engine_activity.py +0 -0
  66. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_engine_activity_c.py +0 -0
  67. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_gov_eng_status.py +0 -0
  68. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_integ_daemon_status.py +0 -0
  69. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_platform_status.py +0 -0
  70. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_server_startup.py +0 -0
  71. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/monitor_server_status.py +0 -0
  72. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/orig_monitor_server_list.py +0 -0
  73. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/orig_monitor_server_status.py +0 -0
  74. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/refresh_integration_daemon.py +0 -0
  75. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/restart_integration_daemon.py +0 -0
  76. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/ops/table_integ_daemon_status.py +0 -0
  77. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/README.md +0 -0
  78. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/__init__.py +0 -0
  79. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/get_element_graph.py +0 -0
  80. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/get_element_info.py +0 -0
  81. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/get_guid_info.py +0 -0
  82. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/get_tech_details.py +0 -0
  83. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_asset_types.py +0 -0
  84. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_elements.py +0 -0
  85. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_elements_for_classification.py +0 -0
  86. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_elements_x.py +0 -0
  87. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_gov_action_processes.py +0 -0
  88. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_registered_services.py +0 -0
  89. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_related_elements.py +0 -0
  90. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_related_specification.py +0 -0
  91. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_relationship_types.py +0 -0
  92. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/list_valid_metadata_values.py +0 -0
  93. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/table_tech_templates.py +0 -0
  94. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/commands/tech/x_list_related_elements.py +0 -0
  95. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/core_omag_server_config.py +0 -0
  96. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/create_tech_guid_lists.py +0 -0
  97. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/egeria_cat_client.py +0 -0
  98. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/egeria_client.py +0 -0
  99. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/egeria_config_client.py +0 -0
  100. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/egeria_my_client.py +0 -0
  101. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/egeria_tech_client.py +0 -0
  102. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/feedback_manager_omvs.py +0 -0
  103. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/full_omag_server_config.py +0 -0
  104. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/glossary_browser_omvs.py +0 -0
  105. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/mermaid_utilities.py +0 -0
  106. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/my_profile_omvs.py +0 -0
  107. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/platform_services.py +0 -0
  108. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/project_manager_omvs.py +0 -0
  109. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/registered_info.py +0 -0
  110. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/runtime_manager_omvs.py +0 -0
  111. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/server_operations.py +0 -0
  112. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/template_manager_omvs.py +0 -0
  113. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/utils.py +0 -0
  114. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/valid_metadata_omvs.py +0 -0
  115. {pyegeria-1.5.1.1.22 → pyegeria-1.5.1.1.25}/pyegeria/x_action_author_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.1.22
3
+ Version: 1.5.1.1.25
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -117,6 +117,21 @@ def create_glossary(
117
117
  m_client.close_session()
118
118
 
119
119
 
120
+ def display_glossaries(
121
+ search_string: str,
122
+ server: str,
123
+ url: str,
124
+ userid: str,
125
+ password: str,
126
+ timeout: int,
127
+ jupyter: bool,
128
+ width: int,
129
+ ):
130
+ list_glossaries(
131
+ search_string, server, url, userid, password, timeout, jupyter, width
132
+ )
133
+
134
+
120
135
  @click.command("glossaries")
121
136
  @click.option("--search-string", default="*", help="Glossaries to search for")
122
137
  @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
@@ -0,0 +1,360 @@
1
+ """This creates a templates guid file from the core metadata archive"""
2
+
3
+ import argparse
4
+ import os
5
+ import sys
6
+ import time
7
+ from typing import Union
8
+
9
+ import nest_asyncio
10
+ from rich import box
11
+ from rich.console import Console
12
+ from rich.prompt import Prompt
13
+ from rich.table import Table
14
+ from textual.widgets import DataTable
15
+
16
+ from pyegeria import AutomatedCuration
17
+ from pyegeria import (
18
+ InvalidParameterException,
19
+ PropertyServerException,
20
+ UserNotAuthorizedException,
21
+ print_exception_response,
22
+ )
23
+
24
+ console = Console()
25
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
26
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
27
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
28
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
29
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
30
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
31
+ )
32
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
33
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
34
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
35
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
36
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
37
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
38
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
39
+
40
+
41
+ def list_templates(
42
+ search_string: str, server: str, url: str, username: str, password: str
43
+ ) -> []:
44
+ """Return a list of templates for one or more technology type"""
45
+ a_client = AutomatedCuration(server, url, username)
46
+ token = a_client.create_egeria_bearer_token(username, password)
47
+ tech_list = a_client.find_technology_types(search_string, page_size=0)
48
+ tech_info_list: dict = []
49
+
50
+ if type(tech_list) is list:
51
+ for item in tech_list:
52
+ if "deployedImplementationType" not in item["qualifiedName"]:
53
+ continue
54
+
55
+ details = a_client.get_technology_type_detail(item["name"])
56
+ entry = {details["name"]: {}}
57
+ if type(details) is str:
58
+ tech_info_list.append(entry)
59
+ continue
60
+ templates = details.get("catalogTemplates", "Not Found")
61
+ if type(templates) is list:
62
+ t_list = []
63
+ entry = {details["name"]: {}}
64
+ for template in templates:
65
+ t_list.append({"template": template["name"]})
66
+ entry[details["name"]] = t_list
67
+ tech_info_list.append(entry)
68
+ return tech_info_list
69
+
70
+
71
+ def add_row(
72
+ table: Union[Table, DataTable],
73
+ name: str,
74
+ template_name: str,
75
+ template_guid: str,
76
+ placeholder_table: Table,
77
+ ) -> Table | DataTable:
78
+ if isinstance(table, Table):
79
+ table.add_row(name, template_name, template_guid, placeholder_table)
80
+ elif isinstance(table, DataTable):
81
+ table.add_row(name, template_name, template_guid, placeholder_table)
82
+
83
+ return table
84
+
85
+
86
+ def display_templates_spec(
87
+ search_string: str,
88
+ server: str,
89
+ url: str,
90
+ username: str,
91
+ password: str,
92
+ jupyter: bool = EGERIA_JUPYTER,
93
+ width: int = EGERIA_WIDTH,
94
+ data_table: bool = False,
95
+ ) -> Table | DataTable:
96
+ a_client = AutomatedCuration(server, url, username)
97
+ nest_asyncio.apply()
98
+ token = a_client.create_egeria_bearer_token(username, password)
99
+ tech_list = a_client.find_technology_types(search_string, page_size=0)
100
+
101
+ def generate_table(data_table: bool) -> Table | DataTable:
102
+ """Make a new table."""
103
+ if data_table:
104
+ table = DataTable()
105
+ table.add_columns("Name", "Template Name", "Template GUID", "Placeholders")
106
+ else:
107
+ table = Table(
108
+ title=f"Technology Templates for: {url} @ {time.asctime()}",
109
+ style="bold bright_white on black",
110
+ row_styles=["bold bright_white on black"],
111
+ header_style="white on dark_blue",
112
+ title_style="bold bright_white on black",
113
+ caption_style="white on black",
114
+ show_lines=True,
115
+ box=box.ROUNDED,
116
+ caption=f"Templates from Server '{server}' @ Platform - {url}",
117
+ expand=True,
118
+ # width=500
119
+ )
120
+
121
+ table.add_column("Name", width=20)
122
+ table.add_column("Template Name", width=20)
123
+ table.add_column("Template GUID", width=38, no_wrap=True)
124
+ table.add_column("Placeholders")
125
+
126
+ if type(tech_list) is list:
127
+ for item in tech_list:
128
+ if "deployedImplementationType" not in item["qualifiedName"]:
129
+ continue
130
+ placeholder_table = Table(expand=False, show_lines=True)
131
+ placeholder_table.add_column("Name", width=20, no_wrap=True)
132
+ placeholder_table.add_column("Type", width=10)
133
+ placeholder_table.add_column("Required", width=10)
134
+ placeholder_table.add_column("Example", width=20)
135
+ placeholder_table.add_column("Description", width=40)
136
+
137
+ name = item.get("name", "none")
138
+
139
+ details = a_client.get_technology_type_detail(name)
140
+ if type(details) is str:
141
+ console.log(f"Missing details for - {name}: {details}")
142
+ continue
143
+
144
+ templates = details.get("catalogTemplates", "Not Found")
145
+ if type(templates) is not str:
146
+ for template in templates:
147
+ template_name = template.get("name", None)
148
+
149
+ template_name = (
150
+ f"{name}_Template"
151
+ if template_name is None
152
+ else template_name
153
+ )
154
+
155
+ specification = template["specification"]["placeholderProperty"]
156
+ template_guid = template["relatedElement"]["guid"]
157
+
158
+ for placeholder in specification:
159
+ placeholder_data_type = placeholder["dataType"]
160
+ placeholder_description = placeholder["description"]
161
+ placeholder_name = placeholder["placeholderPropertyName"]
162
+ placeholder_required = placeholder["required"]
163
+ placeholder_example = placeholder.get("example", None)
164
+ placeholder_table.add_row(
165
+ placeholder_name,
166
+ placeholder_data_type,
167
+ placeholder_required,
168
+ placeholder_example,
169
+ placeholder_description,
170
+ )
171
+
172
+ # table.add_row(name, template_name, template_guid, placeholder_table)
173
+ table = add_row(
174
+ table, name, template_name, template_guid, placeholder_table
175
+ )
176
+
177
+ return table
178
+ else:
179
+ print("Unknown technology type")
180
+ sys.exit(1)
181
+
182
+ try:
183
+ if data_table:
184
+ return generate_table(data_table)
185
+ else:
186
+ console = Console(width=width, force_terminal=not jupyter)
187
+
188
+ with console.pager(styles=True):
189
+ console.print(generate_table(data_table))
190
+
191
+ except (
192
+ InvalidParameterException,
193
+ PropertyServerException,
194
+ UserNotAuthorizedException,
195
+ ) as e:
196
+ print_exception_response(e)
197
+ assert e.related_http_code != "200", "Invalid parameters"
198
+ finally:
199
+ a_client.close_session()
200
+
201
+
202
+ def main():
203
+ parser = argparse.ArgumentParser()
204
+ parser.add_argument("--server", help="Name of the server to display status for")
205
+ parser.add_argument("--url", help="URL Platform to connect to")
206
+ parser.add_argument("--userid", help="User Id")
207
+ parser.add_argument("--password", help="Password")
208
+
209
+ args = parser.parse_args()
210
+
211
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
212
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
213
+ userid = args.userid if args.userid is not None else EGERIA_USER
214
+ password = args.password if args.password is not None else EGERIA_USER_PASSWORD
215
+ guid = None
216
+
217
+ try:
218
+ search_string = Prompt.ask(
219
+ "Enter the technology you are searching for:", default="*"
220
+ )
221
+ display_templates_spec(
222
+ search_string, server, url, userid, password, data_table=False
223
+ )
224
+ except KeyboardInterrupt:
225
+ pass
226
+
227
+
228
+ # def display_templates_spec(
229
+ # search_string: str,
230
+ # server: str,
231
+ # url: str,
232
+ # username: str,
233
+ # password: str,
234
+ # jupyter: bool = EGERIA_JUPYTER,
235
+ # width: int = EGERIA_WIDTH,
236
+ # ):
237
+ # a_client = AutomatedCuration(server, url, username)
238
+ # token = a_client.create_egeria_bearer_token(username, password)
239
+ # tech_list = a_client.find_technology_types(search_string, page_size=0)
240
+ #
241
+ # def generate_table() -> Table:
242
+ # """Make a new table."""
243
+ # table = Table(
244
+ # title=f"Technology Templates for: {url} @ {time.asctime()}",
245
+ # style="bold bright_white on black",
246
+ # row_styles=["bold bright_white on black"],
247
+ # header_style="white on dark_blue",
248
+ # title_style="bold bright_white on black",
249
+ # caption_style="white on black",
250
+ # show_lines=True,
251
+ # box=box.ROUNDED,
252
+ # caption=f"Templates from Server '{server}' @ Platform - {url}",
253
+ # expand=True,
254
+ # # width=500
255
+ # )
256
+ #
257
+ # table.add_column("Name", width=20)
258
+ # table.add_column("Template Name", width=20)
259
+ # table.add_column("Template GUID", width=38, no_wrap=True)
260
+ # table.add_column("Placeholders")
261
+ #
262
+ # if type(tech_list) is list:
263
+ # for item in tech_list:
264
+ # if "deployedImplementationType" not in item["qualifiedName"]:
265
+ # continue
266
+ # placeholder_table = Table(expand=False, show_lines=True)
267
+ # placeholder_table.add_column("Name", width=20, no_wrap=True)
268
+ # placeholder_table.add_column("Type", width=10)
269
+ # placeholder_table.add_column("Required", width=10)
270
+ # placeholder_table.add_column("Example", width=20)
271
+ # placeholder_table.add_column("Description", width=40)
272
+ #
273
+ # name = item.get("name", "none")
274
+ #
275
+ # details = a_client.get_technology_type_detail(name)
276
+ # if type(details) is str:
277
+ # console.log(f"Missing details for - {name}: {details}")
278
+ # continue
279
+ #
280
+ # templates = details.get("catalogTemplates", "Not Found")
281
+ # if type(templates) is not str:
282
+ # for template in templates:
283
+ # template_name = template.get("name", None)
284
+ #
285
+ # template_name = (
286
+ # f"{name}_Template"
287
+ # if template_name is None
288
+ # else template_name
289
+ # )
290
+ #
291
+ # specification = template["specification"]["placeholderProperty"]
292
+ # template_guid = template["relatedElement"]["guid"]
293
+ #
294
+ # for placeholder in specification:
295
+ # placeholder_data_type = placeholder["dataType"]
296
+ # placeholder_description = placeholder["description"]
297
+ # placeholder_name = placeholder["placeholderPropertyName"]
298
+ # placeholder_required = placeholder["required"]
299
+ # placeholder_example = placeholder.get("example", None)
300
+ # placeholder_table.add_row(
301
+ # placeholder_name,
302
+ # placeholder_data_type,
303
+ # placeholder_required,
304
+ # placeholder_example,
305
+ # placeholder_description,
306
+ # )
307
+ #
308
+ # table.add_row(
309
+ # name, template_name, template_guid, placeholder_table
310
+ # )
311
+ #
312
+ # return table
313
+ # else:
314
+ # print("Unknown technology type")
315
+ # sys.exit(1)
316
+ #
317
+ # try:
318
+ # console = Console(width=width, force_terminal=not jupyter)
319
+ #
320
+ # with console.pager(styles=True):
321
+ # console.print(generate_table())
322
+ #
323
+ # except (
324
+ # InvalidParameterException,
325
+ # PropertyServerException,
326
+ # UserNotAuthorizedException,
327
+ # ) as e:
328
+ # print_exception_response(e)
329
+ # assert e.related_http_code != "200", "Invalid parameters"
330
+ # finally:
331
+ # a_client.close_session()
332
+ #
333
+ #
334
+ # def main():
335
+ # parser = argparse.ArgumentParser()
336
+ # parser.add_argument("--server", help="Name of the server to display status for")
337
+ # parser.add_argument("--url", help="URL Platform to connect to")
338
+ # parser.add_argument("--userid", help="User Id")
339
+ # parser.add_argument("--password", help="Password")
340
+ #
341
+ # args = parser.parse_args()
342
+ #
343
+ # server = args.server if args.server is not None else EGERIA_VIEW_SERVER
344
+ # url = args.url if args.url is not None else EGERIA_PLATFORM_URL
345
+ # userid = args.userid if args.userid is not None else EGERIA_USER
346
+ # password = args.password if args.password is not None else EGERIA_USER_PASSWORD
347
+ # guid = None
348
+ #
349
+ # try:
350
+ # search_string = Prompt.ask(
351
+ # "Enter the technology you are searching for:", default="*"
352
+ # )
353
+ # # display_templates_spec(search_string, server, url, userid, password)
354
+ # list_templates(search_string, server, url, userid, password)
355
+ # except KeyboardInterrupt:
356
+ # pass
357
+ #
358
+ #
359
+ # if __name__ == "__main__":
360
+ # main()
@@ -1622,7 +1622,6 @@ class GlossaryManager(GlossaryBrowser):
1622
1622
  {
1623
1623
  "term_name": term_name,
1624
1624
  "qualified_name": qualified_name,
1625
- "term_guid": term_guid,
1626
1625
  "error": "Matching term not found - skipping",
1627
1626
  }
1628
1627
  )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "1.5.1.1.22"
3
+ version = "1.5.1.1.25"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
@@ -1,204 +0,0 @@
1
- """This creates a templates guid file from the core metadata archive"""
2
- import json
3
-
4
- from rich.markdown import Markdown
5
- from rich.prompt import Prompt
6
- import os
7
- from pyegeria import AutomatedCuration
8
- from datetime import datetime
9
- import argparse
10
- import time
11
- import sys
12
- from rich import box
13
- from rich.console import Console
14
- from rich.table import Table
15
-
16
- from pyegeria import (
17
- InvalidParameterException,
18
- PropertyServerException,
19
- UserNotAuthorizedException,
20
- print_exception_response,
21
- RegisteredInfo,
22
- )
23
-
24
-
25
- console = Console()
26
- EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
27
- EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
28
- EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
29
- EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
30
- EGERIA_VIEW_SERVER_URL = os.environ.get(
31
- "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
32
- )
33
- EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
34
- EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
35
- EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
36
- EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
37
- EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
38
- EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
39
- EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
40
-
41
-
42
- def list_templates(
43
- search_string: str, server: str, url: str, username: str, password: str
44
- ) -> []:
45
- """Return a list of templates for one or more technology type"""
46
- a_client = AutomatedCuration(server, url, username)
47
- token = a_client.create_egeria_bearer_token(username, password)
48
- tech_list = a_client.find_technology_types(search_string, page_size=0)
49
- tech_info_list: dict = []
50
-
51
- if type(tech_list) is list:
52
- for item in tech_list:
53
- if "deployedImplementationType" not in item["qualifiedName"]:
54
- continue
55
-
56
- details = a_client.get_technology_type_detail(item["name"])
57
- entry = {details["name"]: {}}
58
- if type(details) is str:
59
- tech_info_list.append(entry)
60
- continue
61
- templates = details.get("catalogTemplates", "Not Found")
62
- if type(templates) is list:
63
- t_list = []
64
- entry = {details["name"]: {}}
65
- for template in templates:
66
- t_list.append({"template": template["name"]})
67
- entry[details["name"]] = t_list
68
- tech_info_list.append(entry)
69
- return tech_info_list
70
-
71
-
72
- def display_templates_spec(
73
- search_string: str,
74
- server: str,
75
- url: str,
76
- username: str,
77
- password: str,
78
- jupyter: bool = EGERIA_JUPYTER,
79
- width: int = EGERIA_WIDTH,
80
- ):
81
- a_client = AutomatedCuration(server, url, username)
82
- token = a_client.create_egeria_bearer_token(username, password)
83
- tech_list = a_client.find_technology_types(search_string, page_size=0)
84
-
85
- def generate_table() -> Table:
86
- """Make a new table."""
87
- table = Table(
88
- title=f"Technology Templates for: {url} @ {time.asctime()}",
89
- style="bold bright_white on black",
90
- row_styles=["bold bright_white on black"],
91
- header_style="white on dark_blue",
92
- title_style="bold bright_white on black",
93
- caption_style="white on black",
94
- show_lines=True,
95
- box=box.ROUNDED,
96
- caption=f"Templates from Server '{server}' @ Platform - {url}",
97
- expand=True,
98
- # width=500
99
- )
100
-
101
- table.add_column("Name", width=20)
102
- table.add_column("Template Name", width=20)
103
- table.add_column("Template GUID", width=38, no_wrap=True)
104
- table.add_column("Placeholders")
105
-
106
- if type(tech_list) is list:
107
- for item in tech_list:
108
- if "deployedImplementationType" not in item["qualifiedName"]:
109
- continue
110
- placeholder_table = Table(expand=False, show_lines=True)
111
- placeholder_table.add_column("Name", width=20, no_wrap=True)
112
- placeholder_table.add_column("Type", width=10)
113
- placeholder_table.add_column("Required", width=10)
114
- placeholder_table.add_column("Example", width=20)
115
- placeholder_table.add_column("Description", width=40)
116
-
117
- name = item.get("name", "none")
118
-
119
- details = a_client.get_technology_type_detail(name)
120
- if type(details) is str:
121
- console.log(f"Missing details for - {name}: {details}")
122
- continue
123
-
124
- templates = details.get("catalogTemplates", "Not Found")
125
- if type(templates) is not str:
126
- for template in templates:
127
- template_name = template.get("name", None)
128
-
129
- template_name = (
130
- f"{name}_Template"
131
- if template_name is None
132
- else template_name
133
- )
134
-
135
- specification = template["specification"]["placeholderProperty"]
136
- template_guid = template["relatedElement"]["guid"]
137
-
138
- for placeholder in specification:
139
- placeholder_data_type = placeholder["dataType"]
140
- placeholder_description = placeholder["description"]
141
- placeholder_name = placeholder["placeholderPropertyName"]
142
- placeholder_required = placeholder["required"]
143
- placeholder_example = placeholder.get("example", None)
144
- placeholder_table.add_row(
145
- placeholder_name,
146
- placeholder_data_type,
147
- placeholder_required,
148
- placeholder_example,
149
- placeholder_description,
150
- )
151
-
152
- table.add_row(
153
- name, template_name, template_guid, placeholder_table
154
- )
155
-
156
- return table
157
- else:
158
- print("Unknown technology type")
159
- sys.exit(1)
160
-
161
- try:
162
- console = Console(width=width, force_terminal=not jupyter)
163
-
164
- with console.pager(styles=True):
165
- console.print(generate_table())
166
-
167
- except (
168
- InvalidParameterException,
169
- PropertyServerException,
170
- UserNotAuthorizedException,
171
- ) as e:
172
- print_exception_response(e)
173
- assert e.related_http_code != "200", "Invalid parameters"
174
- finally:
175
- a_client.close_session()
176
-
177
-
178
- def main():
179
- parser = argparse.ArgumentParser()
180
- parser.add_argument("--server", help="Name of the server to display status for")
181
- parser.add_argument("--url", help="URL Platform to connect to")
182
- parser.add_argument("--userid", help="User Id")
183
- parser.add_argument("--password", help="Password")
184
-
185
- args = parser.parse_args()
186
-
187
- server = args.server if args.server is not None else EGERIA_VIEW_SERVER
188
- url = args.url if args.url is not None else EGERIA_PLATFORM_URL
189
- userid = args.userid if args.userid is not None else EGERIA_USER
190
- password = args.password if args.password is not None else EGERIA_USER_PASSWORD
191
- guid = None
192
-
193
- try:
194
- search_string = Prompt.ask(
195
- "Enter the technology you are searching for:", default="*"
196
- )
197
- # display_templates_spec(search_string, server, url, userid, password)
198
- list_templates(search_string, server, url, userid, password)
199
- except KeyboardInterrupt:
200
- pass
201
-
202
-
203
- if __name__ == "__main__":
204
- main()
File without changes
File without changes