pyegeria 0.7.45.1__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 (111) hide show
  1. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/PKG-INFO +1 -1
  2. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_cert_types.py +61 -43
  3. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_projects.py +1 -1
  4. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/my_profile_actions.py +51 -32
  5. pyegeria-0.8.0/examples/widgets/ops/engine_actions.py +83 -0
  6. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/integration_daemon_actions.py +51 -32
  7. pyegeria-0.8.0/examples/widgets/tech/get_element_info.py +144 -0
  8. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/get_guid_info.py +50 -27
  9. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_asset_types.py +33 -23
  10. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_elements.py +44 -34
  11. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_elements_x.py +69 -49
  12. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_registered_services.py +44 -24
  13. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_related_specification.py +70 -45
  14. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_relationship_types.py +50 -31
  15. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_valid_metadata_values.py +57 -28
  16. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/x_list_related_elements.py +54 -34
  17. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/Xloaded_resources_omvs.py +43 -41
  18. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/__init__.py +5 -1
  19. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/_client.py +142 -102
  20. pyegeria-0.8.0/pyegeria/_deprecated_gov_engine.py +451 -0
  21. pyegeria-0.8.0/pyegeria/action_author_omvs.py +205 -0
  22. pyegeria-0.8.0/pyegeria/asset_catalog_omvs.py +739 -0
  23. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/automated_curation_omvs.py +2 -2
  24. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/classification_manager_omvs.py +3 -9
  25. pyegeria-0.8.0/pyegeria/collection_manager_omvs.py +2805 -0
  26. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/core_omag_server_config.py +310 -192
  27. pyegeria-0.8.0/pyegeria/egeria_cat_client.py +88 -0
  28. pyegeria-0.8.0/pyegeria/egeria_config_client.py +37 -0
  29. pyegeria-0.8.0/pyegeria/egeria_my_client.py +47 -0
  30. pyegeria-0.8.0/pyegeria/egeria_ops_client.py +67 -0
  31. pyegeria-0.8.0/pyegeria/egeria_tech_client.py +77 -0
  32. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/feedback_manager_omvs.py +633 -631
  33. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/full_omag_server_config.py +330 -158
  34. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/glossary_browser_omvs.py +927 -474
  35. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/glossary_manager_omvs.py +1033 -543
  36. pyegeria-0.8.0/pyegeria/my_profile_omvs.py +1113 -0
  37. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/platform_services.py +228 -176
  38. pyegeria-0.8.0/pyegeria/project_manager_omvs.py +1938 -0
  39. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/registered_info.py +76 -74
  40. pyegeria-0.8.0/pyegeria/runtime_manager_omvs.py +1046 -0
  41. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/server_operations.py +123 -85
  42. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/valid_metadata_omvs.py +268 -168
  43. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyproject.toml +1 -1
  44. pyegeria-0.7.45.1/examples/widgets/ops/engine_actions.py +0 -71
  45. pyegeria-0.7.45.1/examples/widgets/tech/get_element_info.py +0 -119
  46. pyegeria-0.7.45.1/pyegeria/_deprecated_gov_engine.py +0 -400
  47. pyegeria-0.7.45.1/pyegeria/action_author_omvs.py +0 -186
  48. pyegeria-0.7.45.1/pyegeria/asset_catalog_omvs.py +0 -667
  49. pyegeria-0.7.45.1/pyegeria/collection_manager_omvs.py +0 -2367
  50. pyegeria-0.7.45.1/pyegeria/my_profile_omvs.py +0 -973
  51. pyegeria-0.7.45.1/pyegeria/project_manager_omvs.py +0 -1683
  52. pyegeria-0.7.45.1/pyegeria/runtime_manager_omvs.py +0 -967
  53. pyegeria-0.7.45.1/pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
  54. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/LICENSE +0 -0
  55. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/README.md +0 -0
  56. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  57. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  58. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/README.md +0 -0
  59. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/__init__.py +0 -0
  60. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/get_asset_graph.py +0 -0
  61. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/get_collection.py +0 -0
  62. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/get_project_dependencies.py +0 -0
  63. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/get_project_structure.py +0 -0
  64. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/get_tech_type_elements.py +0 -0
  65. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/get_tech_type_template.py +0 -0
  66. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_archives.py +0 -0
  67. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_assets.py +0 -0
  68. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_glossary.py +0 -0
  69. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_relationships.py +0 -0
  70. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_tech_types.py +0 -0
  71. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_todos.py +0 -0
  72. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cat/list_user_ids.py +0 -0
  73. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/__init__.py +0 -0
  74. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/egeria.py +0 -0
  75. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/egeria_cat.py +0 -0
  76. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/egeria_my.py +0 -0
  77. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/egeria_ops.py +0 -0
  78. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/egeria_tech.py +0 -0
  79. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/cli/ops_config.py +0 -0
  80. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/README.md +0 -0
  81. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/__init__.py +0 -0
  82. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/list_my_profile.py +0 -0
  83. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/list_my_roles.py +0 -0
  84. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/monitor_my_todos.py +0 -0
  85. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/monitor_open_todos.py +0 -0
  86. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/my/todo_actions.py +0 -0
  87. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/README.md +0 -0
  88. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/__init__.py +0 -0
  89. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/list_catalog_targets.py +0 -0
  90. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/load_archive.py +0 -0
  91. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_asset_events.py +0 -0
  92. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_coco_status.py +0 -0
  93. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_engine_activity.py +0 -0
  94. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_engine_activity_c.py +0 -0
  95. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_gov_eng_status.py +0 -0
  96. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
  97. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_platform_status.py +0 -0
  98. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_server_list.py +0 -0
  99. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/monitor_server_status.py +0 -0
  100. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
  101. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/ops/restart_integration_daemon.py +0 -0
  102. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/README.md +0 -0
  103. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/__init__.py +0 -0
  104. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/get_tech_details.py +0 -0
  105. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/examples/widgets/tech/list_tech_templates.py +0 -0
  106. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/_exceptions.py +0 -0
  107. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/_globals.py +0 -0
  108. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/_validators.py +0 -0
  109. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/create_tech_guid_lists.py +0 -0
  110. {pyegeria-0.7.45.1 → pyegeria-0.8.0}/pyegeria/mermaid_utilities.py +0 -0
  111. {pyegeria-0.7.45.1 → 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.1
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."""
@@ -22,79 +22,97 @@ from pyegeria._exceptions import (
22
22
  )
23
23
 
24
24
 
25
- @click.command('add-todo')
26
- @click.argument('integration-connector')
27
- @click.argument('metadata-element-guid')
28
- @click.argument('catalog-target-name')
25
+ @click.command("add-todo")
26
+ @click.argument("integration-connector")
27
+ @click.argument("metadata-element-guid")
28
+ @click.argument("catalog-target-name")
29
29
  @click.pass_context
30
- def add_catalog_target(ctx, integration_connector: str, metadata_element_guid:str, catalog_target_name:str)-> str:
30
+ def add_catalog_target(
31
+ ctx,
32
+ integration_connector: str,
33
+ metadata_element_guid: str,
34
+ catalog_target_name: str,
35
+ ) -> str:
31
36
  """Add catalog targets to the specified integration connector"""
32
37
  try:
33
38
  if integration_connector not in INTEGRATION_GUIDS.keys():
34
- click.echo('Integration connector is not known')
39
+ click.echo("Integration connector is not known")
35
40
 
36
41
  c = ctx.obj
37
- a_client = AutomatedCuration(c.view_server, c.view_server_url, c.userid, c.password)
42
+ a_client = AutomatedCuration(
43
+ c.view_server, c.view_server_url, c.userid, c.password
44
+ )
38
45
  token = a_client.create_egeria_bearer_token()
39
46
 
40
- guid = a_client.add_catalog_target(INTEGRATION_GUIDS[integration_connector], metadata_element_guid,
41
- catalog_target_name)
42
-
43
- click.echo(f"Added catalog target to {integration_connector} with a return guid of {guid}")
47
+ guid = a_client.add_catalog_target(
48
+ INTEGRATION_GUIDS[integration_connector],
49
+ metadata_element_guid,
50
+ catalog_target_name,
51
+ )
44
52
 
53
+ click.echo(
54
+ f"Added catalog target to {integration_connector} with a return guid of {guid}"
55
+ )
45
56
 
46
57
  except (InvalidParameterException, PropertyServerException) as e:
47
58
  print_exception_response(e)
48
59
 
49
60
 
50
-
51
- @click.command('remove-target')
52
- @click.argument('relationship-guid')
61
+ @click.command("remove-target")
62
+ @click.argument("relationship-guid")
53
63
  @click.pass_context
54
64
  def remove_catalog_target(ctx, relationship_guid: str):
55
65
  """Remove the catalog target specified by the relationship guidr"""
56
66
  try:
57
67
  c = ctx.obj
58
- a_client = AutomatedCuration(c.view_server, c.view_server_url, c.userid, c.password)
68
+ a_client = AutomatedCuration(
69
+ c.view_server, c.view_server_url, c.userid, c.password
70
+ )
59
71
  token = a_client.create_egeria_bearer_token()
60
72
 
61
73
  a_client.remove_catalog_target(relationship_guid)
62
74
 
63
- click.echo(f"Removed catalog target with relationship guid of {relationship_guid}")
64
-
75
+ click.echo(
76
+ f"Removed catalog target with relationship guid of {relationship_guid}"
77
+ )
65
78
 
66
79
  except (InvalidParameterException, PropertyServerException) as e:
67
80
  print_exception_response(e)
68
81
 
69
82
 
70
- @click.command('update-target')
71
- @click.argument('relationship-guid')
72
- @click.argument('catalog-target-name')
83
+ @click.command("update-target")
84
+ @click.argument("relationship-guid")
85
+ @click.argument("catalog-target-name")
73
86
  @click.pass_context
74
- def update_catalog_target(ctx, relationship_guid: str, catalog_target_name:str):
75
- """Update the catalog target specified by the relationship guid """
87
+ def update_catalog_target(ctx, relationship_guid: str, catalog_target_name: str):
88
+ """Update the catalog target specified by the relationship guid"""
76
89
  try:
77
90
  c = ctx.obj
78
- a_client = AutomatedCuration(c.view_server, c.view_server_url, c.userid, c.password)
91
+ a_client = AutomatedCuration(
92
+ c.view_server, c.view_server_url, c.userid, c.password
93
+ )
79
94
  token = a_client.create_egeria_bearer_token()
80
95
 
81
96
  guid = a_client.update_catalog_target(relationship_guid, catalog_target_name)
82
97
 
83
- click.echo(f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
84
- f"{catalog_target_name} with a return guid of {guid}")
85
-
98
+ click.echo(
99
+ f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
100
+ f"{catalog_target_name} with a return guid of {guid}"
101
+ )
86
102
 
87
103
  except (InvalidParameterException, PropertyServerException) as e:
88
104
  print_exception_response(e)
89
105
 
90
106
 
91
- @click.command('stop')
107
+ @click.command("stop")
92
108
  @click.pass_context
93
109
  def stop_server(ctx):
94
110
  """Stop an integration daemon"""
95
111
  try:
96
112
  c = ctx.obj
97
- p_client = Platform(c.integration_daemon, c.integration_daemon_url, c.userid, c.password)
113
+ p_client = Platform(
114
+ c.integration_daemon, c.integration_daemon_url, c.userid, c.password
115
+ )
98
116
 
99
117
  p_client.shutdown_server()
100
118
 
@@ -103,13 +121,15 @@ def stop_server(ctx):
103
121
  print_exception_response(e)
104
122
 
105
123
 
106
- @click.command('start')
124
+ @click.command("start")
107
125
  @click.pass_context
108
126
  def start_server(ctx):
109
- """Start or restart an integration daemon from its known configuration """
127
+ """Start or restart an integration daemon from its known configuration"""
110
128
  try:
111
129
  c = ctx.obj
112
- p_client = Platform(c.integration_daemon, c.integration_daemon_url, c.userid, c.password)
130
+ p_client = Platform(
131
+ c.integration_daemon, c.integration_daemon_url, c.userid, c.password
132
+ )
113
133
 
114
134
  p_client.activate_server_stored_config()
115
135
 
@@ -117,4 +137,3 @@ def start_server(ctx):
117
137
 
118
138
  except (InvalidParameterException, PropertyServerException) as e:
119
139
  print_exception_response(e)
120
-
@@ -0,0 +1,83 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+
6
+
7
+ Execute engine actions.
8
+
9
+ """
10
+ import os
11
+
12
+ import click
13
+
14
+ # from ops_config import Config, pass_config
15
+ from pyegeria import Platform
16
+ from pyegeria._exceptions import (
17
+ InvalidParameterException,
18
+ PropertyServerException,
19
+ print_exception_response,
20
+ )
21
+
22
+ GERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
23
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
24
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
25
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
26
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
27
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
28
+ )
29
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
30
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
31
+ "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
32
+ )
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
+
38
+
39
+ @click.command("stop")
40
+ @click.option(
41
+ "--server", default=EGERIA_VIEW_SERVER, help="Egeria metadata store to load"
42
+ )
43
+ @click.option(
44
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
45
+ )
46
+ @click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
47
+ @click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
48
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
49
+ def stop_daemon(file, server, url, userid, password, timeout):
50
+ """Stop an engine-host daemon"""
51
+ p_client = Platform(server, url, userid, password)
52
+ try:
53
+ p_client.shutdown_server()
54
+
55
+ click.echo(f"Stopped server {server}")
56
+ except (InvalidParameterException, PropertyServerException) as e:
57
+ print_exception_response(e)
58
+ finally:
59
+ p_client.close_session()
60
+
61
+
62
+ @click.command("start")
63
+ @click.option(
64
+ "--server", default=EGERIA_VIEW_SERVER, help="Egeria metadata store to load"
65
+ )
66
+ @click.option(
67
+ "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
68
+ )
69
+ @click.option("--userid", default=EGERIA_ADMIN_USER, help="Egeria admin user")
70
+ @click.option("--password", default=EGERIA_ADMIN_PASSWORD, help="Egeria admin password")
71
+ @click.option("--timeout", default=60, help="Number of seconds to wait")
72
+ def start_daemon(file, server, url, userid, password, timeout):
73
+ """Start or restart an engine-host from its known configuration"""
74
+ p_client = Platform(server, url, userid, password)
75
+ try:
76
+ p_client.activate_server_stored_config()
77
+
78
+ click.echo(f"Started server {server}")
79
+
80
+ except (InvalidParameterException, PropertyServerException) as e:
81
+ print_exception_response(e)
82
+ finally:
83
+ p_client.close_session()
@@ -22,79 +22,97 @@ from pyegeria._exceptions import (
22
22
  )
23
23
 
24
24
 
25
- @click.command('add-target')
26
- @click.argument('integration-connector')
27
- @click.argument('metadata-element-guid')
28
- @click.argument('catalog-target-name')
25
+ @click.command("add-target")
26
+ @click.argument("integration-connector")
27
+ @click.argument("metadata-element-guid")
28
+ @click.argument("catalog-target-name")
29
29
  @click.pass_context
30
- def add_catalog_target(ctx, integration_connector: str, metadata_element_guid:str, catalog_target_name:str)-> str:
30
+ def add_catalog_target(
31
+ ctx,
32
+ integration_connector: str,
33
+ metadata_element_guid: str,
34
+ catalog_target_name: str,
35
+ ) -> str:
31
36
  """Add catalog targets to the specified integration connector"""
32
37
  try:
33
38
  if integration_connector not in INTEGRATION_GUIDS.keys():
34
- click.echo('Integration connector is not known')
39
+ click.echo("Integration connector is not known")
35
40
 
36
41
  c = ctx.obj
37
- a_client = AutomatedCuration(c.view_server, c.view_server_url, c.userid, c.password)
42
+ a_client = AutomatedCuration(
43
+ c.view_server, c.view_server_url, c.userid, c.password
44
+ )
38
45
  token = a_client.create_egeria_bearer_token()
39
46
 
40
- guid = a_client.add_catalog_target(INTEGRATION_GUIDS[integration_connector], metadata_element_guid,
41
- catalog_target_name)
42
-
43
- click.echo(f"Added catalog target to {integration_connector} with a return guid of {guid}")
47
+ guid = a_client.add_catalog_target(
48
+ INTEGRATION_GUIDS[integration_connector],
49
+ metadata_element_guid,
50
+ catalog_target_name,
51
+ )
44
52
 
53
+ click.echo(
54
+ f"Added catalog target to {integration_connector} with a return guid of {guid}"
55
+ )
45
56
 
46
57
  except (InvalidParameterException, PropertyServerException) as e:
47
58
  print_exception_response(e)
48
59
 
49
60
 
50
-
51
- @click.command('remove-target')
52
- @click.argument('relationship-guid')
61
+ @click.command("remove-target")
62
+ @click.argument("relationship-guid")
53
63
  @click.pass_context
54
64
  def remove_catalog_target(ctx, relationship_guid: str):
55
65
  """Remove the catalog target specified by the relationship guidr"""
56
66
  try:
57
67
  c = ctx.obj
58
- a_client = AutomatedCuration(c.view_server, c.view_server_url, c.userid, c.password)
68
+ a_client = AutomatedCuration(
69
+ c.view_server, c.view_server_url, c.userid, c.password
70
+ )
59
71
  token = a_client.create_egeria_bearer_token()
60
72
 
61
73
  a_client.remove_catalog_target(relationship_guid)
62
74
 
63
- click.echo(f"Removed catalog target with relationship guid of {relationship_guid}")
64
-
75
+ click.echo(
76
+ f"Removed catalog target with relationship guid of {relationship_guid}"
77
+ )
65
78
 
66
79
  except (InvalidParameterException, PropertyServerException) as e:
67
80
  print_exception_response(e)
68
81
 
69
82
 
70
- @click.command('update-target')
71
- @click.argument('relationship-guid')
72
- @click.argument('catalog-target-name')
83
+ @click.command("update-target")
84
+ @click.argument("relationship-guid")
85
+ @click.argument("catalog-target-name")
73
86
  @click.pass_context
74
- def update_catalog_target(ctx, relationship_guid: str, catalog_target_name:str):
75
- """Update the catalog target specified by the relationship guid """
87
+ def update_catalog_target(ctx, relationship_guid: str, catalog_target_name: str):
88
+ """Update the catalog target specified by the relationship guid"""
76
89
  try:
77
90
  c = ctx.obj
78
- a_client = AutomatedCuration(c.view_server, c.view_server_url, c.userid, c.password)
91
+ a_client = AutomatedCuration(
92
+ c.view_server, c.view_server_url, c.userid, c.password
93
+ )
79
94
  token = a_client.create_egeria_bearer_token()
80
95
 
81
96
  guid = a_client.update_catalog_target(relationship_guid, catalog_target_name)
82
97
 
83
- click.echo(f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
84
- f"{catalog_target_name} with a return guid of {guid}")
85
-
98
+ click.echo(
99
+ f"Update catalog target with relationship guid of {relationship_guid} to a catalog target name of "
100
+ f"{catalog_target_name} with a return guid of {guid}"
101
+ )
86
102
 
87
103
  except (InvalidParameterException, PropertyServerException) as e:
88
104
  print_exception_response(e)
89
105
 
90
106
 
91
- @click.command('stop')
107
+ @click.command("stop")
92
108
  @click.pass_context
93
109
  def stop_server(ctx):
94
110
  """Stop an integration daemon"""
95
111
  try:
96
112
  c = ctx.obj
97
- p_client = Platform(c.integration_daemon, c.integration_daemon_url, c.userid, c.password)
113
+ p_client = Platform(
114
+ c.integration_daemon, c.integration_daemon_url, c.userid, c.password
115
+ )
98
116
 
99
117
  p_client.shutdown_server()
100
118
 
@@ -103,13 +121,15 @@ def stop_server(ctx):
103
121
  print_exception_response(e)
104
122
 
105
123
 
106
- @click.command('start')
124
+ @click.command("start")
107
125
  @click.pass_context
108
126
  def start_server(ctx):
109
- """Start or restart an integration daemon from its known configuration """
127
+ """Start or restart an integration daemon from its known configuration"""
110
128
  try:
111
129
  c = ctx.obj
112
- p_client = Platform(c.integration_daemon, c.integration_daemon_url, c.userid, c.password)
130
+ p_client = Platform(
131
+ c.integration_daemon, c.integration_daemon_url, c.userid, c.password
132
+ )
113
133
 
114
134
  p_client.activate_server_stored_config()
115
135
 
@@ -117,4 +137,3 @@ def start_server(ctx):
117
137
 
118
138
  except (InvalidParameterException, PropertyServerException) as e:
119
139
  print_exception_response(e)
120
-