pyegeria 1.5.1.1.41__tar.gz → 1.5.1.1.42__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.41 → pyegeria-1.5.1.1.42}/PKG-INFO +1 -1
  2. pyegeria-1.5.1.1.42/pyegeria/commands/tech/table_tech_templates.py +236 -0
  3. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyproject.toml +1 -1
  4. pyegeria-1.5.1.1.41/pyegeria/commands/tech/table_tech_templates.py +0 -173
  5. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/LICENSE +0 -0
  6. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/README.md +0 -0
  7. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/README.md +0 -0
  8. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/__init__.py +0 -0
  9. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/_client.py +0 -0
  10. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/_deprecated_gov_engine.py +0 -0
  11. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/_exceptions.py +0 -0
  12. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/_globals.py +0 -0
  13. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/_validators.py +0 -0
  14. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/asset_catalog_omvs.py +0 -0
  15. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/automated_curation_omvs.py +0 -0
  16. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/classification_manager_omvs.py +0 -0
  17. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/collection_manager_omvs.py +0 -0
  18. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/README.md +0 -0
  19. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/__init__.py +0 -0
  20. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/README.md +0 -0
  21. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/__init__.py +0 -0
  22. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/get_asset_graph.py +0 -0
  23. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/get_collection.py +0 -0
  24. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/get_project_dependencies.py +0 -0
  25. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/get_project_structure.py +0 -0
  26. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/get_tech_type_elements.py +0 -0
  27. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/get_tech_type_template.py +0 -0
  28. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/glossary_actions.py +0 -0
  29. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_archives.py +0 -0
  30. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_assets.py +0 -0
  31. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_cert_types.py +0 -0
  32. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_deployed_catalogs.py +0 -0
  33. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_deployed_database_schemas.py +0 -0
  34. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_deployed_databases.py +0 -0
  35. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_glossaries.py +0 -0
  36. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_projects.py +0 -0
  37. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_relationships.py +0 -0
  38. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_servers_deployed_imp.py +0 -0
  39. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_tech_types.py +0 -0
  40. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_terms.py +0 -0
  41. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_todos.py +0 -0
  42. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cat/list_user_ids.py +0 -0
  43. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/__init__.py +0 -0
  44. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/egeria.py +0 -0
  45. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/egeria_cat.py +0 -0
  46. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/egeria_my.py +0 -0
  47. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/egeria_ops.py +0 -0
  48. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/egeria_tech.py +0 -0
  49. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/cli/ops_config.py +0 -0
  50. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/README.md +0 -0
  51. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/__init__.py +0 -0
  52. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/list_my_profile.py +0 -0
  53. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/list_my_roles.py +0 -0
  54. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/monitor_my_todos.py +0 -0
  55. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/monitor_open_todos.py +0 -0
  56. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/my/todo_actions.py +0 -0
  57. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/README.md +0 -0
  58. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/__init__.py +0 -0
  59. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/gov_server_actions.py +0 -0
  60. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/list_catalog_targets.py +0 -0
  61. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/load_archive.py +0 -0
  62. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_asset_events.py +0 -0
  63. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_engine_activity.py +0 -0
  64. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_engine_activity_c.py +0 -0
  65. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_gov_eng_status.py +0 -0
  66. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_integ_daemon_status.py +0 -0
  67. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_platform_status.py +0 -0
  68. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_server_startup.py +0 -0
  69. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/monitor_server_status.py +0 -0
  70. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/orig_monitor_server_list.py +0 -0
  71. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/orig_monitor_server_status.py +0 -0
  72. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/refresh_integration_daemon.py +0 -0
  73. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/restart_integration_daemon.py +0 -0
  74. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/table_integ_daemon_status.py +0 -0
  75. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/ops/x_engine_actions.py +0 -0
  76. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/README.md +0 -0
  77. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/__init__.py +0 -0
  78. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/get_element_graph.py +0 -0
  79. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/get_element_info.py +0 -0
  80. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/get_guid_info.py +0 -0
  81. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/get_tech_details.py +0 -0
  82. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_asset_types.py +0 -0
  83. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_elements.py +0 -0
  84. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_elements_for_classification.py +0 -0
  85. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_elements_x.py +0 -0
  86. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_gov_action_processes.py +0 -0
  87. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_registered_services.py +0 -0
  88. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_related_elements.py +0 -0
  89. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_related_specification.py +0 -0
  90. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_relationship_types.py +0 -0
  91. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_tech_templates.py +0 -0
  92. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/list_valid_metadata_values.py +0 -0
  93. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/commands/tech/x_list_related_elements.py +0 -0
  94. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/core_omag_server_config.py +0 -0
  95. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/create_tech_guid_lists.py +0 -0
  96. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/egeria_cat_client.py +0 -0
  97. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/egeria_client.py +0 -0
  98. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/egeria_config_client.py +0 -0
  99. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/egeria_my_client.py +0 -0
  100. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/egeria_tech_client.py +0 -0
  101. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/feedback_manager_omvs.py +0 -0
  102. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/full_omag_server_config.py +0 -0
  103. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/glossary_browser_omvs.py +0 -0
  104. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/glossary_manager_omvs.py +0 -0
  105. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/mermaid_utilities.py +0 -0
  106. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/my_profile_omvs.py +0 -0
  107. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/platform_services.py +0 -0
  108. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/project_manager_omvs.py +0 -0
  109. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/registered_info.py +0 -0
  110. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/runtime_manager_omvs.py +0 -0
  111. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/server_operations.py +0 -0
  112. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/template_manager_omvs.py +0 -0
  113. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/utils.py +0 -0
  114. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/pyegeria/valid_metadata_omvs.py +0 -0
  115. {pyegeria-1.5.1.1.41 → pyegeria-1.5.1.1.42}/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.41
3
+ Version: 1.5.1.1.42
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -0,0 +1,236 @@
1
+ """This creates a templates guid file from the core metadata archive"""
2
+ from rich.markdown import Markdown
3
+ from rich.prompt import Prompt
4
+ import os
5
+ from pyegeria import AutomatedCuration, _client
6
+ from datetime import datetime
7
+ import argparse
8
+ import time
9
+ import sys
10
+ from rich import box
11
+ from rich.console import Console
12
+ from rich.table import Table
13
+ import asyncio
14
+ import nest_asyncio
15
+ from typing import Union
16
+
17
+ from pyegeria import (
18
+ InvalidParameterException,
19
+ PropertyServerException,
20
+ UserNotAuthorizedException,
21
+ print_exception_response,
22
+ RegisteredInfo,
23
+ )
24
+ from textual.widgets import DataTable
25
+
26
+ console = Console()
27
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
28
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
29
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
30
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
31
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
32
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
33
+ )
34
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
35
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
36
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
37
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
38
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
39
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
40
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
41
+
42
+ # def add_row(table: Union[Table,DataTable], name: str, template_name:str, template_guid: str,
43
+ # placeholder_table: Table) -> Table | DataTable:
44
+ # if isinstance(table, Table):
45
+ # table.add_row(name, template_name, template_guid, placeholder_table)
46
+ # elif isinstance(table, DataTable):
47
+ # table.add_row(name, template_name, template_guid, placeholder_table)
48
+ #
49
+ # return table
50
+
51
+
52
+ def add_row(
53
+ table: Union[Table, DataTable],
54
+ name: str,
55
+ template_name: str,
56
+ template_guid: str,
57
+ placeholder_table: Table,
58
+ ) -> Table | DataTable:
59
+ if placeholder_table:
60
+ table.add_row(name, template_name, template_guid, placeholder_table)
61
+ else:
62
+ table.add_row(name, template_name, template_guid)
63
+ return table
64
+
65
+
66
+ def display_templates_spec(
67
+ search_string: str,
68
+ server: str,
69
+ url: str,
70
+ username: str,
71
+ password: str,
72
+ jupyter: bool = EGERIA_JUPYTER,
73
+ width: int = EGERIA_WIDTH,
74
+ data_table: bool = False,
75
+ placeholders: bool = False,
76
+ ) -> Table | DataTable:
77
+ a_client = AutomatedCuration(server, url, username)
78
+ nest_asyncio.apply()
79
+ token = a_client.create_egeria_bearer_token(username, password)
80
+ tech_list = a_client.find_technology_types(search_string, page_size=0)
81
+
82
+ def generate_table(data_table: bool) -> Table | DataTable:
83
+ """Make a new table."""
84
+ if data_table:
85
+ table = DataTable()
86
+ table.add_columns("Name", "Template Name", "Template GUID", "Placeholders")
87
+ else:
88
+ table = Table(
89
+ title=f"Technology Templates for: {url} @ {time.asctime()}",
90
+ style="bold bright_white on black",
91
+ row_styles=["bold bright_white on black"],
92
+ header_style="white on dark_blue",
93
+ title_style="bold bright_white on black",
94
+ caption_style="white on black",
95
+ show_lines=True,
96
+ box=box.ROUNDED,
97
+ caption=f"Templates from Server '{server}' @ Platform - {url}",
98
+ expand=True,
99
+ # width=500
100
+ )
101
+
102
+ table.add_column("Name", width=20)
103
+ table.add_column("Template Name", width=20)
104
+ table.add_column("Template GUID", width=38, no_wrap=True)
105
+ if placeholders:
106
+ table.add_column("Placeholders")
107
+
108
+ if type(tech_list) is list:
109
+ for item in tech_list:
110
+ if "deployedImplementationType" not in item["qualifiedName"]:
111
+ continue
112
+ # if placeholders:
113
+ # placeholder_table = Table(expand=False, show_lines=True)
114
+ # placeholder_table.add_column("Name", width = 20,no_wrap=True)
115
+ # placeholder_table.add_column("Type", width = 10)
116
+ # placeholder_table.add_column("Required", width = 10)
117
+ # placeholder_table.add_column("Example", width = 20)
118
+ # placeholder_table.add_column("Description", width = 40)
119
+
120
+ name = item.get("name", "none")
121
+
122
+ details = a_client.get_technology_type_detail(name)
123
+ if type(details) is str:
124
+ console.log(f"Missing details for - {name}: {details}")
125
+ continue
126
+
127
+ templates = details.get("catalogTemplates", "Not Found")
128
+ if type(templates) is not str:
129
+ for template in templates:
130
+ template_name = template.get("name", None)
131
+
132
+ template_name = (
133
+ f"{name}_Template"
134
+ if template_name is None
135
+ else template_name
136
+ )
137
+
138
+ specification = template["specification"]["placeholderProperty"]
139
+ template_guid = template["relatedElement"]["guid"]
140
+ if placeholders:
141
+ placeholder_table = Table(expand=False, show_lines=True)
142
+ placeholder_table.add_column("Name", width=20, no_wrap=True)
143
+ placeholder_table.add_column("Type", width=10)
144
+ placeholder_table.add_column("Required", width=10)
145
+ placeholder_table.add_column("Example", width=20)
146
+ placeholder_table.add_column("Description", width=40)
147
+
148
+ for placeholder in specification:
149
+ placeholder_data_type = placeholder["dataType"]
150
+ placeholder_description = placeholder["description"]
151
+ placeholder_name = placeholder[
152
+ "placeholderPropertyName"
153
+ ]
154
+ placeholder_required = placeholder["required"]
155
+ placeholder_example = placeholder.get("example", None)
156
+ placeholder_table.add_row(
157
+ placeholder_name,
158
+ placeholder_data_type,
159
+ placeholder_required,
160
+ placeholder_example,
161
+ placeholder_description,
162
+ )
163
+ table = add_row(
164
+ table,
165
+ name,
166
+ template_name,
167
+ template_guid,
168
+ placeholder_table,
169
+ )
170
+ else:
171
+ table = add_row(
172
+ table, name, template_name, template_guid, None
173
+ )
174
+
175
+ # table.add_row(name, template_name, template_guid, placeholder_table)
176
+ # table = add_row(table, name, template_name, template_guid, placeholder_table)
177
+
178
+ return table
179
+ else:
180
+ print("Unknown technology type")
181
+ sys.exit(1)
182
+
183
+ try:
184
+ if data_table:
185
+ return generate_table(data_table)
186
+ else:
187
+ console = Console(width=width, force_terminal=not jupyter)
188
+
189
+ with console.pager(styles=True):
190
+ console.print(generate_table(data_table))
191
+
192
+ except (
193
+ InvalidParameterException,
194
+ PropertyServerException,
195
+ UserNotAuthorizedException,
196
+ ) as e:
197
+ print_exception_response(e)
198
+ assert e.related_http_code != "200", "Invalid parameters"
199
+ finally:
200
+ a_client.close_session()
201
+
202
+
203
+ def main():
204
+ parser = argparse.ArgumentParser()
205
+ parser.add_argument("--server", help="Name of the server to display status for")
206
+ parser.add_argument("--url", help="URL Platform to connect to")
207
+ parser.add_argument("--userid", help="User Id")
208
+ parser.add_argument("--password", help="Password")
209
+
210
+ args = parser.parse_args()
211
+
212
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
213
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
214
+ userid = args.userid if args.userid is not None else EGERIA_USER
215
+ password = args.password if args.password is not None else EGERIA_USER_PASSWORD
216
+ guid = None
217
+
218
+ try:
219
+ search_string = Prompt.ask(
220
+ "Enter the technology you are searching for:", default="*"
221
+ )
222
+ display_templates_spec(
223
+ search_string,
224
+ server,
225
+ url,
226
+ userid,
227
+ password,
228
+ data_table=False,
229
+ placeholders=True,
230
+ )
231
+ except KeyboardInterrupt:
232
+ pass
233
+
234
+
235
+ if __name__ == "__main__":
236
+ main()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "1.5.1.1.41"
3
+ version = "1.5.1.1.42"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
@@ -1,173 +0,0 @@
1
- """This creates a templates guid file from the core metadata archive"""
2
- from rich.markdown import Markdown
3
- from rich.prompt import Prompt
4
- import os
5
- from pyegeria import AutomatedCuration, _client
6
- from datetime import datetime
7
- import argparse
8
- import time
9
- import sys
10
- from rich import box
11
- from rich.console import Console
12
- from rich.table import Table
13
- import asyncio
14
- import nest_asyncio
15
- from typing import Union
16
-
17
- from pyegeria import (
18
- InvalidParameterException,
19
- PropertyServerException,
20
- UserNotAuthorizedException,
21
- print_exception_response,
22
- RegisteredInfo
23
- )
24
- from textual.widgets import DataTable
25
-
26
- console = Console()
27
- EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
28
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
29
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
30
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
31
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
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
- def add_row(table: Union[Table,DataTable], name: str, template_name:str, template_guid: str,
41
- placeholder_table: Table) -> Table | DataTable:
42
- if isinstance(table, Table):
43
- table.add_row(name, template_name, template_guid, placeholder_table)
44
- elif isinstance(table, DataTable):
45
- table.add_row(name, template_name, template_guid, placeholder_table)
46
-
47
- return table
48
-
49
- def display_templates_spec(search_string:str, server: str,
50
- url: str, username: str, password: str, jupyter:bool=EGERIA_JUPYTER,
51
- width:int = EGERIA_WIDTH, data_table: bool = False
52
- )-> Table | DataTable:
53
-
54
- a_client = AutomatedCuration(server, url, username)
55
- nest_asyncio.apply()
56
- token = a_client.create_egeria_bearer_token(username, password)
57
- tech_list = a_client.find_technology_types(search_string, page_size=0)
58
-
59
- def generate_table(data_table: bool) -> Table | DataTable:
60
- """Make a new table."""
61
- if data_table:
62
- table = DataTable()
63
- table.add_columns("Name", "Template Name", "Template GUID", "Placeholders")
64
- else:
65
- table = Table(
66
- title=f"Technology Templates for: {url} @ {time.asctime()}",
67
- style="bold bright_white on black",
68
- row_styles=["bold bright_white on black"],
69
- header_style="white on dark_blue",
70
- title_style="bold bright_white on black",
71
- caption_style="white on black",
72
- show_lines=True,
73
- box=box.ROUNDED,
74
- caption=f"Templates from Server '{server}' @ Platform - {url}",
75
- expand=True,
76
- # width=500
77
- )
78
-
79
- table.add_column("Name", width=20)
80
- table.add_column("Template Name", width=20)
81
- table.add_column("Template GUID", width = 38,no_wrap=True)
82
- table.add_column("Placeholders")
83
-
84
-
85
- if type(tech_list) is list:
86
- for item in tech_list:
87
- if 'deployedImplementationType' not in item['qualifiedName']:
88
- continue
89
- placeholder_table = Table(expand=False, show_lines=True)
90
- placeholder_table.add_column("Name", width = 20,no_wrap=True)
91
- placeholder_table.add_column("Type", width = 10)
92
- placeholder_table.add_column("Required", width = 10)
93
- placeholder_table.add_column("Example", width = 20)
94
- placeholder_table.add_column("Description", width = 40)
95
-
96
-
97
- name = item.get("name", "none")
98
-
99
- details = a_client.get_technology_type_detail(name)
100
- if type(details) is str:
101
- console.log(f"Missing details for - {name}: {details}")
102
- continue
103
-
104
- templates = details.get("catalogTemplates", "Not Found")
105
- if type(templates) is not str:
106
- for template in templates:
107
- template_name = template.get("name", None)
108
-
109
- template_name = f"{name}_Template" if template_name is None else template_name
110
-
111
- specification = template["specification"]["placeholderProperty"]
112
- template_guid = template["relatedElement"]["guid"]
113
-
114
- for placeholder in specification:
115
- placeholder_data_type = placeholder["dataType"]
116
- placeholder_description = placeholder["description"]
117
- placeholder_name = placeholder["placeholderPropertyName"]
118
- placeholder_required = placeholder["required"]
119
- placeholder_example = placeholder.get("example", None)
120
- placeholder_table.add_row(placeholder_name, placeholder_data_type, placeholder_required,
121
- placeholder_example, placeholder_description,)
122
-
123
- # table.add_row(name, template_name, template_guid, placeholder_table)
124
- table = add_row(table, name, template_name, template_guid, placeholder_table)
125
-
126
- return table
127
- else:
128
- print("Unknown technology type")
129
- sys.exit(1)
130
-
131
- try:
132
- if data_table:
133
- return generate_table(data_table)
134
- else:
135
- console = Console(width=width, force_terminal=not jupyter)
136
-
137
- with console.pager(styles=True):
138
- console.print(generate_table(data_table))
139
-
140
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
141
- print_exception_response(e)
142
- assert e.related_http_code != "200", "Invalid parameters"
143
- finally:
144
- a_client.close_session()
145
-
146
-
147
- def main():
148
- parser = argparse.ArgumentParser()
149
- parser.add_argument("--server", help="Name of the server to display status for")
150
- parser.add_argument("--url", help="URL Platform to connect to")
151
- parser.add_argument("--userid", help="User Id")
152
- parser.add_argument("--password", help="Password")
153
-
154
- args = parser.parse_args()
155
-
156
- server = args.server if args.server is not None else EGERIA_VIEW_SERVER
157
- url = args.url if args.url is not None else EGERIA_PLATFORM_URL
158
- userid = args.userid if args.userid is not None else EGERIA_USER
159
- password = args.password if args.password is not None else EGERIA_USER_PASSWORD
160
- guid = None
161
-
162
- try:
163
- search_string = Prompt.ask("Enter the technology you are searching for:", default="*")
164
- display_templates_spec(search_string, server, url, userid, password,data_table=False)
165
- except(KeyboardInterrupt):
166
- pass
167
-
168
-
169
- if __name__ == "__main__":
170
- main()
171
-
172
-
173
-
File without changes
File without changes