pyegeria 0.3.2__py3-none-any.whl → 0.3.4__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.
pyegeria/exceptions.py ADDED
@@ -0,0 +1,382 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ Definitions, utilities and exceptions in support of the Egeria Python Client package.
6
+
7
+ """
8
+
9
+ import json
10
+ from enum import Enum
11
+
12
+ """
13
+
14
+ The following definitions are used in creating Exception messages.
15
+ They mirror similar definitions in the Egeria core.
16
+ Note that not all of the definitions are currently used - they merely serve as placeholders for future extensions.
17
+
18
+ """
19
+
20
+
21
+ class EgeriaErrorCode(Enum):
22
+ """ Egeria error codes """
23
+
24
+ def __str__(self):
25
+ return (
26
+ "http_error_code="
27
+ + self.value["http_error_code"]
28
+ + "messageId="
29
+ + self.value["message_id"]
30
+ + ", message="
31
+ + self.value["message_template"]
32
+ + ", systemAction="
33
+ + self.value["system_action"]
34
+ + ", userAction="
35
+ + self.value["user_action"]
36
+ )
37
+
38
+
39
+ class OMAGServerInstanceErrorCode(EgeriaErrorCode):
40
+ """ OMAGServer instance error codes """
41
+
42
+ BAD_SERVER_SECURITY_CONNECTION = dict(
43
+ https_error_code="400",
44
+ message_id="OMAG-MULTI-TENANT-400-001",
45
+ message_template="The OMAG server {0} has been configured with a bad connection to its security connector."
46
+ + " Error message is {1}. Connection is {2}",
47
+ system_action="The system is unable to validate the users issuing requests to this server.",
48
+ user_action="Review the error message to determine the cause of the problem.",
49
+ )
50
+
51
+ """
52
+ OMAG-MULTI-TENANT-400-002 - The OMAG server {0} has been requested to shut down but the following services are
53
+ still running: {1}
54
+ """
55
+ SERVICES_NOT_SHUTDOWN = dict(
56
+ https_error_code="400",
57
+ message_id="OMAG-MULTI-TENANT-400-002",
58
+ message_template="The OMAG server {0} has been requested to shutdown but the following services " +
59
+ "are still running: {1}",
60
+ system_action="The system is unable to shutdown the server correctly.",
61
+ user_action="Review other error messages to determine the cause of the problem."
62
+ + " This is likely to be a logic error in the services listed in the message",
63
+ )
64
+
65
+ """
66
+ OMAG-MULTI-TENANT-400-003 - Method {0} called on behalf of the {1} service is unable to create a client-side
67
+ open metadata topic connection because the topic name is not configured in the configuration for this service.
68
+ """
69
+ NO_TOPIC_INFORMATION = dict(
70
+ https_error_code="400",
71
+ message_id="OMAG-MULTI-TENANT-400-003",
72
+ message_template="Method {0} called on behalf of the {1} service is unable to create a client-side open "
73
+ + "metadata topic connection because the topic name is not configured in the configuration "
74
+ + "for this service.",
75
+ system_action="This is a configuration error and an exception is sent to the requester.",
76
+ user_action="Correct the configuration of the access service to include the name of the topic.",
77
+ )
78
+
79
+ """
80
+ OMAG-MULTI-TENANT-400-004 - The connector provider class name {0} does not create a connector of class {1}
81
+ which is required for the {2}
82
+ """
83
+ NOT_CORRECT_CONNECTOR_PROVIDER = dict(
84
+ https_error_code="400",
85
+ message_id="OMAG-MULTI-TENANT-400-004",
86
+ message_template="The connector provider class name {0} does not create a connector of class {1} which is"
87
+ + " required for the {2}",
88
+ system_action="An invalid parameter exception is returned to the caller.",
89
+ user_action="Either change the connector or the hosting environment because the current"
90
+ + " combination is not compatible.",
91
+ )
92
+
93
+ """
94
+ OMAG-MULTI-TENANT-404-001 - The OMAG Server {0} is not available to service a request from user {1}
95
+ """
96
+ SERVER_NOT_AVAILABLE = dict(
97
+ https_error_code="404",
98
+ message_id="OMAG-MULTI-TENANT-404-001",
99
+ message_template="The OMAG Server {0} is not available to service a request from user {1}",
100
+ system_action="The system is unable to process the request because the server"
101
+ + " is not running on the called platform.",
102
+ user_action="Verify that the correct server is being called on the correct platform and that this server "
103
+ + "is running. Retry the request when the server is available.",
104
+ )
105
+
106
+ """
107
+ OMAG-MULTI-TENANT-404-002- The {0} service is not available on OMAG Server {1} to handle a request from user {2}
108
+ """
109
+ SERVICE_NOT_AVAILABLE = dict(
110
+ https_error_code="404",
111
+ message_id="OMAG-MULTI-TENANT-404-002",
112
+ message_template="The {0} service is not available on OMAG Server {1} to handle a request from user {2}",
113
+ system_action="The system is unable to process the request because the service is not available.",
114
+ user_action="Verify that the correct server is being called on the correct platform and that the "
115
+ + "requested service is configured to run there. "
116
+ + "Once the correct environment is in place, retry the request.",
117
+ )
118
+
119
+ """
120
+ OMAG-MULTI-TENANT-404-003 - The server name is not available for the {0} operation
121
+ """
122
+ SERVER_NAME_NOT_AVAILABLE = dict(
123
+ https_error_code="404",
124
+ message_id="OMAG-MULTI-TENANT-404-003",
125
+ message_template="The server name is not available for the {0} operation",
126
+ system_action="The system is unable to return the server name because it is not available.",
127
+ user_action="Check that the server where the access service is running initialized correctly. "
128
+ + "Correct any errors discovered and retry the request when the open metadata services are available.",
129
+ )
130
+
131
+ """
132
+ OMAG-MULTI-TENANT-404-004 - The open metadata repository services are not initialized for the {0} operation
133
+ """
134
+ OMRS_NOT_INITIALIZED = dict(
135
+ https_error_code="404",
136
+ message_id="OMAG-MULTI-TENANT-404-004",
137
+ message_template="The open metadata repository services are not initialized for the {0} operation",
138
+ system_action="The system is unable to connect to the open metadata repository services because"
139
+ + " they are not running in this server.",
140
+ user_action="Check that the server where the called service is running initialized correctly. "
141
+ + "Correct any errors discovered and retry the request when the open metadata services are available.",
142
+ )
143
+
144
+ """
145
+ OMAG-MULTI-TENANT-404-005 - The open metadata repository services are not available for the {0} operation
146
+ """
147
+ OMRS_NOT_AVAILABLE = (
148
+ dict(
149
+ https_error_code="404",
150
+ message_id="OMAG-MULTI-TENANT-404-005",
151
+ message_template="The open metadata repository services are not available for the {0} operation",
152
+ system_action="The system is unable to connect to the open metadata repository services because"
153
+ " they are not in the correct state to be called.",
154
+ user_action="Check that the server where the called service is running initialized correctly and is not"
155
+ + " in the process of shutting down. Correct any errors discovered and retry the"
156
+ + " request when the open metadata repository services are available.",
157
+ ),
158
+ )
159
+
160
+ """
161
+ OMAG-MULTI-TENANT-500-003 - Method {0} called on behalf of the {1} service detected a {2} exception when
162
+ creating an open metadata topic connection because the connector provider is incorrect.
163
+ The error message was {3}
164
+ """
165
+ BAD_TOPIC_CONNECTOR_PROVIDER = dict(
166
+ http_error_code="500",
167
+ message_id="OMAG-MULTI-TENANT-500-003",
168
+ message_template="Method {0} called on behalf of the {1} service detected a {2} exception when creating an "
169
+ + "open metadata topic connection because the connector provider is incorrect. The error message was {3}",
170
+ system_action="This is an internal error. The access service is not using a valid connector provider.",
171
+ user_action="Raise an issue on Egeria's GitHub and work with the Egeria community to resolve.",
172
+ )
173
+
174
+
175
+ class OMAGCommonErrorCode(EgeriaErrorCode):
176
+ CLIENT_SIDE_REST_API_ERROR = dict(
177
+ http_error_code="503",
178
+ message_id="CLIENT-SIDE-REST-API-CONNECTOR-503-002",
179
+ message_template="A client-side error {0} was received by method {1} from API call {2} during the call {3}."
180
+ + " The error message was {4}",
181
+ system_action="The client has issued a call to the open metadata access service REST API in a remote server"
182
+ + " and has received an exception from the local client libraries.",
183
+ user_action="Review the error message to determine the cause of the error. Check that the server is running"
184
+ + " and the URL is correct. Look for errors in the local server's console to understand and"
185
+ + " correct the cause of the error. Then rerun the request",
186
+ )
187
+
188
+ EXCEPTION_RESPONSE_FROM_API = dict(
189
+ http_error_code="503",
190
+ message_id="SERVER-SIDE-REST-API-ERROR-503-003 ",
191
+ message_template="A {0} exception was received from REST API call {1} to server {2}: error message was: {3}",
192
+ system_action="The system has issued a call to an open metadata access service REST API in a remote server"
193
+ + " and has received an exception response.",
194
+ user_action="The error message should indicate the cause of the error. "
195
+ + "Otherwise look for errors in the remote server's audit log and console to understand and "
196
+ + "correct the source of the error.",
197
+ )
198
+
199
+ SERVER_URL_NOT_SPECIFIED = dict(
200
+ http_error_code="400",
201
+ message_id="OMAG-COMMON-400-001",
202
+ message_template="The OMAG Server Platform URL is null",
203
+ system_action="The system is unable to identify the OMAG Server Platform.",
204
+ user_action="Create a new client and pass the URL for the server on the constructor.",
205
+ )
206
+
207
+ SERVER_URL_MALFORMED = dict(
208
+ http_error_code="400",
209
+ message_id="OMAG-COMMON-400-002",
210
+ message_template="The OMAS Server URL: {0} is not in a recognized format",
211
+ system_action="The system is unable to connect to the OMAG Server Platform to fulfill any requests.",
212
+ user_action="Create a new client and pass the correct URL for the server on the constructor.",
213
+ )
214
+
215
+ SERVER_NAME_NOT_SPECIFIED = dict(
216
+ http_error_code="400",
217
+ message_id="OMAG-COMMON-400-003",
218
+ message_template="The OMAG Server name is null",
219
+ system_action="The system is unable to locate to the OMAG Server to fulfill any request.",
220
+ user_action="Create a new client and pass the correct name for the server on the constructor.",
221
+ )
222
+
223
+ NULL_USER_ID = dict(
224
+ http_error_code="400",
225
+ message_id="OMAG-COMMON-400-004",
226
+ message_template="The user identifier {0} passed on the operation is null",
227
+ system_action="The system is unable to process the request without a user id..",
228
+ user_action="Correct the code in the caller to provide the user id.",
229
+ )
230
+
231
+ NULL_GUID = dict(
232
+ http_error_code="400",
233
+ message_id="OMAG-COMMON-400-005",
234
+ message_template="The unique identifier (guid) passed is null or not a string",
235
+ system_action="The system is unable to process the request without a guid.",
236
+ user_action="Correct the code in the caller to provide the guid.",
237
+ )
238
+
239
+ NULL_NAME = dict(
240
+ http_error_code="400",
241
+ message_id="OMAG-COMMON-400-006",
242
+ message_template="The name passed on the parameter of the operation is null",
243
+ system_action="The system is unable to process the request without a name.",
244
+ user_action="Correct the code in the caller to provide the name on the parameter.",
245
+ )
246
+
247
+ NULL_ARRAY_PARAMETER = dict(
248
+ http_error_code="400",
249
+ message_id="OMAG-COMMON-400-007",
250
+ message_template="The array value passed on the {0} parameter of the {1} operation is null or empty",
251
+ system_action="The system is unable to process the request without this value.",
252
+ user_action="Correct the code in the caller to provide the array.",
253
+ )
254
+
255
+ NEGATIVE_START_FROM = dict(
256
+ http_error_code="400",
257
+ message_id="OMAG-COMMON-400-008",
258
+ message_template="The starting point for the results {0}, passed on the {1} parameter of the {2}"
259
+ + " operation, is negative",
260
+ system_action="The system is unable to process the request with this invalid value."
261
+ + "It should be zero for the start of the values, or a number greater than 0"
262
+ + "to start partway down the list.",
263
+ user_action="Correct the code in the caller to provide a non-negative value for the starting point.",
264
+ )
265
+
266
+ NEGATIVE_PAGE_SIZE = dict(
267
+ http_error_code="400",
268
+ message_id="OMAG-COMMON-400-009",
269
+ message_template="The page size for the results {0}, passed on the {1} parameter of the {2} operation, " +
270
+ "is negative",
271
+ system_action="The system is unable to process the request with this invalid value. "
272
+ + "It should be zero to return all the result, or greater than zero to set a maximum.",
273
+ user_action="Correct the code in the caller to provide a non-negative value for the page size.",
274
+ )
275
+
276
+ MAX_PAGE_SIZE = dict(
277
+ http_error_code="400",
278
+ message_id="OMAG-COMMON-400-010",
279
+ message_template=(
280
+ "The number of records to return, {0}, passed on the {1} parameter of the {2} operation, "
281
+ + "is greater than the allowable maximum of {3}"
282
+ ),
283
+ system_action="The system is unable to process the request with this page size value.",
284
+ user_action="Correct the code in the caller to provide a smaller page size.",
285
+ )
286
+
287
+ NULL_ENUM = dict(
288
+ http_error_code="400",
289
+ message_id="OMAG-COMMON-400-012",
290
+ message_template="The enumeration value passed on the {0} parameter of the {1} operation is null",
291
+ system_action="The system is unable to process the request without a enumeration value.",
292
+ user_action="Correct the code in the caller to provide the enumeration value.",
293
+ )
294
+
295
+ NULL_TEXT = dict(
296
+ http_error_code="400",
297
+ message_id="OMAG-COMMON-400-013",
298
+ message_template="The text field passed on the {0} parameter of the {1} operation is null",
299
+ system_action="The system is unable to process the request without this text value.",
300
+ user_action="Correct the code in the caller to provide a value in the text field.",
301
+ )
302
+
303
+ NULL_OBJECT = dict(
304
+ http_error_code="400",
305
+ message_id="OMAG-COMMON-400-015",
306
+ message_template="The object passed on the {0} parameter of the {1} operation is null",
307
+ system_action="The system is unable to process the request without this object.",
308
+ user_action="Correct the code in the caller to provide the object.",
309
+ )
310
+
311
+ NULL_SEARCH_STRING = dict(
312
+ http_error_code="400",
313
+ message_id="OMAG-COMMON-400-022",
314
+ message_template="The search string passed on the {0} parameter of the {1} operation is null",
315
+ system_action="The system is unable to process the request without a search string.",
316
+ user_action="Correct the code in the caller to provide the search string.",
317
+ )
318
+
319
+
320
+ class EgeriaException(Exception):
321
+ """
322
+ Define the Egeria exceptions raised during error handling. Modeled on the exceptions defined in the Egeria core.
323
+
324
+ """
325
+ raw_error_message = ""
326
+ def __init__(self, response_body) -> None:
327
+ response_dict = json.loads(response_body)
328
+ self.response_class = response_dict["class"]
329
+ self.related_http_code = response_dict["relatedHTTPCode"]
330
+ self.exception_class_name = response_dict["exceptionClassName"]
331
+ self.action_description = response_dict["actionDescription"]
332
+ self.exception_error_message = response_dict["exceptionErrorMessage"]
333
+ self.exception_error_message_id = response_dict["exceptionErrorMessageId"]
334
+
335
+ # self.exception_error_message_id = response_dict["exceptionErrorMessageId"]
336
+ self.exception_error_message_parameters = response_dict[
337
+ "exceptionErrorMessageParameters"
338
+ ]
339
+ self.exception_system_action = response_dict["exceptionSystemAction"]
340
+ self.exception_user_action = response_dict["exceptionUserAction"]
341
+
342
+ def __str__(self):
343
+ return self.exception_error_message
344
+
345
+
346
+ class InvalidParameterException(EgeriaException):
347
+ """Exception due to invalid parameters such as one of the parameters is null or invalid"""
348
+
349
+ def __init__(self, response_body):
350
+ EgeriaException.__init__(self, response_body)
351
+
352
+
353
+ class PropertyServerException(EgeriaException):
354
+ """Exception due to a problem retrieving information from the property server"""
355
+
356
+ def __init__(self, response_body):
357
+ EgeriaException.__init__(self, response_body)
358
+
359
+
360
+ class UserNotAuthorizedException(EgeriaException):
361
+ """Exception as the requesting user is not authorized to issue this request"""
362
+
363
+ def __init__(self, response_body):
364
+ EgeriaException.__init__(self, response_body)
365
+
366
+
367
+ def print_exception_response(e: EgeriaException):
368
+ """ Prints the exception response """
369
+
370
+ if isinstance(e, EgeriaException):
371
+ print(f"\n\nException: {e.response_class}")
372
+ print(f"\t\t Error Message: {e.exception_error_message}")
373
+ print(
374
+ f"\t\t Error Code: {e.exception_error_message_id} with http code {str(e.related_http_code)}"
375
+ )
376
+ # print(f"\t\t Raw Error Text is {e.raw_error_message}")
377
+ print(f"\t\t Class: {e.exception_class_name}")
378
+ print(f"\t\t Caller: {e.action_description}")
379
+ print(f"\t\t System Action: {e.exception_system_action}")
380
+ print(f"\t\t User Action: {e.exception_user_action}")
381
+ else:
382
+ print(f"\n\n\t Not an Egeria exception {e}")
@@ -601,7 +601,6 @@ class FullServerConfig(CoreServerConfig):
601
601
 
602
602
  self.make_request("POST", url, target_url_root)
603
603
 
604
-
605
604
  def get_event_bus(self, server_name: str = None) -> dict:
606
605
  """ Returns the event bus configuration for the specified server
607
606
 
pyegeria/glossary_omvs.py CHANGED
@@ -26,8 +26,20 @@ class GlossaryBrowser(Client):
26
26
  GlossaryBrowser is a class that extends the Client class. It provides methods to search and retrieve glossaries,
27
27
  terms and categories.
28
28
 
29
- Methods:
30
-
29
+ Attributes:
30
+
31
+ server_name: str
32
+ The name of the View Server to connect to.
33
+ platform_url : str
34
+ URL of the server platform to connect to
35
+ user_id : str
36
+ The identity of the user calling the method - this sets a default optionally used by the methods
37
+ when the user doesn't pass the user_id on a method call.
38
+ user_pwd: str
39
+ The password associated with the user_id. Defaults to None
40
+ verify_flag: bool
41
+ Flag to indicate if SSL Certificates should be verified in the HTTP requests.
42
+ Defaults to False.
31
43
 
32
44
  """
33
45
 
pyegeria/gov_engine.py CHANGED
@@ -33,7 +33,7 @@ class GovEng(Client):
33
33
 
34
34
  Attributes:
35
35
  server_name: str
36
- Name of the server to configure.
36
+ Name of the server to use.
37
37
  platform_url : str
38
38
  URL of the server platform to connect to
39
39
  user_id : str
@@ -45,13 +45,6 @@ class GovEng(Client):
45
45
  Set true for SSL verification to be enabled, false for disabled. Default behaviour set by the
46
46
  enable_ssl_check attribute from _globals.py
47
47
 
48
- Methods:
49
- __init__(self,
50
- platform_url: str,
51
- end_user_id: str,
52
- )
53
- Initializes the connection - throwing an exception if there is a problem
54
-
55
48
  """
56
49
 
57
50
  def __init__(
@@ -22,6 +22,8 @@ class GovernanceAuthor(AutomatedCuration):
22
22
 
23
23
  Attributes:
24
24
 
25
+ server_name: str
26
+ Name of the server to use.
25
27
  platform_url : str
26
28
  URL of the server platform to connect to
27
29
  user_id : str
@@ -20,7 +20,7 @@ class MyProfile(Client):
20
20
  Parameters
21
21
  ----------
22
22
  server_name : str
23
- The name of the server to configure.
23
+ The name of the view server to configure.
24
24
  platform_url : str
25
25
  The URL of the platform.
26
26
  token : str, optional
@@ -30,7 +30,8 @@ class Platform(Client):
30
30
  Client to operate Egeria Platforms - inherits from Server Ops
31
31
 
32
32
  Attributes:
33
-
33
+ server_name: str
34
+ Name of the server to use.
34
35
  platform_url : str
35
36
  URL of the server platform to connect to
36
37
  user_id : str
@@ -42,44 +43,6 @@ class Platform(Client):
42
43
  Flag to indicate if SSL Certificates should be verified in the HTTP requests.
43
44
  Defaults to False.
44
45
 
45
- Methods:
46
- __init__(self, platform_url: str, end_user_id: str)
47
- Initializes the connection - throwing an exception if there is a problem
48
-
49
-
50
-
51
- get_platform_origin() -> str
52
-
53
- activate_server_stored_config(server: str = None, timeout: int = 30) -> None
54
-
55
- activate_server_supplied_config(config_body: str, server: str = None, timeout: int = 30) -> None
56
-
57
- get_active_server_instance_status(server: str = None)-> dict | str
58
-
59
- get_known_servers() -> list[str] | str
60
-
61
- is_server_known(server: str = None) -> bool
62
-
63
- is_server_configured(server: str = None) -> bool
64
-
65
- check_server_active(server: str = None)
66
-
67
- get_active_server_list() -> dict | str
68
-
69
- shutdown_platform() -> None:
70
-
71
- shutdown_server(server: str = None) -> None:
72
-
73
- shutdown_unregister_servers() -> None
74
-
75
- shutdown_all_servers() -> None
76
-
77
- activate_server_if_down(server: str) -> bool
78
-
79
- activate_servers_on_platform(server_list: str) -> bool
80
-
81
- activate_platform(self, platform_name: str, hosted_server_names: [str], timeout:int = 60) -> None
82
-
83
46
  """
84
47
 
85
48
  admin_command_root: str
@@ -10,12 +10,16 @@ integration service, it is important to know what companion service it depends o
10
10
  companion service is also configured and running.
11
11
 
12
12
  """
13
+ import json
14
+ from rich.console import Console
15
+ from rich import print, print_json
16
+
13
17
  import pandas as pd
14
18
  from tabulate import tabulate
15
19
 
16
- from .utils import wrap_text
20
+ from pyegeria.utils import wrap_text
17
21
 
18
- from ._client import Client
22
+ from pyegeria._client import Client
19
23
 
20
24
 
21
25
  class RegisteredInfo(Client):
@@ -23,6 +27,8 @@ class RegisteredInfo(Client):
23
27
 
24
28
  Attributes:
25
29
  ----------
30
+ server_name: str
31
+ Name of the server to use.
26
32
  platform_url : str
27
33
  URL of the server platform to connect to
28
34
  user_id : str
@@ -42,17 +48,20 @@ class RegisteredInfo(Client):
42
48
 
43
49
  list_severity_definitions(self, fmt: str = 'json', skinny: bool = True, wrap_len: int = 30) -> list | str
44
50
  Returns a list of severity definitions for an OMAG Server used by the audit services.
51
+
52
+ list_asset_types(self, server: str = None) -> list | str
53
+ Lists the defined asset types.
45
54
  """
46
55
 
47
56
  admin_command_root: str
48
57
 
49
58
  def __init__(
50
59
  self,
60
+ server_name: str,
51
61
  platform_url: str,
52
62
  user_id: str,
53
63
  user_pwd: str = None,
54
64
  verify_flag: bool = False,
55
- server_name: str = None
56
65
  ):
57
66
  if server_name is None:
58
67
  server_name = "NA"
@@ -93,7 +102,7 @@ class RegisteredInfo(Client):
93
102
  The principle specified by the user_id does not have authorization for the requested action
94
103
 
95
104
  """
96
- if kind is None or kind is "help":
105
+ if kind is None or kind == "help":
97
106
  return ("""
98
107
  The kinds of services that you can get more information include:
99
108
  all.....................lists all registered services
@@ -107,15 +116,15 @@ class RegisteredInfo(Client):
107
116
  Pass in a parameter from the left-hand column into the function to
108
117
  get more details on the specified service category.
109
118
  """)
110
- if kind is "all":
119
+ if kind == "all":
111
120
  url = f"{self.admin_command_root}"
112
121
  else:
113
122
  url = f"{self.admin_command_root}/{kind}"
114
123
  response = self.make_request("GET", url)
115
124
 
116
- if fmt is 'json':
125
+ if fmt == 'json':
117
126
  return response.json().get("services", "No services found")
118
- elif fmt is 'table':
127
+ elif fmt == 'table':
119
128
  df = pd.DataFrame(response.json().get("services", []))
120
129
  if skinny:
121
130
  df = df.drop(columns=['serviceId', 'serviceDevelopmentStatus'])
@@ -155,10 +164,38 @@ class RegisteredInfo(Client):
155
164
  f"/users/{self.user_id}/audit-log/severity-definitions"
156
165
  )
157
166
  response = self.make_request("GET", url)
158
- if fmt is 'json':
167
+ if fmt == 'json':
159
168
  return response.json().get("severities", "No severities found")
160
- elif fmt is 'table':
169
+ elif fmt == 'table':
161
170
  df = pd.DataFrame(response.json().get("severities", []))
162
171
  if skinny:
163
172
  df = df.drop(columns=['ordinal'])
164
173
  return tabulate(wrap_text(df, wrap_len=wrap_len), headers='keys', tablefmt='psql')
174
+
175
+ def list_asset_types(self, server: str = None) -> list | str:
176
+ """ Get the registered severities for the OMAG Server
177
+
178
+ Parameters
179
+ ----------
180
+ server: str, optional, default = None
181
+
182
+ Returns
183
+ -------
184
+ dict | str
185
+ Returns a list of the asset types.
186
+
187
+ Raises
188
+ ------
189
+ InvalidParameterException
190
+ If the response code is not 200.
191
+ PropertyServerException:
192
+ Raised by the server when an issue arises in processing a valid request
193
+ NotAuthorizedException:
194
+ The principle specified by the user_id does not have authorization for the requested action
195
+
196
+ """
197
+ server = self.server_name if server is None else server
198
+ url = f"{self.platform_url}/servers/{self.server_name}/api/open-metadata/asset-catalog/assets/types"
199
+
200
+ response = self.make_request("GET", url)
201
+ return response.json().get('types', 'no types found')
@@ -19,7 +19,8 @@ class ServerOps(Platform):
19
19
  Client to issue operations on a running OMAG server.
20
20
 
21
21
  Attributes:
22
-
22
+ server_name: str
23
+ Name of the server to use.
23
24
  platform_url : str
24
25
  URL of the server platform to connect to
25
26
  user_id : str
@@ -31,7 +32,6 @@ class ServerOps(Platform):
31
32
  Flag to indicate if SSL Certificates should be verified in the HTTP requests.
32
33
  Defaults to False.
33
34
 
34
- Methods:
35
35
 
36
36
  """
37
37
  def __init__(