pyegeria 0.5.8.20__tar.gz → 0.5.8.22__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 (78) hide show
  1. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/PKG-INFO +1 -1
  2. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/get_asset_graph.py +3 -5
  3. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/list_assets.py +17 -9
  4. {pyegeria-0.5.8.20/examples/widgets/personal_organizer → pyegeria-0.5.8.22/examples/widgets/catalog_user}/list_projects.py +18 -16
  5. {pyegeria-0.5.8.20/examples/widgets/personal_organizer → pyegeria-0.5.8.22/examples/widgets/catalog_user}/list_todos.py +6 -5
  6. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/cli/egeria_cat.py +46 -11
  7. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/cli/egeria_ops.py +19 -3
  8. pyegeria-0.5.8.22/examples/widgets/cli/egeria_tech.py +201 -0
  9. pyegeria-0.5.8.22/examples/widgets/operational/engine_actions.py +58 -0
  10. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/integration_daemon_actions.py +2 -2
  11. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/list_catalog_targets.py +12 -10
  12. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/load_archive.py +6 -4
  13. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/get_guid_info.py +20 -13
  14. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/get_tech_details.py +36 -31
  15. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/list_asset_types.py +8 -4
  16. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/list_registered_services.py +14 -7
  17. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/list_relationship_types.py +16 -10
  18. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/list_tech_templates.py +11 -6
  19. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/list_valid_metadata_values.py +12 -7
  20. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/asset_catalog_omvs.py +2 -2
  21. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyproject.toml +12 -11
  22. pyegeria-0.5.8.20/examples/widgets/operational/engine_actions.py +0 -91
  23. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/LICENSE +0 -0
  24. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/README.md +0 -0
  25. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  26. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  27. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/README.md +0 -0
  28. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/__init__.py +0 -0
  29. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/get_collection.py +0 -0
  30. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
  31. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
  32. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/list_glossary.py +0 -0
  33. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/catalog_user/list_tech_types.py +0 -0
  34. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/cli/__init__.py +0 -0
  35. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/cli/ops_config.py +0 -0
  36. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/README.md +0 -0
  37. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/__init__.py +0 -0
  38. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_asset_events.py +0 -0
  39. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_coco_status.py +0 -0
  40. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_engine_activity.py +0 -0
  41. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_gov_eng_status.py +0 -0
  42. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_integ_daemon_status.py +0 -0
  43. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_platform_status.py +0 -0
  44. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_server_list.py +0 -0
  45. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/monitor_server_status.py +0 -0
  46. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
  47. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/operational/restart_integration_daemon.py +0 -0
  48. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/personal_organizer/README.md +0 -0
  49. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/personal_organizer}/__init__.py +0 -0
  50. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/personal_organizer/list_my_profile.py +0 -0
  51. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/personal_organizer/monitor_my_todos.py +0 -0
  52. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/examples/widgets/personal_organizer/monitor_open_todos.py +0 -0
  53. {pyegeria-0.5.8.20/examples/widgets/developer → pyegeria-0.5.8.22/examples/widgets/tech}/README.md +0 -0
  54. {pyegeria-0.5.8.20/examples/widgets/personal_organizer → pyegeria-0.5.8.22/examples/widgets/tech}/__init__.py +0 -0
  55. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/Xfeedback_manager_omvs.py +0 -0
  56. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/Xloaded_resources_omvs.py +0 -0
  57. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/__init__.py +0 -0
  58. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/_client.py +0 -0
  59. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/_deprecated_gov_engine.py +0 -0
  60. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/_exceptions.py +0 -0
  61. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/_globals.py +0 -0
  62. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/_validators.py +0 -0
  63. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/action_author_omvs.py +0 -0
  64. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/automated_curation_omvs.py +0 -0
  65. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/collection_manager_omvs.py +0 -0
  66. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/core_omag_server_config.py +0 -0
  67. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/create_tech_guid_lists.py +0 -0
  68. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/full_omag_server_config.py +0 -0
  69. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/glossary_browser_omvs.py +0 -0
  70. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/glossary_manager_omvs.py +0 -0
  71. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/my_profile_omvs.py +0 -0
  72. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/platform_services.py +0 -0
  73. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/project_manager_omvs.py +0 -0
  74. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/registered_info.py +0 -0
  75. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/runtime_manager_omvs.py +0 -0
  76. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/server_operations.py +0 -0
  77. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/utils.py +0 -0
  78. {pyegeria-0.5.8.20 → pyegeria-0.5.8.22}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.5.8.20
3
+ Version: 0.5.8.22
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -14,6 +14,7 @@ from rich.markdown import Markdown
14
14
  from rich.panel import Panel
15
15
  from rich.prompt import Prompt
16
16
  from rich.tree import Tree
17
+ from rich import print
17
18
 
18
19
  from pyegeria import (
19
20
  InvalidParameterException,
@@ -38,11 +39,9 @@ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
38
39
 
39
40
  disable_ssl_warnings = True
40
41
 
41
- # console = Console(width=EGERIA_WIDTH, force_terminal=(not EGERIA_JUPYTER))
42
- console = Console()
43
-
44
42
  guid_list = []
45
43
 
44
+ console = Console(width=EGERIA_WIDTH, force_terminal=(not EGERIA_JUPYTER))
46
45
 
47
46
  def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str, user_pass: str,
48
47
  jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
@@ -225,10 +224,9 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
225
224
  relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white",
226
225
  title="Asset Relationships")
227
226
  tree.add(relationship_panel)
228
-
229
227
  with console.screen():
230
228
  print("\n\n")
231
- print(tree)
229
+ print(tree)
232
230
 
233
231
  except (
234
232
  InvalidParameterException,
@@ -10,12 +10,13 @@ A simple display for glossary terms
10
10
  """
11
11
  import argparse
12
12
  import os
13
+ import sys
13
14
  import time
14
15
 
15
16
  from rich import box
16
17
  from rich.console import Console
17
18
  from rich.prompt import Prompt
18
-
19
+ from rich.markdown import Markdown
19
20
  from rich.table import Table
20
21
 
21
22
  from pyegeria import (
@@ -41,14 +42,17 @@ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
41
42
 
42
43
  disable_ssl_warnings = True
43
44
 
45
+
44
46
  def display_assets(search_string: str, server: str, url: str, username: str, user_password: str, time_out: int = 60,
45
47
  jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
46
-
48
+ console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
49
+ if (search_string is None) or (len(search_string) < 4):
50
+ raise ValueError("Invalid Search String - must be greater than four characters long")
47
51
  g_client = AssetCatalog(server, url, username)
48
52
  token = g_client.create_egeria_bearer_token(username, user_password)
49
53
 
50
54
 
51
- def generate_table(search_string:str = 'Enter Your Tech Type') -> Table:
55
+ def generate_table(search_string:str = None) -> Table:
52
56
  """Make a new table."""
53
57
  table = Table(
54
58
  title=f"Assets containing the string {search_string} @ {time.asctime()}",
@@ -62,7 +66,7 @@ def display_assets(search_string: str, server: str, url: str, username: str, use
62
66
  caption=f"View Server '{server}' @ Platform - {url}",
63
67
  expand=True
64
68
  )
65
- table.add_column("Display Name")
69
+ table.add_column("Display Name", max_width=15)
66
70
  table.add_column("Type Name")
67
71
  table.add_column("GUID", no_wrap=True)
68
72
  table.add_column("Technology Type")
@@ -101,9 +105,9 @@ def display_assets(search_string: str, server: str, url: str, username: str, use
101
105
  match_props = match['properties']
102
106
  match_details_md = ""
103
107
  for key in match_props.keys():
104
- match_details_md += f"{key}: {match_props[key]}\n"
105
-
106
- match_tab.add_row(match_type_name, matching_guid, match_details_md)
108
+ match_details_md += f"* {key}: {match_props[key]}\n"
109
+ match_details_out = Markdown(match_details_md)
110
+ match_tab.add_row(match_type_name, matching_guid, match_details_out)
107
111
 
108
112
 
109
113
  table.add_row(
@@ -118,14 +122,18 @@ def display_assets(search_string: str, server: str, url: str, username: str, use
118
122
  # while True:
119
123
  # time.sleep(2)
120
124
  # live.update(generate_table())
121
- console = Console(width=width, force_terminal=not jupyter)
125
+
122
126
  with console.pager(styles=True):
123
- console.print(generate_table(search_string))
127
+ console.print(generate_table(search_string), soft_wrap=True)
124
128
 
125
129
 
126
130
  except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
127
131
  console.print_exception()
132
+ sys.exit(1)
128
133
 
134
+ except ValueError as e:
135
+ console.print(f"\n\n====> Invalid Search String - must be greater than four characters long")
136
+ sys.exit(1)
129
137
 
130
138
 
131
139
  def main():
@@ -9,9 +9,9 @@ Unit tests for the Utils helper functions using the Pytest framework.
9
9
 
10
10
  A simple display for glossary terms
11
11
  """
12
- import os
13
12
  import argparse
14
13
  import json
14
+ import os
15
15
  import time
16
16
 
17
17
  from rich import box
@@ -39,11 +39,13 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
39
39
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
40
40
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
41
41
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
42
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
43
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
42
44
 
43
45
 
44
- def display_list(project_name: str, server: str, url: str,
45
- username: str, user_pass: str, save_output: bool):
46
-
46
+ def display_project_list(project_name: str, server: str, url: str,
47
+ username: str, user_pass: str, save_output: bool, jupyter: bool = EGERIA_JUPYTER,
48
+ width: int = EGERIA_WIDTH):
47
49
  p_client = ProjectManager(server, url, user_id=username)
48
50
  token = p_client.create_egeria_bearer_token(username, user_pass)
49
51
 
@@ -58,9 +60,8 @@ def display_list(project_name: str, server: str, url: str,
58
60
  expand=True
59
61
  )
60
62
 
61
-
62
63
  table.add_column("Display Name")
63
- table.add_column("Project GUID", no_wrap=True,)
64
+ table.add_column("Project GUID", no_wrap=True, )
64
65
  table.add_column("Classifications")
65
66
  table.add_column("Qualified Name")
66
67
  table.add_column("Identifier")
@@ -79,7 +80,7 @@ def display_list(project_name: str, server: str, url: str,
79
80
  classification = " "
80
81
  qualified_name = " "
81
82
  identifier = " "
82
- phase= " "
83
+ phase = " "
83
84
  health = " "
84
85
  status = " "
85
86
  start = " "
@@ -92,25 +93,25 @@ def display_list(project_name: str, server: str, url: str,
92
93
  classification = ""
93
94
  guid = project['elementHeader']['guid']
94
95
  props = project["properties"]
95
- name = props.get("name","None")
96
+ name = props.get("name", "None")
96
97
  p_class = project['elementHeader'].get("classifications")
97
98
  if p_class:
98
99
  for classif in p_class:
99
- classification = f"{classif.get('classificationName')}, {classification}"
100
- qualified_name = props.get("qualifiedName"," ")
100
+ classification += f"{classif.get('classificationName')}"
101
+ qualified_name = props.get("qualifiedName", " ")
101
102
  identifier = props.get("identifier", " ")
102
103
  phase = props.get("projectPhase", " ")
103
104
  health = props.get("projectHealth", " ")
104
105
  status = props.get("projectStatus", " ")
105
106
  description = props.get("description", " ")
106
- start = props.get("startDate"," ")
107
+ start = props.get("startDate", " ")
107
108
  end = props.get("plannedEndDate", " ")
108
109
  additional_properties = project.get('additionalProperties')
109
110
  if additional_properties is not None:
110
111
  props = json.dumps(additional_properties)
111
112
  table.add_row(
112
113
  name, guid, classification, qualified_name, identifier, phase, health, status, start,
113
- end,description)
114
+ end, description)
114
115
 
115
116
  p_client.close_session()
116
117
  return table
@@ -120,9 +121,9 @@ def display_list(project_name: str, server: str, url: str,
120
121
  # while True:
121
122
  # time.sleep(2)
122
123
  # live.update(generate_table())
123
- console = Console(record=True)
124
+ console = Console(record=True,width=width, force_terminal=not jupyter, soft_wrap=True)
124
125
  with console.pager():
125
- console.print(generate_table(project_name))
126
+ console.print(generate_table(project_name), soft_wrap=True)
126
127
  if save_output:
127
128
  console.save_html("projects.html")
128
129
 
@@ -136,6 +137,7 @@ def display_list(project_name: str, server: str, url: str,
136
137
  finally:
137
138
  p_client.close_session()
138
139
 
140
+
139
141
  def main():
140
142
  parser = argparse.ArgumentParser()
141
143
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -154,11 +156,11 @@ def main():
154
156
  try:
155
157
  save_output = args.save_output if args.save_output is not None else False
156
158
  project_name = Prompt.ask("Enter the Project to retrieve:", default="*")
157
- display_list(project_name, server, url, userid, user_pass, save_output)
159
+ display_project_list(project_name, server, url, userid, user_pass, save_output)
158
160
 
159
161
  except KeyboardInterrupt:
160
162
  pass
161
163
 
162
164
 
163
165
  if __name__ == "__main__":
164
- main()
166
+ main()
@@ -37,9 +37,11 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
37
37
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
38
38
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
39
39
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
40
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
41
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
40
42
 
41
-
42
- def display_to_dos(search_string: str, guid:str, server: str, url: str, username: str, user_pass:str):
43
+ def display_to_dos(search_string: str, server: str, url: str, username: str, user_pass:str,
44
+ jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
43
45
 
44
46
  m_client = MyProfile(server, url, user_id=username)
45
47
  token = m_client.create_egeria_bearer_token(username, user_pass)
@@ -109,7 +111,7 @@ def display_to_dos(search_string: str, guid:str, server: str, url: str, username
109
111
  # while True:
110
112
  # time.sleep(2)
111
113
  # live.update(generate_table())
112
- console = Console(width = 200)
114
+ console = Console(width=width, force_terminal=not jupyter)
113
115
  with console.pager():
114
116
 
115
117
  console.print(generate_table(search_string))
@@ -136,10 +138,9 @@ def main():
136
138
  url = args.url if args.url is not None else EGERIA_PLATFORM_URL
137
139
  userid = args.userid if args.userid is not None else EGERIA_USER
138
140
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
139
- guid = None
140
141
  try:
141
142
  search_string = Prompt.ask("Enter the ToDo you are searching for:", default="*")
142
- display_to_dos(search_string, guid,server, url, userid, user_pass)
143
+ display_to_dos(search_string, server, url, userid, user_pass)
143
144
  except KeyboardInterrupt:
144
145
  pass
145
146
 
@@ -19,6 +19,9 @@ from examples.widgets.catalog_user.get_tech_type_template import template_viewer
19
19
  from examples.widgets.catalog_user.list_assets import display_assets
20
20
  from examples.widgets.catalog_user.list_glossary import display_glossary_terms
21
21
  from examples.widgets.catalog_user.list_tech_types import display_tech_types
22
+ from examples.widgets.catalog_user.list_projects import display_project_list
23
+ from examples.widgets.catalog_user.list_todos import display_to_dos
24
+
22
25
  # from pyegeria import ServerOps
23
26
  from examples.widgets.cli.ops_config import Config
24
27
 
@@ -37,7 +40,7 @@ from examples.widgets.cli.ops_config import Config
37
40
  # pass_config = click.make_pass_decorator(Config)
38
41
 
39
42
  # @tui
40
- @tui()
43
+ @tui('cli','cli','A textual command line interface')
41
44
  @click.version_option("0.0.1", prog_name="egeria_ops")
42
45
  @click.group()
43
46
  @click.option('--server', default='active-metadata-store', envvar='EGERIA_METADATA_STORE',
@@ -90,7 +93,7 @@ def show(ctx):
90
93
  pass
91
94
 
92
95
 
93
- @show.command('tech_types')
96
+ @show.command('tech-types')
94
97
  @click.option('--tech_type', default='*', help='Tech type to search for')
95
98
  @click.pass_context
96
99
  def show_tech_types(ctx, tech_type):
@@ -100,7 +103,7 @@ def show_tech_types(ctx, tech_type):
100
103
  c.userid, c.password)
101
104
 
102
105
 
103
- @show.command('tech_type_elements')
106
+ @show.command('tech-type-elements')
104
107
  @click.option('--tech_type', default='PostgreSQL Server', help='Specific tech type to get elements for')
105
108
  @click.pass_context
106
109
  def show_tech_type_elements(ctx, tech_type):
@@ -110,8 +113,8 @@ def show_tech_type_elements(ctx, tech_type):
110
113
  c.userid, c.password)
111
114
 
112
115
 
113
- @show.command('tech_type_templates')
114
- @click.option('--tech_type', default='PostgreSQL Server', help='Specific tech type to get elements for')
116
+ @show.command('tech-type-templates')
117
+ @click.option('--tech-type', default='PostgreSQL Server', help='Specific tech type to get elements for')
115
118
  @click.pass_context
116
119
  def show_tech_type_templates(ctx, tech_type):
117
120
  """List technology type templates"""
@@ -121,17 +124,22 @@ def show_tech_type_templates(ctx, tech_type):
121
124
 
122
125
 
123
126
  @show.command('assets')
124
- @click.option('--search_string', help='List assets similar to search string - minimum of 4 characters')
127
+ @click.argument('search-string')
125
128
  @click.pass_context
126
129
  def show_assets(ctx, search_string):
127
- """Find and display assets"""
130
+ """Find and display assets
131
+
132
+ Usage: show assets <search-string>
133
+
134
+ search-string must be greater than four characters.
135
+ """
128
136
  c = ctx.obj
129
137
  display_assets(search_string, c.view_server, c.view_server_url, c.userid,
130
138
  c.password, 60,c.jupyter, c.width)
131
139
 
132
140
 
133
- @show.command('glossary_terms')
134
- @click.option('--search_string', default='*',
141
+ @show.command('glossary-terms')
142
+ @click.option('--search-string', default='*',
135
143
  help='List glossary terms similar to search string - minimum of 4 characters')
136
144
  @click.option('--glossary_guid', default=None, help='Optionally restrict search to glossary with the specified guid')
137
145
  @click.pass_context
@@ -142,11 +150,17 @@ def show_terms(ctx, search_string, glossary_guid):
142
150
  c.password, c.jupyter, c.width)
143
151
 
144
152
 
145
- @show.command('asset_graph')
153
+ @show.command('asset-graph')
146
154
  @click.argument('asset_guid', nargs=1)
147
155
  @click.pass_context
148
156
  def show_asset_graph(ctx, asset_guid):
149
- """Display a tree graph of information about an asset """
157
+ """Display a tree graph of information about an asset
158
+
159
+ Usage: show asset-graph <asset-guid>
160
+
161
+ asset-guid must be a valid asset guid. These can be found through other commands such as 'show tech-type-elements'
162
+
163
+ """
150
164
  c = ctx.obj
151
165
  asset_viewer(asset_guid, c.view_server, c.view_server_url, c.userid,
152
166
  c.password, c.jupyter, c.width)
@@ -163,6 +177,27 @@ def show_asset_graph(ctx, root_collection):
163
177
  c.password, c.jupyter, c.width)
164
178
 
165
179
 
180
+ @show.command('projects')
181
+ @click.option('--search-string', default='*',
182
+ help='List Projects by Search String')
183
+ @click.pass_context
184
+ def show_projects(ctx, search_string):
185
+ """Display a list of Egeria projects """
186
+ c = ctx.obj
187
+ display_project_list(search_string, c.view_server, c.view_server_url, c.userid,
188
+ c.password, False,c.jupyter, c.width)
189
+
190
+
191
+ @show.command('to-dos')
192
+ @click.option('--search-string', default='*',
193
+ help='View the list of To-Do items')
194
+ @click.pass_context
195
+ def show_todos(ctx, search_string):
196
+ """Display a tree graph of information about an asset """
197
+ c = ctx.obj
198
+ display_to_dos(search_string, c.view_server, c.view_server_url, c.userid,
199
+ c.password, c.jupyter, c.width)
200
+
166
201
  #
167
202
  # Tell
168
203
  #
@@ -14,9 +14,12 @@ from trogon import tui
14
14
 
15
15
  # from pyegeria import ServerOps
16
16
  from examples.widgets.cli.ops_config import Config
17
+ from examples.widgets.operational.engine_actions import start_server as start_engine_host, \
18
+ stop_server as stop_engine_host
17
19
  from examples.widgets.operational.integration_daemon_actions import (add_catalog_target, remove_catalog_target,
18
20
  update_catalog_target, stop_server, start_server)
19
21
  from examples.widgets.operational.list_catalog_targets import display_catalog_targets
22
+ from examples.widgets.operational.load_archive import load_archive
20
23
  from examples.widgets.operational.monitor_engine_activity import display_engine_activity
21
24
  from examples.widgets.operational.monitor_gov_eng_status import display_gov_eng_status
22
25
  from examples.widgets.operational.monitor_integ_daemon_status import display_integration_daemon_status
@@ -41,7 +44,7 @@ from examples.widgets.operational.restart_integration_daemon import restart_conn
41
44
  # pass_config = click.make_pass_decorator(Config)
42
45
 
43
46
  # @tui
44
- @tui()
47
+ @tui('cli', 'cli', 'A textual command line interface')
45
48
  @click.version_option("0.0.1", prog_name="egeria_ops")
46
49
  @click.group()
47
50
  @click.option('--server', default='active-metadata-store', envvar='EGERIA_METADATA_STORE',
@@ -144,7 +147,7 @@ def gov_eng_status(ctx, list):
144
147
  """Display engine-host status information"""
145
148
  c = ctx.obj
146
149
  display_gov_eng_status(c.engine_host, c.engine_host_url,
147
- c.admin_user, c.admin_user_password,
150
+ c.userid, c.password,
148
151
  list, c.jupyter, c.width)
149
152
 
150
153
 
@@ -198,7 +201,7 @@ def tell(ctx):
198
201
  pass
199
202
 
200
203
 
201
- @tell.group('integration_daemon')
204
+ @tell.group('integration-daemon')
202
205
  @click.pass_context
203
206
  def integration_daemon(ctx):
204
207
  """Group of commands to an integration-daemon"""
@@ -231,5 +234,18 @@ integration_daemon.add_command(update_catalog_target)
231
234
  integration_daemon.add_command(stop_server)
232
235
  integration_daemon.add_command(start_server)
233
236
 
237
+
238
+ @tell.group('engine-host')
239
+ @click.pass_context
240
+ def engine_host(ctx):
241
+ """Group of commands to an engine-host"""
242
+ pass
243
+
244
+
245
+ engine_host.add_command(start_engine_host)
246
+ engine_host.add_command(stop_engine_host)
247
+
248
+ tell.add_command(load_archive)
249
+
234
250
  if __name__ == '__main__':
235
251
  cli()
@@ -0,0 +1,201 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+
7
+ A command line interface for Egeria Data techs.
8
+
9
+ This is an emerging capability based on the **click** package. Feedback welcome!
10
+
11
+ """
12
+ import click
13
+ from trogon import tui
14
+
15
+ from examples.widgets.catalog_user.list_tech_types import display_tech_types
16
+ from examples.widgets.cli.ops_config import Config
17
+ from examples.widgets.tech.get_guid_info import display_guid
18
+ from examples.widgets.tech.get_tech_details import tech_details_viewer
19
+ from examples.widgets.tech.list_asset_types import display_asset_types
20
+ from examples.widgets.tech.list_registered_services import display_registered_svcs
21
+ from examples.widgets.tech.list_relationship_types import display_relationship_types
22
+ from examples.widgets.tech.list_tech_templates import display_tech_templates
23
+ from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
24
+
25
+
26
+ # from pyegeria import ServerOps
27
+
28
+
29
+ # class Config(object):
30
+ # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
31
+ # timeout:int = 30, paging: bool = False):
32
+ # self.server = server
33
+ # self.url = url
34
+ # self.userid = userid
35
+ # self.password = password
36
+ # self.timeout = timeout
37
+ # self.paging = paging
38
+ #
39
+ #
40
+ # pass_config = click.make_pass_decorator(Config)
41
+
42
+ # @tui
43
+ @tui('cli', 'cli', 'A textual command line interface')
44
+ @click.version_option("0.0.1", prog_name="egeria_ops")
45
+ @click.group()
46
+ @click.option('--server', default='active-metadata-store', envvar='EGERIA_METADATA_STORE',
47
+ help='Egeria metadata store to work with')
48
+ @click.option('--url', default='https://localhost:9443', envvar='EGERIA_PLATFORM_URL',
49
+ help='URL of Egeria metadata store platform to connect to')
50
+ @click.option('--integration-daemon', default='integration-daemon', envvar='EGERIA_INTEGRATION_DAEMON',
51
+ help='Egeria integration daemon to work with')
52
+ @click.option('--integration_daemon_url', default='https://localhost:9443', envvar='EGERIA_INTEGRATION_DAEMON_URL',
53
+ help='URL of Egeria integration daemon platform to connect to')
54
+ @click.option('--view_server', default='view-server', envvar='EGERIA_VIEW_SERVER',
55
+ help='Egeria view server to work with')
56
+ @click.option('--view_server_url', default='https://localhost:9443', envvar='EGERIA_VIEW_SERVER_URL',
57
+ help='URL of Egeria view server platform to connect to')
58
+ @click.option('--engine_host', default='engine-host', envvar='EGERIA_ENGINE_HOST',
59
+ help='Egeria engine host to work with')
60
+ @click.option('--engine_host_url', default='https://localhost:9443', envvar='EGERIA_ENGINE_HOST_URL',
61
+ help='URL of Egeria engine host platform to connect to')
62
+ @click.option('--admin_user', default='garygeeke', envvar='EGERIA_ADMIN_USER', help='Egeria admin user')
63
+ @click.option('--admin_user_password', default='secret', envvar='EGERIA_ADMIN_PASSWORD',
64
+ help='Egeria admin password')
65
+ @click.option('--userid', default='garygeeke', envvar='EGERIA_USER', help='Egeria user')
66
+ @click.option('--password', default='secret', envvar='EGERIA_PASSWORD',
67
+ help='Egeria user password')
68
+ @click.option('--timeout', default=60, help='Number of seconds to wait')
69
+ @click.option('--verbose', is_flag=True, default=False, help='Enable verbose mode')
70
+ @click.option('--paging', is_flag=True, default=False, help='Enable paging snapshots vs live updates')
71
+ @click.option('--jupyter', is_flag=True, default=False, envvar='EGERIA_JUPYTER',
72
+ help='Enable for rendering in a Jupyter terminal')
73
+ @click.option('--width', default=200, envvar='EGERIA_WIDTH', help='Screen width, in characters, to use')
74
+ @click.pass_context
75
+ def cli(ctx, server, url, view_server, view_server_url, integration_daemon, integration_daemon_url,
76
+ engine_host, engine_host_url, admin_user, admin_user_password, userid, password, timeout, paging,
77
+ verbose, jupyter, width):
78
+ """An Egeria Command Line interface for Operations """
79
+ ctx.obj = Config(server, url, view_server, view_server_url, integration_daemon,
80
+ integration_daemon_url, engine_host, engine_host_url,
81
+ admin_user, admin_user_password, userid, password,
82
+ timeout, paging, verbose, jupyter, width)
83
+ ctx.max_content_width = 200
84
+ ctx.ensure_object(Config)
85
+ if verbose:
86
+ click.echo(f"we are in verbose mode - server is {server}")
87
+
88
+
89
+ @cli.group("show")
90
+ @click.pass_context
91
+ def show(ctx):
92
+ """Display an Egeria Object"""
93
+ pass
94
+
95
+
96
+ @show.command('guid-info')
97
+ @click.argument('guid', nargs=1)
98
+ @click.pass_context
99
+ def show_guid_infos(ctx, guid):
100
+ """Display a live status view of known platforms
101
+
102
+ Usage: show guid-info <a guid>
103
+
104
+ """
105
+ c = ctx.obj
106
+ display_guid(guid, c.server, c.url,
107
+ c.user_id, c.password, c.jupyter, c.width)
108
+
109
+
110
+ @show.command('tech-types')
111
+ @click.option('--tech_type', default='*', help='Tech type to search for')
112
+ @click.pass_context
113
+ def show_tech_types(ctx, tech_type):
114
+ """List deployed technology types"""
115
+ c = ctx.obj
116
+ display_tech_types(tech_type, c.view_server, c.view_server_url,
117
+ c.userid, c.password)
118
+
119
+
120
+ @show.command('tech-details')
121
+ @click.argument('tech-name')
122
+ @click.pass_context
123
+ def show_tech_details(ctx, tech_name):
124
+ """Display a live status view of Egeria servers for the specified Egeria platform
125
+
126
+ Usage: show tech-details <tech-name>
127
+
128
+ tech-name is a valid technology name (see 'show tech-types')
129
+ """
130
+ c = ctx.obj
131
+ tech_details_viewer(tech_name, c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width)
132
+
133
+
134
+ @show.command("asset-types")
135
+ @click.pass_context
136
+ def show_asset_types(ctx):
137
+ """Display engine-host status information"""
138
+ c = ctx.obj
139
+ display_asset_types(c.view_server, c.view_server_url,
140
+ c.userid, c.password,
141
+ c.jupyter, c.width)
142
+
143
+
144
+ @show.command('registered-services')
145
+ @click.option('--services',
146
+ type=click.Choice(['all', 'access-services', 'common-services', 'engine-services',
147
+ 'governance-services', 'integration-services', 'view-services'],
148
+ case_sensitive=False), default='all', help='Which service group to display')
149
+ @click.pass_context
150
+ def show_registered_services(ctx, services):
151
+ """Show information about a registered servicese"""
152
+ c = ctx.obj
153
+ display_registered_svcs(services, c.view_server, c.view_server_url,
154
+ c.userid, c.password, c.jupyter, c.width)
155
+
156
+
157
+ @show.command('relationship-types')
158
+ @click.option('--rel-type', default='AssetOwner', help='Relationship type to get information about')
159
+ @click.pass_context
160
+ def show_relationship_types(ctx, rel_type):
161
+ """Show information about the specified relationship type"""
162
+ c = ctx.obj
163
+ display_relationship_types(rel_type, c.view_server, c.view_server_url,
164
+
165
+ c.userid, c.password, False, c.jupyter, c.width)
166
+
167
+
168
+ @show.command("tech-templates")
169
+ @click.pass_context
170
+ @click.option('--search-string', default='*', help='Technology type to get information about')
171
+ def integrations_status(ctx, search_string):
172
+ """Display template information about the specified technologyr"""
173
+ c = ctx.obj
174
+ display_tech_templates(search_string, c.view_server, c.view_server_url,
175
+ c.userid, c.password, c.jupyter, c.width)
176
+
177
+
178
+ @show.command("valid-metadata-values")
179
+ @click.pass_context
180
+ @click.option('--property', default='projectHealth', help='Metadata property to query')
181
+ @click.option('--type-name', default='Project', help='Metadata type to query')
182
+ def integrations_status(ctx, property, type_name):
183
+ """Display the valid metadata values for a property and type"""
184
+ c = ctx.obj
185
+ display_metadata_values(property, type_name, c.view_server, c.view_server_url,
186
+ c.userid, c.password, False, c.jupyter, c.width)
187
+
188
+
189
+ #
190
+ # Tell
191
+ #
192
+
193
+ @cli.group('tell')
194
+ @click.pass_context
195
+ def tell(ctx):
196
+ """Perform actions an Egeria Objects"""
197
+ pass
198
+
199
+
200
+ if __name__ == '__main__':
201
+ cli()