pyegeria 0.5.8.27__tar.gz → 0.5.9.2__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 (79) hide show
  1. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/PKG-INFO +1 -1
  2. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_asset_graph.py +9 -10
  3. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_assets.py +10 -7
  4. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_my.py +13 -0
  5. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_tech.py +15 -5
  6. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_platform_status.py +20 -15
  7. pyegeria-0.5.9.2/examples/widgets/personal/list_my_profile.py +134 -0
  8. pyegeria-0.5.8.27/examples/widgets/personal/list_my_profile.py → pyegeria-0.5.9.2/examples/widgets/personal/list_my_roles.py +2 -2
  9. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/list_tech_templates.py +2 -2
  10. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/collection_manager_omvs.py +1 -1
  11. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/runtime_manager_omvs.py +14 -14
  12. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyproject.toml +1 -1
  13. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/LICENSE +0 -0
  14. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/README.md +0 -0
  15. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  16. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  17. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/README.md +0 -0
  18. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/__init__.py +0 -0
  19. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_collection.py +0 -0
  20. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
  21. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
  22. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_glossary.py +0 -0
  23. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_projects.py +0 -0
  24. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_tech_types.py +0 -0
  25. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_todos.py +0 -0
  26. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/cli/__init__.py +0 -0
  27. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_cat.py +0 -0
  28. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_ops.py +0 -0
  29. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/cli/ops_config.py +0 -0
  30. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/README.md +0 -0
  31. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/__init__.py +0 -0
  32. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/engine_actions.py +0 -0
  33. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/integration_daemon_actions.py +0 -0
  34. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/list_catalog_targets.py +0 -0
  35. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/load_archive.py +0 -0
  36. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_asset_events.py +0 -0
  37. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_coco_status.py +0 -0
  38. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_engine_activity.py +0 -0
  39. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_gov_eng_status.py +0 -0
  40. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_integ_daemon_status.py +0 -0
  41. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_server_list.py +0 -0
  42. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_server_status.py +0 -0
  43. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
  44. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/operational/restart_integration_daemon.py +0 -0
  45. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/personal/README.md +0 -0
  46. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/personal/__init__.py +0 -0
  47. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/personal/monitor_my_todos.py +0 -0
  48. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/personal/monitor_open_todos.py +0 -0
  49. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/README.md +0 -0
  50. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/__init__.py +0 -0
  51. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/get_guid_info.py +0 -0
  52. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/get_tech_details.py +0 -0
  53. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/list_asset_types.py +0 -0
  54. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/list_registered_services.py +0 -0
  55. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/list_relationship_types.py +0 -0
  56. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
  57. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/Xfeedback_manager_omvs.py +0 -0
  58. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/Xloaded_resources_omvs.py +0 -0
  59. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/__init__.py +0 -0
  60. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/_client.py +0 -0
  61. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/_deprecated_gov_engine.py +0 -0
  62. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/_exceptions.py +0 -0
  63. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/_globals.py +0 -0
  64. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/_validators.py +0 -0
  65. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/action_author_omvs.py +0 -0
  66. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/asset_catalog_omvs.py +0 -0
  67. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/automated_curation_omvs.py +0 -0
  68. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/core_omag_server_config.py +0 -0
  69. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/create_tech_guid_lists.py +0 -0
  70. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/full_omag_server_config.py +0 -0
  71. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/glossary_browser_omvs.py +0 -0
  72. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/glossary_manager_omvs.py +0 -0
  73. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/my_profile_omvs.py +0 -0
  74. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/platform_services.py +0 -0
  75. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/project_manager_omvs.py +0 -0
  76. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/registered_info.py +0 -0
  77. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/server_operations.py +0 -0
  78. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/pyegeria/utils.py +0 -0
  79. {pyegeria-0.5.8.27 → pyegeria-0.5.9.2}/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.27
3
+ Version: 0.5.9.2
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -91,7 +91,6 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
91
91
  return output
92
92
 
93
93
  try:
94
-
95
94
  a_client = AssetCatalog(server_name, platform_url,
96
95
  user_id=user)
97
96
 
@@ -112,20 +111,20 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
112
111
 
113
112
  # print(f"\n{json.dumps(asset_graph, indent =2)}\n")
114
113
 
115
- asset_name = asset_graph["displayName"]
116
- qualified_name = asset_graph["qualifiedName"]
117
- resource_name = asset_graph["resourceName"]
114
+ asset_name = asset_graph["properties"].get("displayName",'---')
115
+ qualified_name = asset_graph["properties"]["qualifiedName"]
116
+ resource_name = asset_graph['properties'].get("resourceName","---")
118
117
 
119
118
  tree = Tree(f"{asset_name} ({asset_guid})", style="bold bright_white on black", guide_style="bold bright_blue")
120
119
  style = ""
121
-
122
- asset_type = asset_graph["type"]["typeName"]
120
+ asset_elements = asset_graph['elementHeader']
121
+ asset_type = asset_elements["type"]["typeName"]
123
122
  asset_deployed_imp_type = asset_graph.get("deployedImplementationType", "---")
124
123
 
125
- asset_origin = asset_graph["origin"]["homeMetadataCollectionName"]
126
- asset_creation = asset_graph["versions"]["createTime"]
127
- asset_created_by = asset_graph["versions"]["createdBy"]
128
- asset_classifications = asset_graph["classifications"]
124
+ asset_origin = asset_elements["origin"]["homeMetadataCollectionName"]
125
+ asset_creation = asset_elements["versions"]["createTime"]
126
+ asset_created_by = asset_elements["versions"]["createdBy"]
127
+ asset_classifications = asset_elements["classifications"]
129
128
  asset_nested_elements = asset_graph.get("anchoredElements", "----")
130
129
  asset_relationships = asset_graph["relationships"]
131
130
  asset_class_md = build_classifications(asset_classifications)
@@ -80,18 +80,21 @@ def display_assets(search_string: str, server: str, url: str, username: str, use
80
80
  return table
81
81
 
82
82
  for element in assets:
83
- display_name = element.get("resourceName",'---')
84
- # qualified_name = element["qualifiedName"] # we decided that qualified name wasn't useful
85
- type_name = element["type"]["typeName"]
86
- tech_type = element.get("deployedImplementationType",'---')
87
- guid = element["guid"]
83
+ properties = element['properties']
84
+ header = element['elementHeader']
85
+ nested = element.get('matchingElements','---')
86
+
87
+ display_name = properties.get("displayName",'---')
88
+ # qualified_name = properties["qualifiedName"] # we decided that qualified name wasn't useful
89
+ type_name = header["type"]["typeName"]
90
+ tech_type = properties.get("deployedImplementationType",'---')
91
+ guid = header["guid"]
88
92
  #### We decided that path wasn't useful
89
93
  # path_name = element.get("extendedProperties", None)
90
94
  # if path_name:
91
95
  # path = path_name.get("pathName"," ")
92
96
  # else:
93
97
  # path = " "
94
- matches = element['matchingElements']
95
98
  match_md = ""
96
99
 
97
100
  match_tab = Table(expand=True)
@@ -99,7 +102,7 @@ def display_assets(search_string: str, server: str, url: str, username: str, use
99
102
  match_tab.add_column("GUID", no_wrap=True, width=36)
100
103
  match_tab.add_column("Properties")
101
104
 
102
- for match in matches:
105
+ for match in nested:
103
106
  match_type_name = match['type']['typeName']
104
107
  matching_guid = match['guid']
105
108
  match_props = match['properties']
@@ -17,6 +17,7 @@ from examples.widgets.cli.ops_config import Config
17
17
  from examples.widgets.personal.monitor_open_todos import display_todos
18
18
  from examples.widgets.personal.monitor_my_todos import display_my_todos
19
19
  from examples.widgets.personal.list_my_profile import display_my_profiles
20
+ from examples.widgets.personal.list_my_roles import display_my_roles
20
21
 
21
22
 
22
23
 
@@ -100,6 +101,18 @@ def show_my_profile(ctx):
100
101
  display_my_profiles( c.view_server, c.view_server_url,
101
102
  c.userid, c.password, c.jupyter, c.width)
102
103
 
104
+ @show.command('my-roles')
105
+ @click.pass_context
106
+ def show_my_roles(ctx):
107
+ """Display my profiles
108
+
109
+ Usage: show my-profile
110
+
111
+ """
112
+ c = ctx.obj
113
+ display_my_roles( c.view_server, c.view_server_url,
114
+ c.userid, c.password, c.jupyter, c.width)
115
+
103
116
 
104
117
  @show.command('my-to-dos')
105
118
  @click.pass_context
@@ -19,8 +19,9 @@ from examples.widgets.tech.get_tech_details import tech_details_viewer
19
19
  from examples.widgets.tech.list_asset_types import display_asset_types
20
20
  from examples.widgets.tech.list_registered_services import display_registered_svcs
21
21
  from examples.widgets.tech.list_relationship_types import display_relationship_types
22
- from examples.widgets.tech.list_tech_templates import display_tech_templates
22
+ from examples.widgets.tech.list_tech_templates import display_templates_spec
23
23
  from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
24
+ from examples.widgets.catalog_user.get_tech_type_template import template_viewer
24
25
 
25
26
 
26
27
  # from pyegeria import ServerOps
@@ -177,10 +178,19 @@ def show_relationship_types(ctx, rel_type):
177
178
  @show.command("tech-templates")
178
179
  @click.pass_context
179
180
  @click.option('--search-string', default='*', help='Technology type to get information about')
180
- def integrations_status(ctx, search_string):
181
- """Display template information about the specified technologyr"""
181
+ def tech_templates(ctx, search_string):
182
+ """Display template information about the specified technology."""
182
183
  c = ctx.obj
183
- display_tech_templates(search_string, c.view_server, c.view_server_url,
184
+ template_viewer(search_string, c.view_server, c.view_server_url,
185
+ c.userid, c.password, c.jupyter, c.width)
186
+
187
+ @show.command("tech-template-spec")
188
+ @click.pass_context
189
+ @click.option('--search-string', default='*', help='Technology type to get information about')
190
+ def tech_template_spec(ctx, search_string):
191
+ """Display template specification information about the specified technology."""
192
+ c = ctx.obj
193
+ display_templates_spec(search_string, c.view_server, c.view_server_url,
184
194
  c.userid, c.password, c.jupyter, c.width)
185
195
 
186
196
 
@@ -188,7 +198,7 @@ def integrations_status(ctx, search_string):
188
198
  @click.pass_context
189
199
  @click.option('--property', default='projectHealth', help='Metadata property to query')
190
200
  @click.option('--type-name', default='Project', help='Metadata type to query')
191
- def integrations_status(ctx, property, type_name):
201
+ def valid_metadata_values(ctx, property, type_name):
192
202
  """Display the valid metadata values for a property and type"""
193
203
  c = ctx.obj
194
204
  display_metadata_values(property, type_name, c.view_server, c.view_server_url,
@@ -7,7 +7,7 @@ Display the status of cataloged platforms and servers.
7
7
  """
8
8
 
9
9
  import argparse
10
- import os
10
+ import os, sys
11
11
  import time
12
12
 
13
13
  from rich.console import Console
@@ -72,14 +72,18 @@ def display_status(server: str, url: str, username: str, user_pass: str, jupyter
72
72
  "Engine Host Server": "EngineHost",
73
73
  "Integration Daemon": "Integration"
74
74
  }
75
+ try:
76
+ platform_list = r_client.get_platforms_by_type()
77
+ if type(platform_list) is str:
78
+ print("No OMAG Server Platforms found?")
79
+ sys.exit(1)
80
+
81
+ for platform in platform_list:
82
+ platform_name = platform['properties'].get("displayName", '---')
83
+ platform_guid = platform['elementHeader']["guid"]
84
+ platform_desc = platform['properties'].get("resourceDescription",'---')
85
+ server_list = ""
75
86
 
76
- platform_list = r_client.get_platforms_by_type()
77
- for platform in platform_list:
78
- platform_name = platform['properties']["name"]
79
- platform_guid = platform['elementHeader']["guid"]
80
- platform_desc = platform['properties']["description"]
81
- server_list = ""
82
- try:
83
87
  platform_report = r_client.get_platform_report(platform_guid)
84
88
  platform_url = platform_report.get('platformURLRoot', " ")
85
89
  platform_origin = platform_report.get("platformOrigin", " ")
@@ -103,13 +107,14 @@ def display_status(server: str, url: str, username: str, user_pass: str, jupyter
103
107
  serv = f"{status_flag}{server_types[server_type]}: {server_name}\n"
104
108
  server_list = server_list + serv
105
109
 
106
- table.add_row(platform_name, platform_url, platform_origin, platform_desc,
107
- platform_started, server_list, style="bold white on black")
108
- except (Exception) as e:
109
- # console.print_exception(e)
110
- platform_url = " "
111
- platform_origin = " "
112
- platform_started = " "
110
+ table.add_row(platform_name, platform_url, platform_origin, platform_desc,
111
+ platform_started, server_list, style="bold white on black")
112
+
113
+ except (Exception) as e:
114
+ # console.print_exception(e)
115
+ platform_url = " "
116
+ platform_origin = " "
117
+ platform_started = " "
113
118
 
114
119
  return table
115
120
 
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+ Unit tests for the Utils helper functions using the Pytest framework.
7
+
8
+
9
+ A simple display for my profile
10
+ """
11
+ import os
12
+ import argparse
13
+ import time
14
+ import sys
15
+
16
+ from rich import box, print
17
+ from rich.console import Console
18
+ from rich.table import Table
19
+ from rich.tree import Tree
20
+ from rich.panel import Panel
21
+ from rich.markdown import Markdown
22
+
23
+ from pyegeria import (
24
+ InvalidParameterException,
25
+ PropertyServerException,
26
+ UserNotAuthorizedException,
27
+ print_exception_response,
28
+ )
29
+ from pyegeria.my_profile_omvs import MyProfile
30
+
31
+ disable_ssl_warnings = True
32
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
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('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
37
+ EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
38
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
39
+ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
40
+ EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
41
+ EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
42
+ EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
43
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
44
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '250'))
45
+
46
+ def display_my_profile(server: str, url: str, username: str, user_pass:str,
47
+ jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
48
+
49
+ try:
50
+ m_client = MyProfile(server, url, user_id=username, user_pwd=user_pass)
51
+ token = m_client.create_egeria_bearer_token(username, user_pass)
52
+ my_profiles = m_client.get_my_profile()
53
+ if type(my_profiles) is str:
54
+ print(f"No profiles found for {username}")
55
+ sys.exit(1)
56
+
57
+ console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
58
+
59
+ profile_props = my_profiles.get('profileProperties','---')
60
+ name = profile_props["fullName"]
61
+ tree = Tree(Panel(f"Profile of {name}",title = "Personal Profile"),
62
+ expanded=True,style="bright_white on black", guide_style="bold bright_blue")
63
+
64
+ profile_props_md = f"\n* GUID: {my_profiles["elementHeader"]["guid"]}\n"
65
+ if type(profile_props) is dict:
66
+ for key in profile_props.keys():
67
+ if type(profile_props[key]) is str:
68
+ profile_props_md += f"* {key}: {profile_props[key]}\n"
69
+ elif type(profile_props[key]) is dict:
70
+ p_md = '\n* Additional Details:\n'
71
+ for k in profile_props[key].keys():
72
+ p_md += f"\t* {k}: {profile_props[key][k]}\n"
73
+ profile_props_md += p_md
74
+ t1 = tree.add(Panel(Markdown(profile_props_md),title="Profile Properties"))
75
+
76
+
77
+ id_list_md=""
78
+ for identities in my_profiles["userIdentities"]:
79
+ id_list_md += f"* {identities['userIdentity']['properties']['userId']}\n"
80
+ t2 = tree.add(Panel(Markdown(id_list_md), title="Identities"))
81
+
82
+ contact_methods = my_profiles['contactMethods']
83
+ for method in contact_methods:
84
+ contact = method['properties']
85
+ contact_methods_md = ""
86
+ for key in contact.keys():
87
+ contact_methods_md += f"* {key}: {contact[key]}\n"
88
+ t3 = tree.add(Panel(Markdown(contact_methods_md), title="Contact Methods"))
89
+
90
+ my_roles = my_profiles["roles"]
91
+ table = Table(
92
+ title = f" Roles of {name}",
93
+ show_lines= True,
94
+ box=box.ROUNDED,
95
+ expand= True,
96
+ )
97
+ table.add_column("Role Type")
98
+ table.add_column("Role")
99
+ table.add_column("Role GUID")
100
+ for a_role in my_roles:
101
+ my_role_props = a_role["properties"]
102
+ role_type = my_role_props["typeName"]
103
+ role = my_role_props.get("title"," ")
104
+ role_guid = a_role["elementHeader"]["guid"]
105
+ table.add_row(
106
+ role_type, role, role_guid
107
+ )
108
+ t4 = tree.add(Panel(table, title="Roles" ),expanded=True)
109
+
110
+ print(tree)
111
+
112
+ except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
113
+ print_exception_response(e)
114
+ finally:
115
+ m_client.close_session()
116
+
117
+ def main():
118
+ parser = argparse.ArgumentParser()
119
+ parser.add_argument("--server", help="Name of the server to display status for")
120
+ parser.add_argument("--url", help="URL Platform to connect to")
121
+ parser.add_argument("--userid", help="User Id")
122
+ parser.add_argument("--password", help="User Password")
123
+
124
+ args = parser.parse_args()
125
+
126
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
127
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
128
+ userid = args.userid if args.userid is not None else EGERIA_USER
129
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
130
+
131
+ display_my_profile(server, url, userid, user_pass)
132
+
133
+ if __name__ == "__main__":
134
+ main()
@@ -40,7 +40,7 @@ EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
40
40
  EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
41
41
  EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
42
42
 
43
- def display_my_profiles(server: str, url: str, username: str, user_pass:str,
43
+ def display_my_roles(server: str, url: str, username: str, user_pass:str,
44
44
  jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
45
45
 
46
46
  m_client = MyProfile(server, url, user_id=username, user_pwd=user_pass)
@@ -128,7 +128,7 @@ def main():
128
128
  userid = args.userid if args.userid is not None else EGERIA_USER
129
129
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
130
130
 
131
- display_my_profiles(server, url, userid, user_pass)
131
+ display_my_roles(server, url, userid, user_pass)
132
132
 
133
133
  if __name__ == "__main__":
134
134
  main()
@@ -36,7 +36,7 @@ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
36
36
 
37
37
 
38
38
 
39
- def display_tech_templates(search_string:str, server: str,
39
+ def display_templates_spec(search_string:str, server: str,
40
40
  url: str, username: str, password: str, jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH
41
41
  ):
42
42
 
@@ -141,7 +141,7 @@ def main():
141
141
 
142
142
  try:
143
143
  search_string = Prompt.ask("Enter the technology you are searching for:", default="*")
144
- display_tech_templates(search_string, server, url, userid, password)
144
+ display_templates_spec(search_string, server, url, userid, password)
145
145
  except(KeyboardInterrupt):
146
146
  pass
147
147
 
@@ -2328,7 +2328,7 @@ class CollectionManager(Client):
2328
2328
  return False
2329
2329
  # finally, construct a list of member information
2330
2330
  for member_rel in members:
2331
- member_guid = member_rel['member']['guid']
2331
+ member_guid = member_rel['elementHeader']['guid']
2332
2332
  member_resp = await self._async_get_collection(member_guid)
2333
2333
  member = member_resp['element']
2334
2334
  # print(json.dumps(member, indent = 4))
@@ -198,7 +198,7 @@ class RuntimeManager(Client):
198
198
  }
199
199
 
200
200
  response = await self._async_make_request("POST", url, body)
201
- return response.json().get('elementList','No platforms found')
201
+ return response.json().get('elements','No platforms found')
202
202
 
203
203
  def get_platforms_by_type(self, filter: str = None, server:str = None, effective_time: str = None,
204
204
  start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
@@ -293,7 +293,7 @@ class RuntimeManager(Client):
293
293
  }
294
294
 
295
295
  response = await self._async_make_request("POST", url, body)
296
- return response.json().get('elementList','No platforms found')
296
+ return response.json().get('elements','No platforms found')
297
297
 
298
298
 
299
299
  def get_platform_templates_by_type(self, filter: str = None, server:str = None, effective_time: str = None,
@@ -438,7 +438,7 @@ class RuntimeManager(Client):
438
438
  else:
439
439
  response = await self._async_make_request("POST", url)
440
440
 
441
- return response.json().get('elementList','No platforms found')
441
+ return response.json().get('elements','No platforms found')
442
442
 
443
443
  def get_platform_by_guid(self, platform_guid: str = None, server: str = None,
444
444
  effective_time: str = None) -> str | list:
@@ -506,7 +506,7 @@ class RuntimeManager(Client):
506
506
  if server is None:
507
507
  server = self.server_name
508
508
 
509
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/{server_guid}")
509
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/software-servers/{server_guid}")
510
510
 
511
511
  if effective_time is not None:
512
512
  body = {
@@ -517,7 +517,7 @@ class RuntimeManager(Client):
517
517
  else:
518
518
  response = await self._async_make_request("POST", url)
519
519
 
520
- return response.json().get('elementList','No server found')
520
+ return response.json().get('elements','No server found')
521
521
 
522
522
  def get_server_by_guid(self, server_guid: str, server: str = None,
523
523
  effective_time: str = None) -> str | dict:
@@ -585,7 +585,7 @@ class RuntimeManager(Client):
585
585
  if server is None:
586
586
  server = self.server_name
587
587
 
588
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/by-name?"
588
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/software-servers/by-name?"
589
589
  f"startFrom={start_from}&pageSize={page_size}")
590
590
 
591
591
  if effective_time is None:
@@ -599,7 +599,7 @@ class RuntimeManager(Client):
599
599
  }
600
600
  response = await self._async_make_request("POST", url, body)
601
601
 
602
- return response.json().get('elementList','No platforms found')
602
+ return response.json().get('elements','No platforms found')
603
603
 
604
604
  def get_servers_by_name(self, filter: str, server: str = None) -> str | list:
605
605
  """ Returns the list of servers with a particular name. The name is specified in the filter.
@@ -678,14 +678,14 @@ class RuntimeManager(Client):
678
678
  if filter == '*':
679
679
  filter = None
680
680
 
681
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/"
681
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/software-servers/"
682
682
  f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}")
683
683
 
684
684
  body = body_slimmer({ "filter": filter, "effective_time": effective_time})
685
685
 
686
686
  response = await self._async_make_request("POST", url, body)
687
687
 
688
- return response.json().get('elementList','No platforms found')
688
+ return response.json().get('elements','No platforms found')
689
689
 
690
690
  def get_servers_by_dep_impl_type(self, filter: str = "*", server:str = None, effective_time: str = None,
691
691
  start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
@@ -768,14 +768,14 @@ class RuntimeManager(Client):
768
768
  if filter == '*':
769
769
  filter = None
770
770
 
771
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/"
771
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/software-servers/"
772
772
  f"by-deployed-implementation-type?startFrom={start_from}&pageSize={page_size}&getTemplates=true")
773
773
 
774
774
  body = body_slimmer({ "filter": filter, "effective_time": effective_time})
775
775
 
776
776
  response = await self._async_make_request("POST", url, body)
777
777
 
778
- return response.json().get('elementList','No platforms found')
778
+ return response.json().get('elements','No platforms found')
779
779
 
780
780
  def get_server_templates_by_dep_impl_type(self, filter: str = "*", server:str = None, effective_time: str = None,
781
781
  start_from: int = 0, page_size: int = max_paging_size ) -> str | list:
@@ -854,7 +854,7 @@ class RuntimeManager(Client):
854
854
  if server is None:
855
855
  server = self.server_name
856
856
 
857
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/{server_guid}")
857
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/software-servers/{server_guid}")
858
858
 
859
859
  if effective_time is not None:
860
860
  body = {
@@ -929,11 +929,11 @@ class RuntimeManager(Client):
929
929
  if server is None:
930
930
  server = self.server_name
931
931
 
932
- url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/servers/{server_guid}/report")
932
+ url = (f"{self.platform_url}/servers/{server}/api/open-metadata/runtime-manager/software-servers/{server_guid}/report")
933
933
 
934
934
  response = await self._async_make_request("GET", url)
935
935
 
936
- return response.json().get('elementList', 'No server found')
936
+ return response.json().get('elements', 'No server found')
937
937
 
938
938
 
939
939
  def get_server_report(self, server_guid: str = None, server: str = None) -> str | list:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "0.5.8.27"
3
+ version = "0.5.9.2"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
File without changes
File without changes