pyegeria 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl

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 (49) hide show
  1. pyegeria/Xasset_catalog_omvs.py +539 -0
  2. pyegeria/Xfeedback_manager_omvs.py +251 -0
  3. pyegeria/Xglossary_manager_omvs.py +3001 -0
  4. pyegeria/Xloaded_resources_omvs.py +91 -0
  5. pyegeria/__init__.py +6 -9
  6. pyegeria/_client.py +4 -6
  7. pyegeria/{gov_engine.py → _deprecated_gov_engine.py} +2 -59
  8. pyegeria/_exceptions.py +5 -6
  9. pyegeria/_globals.py +1 -1
  10. pyegeria/automated_curation_omvs.py +320 -315
  11. pyegeria/collection_manager_omvs.py +187 -248
  12. pyegeria/core_omag_server_config.py +1 -5
  13. pyegeria/full_omag_server_config.py +53 -83
  14. pyegeria/glossary_browser_omvs.py +2208 -0
  15. pyegeria/my_profile_omvs.py +8 -12
  16. pyegeria/platform_services.py +0 -3
  17. pyegeria/project_manager_omvs.py +9 -15
  18. pyegeria/registered_info.py +12 -52
  19. pyegeria/server_operations.py +1 -5
  20. pyegeria/valid_metadata_omvs.py +11 -23
  21. pyegeria-0.3.9.data/scripts/Create_Collection_Sample.py +292 -0
  22. pyegeria-0.3.9.data/scripts/Create_Sustainability_Collection_Sample.py +115 -0
  23. pyegeria-0.3.9.data/scripts/coco_status.py +98 -0
  24. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/collection_viewer.py +12 -31
  25. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/engine_action_status.py +14 -30
  26. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/find_todos.py +12 -41
  27. pyegeria-0.3.9.data/scripts/get_registered_services.py +135 -0
  28. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/get_relationship_types.py +16 -35
  29. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/glossary_view.py +2 -2
  30. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/gov_engine_status.py +0 -1
  31. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/list_asset_types.py +3 -25
  32. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/my_todos.py +1 -1
  33. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/open_todos.py +3 -24
  34. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/project_list_viewer.py +12 -26
  35. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/server_status.py +1 -20
  36. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/view_my_profile.py +8 -34
  37. {pyegeria-0.3.7.dist-info → pyegeria-0.3.9.dist-info}/METADATA +1 -3
  38. pyegeria-0.3.9.dist-info/RECORD +49 -0
  39. pyegeria/glossary_omvs.py +0 -789
  40. pyegeria-0.3.7.dist-info/RECORD +0 -41
  41. /pyegeria/{governance_author.py → Xaction_author_omvs.py} +0 -0
  42. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/get_tech_details.py +0 -0
  43. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/get_tech_types.py +0 -0
  44. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/integration_daemon_status.py +0 -0
  45. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/multi-server_status.py +0 -0
  46. {pyegeria-0.3.7.data → pyegeria-0.3.9.data}/scripts/server_status_widget.py +0 -0
  47. {pyegeria-0.3.7.dist-info → pyegeria-0.3.9.dist-info}/LICENSE +0 -0
  48. {pyegeria-0.3.7.dist-info → pyegeria-0.3.9.dist-info}/WHEEL +0 -0
  49. {pyegeria-0.3.7.dist-info → pyegeria-0.3.9.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,251 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ Feedback Manager View Service Methods - Add comments, reviews, tags and notes to elements of interest.
6
+
7
+ """
8
+ import asyncio
9
+ from datetime import datetime
10
+
11
+ from httpx import Response
12
+
13
+ from pyegeria import Client, max_paging_size, body_slimmer
14
+ from pyegeria._exceptions import (
15
+ InvalidParameterException,
16
+ )
17
+ from ._validators import validate_name, validate_guid, validate_search_string
18
+
19
+
20
+ class FeedbackManager(Client):
21
+ """ Set up and maintain automation services in Egeria.
22
+
23
+ Attributes:
24
+ server_name : str
25
+ The name of the View Server to use.
26
+ platform_url : str
27
+ URL of the server platform to connect to
28
+ user_id : str
29
+ The identity of the user calling the method - this sets a default optionally used by the methods
30
+ when the user doesn't pass the user_id on a method call.
31
+ user_pwd: str
32
+ The password associated with the user_id. Defaults to None
33
+ verify_flag: bool
34
+ Flag to indicate if SSL Certificates should be verified in the HTTP requests.
35
+ Defaults to False.
36
+
37
+ """
38
+
39
+ def __init__(
40
+ self,
41
+ server_name: str,
42
+ platform_url: str,
43
+ user_id: str,
44
+ user_pwd: str = None,
45
+ verify_flag: bool = False,
46
+ ):
47
+ Client.__init__(self, server_name, platform_url, user_id, user_pwd, verify_flag)
48
+ self.cur_command_root = f"{platform_url}/servers/"
49
+
50
+
51
+ async def _async_get_comment_by_guid(self, comment_guid: str, view_server: str, server: str = None,
52
+ access_service: str = 'asset-manager',for_lineage: bool = False,
53
+ for_duplicate_processing: bool = False, effective_time: str = None) -> dict:
54
+ """ Create a new metadata element from a template. Async version.
55
+ Parameters
56
+ ----------
57
+ body : str
58
+ The json body used to instantiate the template.
59
+ server : str, optional
60
+ The name of the view server to use. If not provided, the default server name will be used.
61
+
62
+ Returns
63
+ -------
64
+ Response
65
+ The guid of the resulting element
66
+
67
+ Raises
68
+ ------
69
+ InvalidParameterException
70
+ PropertyServerException
71
+ UserNotAuthorizedException
72
+
73
+ Notes
74
+ -----
75
+
76
+ """
77
+
78
+ server = self.server_name if server is None else server
79
+
80
+ url = f"{self.platform_url}/servers/{server}/api/open-metadata/automated-curation/catalog-templates/new-element"
81
+ response = await self._async_make_request("POST", url)
82
+ return response.json().get("guid", "GUID failed to be returned")
83
+
84
+ def get_comment_by_guid(self, comment_guid: str, view_server: str, server: str = None,
85
+ access_service: str = 'asset-manager',for_lineage: bool = False,
86
+ for_duplicate_processing: bool = False, effective_time: str = None) -> dict:
87
+ """ Create a new metadata element from a template. Async version.
88
+ Parameters
89
+ ----------
90
+ body : str
91
+ The json body used to instantiate the template.
92
+ server : str, optional
93
+ The name of the view server to use. If not provided, the default server name will be used.
94
+
95
+ Returns
96
+ -------
97
+ Response
98
+ The guid of the resulting element
99
+
100
+ Raises
101
+ ------
102
+ InvalidParameterException
103
+ PropertyServerException
104
+ UserNotAuthorizedException
105
+
106
+ Notes
107
+ -----
108
+ See also: https://egeria-project.org/features/templated-cataloguing/overview/
109
+ The full description of the body is shown below:
110
+ {
111
+ "typeName" : "",
112
+ "initialStatus" : "",
113
+ "initialClassifications" : "",
114
+ "anchorGUID" : "",
115
+ "isOwnAnchor" : "",
116
+ "effectiveFrom" : "",
117
+ "effectiveTo" : "",
118
+ "templateGUID" : "",
119
+ "templateProperties" : {},
120
+ "placeholderPropertyValues" : {
121
+ "placeholderPropertyName1" : "placeholderPropertyValue1",
122
+ "placeholderPropertyName2" : "placeholderPropertyValue2"
123
+ },
124
+ "parentGUID" : "",
125
+ "parentRelationshipTypeName" : "",
126
+ "parentRelationshipProperties" : "",
127
+ "parentAtEnd1" : "",
128
+ "effectiveTime" : ""
129
+ }
130
+ """
131
+ loop = asyncio.get_event_loop()
132
+ response = loop.run_until_complete(
133
+ self._async_get_comment_by_guid(comment_guid, view_server,server,access_service,
134
+ for_lineage,for_duplicate_processing,effective_time)
135
+ )
136
+ return response
137
+
138
+ async def _async_add_comment_to_reply(self, comment_guid: str, view_server: str, comment: str, server: str = None,
139
+ access_service: str = 'asset-manager', is_public: bool = False,
140
+ for_lineage: bool = False, for_duplicate_processing: bool = False,
141
+ effective_time: str = None) -> str:
142
+ """ Add a reply to a comment. Async version.
143
+ See also: https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback
144
+
145
+ Parameters
146
+ ----------
147
+ comment_guid : str
148
+ The GUID of the comment.
149
+ view_server : str
150
+ The server where the view is hosted.
151
+ comment : str
152
+ The text to add as the reply.
153
+ server : str, optional
154
+ The server to connect to. Default is None.
155
+ access_service : str, optional
156
+ The access service to use. Default is 'asset-manager'.
157
+ is_public : bool, optional
158
+ Determines if the comment is public. Default is False.
159
+ for_lineage : bool, optional
160
+ Determines if the comment is for lineage. Default is False.
161
+ for_duplicate_processing : bool, optional
162
+ Determines if the comment is for duplicate processing. Default is False.
163
+ effective_time : str, optional
164
+ The effective time for the comment. Default is None.
165
+
166
+ Returns
167
+ -------
168
+ str
169
+ The unique identifier (guid) of the new comment.
170
+
171
+ Raises
172
+ ------
173
+ InvalidParameterException
174
+ PropertyServerException
175
+ UserNotAuthorizedException
176
+
177
+ """
178
+
179
+ url = f"{self.cur_command_root}api/open-metadata/feedback-manager/comments/{comment_guid}/replies"
180
+ body = {
181
+ 'parentGUID': comment_guid,
182
+ 'effectiveTime': effective_time,
183
+ 'updateDescription': comment
184
+ }
185
+
186
+ response = await self._async_make_request("POST",url,body)
187
+ return response
188
+
189
+ def add_comment_to_reply(self, comment_guid: str, view_server: str, comment: str, server: str = None,
190
+ access_service: str = 'asset-manager', is_public: bool = False,
191
+ for_lineage: bool = False, for_duplicate_processing: bool = False,
192
+ effective_time: str = None) -> str:
193
+ """ Add a reply to a comment. Async version.
194
+ See also: https://egeria-project.org/patterns/metadata-manager/overview/#asset-feedback
195
+
196
+ Parameters
197
+ ----------
198
+ comment_guid : str
199
+ The GUID of the comment.
200
+ view_server : str
201
+ The server where the view is hosted.
202
+ comment : str
203
+ The text to add as the reply.
204
+ server : str, optional
205
+ The server to connect to. Default is None.
206
+ access_service : str, optional
207
+ The access service to use. Default is 'asset-manager'.
208
+ is_public : bool, optional
209
+ Determines if the comment is public. Default is False.
210
+ for_lineage : bool, optional
211
+ Determines if the comment is for lineage. Default is False.
212
+ for_duplicate_processing : bool, optional
213
+ Determines if the comment is for duplicate processing. Default is False.
214
+ effective_time : str, optional
215
+ The effective time for the comment. Default is None.
216
+
217
+ Returns
218
+ -------
219
+ str
220
+ The unique identifier (guid) of the new comment.
221
+
222
+ Raises
223
+ ------
224
+ InvalidParameterException
225
+ PropertyServerException
226
+ UserNotAuthorizedException
227
+
228
+ """
229
+ loop = asyncio.get_event_loop()
230
+ response = loop.run_until_complete(
231
+ self._async_add_comment_to_reply(comment_guid, view_server, comment,
232
+ server, access_service, is_public,)
233
+ )
234
+ return response
235
+
236
+
237
+
238
+ async def _async_get_all_technology_types(self, server: str = None, start_from: int = 0,
239
+ page_size: int = max_paging_size) -> list | str:
240
+ return await self._async_find_technology_types("*", server, start_from, page_size)
241
+
242
+ def get_all_technology_types(self, server: str = None, start_from: int = 0,
243
+ page_size: int = max_paging_size) -> list | str:
244
+ return self.find_technology_types("*", server, start_from, page_size)
245
+
246
+
247
+ if __name__ == "__main__":
248
+ p = AutomatedCuration("meow", "https://127.0.0.1:9443", "garygeeke", verify_flag=False)
249
+ response = p.get_active_engine_actions()
250
+ out = response.json()
251
+ print(out)