pyegeria 0.8.4.8__py3-none-any.whl → 0.8.4.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.
@@ -1,73 +0,0 @@
1
- """
2
- SPDX-License-Identifier: Apache-2.0
3
- Copyright Contributors to the ODPi Egeria project.
4
-
5
-
6
-
7
- This script refreshed an integration daemon.
8
-
9
- """
10
-
11
- import os
12
- import argparse
13
- import time
14
-
15
- from pyegeria import ServerOps, AutomatedCuration
16
- from pyegeria._exceptions import (
17
- InvalidParameterException,
18
- PropertyServerException,
19
- UserNotAuthorizedException,
20
- print_exception_response,
21
- )
22
- EGERIA_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')
33
-
34
-
35
-
36
- def refresh_connector(connector: str, server:str, url:str, userid:str, password:str):
37
- try:
38
-
39
- s_client = ServerOps(server, url, userid)
40
- if connector == 'all':
41
- connector = None
42
- statement = "ALL connectors"
43
- else:
44
- statement = f"the {connector} "
45
-
46
- s_client.refresh_integration_connectors(connector, server, time_out = 60)
47
-
48
- print(f"\n===> Integration Daemon \'{server}\' refreshed {statement}.")
49
-
50
-
51
- except (InvalidParameterException, PropertyServerException) as e:
52
- print_exception_response(e)
53
-
54
-
55
-
56
-
57
- def main():
58
- parser = argparse.ArgumentParser()
59
- parser.add_argument("--server", help="Name of the integration daemon to refresh")
60
- parser.add_argument("--url", help="URL Platform to connect to")
61
- parser.add_argument("--userid", help="User Id")
62
- parser.add_argument("--password", help="User Password")
63
- parser.add_argument("--connector", default='all', help="Name of the connector to refresh")
64
- args = parser.parse_args()
65
-
66
- server = args.server if args.server is not None else EGERIA_INTEGRATION_DAEMON
67
- url = args.url if args.url is not None else EGERIA_INTEGRATION_DAEMON_URL
68
- userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
69
- user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
70
- refresh_connector(args.connector, server, url, userid, user_pass)
71
-
72
- if __name__ == "__main__":
73
- main()
@@ -1,73 +0,0 @@
1
- """
2
- SPDX-License-Identifier: Apache-2.0
3
- Copyright Contributors to the ODPi Egeria project.
4
-
5
-
6
-
7
- This script restarts an integration daemon.
8
-
9
- """
10
-
11
- import os
12
- import argparse
13
- import time
14
-
15
- from pyegeria import ServerOps, AutomatedCuration
16
- from pyegeria._exceptions import (
17
- InvalidParameterException,
18
- PropertyServerException,
19
- UserNotAuthorizedException,
20
- print_exception_response,
21
- )
22
- EGERIA_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')
33
-
34
-
35
-
36
- def restart_connector(connector: str, server:str, url:str, userid:str, password:str):
37
- try:
38
-
39
- s_client = ServerOps(server, url, userid)
40
- if connector == 'all':
41
- connector = None
42
- statement = "ALL connectors"
43
- else:
44
- statement = f"the {connector} "
45
-
46
- s_client.restart_integration_connector(connector, server, time_out = 60)
47
-
48
- print(f"\n===> Integration Daemon \'{server}\' restarted {statement}.")
49
-
50
-
51
- except (InvalidParameterException, PropertyServerException) as e:
52
- print_exception_response(e)
53
-
54
-
55
-
56
-
57
- def main():
58
- parser = argparse.ArgumentParser()
59
- parser.add_argument("--server", help="Name of the integration daemon to refresh")
60
- parser.add_argument("--url", help="URL Platform to connect to")
61
- parser.add_argument("--userid", help="User Id")
62
- parser.add_argument("--password", help="User Password")
63
- parser.add_argument("--connector", default='all', help="Name of the connector to refresh")
64
- args = parser.parse_args()
65
-
66
- server = args.server if args.server is not None else EGERIA_INTEGRATION_DAEMON
67
- url = args.url if args.url is not None else EGERIA_INTEGRATION_DAEMON_URL
68
- userid = args.userid if args.userid is not None else EGERIA_ADMIN_USER
69
- user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
70
- restart_connector(args.connector, server, url, userid, user_pass)
71
-
72
- if __name__ == "__main__":
73
- main()