pyegeria 0.7.18__py3-none-any.whl → 0.7.20__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.
- examples/widgets/cat/get_project_dependencies.py +135 -0
- examples/widgets/cat/get_project_structure.py +3 -0
- examples/widgets/cat/list_todos.py +25 -12
- examples/widgets/cat/list_user_ids.py +119 -0
- examples/widgets/cli/egeria.py +30 -6
- examples/widgets/cli/egeria_cat.py +29 -5
- examples/widgets/cli/egeria_my.py +8 -1
- examples/widgets/cli/egeria_ops.py +2 -2
- examples/widgets/my/todo_actions.py +190 -0
- examples/widgets/ops/engine_actions.py +35 -16
- pyegeria/glossary_manager_omvs.py +33 -135
- pyegeria/my_profile_omvs.py +12 -13
- {pyegeria-0.7.18.dist-info → pyegeria-0.7.20.dist-info}/METADATA +1 -1
- {pyegeria-0.7.18.dist-info → pyegeria-0.7.20.dist-info}/RECORD +17 -14
- {pyegeria-0.7.18.dist-info → pyegeria-0.7.20.dist-info}/entry_points.txt +10 -1
- {pyegeria-0.7.18.dist-info → pyegeria-0.7.20.dist-info}/LICENSE +0 -0
- {pyegeria-0.7.18.dist-info → pyegeria-0.7.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,190 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
Execute ToDo actions.
|
8
|
+
|
9
|
+
"""
|
10
|
+
import os
|
11
|
+
import time
|
12
|
+
|
13
|
+
import click
|
14
|
+
|
15
|
+
# from ops_config import Config, pass_config
|
16
|
+
from pyegeria import MyProfile
|
17
|
+
from pyegeria._exceptions import (
|
18
|
+
InvalidParameterException,
|
19
|
+
PropertyServerException,
|
20
|
+
print_exception_response,
|
21
|
+
)
|
22
|
+
|
23
|
+
erins_guid = "a588fb08-ae09-4415-bd5d-991882ceacba"
|
24
|
+
peter_guid = "a187bc48-8154-491f-97b4-a2f3c3f1a00e"
|
25
|
+
tanya_guid = "26ec1614-bede-4b25-a2a3-f8ed26db3aaa"
|
26
|
+
|
27
|
+
ERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
28
|
+
EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
|
29
|
+
EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
|
30
|
+
EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
|
31
|
+
EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
32
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
33
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
|
34
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
35
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
36
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
37
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
38
|
+
|
39
|
+
|
40
|
+
@click.command('create-todo')
|
41
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
42
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
43
|
+
@click.option('--userid', default=EGERIA_USER, help='Egeria user')
|
44
|
+
@click.option('--password', default=EGERIA_USER_PASSWORD, help='Egeria user password')
|
45
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
46
|
+
@click.option('--name', prompt='Todo Name', help='Name of Todo', required=True)
|
47
|
+
@click.option('--description', prompt='Description', help='Brief description of To Do item', required=True)
|
48
|
+
@click.option('--type', prompt='Todo Type', help='Type of Todo', required=True, default='forMe')
|
49
|
+
@click.option('--priority', prompt='Todo Priority', type=int, help='Priority of Todo', required=True, default=0)
|
50
|
+
@click.option('--due', prompt='Due Date', help='Due date of Todo (yyyy-mm-dd)', required=True)
|
51
|
+
@click.option('--assigned-to', prompt='Assigned to', help='Party the Todo is assigned to', required=True,
|
52
|
+
default=peter_guid)
|
53
|
+
def create_todo(server, url, userid, password, timeout, name, description, type, priority, due, assigned_to):
|
54
|
+
"""Create a new ToDo item"""
|
55
|
+
m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
|
56
|
+
token = m_client.create_egeria_bearer_token()
|
57
|
+
try:
|
58
|
+
body = {
|
59
|
+
"properties": {
|
60
|
+
"class": "ToDoProperties",
|
61
|
+
"qualifiedName": f"{name}-{time.asctime()}",
|
62
|
+
"name": name,
|
63
|
+
"description": description,
|
64
|
+
"toDoType": type,
|
65
|
+
"priority": priority,
|
66
|
+
"dueTime": due,
|
67
|
+
"status": "OPEN"
|
68
|
+
},
|
69
|
+
"assignToActorGUID": assigned_to
|
70
|
+
}
|
71
|
+
|
72
|
+
resp = m_client.create_to_do(body)
|
73
|
+
# if type(resp) is str:
|
74
|
+
click.echo(f"Response was {resp}")
|
75
|
+
# elif type(resp) is dict:
|
76
|
+
# click.echo(json.dumps(resp), indent = 2)
|
77
|
+
|
78
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
79
|
+
print_exception_response(e)
|
80
|
+
finally:
|
81
|
+
m_client.close_session()
|
82
|
+
|
83
|
+
|
84
|
+
@click.command('delete-todo')
|
85
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
86
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
87
|
+
@click.option('--userid', default=EGERIA_USER, help='Egeria user')
|
88
|
+
@click.option('--password', default=EGERIA_USER_PASSWORD, help='Egeria user password')
|
89
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
90
|
+
@click.argument('todo-guid')
|
91
|
+
def delete_todo(server, url, userid, password, timeout, todo_guid):
|
92
|
+
"""Delete the todo item specified """
|
93
|
+
m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
|
94
|
+
token = m_client.create_egeria_bearer_token()
|
95
|
+
try:
|
96
|
+
m_client.delete_to_do(todo_guid)
|
97
|
+
|
98
|
+
click.echo(f"Deleted Todo item {todo_guid}")
|
99
|
+
|
100
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
101
|
+
print_exception_response(e)
|
102
|
+
finally:
|
103
|
+
m_client.close_session()
|
104
|
+
|
105
|
+
|
106
|
+
@click.command('change-todo-status')
|
107
|
+
@click.argument('todo-guid')
|
108
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
109
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
110
|
+
@click.option('--userid', default=EGERIA_USER, help='Egeria user')
|
111
|
+
@click.option('--password', default=EGERIA_USER_PASSWORD, help='Egeria user password')
|
112
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
113
|
+
@click.option('--new-status', type=click.Choice(['OPEN', 'IN_PROGRESS', 'WAITING', 'COMPLETE', 'ABANDONED'],
|
114
|
+
case_sensitive='False'), help='Enter the new ToDo item status',
|
115
|
+
required=True)
|
116
|
+
def change_todo_status(server, url, userid, password, timeout, todo_guid, new_status):
|
117
|
+
"""Update a ToDo item status"""
|
118
|
+
m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
|
119
|
+
token = m_client.create_egeria_bearer_token()
|
120
|
+
try:
|
121
|
+
|
122
|
+
body = {
|
123
|
+
"properties": {
|
124
|
+
"class": "ToDoProperties",
|
125
|
+
"toDoStatus": new_status
|
126
|
+
},
|
127
|
+
}
|
128
|
+
m_client.update_to_do(todo_guid, body, is_merge_update=True)
|
129
|
+
|
130
|
+
click.echo(f"Marked todo item {todo_guid} as complete.")
|
131
|
+
|
132
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
133
|
+
print_exception_response(e)
|
134
|
+
finally:
|
135
|
+
m_client.close_session()
|
136
|
+
|
137
|
+
|
138
|
+
@click.command('mark-todo-complete')
|
139
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
140
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
141
|
+
@click.option('--userid', default=EGERIA_USER, help='Egeria user')
|
142
|
+
@click.option('--password', default=EGERIA_USER_PASSWORD, help='Egeria user password')
|
143
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
144
|
+
@click.argument('todo-guid')
|
145
|
+
@click.pass_context
|
146
|
+
def mark_todo_complete(server, url, userid, password, timeout, todo_guid):
|
147
|
+
"""Mark the specified todo as complete"""
|
148
|
+
try:
|
149
|
+
m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
|
150
|
+
token = m_client.create_egeria_bearer_token()
|
151
|
+
body = {
|
152
|
+
"properties": {
|
153
|
+
"class": "ToDoProperties",
|
154
|
+
"completionTime": time.asctime(),
|
155
|
+
"toDoStatus": "COMPLETE"
|
156
|
+
},
|
157
|
+
}
|
158
|
+
m_client.update_to_do(todo_guid, body, is_merge_update=True)
|
159
|
+
|
160
|
+
click.echo(f"Marked todo item {todo_guid} as complete.")
|
161
|
+
|
162
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
163
|
+
print_exception_response(e)
|
164
|
+
finally:
|
165
|
+
m_client.close_session()
|
166
|
+
|
167
|
+
|
168
|
+
@click.command('reassign-todo')
|
169
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
170
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
171
|
+
@click.option('--userid', default=EGERIA_USER, help='Egeria user')
|
172
|
+
@click.option('--password', default=EGERIA_USER_PASSWORD, help='Egeria user password')
|
173
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
174
|
+
@click.argument('todo-guid')
|
175
|
+
@click.argument('new-actor-guid')
|
176
|
+
@click.pass_context
|
177
|
+
def reassign_todo(server, url, userid, password, timeout, todo_guid, new_actor_guid):
|
178
|
+
"""Reassign ToDo item to new actor"""
|
179
|
+
m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
|
180
|
+
token = m_client.create_egeria_bearer_token()
|
181
|
+
try:
|
182
|
+
|
183
|
+
m_client.reassign_to_do(todo_guid, new_actor_guid)
|
184
|
+
|
185
|
+
click.echo(f"Reassigned Todo item {todo_guid} to {new_actor_guid}")
|
186
|
+
|
187
|
+
except (InvalidParameterException, PropertyServerException) as e:
|
188
|
+
print_exception_response(e)
|
189
|
+
finally:
|
190
|
+
m_client.close_session()
|
@@ -7,46 +7,65 @@ Copyright Contributors to the ODPi Egeria project.
|
|
7
7
|
Execute engine actions.
|
8
8
|
|
9
9
|
"""
|
10
|
+
import os
|
11
|
+
|
10
12
|
import click
|
13
|
+
|
11
14
|
# from ops_config import Config, pass_config
|
12
|
-
from pyegeria import
|
15
|
+
from pyegeria import Platform
|
13
16
|
from pyegeria._exceptions import (
|
14
17
|
InvalidParameterException,
|
15
18
|
PropertyServerException,
|
16
|
-
UserNotAuthorizedException,
|
17
19
|
print_exception_response,
|
18
20
|
)
|
19
21
|
|
20
|
-
|
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('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
|
27
|
+
EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
|
28
|
+
EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
|
29
|
+
EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
|
30
|
+
EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
|
31
|
+
EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
|
32
|
+
EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
|
21
33
|
|
22
34
|
|
23
35
|
@click.command('stop')
|
24
|
-
@click.
|
25
|
-
|
36
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
37
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
38
|
+
@click.option('--userid', default=EGERIA_ADMIN_USER, help='Egeria admin user')
|
39
|
+
@click.option('--password', default=EGERIA_ADMIN_PASSWORD, help='Egeria admin password')
|
40
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
41
|
+
def stop_daemon(file, server, url, userid, password, timeout):
|
26
42
|
"""Stop an engine-host daemon"""
|
43
|
+
p_client = Platform(server, url, userid, password)
|
27
44
|
try:
|
28
|
-
c = ctx.obj
|
29
|
-
p_client = Platform(c.engine_host, c.engine_host_url, c.admin_user, c.admin_user_password)
|
30
|
-
|
31
45
|
p_client.shutdown_server()
|
32
46
|
|
33
|
-
click.echo(f"Stopped server {
|
47
|
+
click.echo(f"Stopped server {server}")
|
34
48
|
except (InvalidParameterException, PropertyServerException) as e:
|
35
49
|
print_exception_response(e)
|
50
|
+
finally:
|
51
|
+
p_client.close_session()
|
36
52
|
|
37
53
|
|
38
54
|
@click.command('start')
|
39
|
-
@click.
|
40
|
-
|
55
|
+
@click.option('--server', default=EGERIA_VIEW_SERVER, help='Egeria metadata store to load')
|
56
|
+
@click.option('--url', default=EGERIA_VIEW_SERVER_URL, help='URL of Egeria platform to connect to')
|
57
|
+
@click.option('--userid', default=EGERIA_ADMIN_USER, help='Egeria admin user')
|
58
|
+
@click.option('--password', default=EGERIA_ADMIN_PASSWORD, help='Egeria admin password')
|
59
|
+
@click.option('--timeout', default=60, help='Number of seconds to wait')
|
60
|
+
def start_daemon(file, server, url, userid, password, timeout):
|
41
61
|
"""Start or restart an engine-host from its known configuration """
|
62
|
+
p_client = Platform(server, url, userid, password)
|
42
63
|
try:
|
43
|
-
c = ctx.obj
|
44
|
-
p_client = Platform(c.engine_host, c.engine_host_url, c.admin_user, c.admin_user_password)
|
45
|
-
|
46
64
|
p_client.activate_server_stored_config()
|
47
65
|
|
48
|
-
click.echo(f"Started server {
|
66
|
+
click.echo(f"Started server {server}")
|
49
67
|
|
50
68
|
except (InvalidParameterException, PropertyServerException) as e:
|
51
69
|
print_exception_response(e)
|
52
|
-
|
70
|
+
finally:
|
71
|
+
p_client.close_session()
|
@@ -7,7 +7,8 @@ added in subsequent versions of the glossary_omvs module.
|
|
7
7
|
|
8
8
|
"""
|
9
9
|
import asyncio
|
10
|
-
from datetime import datetime
|
10
|
+
from datetime import datetime
|
11
|
+
import time
|
11
12
|
|
12
13
|
# import json
|
13
14
|
from pyegeria._client import Client
|
@@ -48,7 +49,8 @@ class GlossaryManager(GlossaryBrowser):
|
|
48
49
|
# Get Valid Values for Enumerations
|
49
50
|
#
|
50
51
|
|
51
|
-
async def _async_create_glossary(self, display_name: str, description: str,
|
52
|
+
async def _async_create_glossary(self, display_name: str, description: str, language: str = "English",
|
53
|
+
usage: str = None, server_name: str = None) -> str:
|
52
54
|
""" Create a new glossary. Async version.
|
53
55
|
|
54
56
|
Parameters
|
@@ -57,6 +59,10 @@ class GlossaryManager(GlossaryBrowser):
|
|
57
59
|
The name of the new glossary. This will be used to produce a unique qualified name for the glossary.
|
58
60
|
description: str
|
59
61
|
A description of the glossary.
|
62
|
+
language: str, optional, default = "English"
|
63
|
+
The language the used for the glossary
|
64
|
+
usage: str, optional, default = None
|
65
|
+
How the glossary is intended to be used
|
60
66
|
server_name : str, optional
|
61
67
|
The name of the server to query. If not provided, the server name associated with the instance is used.
|
62
68
|
|
@@ -69,7 +75,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
69
75
|
if server_name is None:
|
70
76
|
server_name = self.server_name
|
71
77
|
|
72
|
-
url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries
|
78
|
+
url = f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries"
|
73
79
|
body = {
|
74
80
|
"class": "ReferenceableRequestBody",
|
75
81
|
"elementProperties":
|
@@ -77,13 +83,16 @@ class GlossaryManager(GlossaryBrowser):
|
|
77
83
|
"class": "GlossaryProperties",
|
78
84
|
"qualifiedName": f"Glossary-{display_name}-{time.asctime()}",
|
79
85
|
"displayName": display_name,
|
80
|
-
"description": description
|
86
|
+
"description": description,
|
87
|
+
"language" : language,
|
88
|
+
"usage" : usage
|
81
89
|
}
|
82
90
|
}
|
83
|
-
response = await self._async_make_request("POST", url, body)
|
91
|
+
response = await self._async_make_request("POST", url, body_slimmer(body))
|
84
92
|
return response.json().get("guid", None)
|
85
93
|
|
86
|
-
def create_glossary(self, display_name: str, description: str,
|
94
|
+
def create_glossary(self, display_name: str, description: str, language: str = "English", usage: str= None,
|
95
|
+
server_name: str = None) -> str:
|
87
96
|
""" Create a new glossary.
|
88
97
|
|
89
98
|
Parameters
|
@@ -92,6 +101,10 @@ class GlossaryManager(GlossaryBrowser):
|
|
92
101
|
The name of the new glossary. This will be used to produce a unique qualified name for the glossary.
|
93
102
|
description: str
|
94
103
|
A description of the glossary.
|
104
|
+
language: str, optional, default = "English"
|
105
|
+
The language the used for the glossary
|
106
|
+
usage: str, optional, default = None
|
107
|
+
How the glossary is intended to be used
|
95
108
|
server_name : str, optional
|
96
109
|
The name of the server to query. If not provided, the server name associated with the instance is used.
|
97
110
|
|
@@ -102,7 +115,8 @@ class GlossaryManager(GlossaryBrowser):
|
|
102
115
|
|
103
116
|
"""
|
104
117
|
loop = asyncio.get_event_loop()
|
105
|
-
response = loop.run_until_complete(self._async_create_glossary(display_name, description,
|
118
|
+
response = loop.run_until_complete(self._async_create_glossary(display_name, description, language,
|
119
|
+
usage, server_name))
|
106
120
|
return response
|
107
121
|
|
108
122
|
async def _async_delete_glossary(self, glossary_guid: str, server_name: str = None) -> None:
|
@@ -499,7 +513,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
499
513
|
if server_name is None:
|
500
514
|
server_name = self.server_name
|
501
515
|
|
502
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
516
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
503
517
|
f"{glossary_guid}/categories")
|
504
518
|
body = {
|
505
519
|
"class": "ReferenceableRequestBody",
|
@@ -590,7 +604,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
590
604
|
|
591
605
|
body = {"class": "EffectiveTimeQueryRequestBody", "effectiveTime": effective_time}
|
592
606
|
|
593
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
607
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
594
608
|
f"for-category/{glossary_category_guid}/retrieve")
|
595
609
|
|
596
610
|
response = await self._async_make_request("POST", url, body)
|
@@ -698,7 +712,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
698
712
|
body = {"class": "SearchStringRequestBody", "searchString": search_string, "effectiveTime": effective_time}
|
699
713
|
body = body_slimmer(body)
|
700
714
|
|
701
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
715
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
702
716
|
f"categories/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
703
717
|
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
|
704
718
|
|
@@ -797,7 +811,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
797
811
|
if page_size is None:
|
798
812
|
page_size = self.page_size
|
799
813
|
|
800
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
814
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
801
815
|
f"{glossary_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}")
|
802
816
|
|
803
817
|
response = await self._async_make_request("POST", url)
|
@@ -880,7 +894,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
880
894
|
if page_size is None:
|
881
895
|
page_size = self.page_size
|
882
896
|
|
883
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
897
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/terms/"
|
884
898
|
f"{glossary_term_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}")
|
885
899
|
|
886
900
|
response = await self._async_make_request("POST", url)
|
@@ -1263,7 +1277,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1263
1277
|
server_name = self.server_name
|
1264
1278
|
validate_guid(glossary_guid)
|
1265
1279
|
|
1266
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1280
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
1267
1281
|
f"{glossary_guid}/terms/new-controlled"
|
1268
1282
|
)
|
1269
1283
|
|
@@ -1377,7 +1391,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1377
1391
|
validate_guid(glossary_guid)
|
1378
1392
|
validate_guid(glossary_term_guid)
|
1379
1393
|
|
1380
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1394
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
1381
1395
|
f"{glossary_guid}/terms/from-template/{glossary_term_guid}"
|
1382
1396
|
)
|
1383
1397
|
|
@@ -1492,7 +1506,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1492
1506
|
server_name = self.server_name
|
1493
1507
|
validate_guid(glossary_term_guid)
|
1494
1508
|
|
1495
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1509
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/glossaries/"
|
1496
1510
|
f"terms/{glossary_term_guid}/is-data-field"
|
1497
1511
|
)
|
1498
1512
|
|
@@ -1585,7 +1599,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1585
1599
|
server_name = self.server_name
|
1586
1600
|
validate_guid(glossary_term_guid)
|
1587
1601
|
|
1588
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1602
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/elements/"
|
1589
1603
|
f"{glossary_term_guid}/confidentiality"
|
1590
1604
|
)
|
1591
1605
|
|
@@ -1679,7 +1693,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1679
1693
|
server_name = self.server_name
|
1680
1694
|
validate_guid(glossary_term_guid)
|
1681
1695
|
|
1682
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1696
|
+
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/elements/"
|
1683
1697
|
f"{glossary_term_guid}/subject-area-member"
|
1684
1698
|
)
|
1685
1699
|
|
@@ -1785,7 +1799,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1785
1799
|
is_merge_update_s = str(is_merge_update).lower()
|
1786
1800
|
|
1787
1801
|
url = (
|
1788
|
-
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1802
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/terms/{glossary_term_guid}/"
|
1789
1803
|
f"update?isMergeUpdate={is_merge_update_s}"
|
1790
1804
|
)
|
1791
1805
|
|
@@ -1882,7 +1896,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
1882
1896
|
validate_guid(glossary_term_guid)
|
1883
1897
|
|
1884
1898
|
url = (
|
1885
|
-
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-
|
1899
|
+
f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-manager/terms/{glossary_term_guid}/"
|
1886
1900
|
f"update?isMergeUpdate=true"
|
1887
1901
|
)
|
1888
1902
|
|
@@ -2884,119 +2898,3 @@ class GlossaryManager(GlossaryBrowser):
|
|
2884
2898
|
|
2885
2899
|
return response
|
2886
2900
|
|
2887
|
-
#
|
2888
|
-
# Feedback
|
2889
|
-
#
|
2890
|
-
async def _async_get_comment(self, commemtGUID: str, effective_time: str, server_name: str = None,
|
2891
|
-
for_lineage: bool = False, for_duplicate_processing: bool = False) -> dict | list:
|
2892
|
-
""" Retrieve the comment specified by the comment GUID """
|
2893
|
-
if server_name is None:
|
2894
|
-
server_name = self.server_name
|
2895
|
-
|
2896
|
-
validate_guid(commemtGUID)
|
2897
|
-
|
2898
|
-
if effective_time is None:
|
2899
|
-
effective_time = datetime.now().isoformat()
|
2900
|
-
|
2901
|
-
for_lineage_s = str(for_lineage).lower()
|
2902
|
-
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2903
|
-
|
2904
|
-
body = {"effective_time": effective_time}
|
2905
|
-
|
2906
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/comments/"
|
2907
|
-
f"{commemtGUID}?forLineage={for_lineage_s}&"
|
2908
|
-
f"forDuplicateProcessing={for_duplicate_processing_s}")
|
2909
|
-
|
2910
|
-
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2911
|
-
|
2912
|
-
response = await self._async_make_request("POST", url, body)
|
2913
|
-
return response.json()
|
2914
|
-
|
2915
|
-
async def _async_add_comment_reply(self, commentGUID: str, is_public: bool, comment_type: str, comment_text: str,
|
2916
|
-
server_name: str = None, for_lineage: bool = False,
|
2917
|
-
for_duplicate_processing: bool = False) -> str:
|
2918
|
-
""" Reply to a comment """
|
2919
|
-
|
2920
|
-
if server_name is None:
|
2921
|
-
server_name = self.server_name
|
2922
|
-
|
2923
|
-
validate_guid(commentGUID)
|
2924
|
-
validate_name(comment_type)
|
2925
|
-
|
2926
|
-
is_public_s = str(is_public).lower()
|
2927
|
-
for_lineage_s = str(for_lineage).lower()
|
2928
|
-
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2929
|
-
|
2930
|
-
body = {"class": "CommentRequestBody", "commentType": comment_type, "commentText": comment_text,
|
2931
|
-
"isPublic": is_public}
|
2932
|
-
|
2933
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/comments/"
|
2934
|
-
f"{commentGUID}/replies?isPublic={is_public_s}&forLineage={for_lineage_s}&"
|
2935
|
-
f"forDuplicateProcessing={for_duplicate_processing_s}")
|
2936
|
-
|
2937
|
-
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2938
|
-
|
2939
|
-
response = await self._async_make_request("POST", url, body)
|
2940
|
-
return response
|
2941
|
-
|
2942
|
-
async def _async_update_comment(self, commentGUID: str, is_public: bool, comment_type: str, comment_text: str,
|
2943
|
-
server_name: str = None, is_merge_update: bool = False, for_lineage: bool = False,
|
2944
|
-
for_duplicate_processing: bool = False) -> str:
|
2945
|
-
""" Update the specified comment"""
|
2946
|
-
if server_name is None:
|
2947
|
-
server_name = self.server_name
|
2948
|
-
|
2949
|
-
validate_guid(commentGUID)
|
2950
|
-
validate_name(comment_type)
|
2951
|
-
|
2952
|
-
is_public_s = str(is_public).lower()
|
2953
|
-
for_lineage_s = str(for_lineage).lower()
|
2954
|
-
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2955
|
-
|
2956
|
-
body = {"class": "CommentRequestBody", "commentType": comment_type, "commentText": comment_text,
|
2957
|
-
"isPublic": is_public}
|
2958
|
-
|
2959
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/comments/"
|
2960
|
-
f"{commentGUID}/replies?isPublic={is_public_s}&forLineage={for_lineage_s}&"
|
2961
|
-
f"forDuplicateProcessing={for_duplicate_processing_s}")
|
2962
|
-
|
2963
|
-
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
2964
|
-
|
2965
|
-
response = await self._async_make_request("POST", url, body)
|
2966
|
-
return response
|
2967
|
-
|
2968
|
-
async def _async_find_comment(self, search_string: str, glossary_guid: str = None, status_filter: list = [],
|
2969
|
-
effective_time: str = None, starts_with: bool = False, ends_with: bool = False,
|
2970
|
-
ignore_case: bool = False, for_lineage: bool = False,
|
2971
|
-
for_duplicate_processing: bool = False, server_name: str = None, start_from: int = 0,
|
2972
|
-
page_size: int = None):
|
2973
|
-
"""Find comments by search string"""
|
2974
|
-
if server_name is None:
|
2975
|
-
server_name = self.server_name
|
2976
|
-
if page_size is None:
|
2977
|
-
page_size = self.page_size
|
2978
|
-
if effective_time is None:
|
2979
|
-
effective_time = datetime.now().isoformat()
|
2980
|
-
starts_with_s = str(starts_with).lower()
|
2981
|
-
ends_with_s = str(ends_with).lower()
|
2982
|
-
ignore_case_s = str(ignore_case).lower()
|
2983
|
-
for_lineage_s = str(for_lineage).lower()
|
2984
|
-
for_duplicate_processing_s = str(for_duplicate_processing).lower()
|
2985
|
-
if search_string == '*':
|
2986
|
-
search_string = None
|
2987
|
-
|
2988
|
-
# validate_search_string(search_string)
|
2989
|
-
|
2990
|
-
body = {"class": "GlossarySearchStringRequestBody", "glossaryGUID": glossary_guid,
|
2991
|
-
"searchString": search_string, "effectiveTime": effective_time, "limitResultsByStatus": status_filter}
|
2992
|
-
# body = body_slimmer(body)
|
2993
|
-
|
2994
|
-
url = (f"{self.platform_url}/servers/{server_name}/api/open-metadata/glossary-browser/glossaries/"
|
2995
|
-
f"terms/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
2996
|
-
f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}&forLineage={for_lineage_s}&"
|
2997
|
-
f"forDuplicateProcessing={for_duplicate_processing_s}")
|
2998
|
-
|
2999
|
-
# print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
|
3000
|
-
|
3001
|
-
response = await self._async_make_request("POST", url, body)
|
3002
|
-
return response.json().get("elementList", "No terms found")
|
pyegeria/my_profile_omvs.py
CHANGED
@@ -392,7 +392,7 @@ class MyProfile(Client):
|
|
392
392
|
response = await self._async_make_request("POST", url, body)
|
393
393
|
return response.json().get("guid", "No guid returned")
|
394
394
|
|
395
|
-
def create_to_do(self, body: dict, server_name: str = None) ->
|
395
|
+
def create_to_do(self, body: dict, server_name: str = None) -> str:
|
396
396
|
""" Create a To-Do item.
|
397
397
|
Parameters
|
398
398
|
----------
|
@@ -534,10 +534,12 @@ class MyProfile(Client):
|
|
534
534
|
if server_name is None:
|
535
535
|
server_name = self.server_name
|
536
536
|
|
537
|
+
is_merge_update_t = str(is_merge_update).lower()
|
538
|
+
|
537
539
|
validate_name(todo_guid)
|
538
540
|
|
539
541
|
url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
|
540
|
-
f"{todo_guid}?
|
542
|
+
f"{todo_guid}?isMergeUpdate={is_merge_update_t}")
|
541
543
|
|
542
544
|
await self._async_make_request("POST", url, body)
|
543
545
|
return
|
@@ -576,14 +578,12 @@ class MyProfile(Client):
|
|
576
578
|
loop.run_until_complete(self._async_update_to_do(todo_guid, body, is_merge_update, server_name))
|
577
579
|
return
|
578
580
|
|
579
|
-
async def _async_delete_to_do(self, todo_guid: str,
|
581
|
+
async def _async_delete_to_do(self, todo_guid: str, server_name: str = None) -> None:
|
580
582
|
""" Delete a To-Do item. Async version.
|
581
583
|
Parameters
|
582
584
|
----------
|
583
585
|
todo_guid: str
|
584
586
|
Identifier of the To-Do item.
|
585
|
-
status: str
|
586
|
-
Filter items to match this status. Defaults to "OPEN"
|
587
587
|
server_name : str, optional
|
588
588
|
The name of the server where the to-do item will be created. If not provided,
|
589
589
|
the default server name associated with the instance of the class will be used.
|
@@ -606,21 +606,19 @@ class MyProfile(Client):
|
|
606
606
|
server_name = self.server_name
|
607
607
|
|
608
608
|
validate_name(todo_guid)
|
609
|
-
body = {"status": status}
|
610
609
|
|
611
|
-
url = f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/{todo_guid}"
|
612
610
|
|
613
|
-
|
611
|
+
url = f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/{todo_guid}/delete"
|
612
|
+
|
613
|
+
await self._async_make_request("POST", url)
|
614
614
|
return
|
615
615
|
|
616
|
-
def delete_to_do(self, todo_guid: str,
|
616
|
+
def delete_to_do(self, todo_guid: str, server_name: str = None) -> None:
|
617
617
|
""" Delete a To-Do item.
|
618
618
|
Parameters
|
619
619
|
----------
|
620
620
|
todo_guid: str
|
621
621
|
Identifier of the To-Do item.
|
622
|
-
status: str
|
623
|
-
Filter items to match this status. Defaults to "OPEN"
|
624
622
|
server_name : str, optional
|
625
623
|
The name of the server where the to-do item will be created. If not provided,
|
626
624
|
the default server name associated with the instance of the class will be used.
|
@@ -640,7 +638,7 @@ class MyProfile(Client):
|
|
640
638
|
The principle specified by the user_id does not have authorization for the requested action
|
641
639
|
"""
|
642
640
|
loop = asyncio.get_event_loop()
|
643
|
-
loop.run_until_complete(self._async_delete_to_do(todo_guid,
|
641
|
+
loop.run_until_complete(self._async_delete_to_do(todo_guid, server_name))
|
644
642
|
return
|
645
643
|
|
646
644
|
async def _async_reassign_to_do(self, todo_guid: str, actor_guid: str, status: str = "OPEN",
|
@@ -934,7 +932,7 @@ class MyProfile(Client):
|
|
934
932
|
validate_name(action_target_guid)
|
935
933
|
|
936
934
|
url = (f"{self.my_profile_command_root}/{server_name}/api/open-metadata/my-profile/to-dos/"
|
937
|
-
f"action-targets/{action_target_guid}?
|
935
|
+
f"action-targets/{action_target_guid}?isMergeUpdate={is_merge_update_t}")
|
938
936
|
|
939
937
|
await self._async_make_request("POST", url, body)
|
940
938
|
return
|
@@ -971,3 +969,4 @@ class MyProfile(Client):
|
|
971
969
|
body, is_merge_update,
|
972
970
|
server_name))
|
973
971
|
return
|
972
|
+
|