pyegeria 1.5.1.1.18__tar.gz → 1.5.1.1.21__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 (114) hide show
  1. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/PKG-INFO +1 -1
  2. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/_client.py +67 -1
  3. pyegeria-1.5.1.1.21/pyegeria/commands/.DS_Store +0 -0
  4. pyegeria-1.5.1.1.21/pyegeria/commands/__pycache__/server_status_widget.cpython-312-pytest-7.4.4.pyc +0 -0
  5. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/glossary_actions.py +16 -6
  6. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_terms.py +24 -8
  7. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/egeria.py +8 -2
  8. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/egeria_cat.py +8 -2
  9. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/glossary_manager_omvs.py +1 -1
  10. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/runtime_manager_omvs.py +0 -66
  11. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyproject.toml +1 -1
  12. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/LICENSE +0 -0
  13. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/README.md +0 -0
  14. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/README.md +0 -0
  15. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/__init__.py +0 -0
  16. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/_deprecated_gov_engine.py +0 -0
  17. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/_exceptions.py +0 -0
  18. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/_globals.py +0 -0
  19. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/_validators.py +0 -0
  20. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/asset_catalog_omvs.py +0 -0
  21. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/automated_curation_omvs.py +0 -0
  22. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/classification_manager_omvs.py +0 -0
  23. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/collection_manager_omvs.py +0 -0
  24. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/README.md +0 -0
  25. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/__init__.py +0 -0
  26. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/README.md +0 -0
  27. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/__init__.py +0 -0
  28. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/get_asset_graph.py +0 -0
  29. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/get_collection.py +0 -0
  30. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/get_project_dependencies.py +0 -0
  31. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/get_project_structure.py +0 -0
  32. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/get_tech_type_elements.py +0 -0
  33. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/get_tech_type_template.py +0 -0
  34. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_archives.py +0 -0
  35. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_assets.py +0 -0
  36. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_cert_types.py +0 -0
  37. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_deployed_catalogs.py +0 -0
  38. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_deployed_database_schemas.py +0 -0
  39. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_deployed_databases.py +0 -0
  40. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_projects.py +0 -0
  41. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_relationships.py +0 -0
  42. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_tech_types.py +0 -0
  43. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_todos.py +0 -0
  44. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cat/list_user_ids.py +0 -0
  45. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/__init__.py +0 -0
  46. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/egeria_my.py +0 -0
  47. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/egeria_ops.py +0 -0
  48. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/egeria_tech.py +0 -0
  49. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/cli/ops_config.py +0 -0
  50. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/README.md +0 -0
  51. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/__init__.py +0 -0
  52. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/list_my_profile.py +0 -0
  53. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/list_my_roles.py +0 -0
  54. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/monitor_my_todos.py +0 -0
  55. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/monitor_open_todos.py +0 -0
  56. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/my/todo_actions.py +0 -0
  57. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/README.md +0 -0
  58. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/__init__.py +0 -0
  59. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/engine_actions.py +0 -0
  60. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/gov_server_actions.py +0 -0
  61. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/list_catalog_targets.py +0 -0
  62. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/load_archive.py +0 -0
  63. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_asset_events.py +0 -0
  64. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_engine_activity.py +0 -0
  65. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_engine_activity_c.py +0 -0
  66. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_gov_eng_status.py +0 -0
  67. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_integ_daemon_status.py +0 -0
  68. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_platform_status.py +0 -0
  69. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_server_startup.py +0 -0
  70. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/monitor_server_status.py +0 -0
  71. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/orig_monitor_server_list.py +0 -0
  72. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/orig_monitor_server_status.py +0 -0
  73. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/refresh_integration_daemon.py +0 -0
  74. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/restart_integration_daemon.py +0 -0
  75. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/ops/table_integ_daemon_status.py +0 -0
  76. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/README.md +0 -0
  77. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/__init__.py +0 -0
  78. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/get_element_graph.py +0 -0
  79. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/get_element_info.py +0 -0
  80. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/get_guid_info.py +0 -0
  81. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/get_tech_details.py +0 -0
  82. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_asset_types.py +0 -0
  83. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_elements.py +0 -0
  84. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_elements_for_classification.py +0 -0
  85. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_elements_x.py +0 -0
  86. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_gov_action_processes.py +0 -0
  87. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_registered_services.py +0 -0
  88. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_related_elements.py +0 -0
  89. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_related_specification.py +0 -0
  90. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_relationship_types.py +0 -0
  91. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_tech_templates.py +0 -0
  92. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/list_valid_metadata_values.py +0 -0
  93. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/table_tech_templates.py +0 -0
  94. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/commands/tech/x_list_related_elements.py +0 -0
  95. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/core_omag_server_config.py +0 -0
  96. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/create_tech_guid_lists.py +0 -0
  97. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/egeria_cat_client.py +0 -0
  98. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/egeria_client.py +0 -0
  99. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/egeria_config_client.py +0 -0
  100. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/egeria_my_client.py +0 -0
  101. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/egeria_tech_client.py +0 -0
  102. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/feedback_manager_omvs.py +0 -0
  103. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/full_omag_server_config.py +0 -0
  104. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/glossary_browser_omvs.py +0 -0
  105. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/mermaid_utilities.py +0 -0
  106. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/my_profile_omvs.py +0 -0
  107. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/platform_services.py +0 -0
  108. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/project_manager_omvs.py +0 -0
  109. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/registered_info.py +0 -0
  110. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/server_operations.py +0 -0
  111. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/template_manager_omvs.py +0 -0
  112. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/utils.py +0 -0
  113. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/valid_metadata_omvs.py +0 -0
  114. {pyegeria-1.5.1.1.18 → pyegeria-1.5.1.1.21}/pyegeria/x_action_author_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.1.18
3
+ Version: 1.5.1.1.21
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -10,7 +10,7 @@ import asyncio
10
10
  import inspect
11
11
  import json
12
12
  import os
13
-
13
+ from pyegeria import body_slimmer
14
14
  import httpx
15
15
  from httpx import AsyncClient, Response
16
16
 
@@ -654,6 +654,72 @@ class Client:
654
654
  integration_guids[display_name] = resource_guid
655
655
  # print(f"Added {display_name} integration connector with GUID {integration_guids[display_name]}")
656
656
 
657
+ async def __async__get_guid__(
658
+ self,
659
+ guid: str = None,
660
+ name: str = None,
661
+ property_name: str = "qualifiedName",
662
+ tech_type: str = None,
663
+ ) -> str:
664
+ """Helper function to return a server_guid - one of server_guid or server_name should
665
+ contain information. If both are None, an exception will be thrown. If both contain
666
+ values, server_guid will be used. If the tech_type is supplied and the property_name is qualifiedName
667
+ then the name will be pre-pended with the tech_type name to form a qualifiedName.
668
+
669
+ An InvalidParameter Exception is thrown if multiple matches
670
+ are found for the given property name. If this occurs, use a qualified name for the property name.
671
+ Async version.
672
+ """
673
+ if guid:
674
+ return guid
675
+ if name:
676
+ if (tech_type) and (property_name == "qualifiedName"):
677
+ name = f"{tech_type}:{name}"
678
+
679
+ body = {
680
+ "class": "NameRequestBody",
681
+ "name": name,
682
+ "namePropertyName": property_name,
683
+ "forLineage": False,
684
+ "forDuplicateProcessing": False,
685
+ "effectiveTime": None,
686
+ }
687
+ url = (
688
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
689
+ f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
690
+ )
691
+
692
+ response: Response = await self._async_make_request(
693
+ "POST", url, body_slimmer(body), time_out=self.time_out
694
+ )
695
+
696
+ return response.json().get("guid", "No elements found")
697
+ else:
698
+ raise InvalidParameterException(
699
+ "Neither server_guid nor server_name were provided - please provide."
700
+ )
701
+
702
+ def __get_guid__(
703
+ self,
704
+ guid: str = None,
705
+ name: str = None,
706
+ property_name: str = "qualifiedName",
707
+ tech_type: str = None,
708
+ ) -> str:
709
+ """Helper function to return a server_guid - one of server_guid or server_name should
710
+ contain information. If both are None, an exception will be thrown. If both contain
711
+ values, server_guid will be used. If the tech_type is supplied and the property_name is qualifiedName
712
+ then the name will be pre-pended with the tech_type name to form a qualifiedName.
713
+
714
+ An InvalidParameter Exception is thrown if multiple matches
715
+ are found for the given property name. If this occurs, use a qualified name for the property name.
716
+ """
717
+ loop = asyncio.get_event_loop()
718
+ result = loop.run_until_complete(
719
+ self.__async__get_guid__(guid, name, property_name, tech_type)
720
+ )
721
+ return result
722
+
657
723
 
658
724
  if __name__ == "__main__":
659
725
  print("Main-__client")
@@ -88,12 +88,22 @@ def create_glossary(
88
88
 
89
89
  existing_glossary = m_client.find_glossaries(name)
90
90
  if type(existing_glossary) is list:
91
- click.echo(f"\nFound {len(existing_glossary)} existing Glossaries\n")
91
+ click.echo(
92
+ f"\nFound {len(existing_glossary)} existing Glossaries with a similar name!\n"
93
+ )
92
94
  for glossary in existing_glossary:
93
- click.echo(
94
- f"\tFound glossary: {glossary['glossaryProperties']['qualifiedName']} with id of {glossary['elementHeader']['guid']}\n"
95
- )
96
- sys.exit(0)
95
+ if (
96
+ glossary["glossaryProperties"]["qualifiedName"]
97
+ == "Glossary:" + name
98
+ ):
99
+ click.echo(
100
+ f"\tFound existing glossary: {glossary['glossaryProperties']['qualifiedName']} with id of {glossary['elementHeader']['guid']}\n"
101
+ )
102
+ sys.exit(0)
103
+ else:
104
+ click.echo(
105
+ "Found glossaries with similar names but different qualifiedNames...proceeding\n"
106
+ )
97
107
 
98
108
  glossary_guid = m_client.create_glossary(name, description, language, usage)
99
109
  print(f"New glossary {name} created with id of {glossary_guid}")
@@ -104,7 +114,7 @@ def create_glossary(
104
114
  m_client.close_session()
105
115
 
106
116
 
107
- @click.command("list-glossaries")
117
+ @click.command("glossaries")
108
118
  @click.option("--search-string", default="*", help="Glossaries to search for")
109
119
  @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
110
120
  @click.option(
@@ -23,6 +23,7 @@ from pyegeria import (
23
23
  InvalidParameterException,
24
24
  PropertyServerException,
25
25
  UserNotAuthorizedException,
26
+ EgeriaTech,
26
27
  )
27
28
  from pyegeria.glossary_browser_omvs import GlossaryBrowser
28
29
 
@@ -46,7 +47,8 @@ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
46
47
 
47
48
  def display_glossary_terms(
48
49
  search_string: str,
49
- guid: str,
50
+ glossary_guid: str,
51
+ glossary_name: str,
50
52
  server: str,
51
53
  url: str,
52
54
  username: str,
@@ -54,10 +56,18 @@ def display_glossary_terms(
54
56
  jupyter: bool = EGERIA_JUPYTER,
55
57
  width: int = EGERIA_WIDTH,
56
58
  ):
57
- g_client = GlossaryBrowser(server, url, username, user_password)
59
+ """Display glossary terms in a table"""
60
+ g_client = EgeriaTech(server, url, username, user_password)
58
61
  token = g_client.create_egeria_bearer_token()
62
+ if (glossary_name is not None) and (glossary_name != "*"):
63
+ glossary_guid = g_client.__get_guid__(
64
+ glossary_guid,
65
+ glossary_name,
66
+ "qualifiedName",
67
+ "Glossary",
68
+ )
59
69
 
60
- def generate_table(search_string: str = "*") -> Table:
70
+ def generate_table(search_string: str, glossary_guid: str = None) -> Table:
61
71
  """Make a new table."""
62
72
  table = Table(
63
73
  title=f"Glossary Definitions for Terms like {search_string} @ {time.asctime()}",
@@ -82,7 +92,7 @@ def display_glossary_terms(
82
92
 
83
93
  terms = g_client.find_glossary_terms(
84
94
  search_string,
85
- guid,
95
+ glossary_guid,
86
96
  starts_with=False,
87
97
  ends_with=False,
88
98
  status_filter=[],
@@ -149,7 +159,7 @@ def display_glossary_terms(
149
159
  style="bold bright_white on black", width=width, force_terminal=not jupyter
150
160
  )
151
161
  with console.pager(styles=True):
152
- console.print(generate_table(search_string))
162
+ console.print(generate_table(search_string, glossary_guid))
153
163
 
154
164
  except (
155
165
  InvalidParameterException,
@@ -167,7 +177,7 @@ def main():
167
177
  parser.add_argument("--userid", help="User Id")
168
178
  parser.add_argument("--password", help="User Password")
169
179
  parser.add_argument("--guid", help="GUID of glossary to search")
170
- parser.add_argument("--sustainability", help="Set True for Sustainability Glossary")
180
+
171
181
  args = parser.parse_args()
172
182
 
173
183
  server = args.server if args.server is not None else EGERIA_VIEW_SERVER
@@ -175,11 +185,17 @@ def main():
175
185
  userid = args.userid if args.userid is not None else EGERIA_USER
176
186
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
177
187
  guid = args.guid if args.guid is not None else None
178
- guid = sus_guid if args.sustainability else None
179
188
 
180
189
  try:
181
190
  search_string = Prompt.ask("Enter the term you are searching for:", default="*")
182
- display_glossary_terms(search_string, guid, server, url, userid, user_pass)
191
+ glossary_name = Prompt.ask(
192
+ "Enter the name of the glossary to search or '*' for all glossaries:",
193
+ default="*",
194
+ )
195
+ display_glossary_terms(
196
+ search_string, guid, glossary_name, server, url, userid, user_pass
197
+ )
198
+
183
199
  except KeyboardInterrupt:
184
200
  pass
185
201
 
@@ -790,17 +790,23 @@ def show_assets(ctx, search_string):
790
790
  help="List glossary terms similar to search string - minimum of 4 characters",
791
791
  )
792
792
  @click.option(
793
- "--glossary_guid",
793
+ "--glossary-guid",
794
794
  default=None,
795
795
  help="Optionally restrict search to glossary with the specified guid",
796
796
  )
797
+ @click.option(
798
+ "--glossary-name",
799
+ default="*",
800
+ help="Optionally restrict search to a specific named glossary",
801
+ )
797
802
  @click.pass_context
798
- def show_terms(ctx, search_string, glossary_guid):
803
+ def show_terms(ctx, search_string, glossary_guid, glossary_name):
799
804
  """Find and display glossary terms"""
800
805
  c = ctx.obj
801
806
  display_glossary_terms(
802
807
  search_string,
803
808
  glossary_guid,
809
+ glossary_name,
804
810
  c.view_server,
805
811
  c.view_server_url,
806
812
  c.userid,
@@ -288,17 +288,23 @@ def show_assets(ctx, search_string):
288
288
  help="List glossary terms similar to search string - minimum of 4 characters",
289
289
  )
290
290
  @click.option(
291
- "--glossary_guid",
291
+ "--glossary-guid",
292
292
  default=None,
293
293
  help="Optionally restrict search to glossary with the specified guid",
294
294
  )
295
+ @click.option(
296
+ "--glossary-name",
297
+ default="*",
298
+ help="Optionally restrict search to a specific named glossary",
299
+ )
295
300
  @click.pass_context
296
- def show_terms(ctx, search_string, glossary_guid):
301
+ def show_terms(ctx, search_string, glossary_guid, glossary_name):
297
302
  """Find and display glossary terms"""
298
303
  c = ctx.obj
299
304
  display_glossary_terms(
300
305
  search_string,
301
306
  glossary_guid,
307
+ glossary_name,
302
308
  c.view_server,
303
309
  c.view_server_url,
304
310
  c.userid,
@@ -103,7 +103,7 @@ class GlossaryManager(GlossaryBrowser):
103
103
  "class": "ReferenceableRequestBody",
104
104
  "elementProperties": {
105
105
  "class": "GlossaryProperties",
106
- "qualifiedName": f"Glossary:{display_name}-{time.asctime()}",
106
+ "qualifiedName": f"Glossary:{display_name}",
107
107
  "displayName": display_name,
108
108
  "description": description,
109
109
  "language": language,
@@ -58,72 +58,6 @@ class RuntimeManager(Client):
58
58
  "Default Local OMAG Server Platform" # this from the core content archive
59
59
  )
60
60
 
61
- async def __async__get_guid__(
62
- self,
63
- guid: str = None,
64
- name: str = None,
65
- property_name: str = "qualifiedName",
66
- tech_type: str = None,
67
- ) -> str:
68
- """Helper function to return a server_guid - one of server_guid or server_name should
69
- contain information. If both are None, an exception will be thrown. If both contain
70
- values, server_guid will be used. If the tech_type is supplied and the property_name is qualifiedName
71
- then the name will be pre-pended with the tech_type name to form a qualifiedName.
72
-
73
- An InvalidParameter Exception is thrown if multiple matches
74
- are found for the given property name. If this occurs, use a qualified name for the property name.
75
- Async version.
76
- """
77
- if guid:
78
- return guid
79
- if name:
80
- if (tech_type) and (property_name == "qualifiedName"):
81
- name = f"{tech_type}:{name}"
82
-
83
- body = {
84
- "class": "NameRequestBody",
85
- "name": name,
86
- "namePropertyName": property_name,
87
- "forLineage": False,
88
- "forDuplicateProcessing": False,
89
- "effectiveTime": None,
90
- }
91
- url = (
92
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/"
93
- f"elements/guid-by-unique-name?forLineage=false&forDuplicateProcessing=false"
94
- )
95
-
96
- response: Response = await self._async_make_request(
97
- "POST", url, body_slimmer(body), time_out=self.time_out
98
- )
99
-
100
- return response.json().get("guid", "No elements found")
101
- else:
102
- raise InvalidParameterException(
103
- "Neither server_guid nor server_name were provided - please provide."
104
- )
105
-
106
- def __get_guid__(
107
- self,
108
- guid: str = None,
109
- name: str = None,
110
- property_name: str = "qualifiedName",
111
- tech_type: str = None,
112
- ) -> str:
113
- """Helper function to return a server_guid - one of server_guid or server_name should
114
- contain information. If both are None, an exception will be thrown. If both contain
115
- values, server_guid will be used. If the tech_type is supplied and the property_name is qualifiedName
116
- then the name will be pre-pended with the tech_type name to form a qualifiedName.
117
-
118
- An InvalidParameter Exception is thrown if multiple matches
119
- are found for the given property name. If this occurs, use a qualified name for the property name.
120
- """
121
- loop = asyncio.get_event_loop()
122
- result = loop.run_until_complete(
123
- self.__async__get_guid__(guid, name, property_name, tech_type)
124
- )
125
- return result
126
-
127
61
  #
128
62
  # Cohorts
129
63
  #
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "1.5.1.1.18"
3
+ version = "1.5.1.1.21"
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