pyegeria 0.7.45__tar.gz → 0.8.0__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 (113) hide show
  1. {pyegeria-0.7.45 → pyegeria-0.8.0}/PKG-INFO +1 -1
  2. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_cert_types.py +61 -43
  3. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_projects.py +1 -1
  4. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cli/egeria.py +18 -2
  5. pyegeria-0.8.0/examples/widgets/cli/egeria_tech.py +454 -0
  6. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/my_profile_actions.py +51 -32
  7. pyegeria-0.8.0/examples/widgets/ops/engine_actions.py +83 -0
  8. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/integration_daemon_actions.py +51 -32
  9. pyegeria-0.8.0/examples/widgets/tech/get_element_info.py +144 -0
  10. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/get_guid_info.py +50 -27
  11. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_asset_types.py +33 -23
  12. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_elements.py +44 -34
  13. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_elements_x.py +69 -49
  14. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_registered_services.py +44 -24
  15. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_related_specification.py +70 -45
  16. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_relationship_types.py +50 -31
  17. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_valid_metadata_values.py +57 -28
  18. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/x_list_related_elements.py +54 -34
  19. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/Xloaded_resources_omvs.py +43 -41
  20. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/__init__.py +5 -1
  21. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/_client.py +142 -102
  22. pyegeria-0.8.0/pyegeria/_deprecated_gov_engine.py +451 -0
  23. pyegeria-0.8.0/pyegeria/action_author_omvs.py +205 -0
  24. pyegeria-0.8.0/pyegeria/asset_catalog_omvs.py +739 -0
  25. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/automated_curation_omvs.py +2 -2
  26. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/classification_manager_omvs.py +1920 -868
  27. pyegeria-0.8.0/pyegeria/collection_manager_omvs.py +2805 -0
  28. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/core_omag_server_config.py +310 -192
  29. pyegeria-0.8.0/pyegeria/egeria_cat_client.py +88 -0
  30. pyegeria-0.8.0/pyegeria/egeria_config_client.py +37 -0
  31. pyegeria-0.8.0/pyegeria/egeria_my_client.py +47 -0
  32. pyegeria-0.8.0/pyegeria/egeria_ops_client.py +67 -0
  33. pyegeria-0.8.0/pyegeria/egeria_tech_client.py +77 -0
  34. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/feedback_manager_omvs.py +633 -631
  35. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/full_omag_server_config.py +330 -158
  36. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/glossary_browser_omvs.py +927 -474
  37. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/glossary_manager_omvs.py +1033 -543
  38. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/mermaid_utilities.py +1 -1
  39. pyegeria-0.8.0/pyegeria/my_profile_omvs.py +1113 -0
  40. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/platform_services.py +228 -176
  41. pyegeria-0.8.0/pyegeria/project_manager_omvs.py +1938 -0
  42. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/registered_info.py +76 -74
  43. pyegeria-0.8.0/pyegeria/runtime_manager_omvs.py +1046 -0
  44. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/server_operations.py +123 -85
  45. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/valid_metadata_omvs.py +268 -168
  46. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyproject.toml +1 -1
  47. pyegeria-0.7.45/examples/widgets/cli/egeria_tech.py +0 -253
  48. pyegeria-0.7.45/examples/widgets/ops/engine_actions.py +0 -71
  49. pyegeria-0.7.45/examples/widgets/tech/get_element_info.py +0 -119
  50. pyegeria-0.7.45/examples/widgets/tech/list_gov_processes.py +0 -162
  51. pyegeria-0.7.45/pyegeria/_deprecated_gov_engine.py +0 -400
  52. pyegeria-0.7.45/pyegeria/action_author_omvs.py +0 -186
  53. pyegeria-0.7.45/pyegeria/asset_catalog_omvs.py +0 -667
  54. pyegeria-0.7.45/pyegeria/collection_manager_omvs.py +0 -2367
  55. pyegeria-0.7.45/pyegeria/my_profile_omvs.py +0 -973
  56. pyegeria-0.7.45/pyegeria/project_manager_omvs.py +0 -1683
  57. pyegeria-0.7.45/pyegeria/runtime_manager_omvs.py +0 -967
  58. pyegeria-0.7.45/pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
  59. {pyegeria-0.7.45 → pyegeria-0.8.0}/LICENSE +0 -0
  60. {pyegeria-0.7.45 → pyegeria-0.8.0}/README.md +0 -0
  61. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  62. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  63. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/README.md +0 -0
  64. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/__init__.py +0 -0
  65. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/get_asset_graph.py +0 -0
  66. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/get_collection.py +0 -0
  67. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/get_project_dependencies.py +0 -0
  68. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/get_project_structure.py +0 -0
  69. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/get_tech_type_elements.py +0 -0
  70. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/get_tech_type_template.py +0 -0
  71. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_archives.py +0 -0
  72. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_assets.py +0 -0
  73. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_glossary.py +0 -0
  74. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_relationships.py +0 -0
  75. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_tech_types.py +0 -0
  76. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_todos.py +0 -0
  77. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cat/list_user_ids.py +0 -0
  78. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cli/__init__.py +0 -0
  79. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cli/egeria_cat.py +0 -0
  80. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cli/egeria_my.py +0 -0
  81. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cli/egeria_ops.py +0 -0
  82. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/cli/ops_config.py +0 -0
  83. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/README.md +0 -0
  84. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/__init__.py +0 -0
  85. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/list_my_profile.py +0 -0
  86. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/list_my_roles.py +0 -0
  87. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/monitor_my_todos.py +0 -0
  88. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/monitor_open_todos.py +0 -0
  89. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/my/todo_actions.py +0 -0
  90. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/README.md +0 -0
  91. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/__init__.py +0 -0
  92. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/list_catalog_targets.py +0 -0
  93. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/load_archive.py +0 -0
  94. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_asset_events.py +0 -0
  95. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_coco_status.py +0 -0
  96. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_engine_activity.py +0 -0
  97. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_engine_activity_c.py +0 -0
  98. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
  99. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
  100. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_platform_status.py +0 -0
  101. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_server_list.py +0 -0
  102. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/monitor_server_status.py +0 -0
  103. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
  104. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/ops/restart_integration_daemon.py +0 -0
  105. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/README.md +0 -0
  106. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/__init__.py +0 -0
  107. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/get_tech_details.py +0 -0
  108. {pyegeria-0.7.45 → pyegeria-0.8.0}/examples/widgets/tech/list_tech_templates.py +0 -0
  109. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/_exceptions.py +0 -0
  110. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/_globals.py +0 -0
  111. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/_validators.py +0 -0
  112. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/create_tech_guid_lists.py +0 -0
  113. {pyegeria-0.7.45 → pyegeria-0.8.0}/pyegeria/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.7.45
3
+ Version: 0.8.0
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -26,35 +26,49 @@ from pyegeria import (
26
26
  UserNotAuthorizedException,
27
27
  print_exception_response,
28
28
  AssetCatalog,
29
- ClassificationManager
29
+ ClassificationManager,
30
30
  )
31
+
31
32
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
32
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
33
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
34
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
35
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
36
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
37
- EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
38
- EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
39
- EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
40
- EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
41
- EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
42
- EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
33
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
34
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
35
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
36
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
37
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
38
+ )
39
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
40
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
41
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
42
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
43
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
44
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
45
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
43
46
 
44
47
 
45
48
  disable_ssl_warnings = True
46
49
 
47
50
 
48
- def display_certifications(search_string: str, server: str, url: str, username: str, user_password: str, time_out: int = 60,
49
- jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
51
+ def display_certifications(
52
+ search_string: str,
53
+ server: str,
54
+ url: str,
55
+ username: str,
56
+ user_password: str,
57
+ time_out: int = 60,
58
+ jupyter: bool = EGERIA_JUPYTER,
59
+ width: int = EGERIA_WIDTH,
60
+ ):
50
61
  console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
51
- if (search_string is None) or ((len(search_string) < 3)) and (search_string != '*'):
52
- raise ValueError("Invalid Search String - must be greater than four characters long")
53
- g_client = ClassificationManager(server, url, user_id=username,user_pwd=user_password)
62
+ if (search_string is None) or ((len(search_string) < 3)) and (search_string != "*"):
63
+ raise ValueError(
64
+ "Invalid Search String - must be greater than four characters long"
65
+ )
66
+ g_client = ClassificationManager(
67
+ server, url, user_id=username, user_pwd=user_password
68
+ )
54
69
  token = g_client.create_egeria_bearer_token(username, user_password)
55
70
 
56
-
57
- def generate_table(search_string:str = None) -> Table:
71
+ def generate_table(search_string: str = None) -> Table:
58
72
  """Make a new table."""
59
73
  table = Table(
60
74
  title=f"Certifications Types @ {time.asctime()}",
@@ -66,10 +80,10 @@ def display_certifications(search_string: str, server: str, url: str, username:
66
80
  show_lines=True,
67
81
  box=box.ROUNDED,
68
82
  caption=f"View Server '{server}' @ Platform - {url}",
69
- expand=True
83
+ expand=True,
70
84
  )
71
85
  table.add_column("Title", max_width=15)
72
- table.add_column('summary')
86
+ table.add_column("summary")
73
87
  table.add_column("domainID")
74
88
  table.add_column("Unique Name")
75
89
  table.add_column("Scope")
@@ -78,34 +92,33 @@ def display_certifications(search_string: str, server: str, url: str, username:
78
92
  table.add_column("Details")
79
93
  table.add_column("Related Elements")
80
94
 
81
-
82
95
  certs = g_client.get_elements(search_string, page_size=100, time_out=time_out)
83
96
  if type(certs) is str:
84
97
  return table
85
98
 
86
99
  for element in certs:
87
- properties = element['properties']
88
- summary = properties.get('summary',"---")
89
- domain = properties.get("domainIdentifier",'---')
90
- unique_name = properties.get('qualifiedName','---')
91
- scope = properties.get('scope','---')
92
- description = properties.get('description','---')
93
- details = properties.get('details','---')
94
- title = properties.get('title','---')
95
- cert_guid = element['elementHeader']['guid']
100
+ properties = element["properties"]
101
+ summary = properties.get("summary", "---")
102
+ domain = properties.get("domainIdentifier", "---")
103
+ unique_name = properties.get("qualifiedName", "---")
104
+ scope = properties.get("scope", "---")
105
+ description = properties.get("description", "---")
106
+ details = properties.get("details", "---")
107
+ title = properties.get("title", "---")
108
+ cert_guid = element["elementHeader"]["guid"]
96
109
 
97
110
  related = g_client.get_all_related_elements(cert_guid)
98
111
  if (len(related) > 0) and (type(related) is list):
99
- rel_md = ''
112
+ rel_md = ""
100
113
  for rel in related:
101
- rel_type = rel['relationshipHeader']['type']['typeName']
102
- rel_element_props = rel['relatedElement']['properties']
114
+ rel_type = rel["relationshipHeader"]["type"]["typeName"]
115
+ rel_element_props = rel["relatedElement"]["properties"]
103
116
  rel_el_md = f"* Rel Type: {rel_type}\n"
104
117
  for key in rel_element_props.keys():
105
118
  rel_el_md += f"* {key}: {rel_element_props[key]}\n"
106
119
  rel_md += f"----\n{rel_el_md}\n"
107
120
  else:
108
- rel_md = '---'
121
+ rel_md = "---"
109
122
 
110
123
  # match_tab = Table(expand=True)
111
124
  # match_tab.add_column("Type Name")
@@ -122,9 +135,8 @@ def display_certifications(search_string: str, server: str, url: str, username:
122
135
  # match_details_out = Markdown(match_details_md)
123
136
  # match_tab.add_row(match_type_name, matching_guid, match_details_out)
124
137
 
125
-
126
138
  table.add_row(
127
- title, summary, domain, unique_name,scope,description,details, rel_md
139
+ title, summary, domain, unique_name, scope, description, details, rel_md
128
140
  )
129
141
 
130
142
  g_client.close_session()
@@ -140,13 +152,18 @@ def display_certifications(search_string: str, server: str, url: str, username:
140
152
  with console.pager(styles=True):
141
153
  console.print(generate_table(search_string), soft_wrap=True)
142
154
 
143
-
144
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
155
+ except (
156
+ InvalidParameterException,
157
+ PropertyServerException,
158
+ UserNotAuthorizedException,
159
+ ) as e:
145
160
  console.print_exception()
146
161
  sys.exit(1)
147
162
 
148
163
  except ValueError as e:
149
- console.print(f"\n\n====> Invalid Search String - must be greater than four characters long")
164
+ console.print(
165
+ f"\n\n====> Invalid Search String - must be greater than four characters long"
166
+ )
150
167
  sys.exit(1)
151
168
 
152
169
 
@@ -167,10 +184,11 @@ def main():
167
184
  time_out = args.time_out if args.time_out is not None else 60
168
185
  try:
169
186
  # search_string = Prompt.ask("Enter an asset search string:", default="*")
170
- search_string = 'CertificationType'
187
+ search_string = "CertificationType"
171
188
  display_certifications(search_string, server, url, userid, user_pass, time_out)
172
- except(KeyboardInterrupt):
189
+ except KeyboardInterrupt:
173
190
  pass
174
191
 
192
+
175
193
  if __name__ == "__main__":
176
- main()
194
+ main()
@@ -59,7 +59,7 @@ def display_project_list(
59
59
  ):
60
60
  p_client = ProjectManager(server, url, user_id=username)
61
61
  token = p_client.create_egeria_bearer_token(username, user_pass)
62
- c_client = ClassificationManager(server, url, token)
62
+ c_client = ClassificationManager(server, url, token=token)
63
63
 
64
64
  def generate_table(project_name: str) -> Table:
65
65
  """Make a new table."""
@@ -352,6 +352,22 @@ def list_element_info(ctx, om_type):
352
352
  )
353
353
 
354
354
 
355
+ @show.command("list-processes")
356
+ @click.pass_context
357
+ def list_element_info(ctx):
358
+ """Display the valid metadata values for a property and type"""
359
+ c = ctx.obj
360
+ list_elements(
361
+ "GovernanceActionProcess",
362
+ c.view_server,
363
+ c.view_server_url,
364
+ c.userid,
365
+ c.password,
366
+ c.jupyter,
367
+ c.width,
368
+ )
369
+
370
+
355
371
  @show.command("guid-info")
356
372
  @click.argument("guid", nargs=1)
357
373
  @click.pass_context
@@ -827,9 +843,9 @@ def show_projects(ctx, search_string):
827
843
  ["OPEN", "IN_PROGRESS", "WAITING", "COMPLETE", "ABANDONED", "None"],
828
844
  case_sensitive="False",
829
845
  ),
830
- help="Enter an optional status filter",
846
+ help="Enter an optional status filter, default='OPEN'",
831
847
  required=False,
832
- default=None,
848
+ default="OPEN",
833
849
  )
834
850
  @click.pass_context
835
851
  def show_todos(ctx, search_string, status):
@@ -0,0 +1,454 @@
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.cat.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_templates_spec
23
+ from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
24
+ from examples.widgets.cat.get_tech_type_template import template_viewer
25
+ from examples.widgets.tech.list_elements import list_elements
26
+ from examples.widgets.tech.get_element_info import display_elements
27
+ from examples.widgets.tech.list_related_specification import (
28
+ display_related_specification,
29
+ )
30
+
31
+
32
+ # from pyegeria import ServerOps
33
+
34
+
35
+ # class Config(object):
36
+ # def __init__(self, server: str = None, url: str = None, userid:str = None, password:str = None,
37
+ # timeout:int = 30, paging: bool = False):
38
+ # self.server = server
39
+ # self.url = url
40
+ # self.userid = userid
41
+ # self.password = password
42
+ # self.timeout = timeout
43
+ # self.paging = paging
44
+ #
45
+ #
46
+ # pass_config = click.make_pass_decorator(Config)
47
+
48
+
49
+ # @tui
50
+ # @tui('menu', 'menu', 'A textual command line interface')
51
+ @tui()
52
+ @click.version_option("0.0.1", prog_name="egeria_ops")
53
+ @click.group()
54
+ @click.option(
55
+ "--server",
56
+ default="active-metadata-store",
57
+ envvar="EGERIA_METADATA_STORE",
58
+ help="Egeria metadata store to work with",
59
+ )
60
+ @click.option(
61
+ "--url",
62
+ default="https://localhost:9443",
63
+ envvar="EGERIA_PLATFORM_URL",
64
+ help="URL of Egeria metadata store platform to connect to",
65
+ )
66
+ @click.option(
67
+ "--integration-daemon",
68
+ default="integration-daemon",
69
+ envvar="EGERIA_INTEGRATION_DAEMON",
70
+ help="Egeria integration daemon to work with",
71
+ )
72
+ @click.option(
73
+ "--integration_daemon_url",
74
+ default="https://localhost:9443",
75
+ envvar="EGERIA_INTEGRATION_DAEMON_URL",
76
+ help="URL of Egeria integration daemon platform to connect to",
77
+ )
78
+ @click.option(
79
+ "--view_server",
80
+ default="view-server",
81
+ envvar="EGERIA_VIEW_SERVER",
82
+ help="Egeria view server to work with",
83
+ )
84
+ @click.option(
85
+ "--view_server_url",
86
+ default="https://localhost:9443",
87
+ envvar="EGERIA_VIEW_SERVER_URL",
88
+ help="URL of Egeria view server platform to connect to",
89
+ )
90
+ @click.option(
91
+ "--engine_host",
92
+ default="engine-host",
93
+ envvar="EGERIA_ENGINE_HOST",
94
+ help="Egeria engine host to work with",
95
+ )
96
+ @click.option(
97
+ "--engine_host_url",
98
+ default="https://localhost:9443",
99
+ envvar="EGERIA_ENGINE_HOST_URL",
100
+ help="URL of Egeria engine host platform to connect to",
101
+ )
102
+ @click.option(
103
+ "--admin_user",
104
+ default="garygeeke",
105
+ envvar="EGERIA_ADMIN_USER",
106
+ help="Egeria admin user",
107
+ )
108
+ @click.option(
109
+ "--admin_user_password",
110
+ default="secret",
111
+ envvar="EGERIA_ADMIN_PASSWORD",
112
+ help="Egeria admin password",
113
+ )
114
+ @click.option(
115
+ "--userid", default="erinoverview", envvar="EGERIA_USER", help="Egeria user"
116
+ )
117
+ @click.option(
118
+ "--password",
119
+ default="secret",
120
+ envvar="EGERIA_PASSWORD",
121
+ help="Egeria user password",
122
+ )
123
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
124
+ @click.option("--verbose", is_flag=True, default=False, help="Enable verbose mode")
125
+ @click.option(
126
+ "--paging",
127
+ is_flag=True,
128
+ default=False,
129
+ help="Enable paging snapshots vs live updates",
130
+ )
131
+ @click.option(
132
+ "--jupyter",
133
+ is_flag=True,
134
+ default=False,
135
+ envvar="EGERIA_JUPYTER",
136
+ help="Enable for rendering in a Jupyter terminal",
137
+ )
138
+ @click.option(
139
+ "--width",
140
+ default=200,
141
+ envvar="EGERIA_WIDTH",
142
+ help="Screen width, in characters, to use",
143
+ )
144
+ @click.pass_context
145
+ def cli(
146
+ ctx,
147
+ server,
148
+ url,
149
+ view_server,
150
+ view_server_url,
151
+ integration_daemon,
152
+ integration_daemon_url,
153
+ engine_host,
154
+ engine_host_url,
155
+ admin_user,
156
+ admin_user_password,
157
+ userid,
158
+ password,
159
+ timeout,
160
+ paging,
161
+ verbose,
162
+ jupyter,
163
+ width,
164
+ ):
165
+ """An Egeria Command Line interface for Operations"""
166
+ ctx.obj = Config(
167
+ server,
168
+ url,
169
+ view_server,
170
+ view_server_url,
171
+ integration_daemon,
172
+ integration_daemon_url,
173
+ engine_host,
174
+ engine_host_url,
175
+ admin_user,
176
+ admin_user_password,
177
+ userid,
178
+ password,
179
+ timeout,
180
+ paging,
181
+ verbose,
182
+ jupyter,
183
+ width,
184
+ )
185
+ ctx.max_content_width = 200
186
+ ctx.ensure_object(Config)
187
+ if verbose:
188
+ click.echo(f"we are in verbose mode - server is {server}")
189
+
190
+
191
+ @cli.group("show")
192
+ @click.pass_context
193
+ def show(ctx):
194
+ """Display an Egeria Object"""
195
+ pass
196
+
197
+
198
+ @show.command("guid-info")
199
+ @click.argument("guid", nargs=1)
200
+ @click.pass_context
201
+ def show_guid_infos(ctx, guid):
202
+ """Display a live status view of known platforms
203
+
204
+ Usage: show guid-info <a guid>
205
+
206
+ """
207
+ c = ctx.obj
208
+ display_guid(guid, c.server, c.url, c.userid, c.password, c.jupyter, c.width)
209
+
210
+
211
+ @show.command("related-specifications")
212
+ @click.pass_context
213
+ @click.argument("element-guid")
214
+ def show_related_specifications(ctx, element_guid):
215
+ """List specifications related to the given Element"""
216
+ c = ctx.obj
217
+ display_related_specification(
218
+ element_guid,
219
+ c.view_server,
220
+ c.view_server_url,
221
+ c.userid,
222
+ c.password,
223
+ c.jupyter,
224
+ c.width,
225
+ )
226
+
227
+
228
+ @show.command("tech-types")
229
+ @click.option("--search-string", default="*", help="Tech type to search for")
230
+ @click.pass_context
231
+ def show_tech_types(ctx, search_string):
232
+ """List deployed technology types
233
+
234
+ Usage: show tech-types <optional search-string>
235
+
236
+ All tech-types will be returned if no search-string is specified.
237
+
238
+ """
239
+
240
+ c = ctx.obj
241
+ display_tech_types(
242
+ search_string, c.view_server, c.view_server_url, c.userid, c.password
243
+ )
244
+
245
+
246
+ @show.command("tech-details")
247
+ @click.argument("tech-name")
248
+ @click.pass_context
249
+ def show_tech_details(ctx, tech_name):
250
+ """Display a live status view of Egeria servers for the specified Egeria platform
251
+
252
+ Usage: show tech-details <tech-name>
253
+
254
+ tech-name is a valid technology name (see 'show tech-types')
255
+ """
256
+ c = ctx.obj
257
+ tech_details_viewer(
258
+ tech_name,
259
+ c.view_server,
260
+ c.view_server_url,
261
+ c.userid,
262
+ c.password,
263
+ c.jupyter,
264
+ c.width,
265
+ )
266
+
267
+
268
+ @show.command("asset-types")
269
+ @click.pass_context
270
+ def show_asset_types(ctx):
271
+ """Display engine-host status information"""
272
+ c = ctx.obj
273
+ display_asset_types(
274
+ c.view_server, c.view_server_url, c.userid, c.password, c.jupyter, c.width
275
+ )
276
+
277
+
278
+ @show.command("registered-services")
279
+ @click.option(
280
+ "--services",
281
+ type=click.Choice(
282
+ [
283
+ "all",
284
+ "access-services",
285
+ "common-services",
286
+ "engine-services",
287
+ "governance-services",
288
+ "integration-services",
289
+ "view-services",
290
+ ],
291
+ case_sensitive=False,
292
+ ),
293
+ default="all",
294
+ help="Which service group to display",
295
+ )
296
+ @click.pass_context
297
+ def show_registered_services(ctx, services):
298
+ """Show information about a registered services"""
299
+ c = ctx.obj
300
+ display_registered_svcs(
301
+ services,
302
+ c.view_server,
303
+ c.view_server_url,
304
+ c.userid,
305
+ c.password,
306
+ c.jupyter,
307
+ c.width,
308
+ )
309
+
310
+
311
+ @show.command("relationship-types")
312
+ @click.option(
313
+ "--rel-type",
314
+ default="AssetOwner",
315
+ help="Relationship type to get information about",
316
+ )
317
+ @click.pass_context
318
+ def show_relationship_types(ctx, rel_type):
319
+ """Show information about the specified relationship type"""
320
+ c = ctx.obj
321
+ display_relationship_types(
322
+ rel_type,
323
+ c.view_server,
324
+ c.view_server_url,
325
+ c.userid,
326
+ c.password,
327
+ False,
328
+ c.jupyter,
329
+ c.width,
330
+ )
331
+
332
+
333
+ @show.command("tech-templates")
334
+ @click.pass_context
335
+ @click.option(
336
+ "--search-string", default="*", help="Technology type to get information about"
337
+ )
338
+ def tech_templates(ctx, search_string):
339
+ """Display template information about the specified technology."""
340
+ c = ctx.obj
341
+ template_viewer(
342
+ search_string,
343
+ c.view_server,
344
+ c.view_server_url,
345
+ c.userid,
346
+ c.password,
347
+ c.jupyter,
348
+ c.width,
349
+ )
350
+
351
+
352
+ @show.command("tech-template-spec")
353
+ @click.pass_context
354
+ @click.option(
355
+ "--search-string", default="*", help="Technology type to get information about"
356
+ )
357
+ def tech_template_spec(ctx, search_string):
358
+ """Display template specification information about the specified technology."""
359
+ c = ctx.obj
360
+ display_templates_spec(
361
+ search_string,
362
+ c.view_server,
363
+ c.view_server_url,
364
+ c.userid,
365
+ c.password,
366
+ c.jupyter,
367
+ c.width,
368
+ )
369
+
370
+
371
+ @show.command("valid-metadata-values")
372
+ @click.pass_context
373
+ @click.option("--property", default="projectHealth", help="Metadata property to query")
374
+ @click.option("--type-name", default="Project", help="Metadata type to query")
375
+ def valid_metadata_values(ctx, property, type_name):
376
+ """Display the valid metadata values for a property and type"""
377
+ c = ctx.obj
378
+ display_metadata_values(
379
+ property,
380
+ type_name,
381
+ c.view_server,
382
+ c.view_server_url,
383
+ c.userid,
384
+ c.password,
385
+ False,
386
+ c.jupyter,
387
+ c.width,
388
+ )
389
+
390
+
391
+ @show.command("list-elements")
392
+ @click.pass_context
393
+ @click.option("--om_type", default="Organization", help="Metadata type to query")
394
+ def list_element_info(ctx, om_type):
395
+ """Display the valid metadata values for a property and type"""
396
+ c = ctx.obj
397
+ list_elements(
398
+ om_type,
399
+ c.view_server,
400
+ c.view_server_url,
401
+ c.userid,
402
+ c.password,
403
+ c.jupyter,
404
+ c.width,
405
+ )
406
+
407
+
408
+ @show.command("list-processes")
409
+ @click.pass_context
410
+ def list_element_info(ctx):
411
+ """Display the valid metadata values for a property and type"""
412
+ c = ctx.obj
413
+ list_elements(
414
+ "GovernanceActionProcess",
415
+ c.view_server,
416
+ c.view_server_url,
417
+ c.userid,
418
+ c.password,
419
+ c.jupyter,
420
+ c.width,
421
+ )
422
+
423
+
424
+ @show.command("get-elements")
425
+ @click.pass_context
426
+ @click.option("--om_type", default="Project", help="Metadata type to query")
427
+ def get_element_info(ctx, om_type):
428
+ """Display the elements for an Open Metadata Type"""
429
+ c = ctx.obj
430
+ display_elements(
431
+ om_type,
432
+ c.view_server,
433
+ c.view_server_url,
434
+ c.userid,
435
+ c.password,
436
+ c.jupyter,
437
+ c.width,
438
+ )
439
+
440
+
441
+ #
442
+ # Tell
443
+ #
444
+
445
+
446
+ @cli.group("tell")
447
+ @click.pass_context
448
+ def tell(ctx):
449
+ """Perform actions an Egeria Objects"""
450
+ pass
451
+
452
+
453
+ if __name__ == "__main__":
454
+ cli()