holado 0.6.2__py3-none-any.whl → 0.6.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.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/__init__.py +2 -2
- holado/common/handlers/object.py +15 -1
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/METADATA +42 -1
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/RECORD +66 -21
- holado_ais/ais/ais_messages.py +3 -1
- holado_docker/tools/docker_controller/server/grpc/docker_controller_client.py → holado_crypto/__init__.py +15 -20
- holado_crypto/crypto/transport/__init__.py +0 -0
- holado_crypto/crypto/transport/crc.py +40 -0
- holado_docker/tools/docker_controller/server/grpc/docker_controller_server.py → holado_crypto/test/behave/steps/__init__.py +2 -17
- holado_docker/sdk/docker/docker_client.py +26 -22
- holado_docker/tools/docker_controller/client/rest/docker_controller_client.py +10 -4
- holado_docker/tools/docker_controller/docker_controller_manager.py +5 -3
- holado_docker/tools/docker_controller/server/Dockerfile +9 -7
- holado_docker/tools/docker_controller/server/requirements.txt +1 -2
- holado_docker/tools/docker_controller/server/rest/README +2 -0
- holado_docker/tools/docker_controller/server/rest/api/__init__.py +16 -17
- holado_docker/tools/docker_controller/server/rest/openapi.yaml +20 -3
- holado_docker/tools/docker_controller/server/run_docker_controller_in_docker.sh +6 -6
- holado_docker/tools/docker_viewer/client/rest/docker_viewer_client.py +40 -0
- holado_docker/tools/docker_viewer/docker_viewer_manager.py +44 -0
- holado_docker/tools/docker_viewer/server/Dockerfile +70 -0
- holado_docker/tools/docker_viewer/server/requirements.txt +2 -0
- holado_docker/tools/docker_viewer/server/rest/README +2 -0
- holado_docker/tools/docker_viewer/server/rest/api/__init__.py +40 -0
- holado_docker/tools/docker_viewer/server/rest/initialize_holado.py +72 -0
- holado_docker/tools/docker_viewer/server/rest/openapi.yaml +58 -0
- holado_docker/tools/docker_viewer/server/rest/run.py +28 -0
- holado_docker/tools/docker_viewer/server/run_docker_viewer_in_docker.sh +101 -0
- holado_examples/projects/server_rest/server_rest_example/initialize_holado.py +72 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/db.sqlite3 +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/manage.py +22 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/__init__.py +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/__init__.py +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/admin.py +3 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/apps.py +7 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/migrations/__init__.py +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/models.py +3 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/serializers.py +15 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/tests.py +3 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/views.py +24 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/asgi.py +16 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/settings.py +130 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/urls.py +31 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/wsgi.py +16 -0
- holado_examples/projects/server_rest/server_rest_example/rest_server.py +37 -0
- holado_examples/scripts/script_custom_initialization.py +16 -0
- holado_examples/scripts/script_minimal_initialization.py +23 -0
- holado_examples/tests/behave/testing_solution/__main__.py +13 -0
- holado_examples/tests/behave/testing_solution/behave_environment.py +35 -0
- holado_examples/tests/behave/testing_solution/environment.py +36 -0
- holado_examples/tests/behave/testing_solution/features/Configuration/Actions/configure_system.feature +10 -0
- holado_examples/tests/behave/testing_solution/features/NonReg/example.feature +26 -0
- holado_examples/tests/behave/testing_solution/initialize_holado.py +62 -0
- holado_examples/tests/behave/testing_solution/logging.conf +102 -0
- holado_examples/tests/behave/testing_solution/requirements.txt +5 -0
- holado_examples/tests/behave/testing_solution/run_test.sh +7 -0
- holado_examples/tests/behave/testing_solution/run_test_nonreg.sh +6 -0
- holado_examples/tests/behave/testing_solution/src/common/tools/path_manager.py +40 -0
- holado_examples/tests/behave/testing_solution/src/config/config_manager.py +30 -0
- holado_examples/tests/behave/testing_solution/src/context/session_context.py +45 -0
- holado_examples/tests/behave/testing_solution/steps/config_steps.py +21 -0
- holado_examples/tests/behave/testing_solution/steps/public_steps.py +10 -0
- holado_multitask/multithreading/functionthreaded.py +11 -5
- holado_rest/api/rest/rest_client.py +13 -5
- holado_docker/tools/docker_controller/server/grpc/proto/generated/docker_controler_pb2.py +0 -52
- holado_docker/tools/docker_controller/server/grpc/proto/generated/docker_controler_pb2_grpc.py +0 -233
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/WHEEL +0 -0
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
[holado]
|
|
2
|
+
level=INFO
|
|
3
|
+
#level=DEBUG
|
|
4
|
+
log_on_console=False
|
|
5
|
+
log_in_file=True
|
|
6
|
+
|
|
7
|
+
[loggers_levels]
|
|
8
|
+
common=DEBUG
|
|
9
|
+
config=DEBUG
|
|
10
|
+
context=DEBUG
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Set HolAdo modules levels
|
|
14
|
+
# In case default level is set to DEBUG to debug KSC testing solution but not HolAdo, level is defined for each HolAdo module (usually: INFO)
|
|
15
|
+
holado=INFO
|
|
16
|
+
holado.common.context=INFO
|
|
17
|
+
holado.common.context.session_context=DEBUG
|
|
18
|
+
holado.common.handlers.object=DEBUG
|
|
19
|
+
holado_ais=INFO
|
|
20
|
+
#holado_ais.ais=DEBUG
|
|
21
|
+
holado_binary=INFO
|
|
22
|
+
holado_context=INFO
|
|
23
|
+
# Note: set DEBUG level in SessionContext in order to analyze a bug in feature context lifecycle resulting randomly to hook errors until end of session
|
|
24
|
+
holado_context.common.context.session_context=DEBUG
|
|
25
|
+
|
|
26
|
+
#holado_core=INFO
|
|
27
|
+
holado_core=DEBUG
|
|
28
|
+
#holado_core.common.tables.comparators=DEBUG
|
|
29
|
+
holado_core.common.tools=DEBUG
|
|
30
|
+
holado_core.common.tools.comparators=INFO
|
|
31
|
+
#holado_crypto.crypto.transport=DEBUG
|
|
32
|
+
holado_core.scenario=DEBUG
|
|
33
|
+
|
|
34
|
+
holado_data=INFO
|
|
35
|
+
holado_db=INFO
|
|
36
|
+
holado_db.tools=DEBUG
|
|
37
|
+
holado_docker=INFO
|
|
38
|
+
holado_docker.sdk=DEBUG
|
|
39
|
+
holado_grpc=INFO
|
|
40
|
+
holado_grpc.ipc=DEBUG
|
|
41
|
+
holado_helper=INFO
|
|
42
|
+
holado_json=INFO
|
|
43
|
+
holado_keycloak=INFO
|
|
44
|
+
holado_keycloak.tools=DEBUG
|
|
45
|
+
holado_logging=DEBUG
|
|
46
|
+
#holado_logging.common.logging.log_manager=DEBUG
|
|
47
|
+
holado_multitask=INFO
|
|
48
|
+
holado_multitask.multithreading.threadsmanager=DEBUG
|
|
49
|
+
holado_protobuf=INFO
|
|
50
|
+
holado_protobuf.ipc=DEBUG
|
|
51
|
+
#holado_protobuf.ipc.protobuf.protobuf_converter=TRACE
|
|
52
|
+
#holado_protobuf.ipc.protobuf.protobuf_messages=TRACE
|
|
53
|
+
holado_python=INFO
|
|
54
|
+
holado_rabbitmq=INFO
|
|
55
|
+
holado_rabbitmq.tools=DEBUG
|
|
56
|
+
holado_redis=INFO
|
|
57
|
+
holado_redis.tools=DEBUG
|
|
58
|
+
holado_report=INFO
|
|
59
|
+
holado_rest=INFO
|
|
60
|
+
#holado_rest.api=DEBUG
|
|
61
|
+
holado_s3=INFO
|
|
62
|
+
holado_s3.tools=DEBUG
|
|
63
|
+
#holado_s3.tools.s3.minio_client=DEBUG
|
|
64
|
+
#holado_s3.tools.s3.minio_client.trace=DEBUG
|
|
65
|
+
|
|
66
|
+
holado_scripting=INFO
|
|
67
|
+
#holado_scripting.common.tools=DEBUG
|
|
68
|
+
#holado_scripting.common.tools.expression_evaluator=INFO
|
|
69
|
+
holado_scripting.common.tools.expression_evaluator=DEBUG
|
|
70
|
+
#holado_scripting.common.tools.expression_evaluator=TRACE
|
|
71
|
+
#holado_scripting.common.tools.variable_manager=DEBUG
|
|
72
|
+
#holado_scripting.common.tools.variable_manager=TRACE
|
|
73
|
+
#holado_scripting.interpreter=TRACE
|
|
74
|
+
#holado_scripting.interpreter.functions=DEBUG
|
|
75
|
+
|
|
76
|
+
holado_sftp=INFO
|
|
77
|
+
holado_sftp.tools=DEBUG
|
|
78
|
+
holado_swagger=INFO
|
|
79
|
+
holado_system=INFO
|
|
80
|
+
holado_system.system.global_system=DEBUG
|
|
81
|
+
#holado_test=INFO
|
|
82
|
+
holado_test=DEBUG
|
|
83
|
+
|
|
84
|
+
# UI modules are not operational yet
|
|
85
|
+
holado_ui=ERROR
|
|
86
|
+
holado_ui_mss=ERROR
|
|
87
|
+
holado_ui_selenium=ERROR
|
|
88
|
+
holado_ui_selenium_angular=ERROR
|
|
89
|
+
holado_ui_selenium_html=ERROR
|
|
90
|
+
|
|
91
|
+
holado_value=DEBUG
|
|
92
|
+
#holado_value.common.tables.converters.value_table_converter=TRACE
|
|
93
|
+
holado_ws=ERROR
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# External libraries
|
|
97
|
+
chardet=WARNING
|
|
98
|
+
docker=INFO
|
|
99
|
+
grpc_requests=DEBUG
|
|
100
|
+
pika=WARN
|
|
101
|
+
psycopg=INFO
|
|
102
|
+
urllib3=INFO
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
from holado_core.common.tools.path_manager import PathManager
|
|
5
|
+
|
|
6
|
+
logger = logging.getLogger(__name__)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TSPathManager(PathManager):
|
|
10
|
+
|
|
11
|
+
def __init__(self):
|
|
12
|
+
super().__init__()
|
|
13
|
+
|
|
14
|
+
def initialize(self):
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
def __get_root_path(self):
|
|
18
|
+
here = os.path.abspath(os.path.dirname(__file__))
|
|
19
|
+
return os.path.join(here, "..", "..", "..")
|
|
20
|
+
|
|
21
|
+
def get_reports_path(self, name=None):
|
|
22
|
+
if os.getenv('TESTING_SOLUTION_REPORTS_PATH') is not None:
|
|
23
|
+
reports_root = os.getenv('TESTING_SOLUTION_REPORTS_PATH')
|
|
24
|
+
elif os.getenv('TEST_OUTPUT_BASEDIR') is not None:
|
|
25
|
+
reports_root = os.path.join(os.getenv('TEST_OUTPUT_BASEDIR'), "reports")
|
|
26
|
+
else:
|
|
27
|
+
reports_root = super().get_reports_path()
|
|
28
|
+
|
|
29
|
+
if name is not None:
|
|
30
|
+
return os.path.join(reports_root, name)
|
|
31
|
+
else:
|
|
32
|
+
return reports_root
|
|
33
|
+
|
|
34
|
+
def get_static_files_path(self, name=None):
|
|
35
|
+
root_path = self.__get_root_path()
|
|
36
|
+
res = os.path.normpath(os.path.join(root_path, "resources", "static_files"))
|
|
37
|
+
if name is not None:
|
|
38
|
+
res = os.path.join(res, name)
|
|
39
|
+
return res
|
|
40
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from holado_test.behave.behave import execute_steps
|
|
5
|
+
|
|
6
|
+
logger = logging.getLogger(__name__)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TSConfigManager:
|
|
10
|
+
|
|
11
|
+
def __init__(self):
|
|
12
|
+
self.__func_path_manager = None
|
|
13
|
+
|
|
14
|
+
def initialize(self, func_path_manager):
|
|
15
|
+
self.__func_path_manager = func_path_manager
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def __path_manager(self):
|
|
19
|
+
return self.__func_path_manager()
|
|
20
|
+
|
|
21
|
+
def configure_system_with_default_settings(self):
|
|
22
|
+
# Remove possible side effects of previous execution
|
|
23
|
+
execute_steps(u"""
|
|
24
|
+
# Given ensure XXX
|
|
25
|
+
""")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from builtins import super
|
|
2
|
+
from holado.common.context.session_context import SessionContext
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
logger = logging.getLogger(__name__)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TSSessionContext(SessionContext):
|
|
9
|
+
|
|
10
|
+
def __init__(self):
|
|
11
|
+
super().__init__("TSSession")
|
|
12
|
+
|
|
13
|
+
def configure(self, session_kwargs=None):
|
|
14
|
+
logger.info("Configuring TSSessionContext")
|
|
15
|
+
|
|
16
|
+
super().configure(session_kwargs)
|
|
17
|
+
|
|
18
|
+
# Override default registered modules
|
|
19
|
+
|
|
20
|
+
from common.tools.path_manager import TSPathManager
|
|
21
|
+
self.services.register_service_type("path_manager", TSPathManager,
|
|
22
|
+
lambda m: m.initialize(),
|
|
23
|
+
raise_if_exist=False )
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Register new modules
|
|
27
|
+
|
|
28
|
+
from config.config_manager import TSConfigManager
|
|
29
|
+
self.services.register_service_type("config_manager", TSConfigManager,
|
|
30
|
+
lambda m: m.initialize(lambda: self.path_manager) )
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def initialize(self, session_kwargs=None):
|
|
34
|
+
if session_kwargs is None:
|
|
35
|
+
session_kwargs = {}
|
|
36
|
+
raise_if_not_exist = session_kwargs.get("raise_if_not_exist", True)
|
|
37
|
+
|
|
38
|
+
# Call default initialization
|
|
39
|
+
super().initialize(session_kwargs)
|
|
40
|
+
|
|
41
|
+
# Initialize testing solution
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from holado_test.behave.behave import * # @UnusedWildImport
|
|
5
|
+
from holado.common.context.session_context import SessionContext
|
|
6
|
+
from config.config_manager import TSConfigManager
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def __get_config_manager() -> TSConfigManager:
|
|
13
|
+
return SessionContext.instance().config_manager
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@Given(r"ensure system is configured with default settings")
|
|
17
|
+
def step_impl(context):
|
|
18
|
+
__get_config_manager().configure_system_with_default_settings()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from test_holado.steps.public_steps import *
|
|
5
|
+
|
|
6
|
+
# Note: following lines are commented since, with this example files architecture, these steps are automatically found and imported by behave
|
|
7
|
+
# from steps.config_steps import *
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
@@ -29,7 +29,7 @@ class FunctionThreaded(ctt.InterruptableThread):
|
|
|
29
29
|
Execute in a thread given function with given arguments
|
|
30
30
|
'''
|
|
31
31
|
|
|
32
|
-
def __init__(self, target, args=None, kwargs=None, name=None, default_wait_timeout=None, register_thread=True, register_scope=default_context, delay_before_run_sec=None):
|
|
32
|
+
def __init__(self, target, args=None, kwargs=None, name=None, default_wait_timeout=None, register_thread=True, register_scope=default_context, delay_before_run_sec=None, do_log=True):
|
|
33
33
|
super().__init__(name if name is not None else f"FunctionThreaded({repr(target)})", default_wait_timeout=default_wait_timeout, register_thread=register_thread, register_scope=register_scope, delay_before_run_sec=delay_before_run_sec)
|
|
34
34
|
|
|
35
35
|
if args is None:
|
|
@@ -46,6 +46,7 @@ class FunctionThreaded(ctt.InterruptableThread):
|
|
|
46
46
|
self.__interrupt_function = None
|
|
47
47
|
|
|
48
48
|
self.__callback_function = None
|
|
49
|
+
self.__do_log = do_log
|
|
49
50
|
|
|
50
51
|
@property
|
|
51
52
|
def error(self):
|
|
@@ -87,7 +88,8 @@ class FunctionThreaded(ctt.InterruptableThread):
|
|
|
87
88
|
try:
|
|
88
89
|
time.sleep(self.delay_before_run_seconds)
|
|
89
90
|
except Exception as exc:
|
|
90
|
-
|
|
91
|
+
if self.__do_log:
|
|
92
|
+
logger.exception(f"[Thread '{self.name}'] Exception while waiting delay before run (delay: {self.delay_before_run_seconds} ; type: {Typing.get_object_class_fullname(self.delay_before_run_seconds)})")
|
|
91
93
|
|
|
92
94
|
if self.is_interrupted:
|
|
93
95
|
return
|
|
@@ -96,7 +98,8 @@ class FunctionThreaded(ctt.InterruptableThread):
|
|
|
96
98
|
# logging.debug("+++++++++ Launching function [{}({})]".format(repr(self._target), repr(self._args)))
|
|
97
99
|
self.__result = self._function.run()
|
|
98
100
|
except Exception as exc:
|
|
99
|
-
|
|
101
|
+
if self.__do_log:
|
|
102
|
+
logger.exception(f"[Thread '{self.name}'] Exception catched during threaded function [{self._function.represent()}]")
|
|
100
103
|
self.__error = exc
|
|
101
104
|
|
|
102
105
|
if self.is_interrupted:
|
|
@@ -107,10 +110,13 @@ class FunctionThreaded(ctt.InterruptableThread):
|
|
|
107
110
|
self.__callback_function.run(self.result, self.error)
|
|
108
111
|
except Exception as exc:
|
|
109
112
|
msg = "Exception catched while calling callback function:\n callback_function: {}\n result: [{}]\n error: [{}]".format(repr(self.__callback_function), Tools.truncate_text(repr(self.result)), repr(self.error))
|
|
110
|
-
|
|
113
|
+
if self.__do_log:
|
|
114
|
+
logger.exception(msg)
|
|
111
115
|
raise FunctionalException(msg) from exc
|
|
112
116
|
|
|
113
|
-
|
|
117
|
+
if self.__do_log:
|
|
118
|
+
# logger.info(f"[Thread '{self.name}'] Thread has finished")
|
|
119
|
+
logger.info(f"[Thread '{self.name}'] Thread has finished (func: {self._function})")
|
|
114
120
|
|
|
115
121
|
def throw_if_error(self):
|
|
116
122
|
if self.error:
|
|
@@ -68,13 +68,19 @@ class RestClient(object):
|
|
|
68
68
|
self.__kwargs.update(ssl_kwargs)
|
|
69
69
|
|
|
70
70
|
def response_result(self, response, status_ok=200):
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
res =
|
|
71
|
+
# Get result
|
|
72
|
+
if response.status_code == 204:
|
|
73
|
+
# 204 == "No Content" => return None
|
|
74
|
+
res = None
|
|
75
75
|
else:
|
|
76
|
-
|
|
76
|
+
if "application/json" in response.headers['Content-Type'] and len(response.content) > 0:
|
|
77
|
+
res = response.json()
|
|
78
|
+
elif response.headers['Content-Type'].startswith('text'):
|
|
79
|
+
res = response.text
|
|
80
|
+
else:
|
|
81
|
+
res = response.content
|
|
77
82
|
|
|
83
|
+
# Verify status
|
|
78
84
|
is_ok = isinstance(status_ok, list) and response.status_code in status_ok or response.status_code == status_ok
|
|
79
85
|
if not is_ok:
|
|
80
86
|
raise FunctionalException(f"[{self.name}] Request failed with status {response.status_code} (expected success status: {status_ok}) on error: {res}")
|
|
@@ -94,6 +100,8 @@ class RestClient(object):
|
|
|
94
100
|
|
|
95
101
|
if Tools.do_log(logger, logging.DEBUG):
|
|
96
102
|
logger.debug(f"[{self.name}] {method} on url '{url}' => {res}")
|
|
103
|
+
if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
|
|
104
|
+
logger.trace(f"[{self.name}] {method} on url '{url}' => {Tools.represent_object(res, 4)}")
|
|
97
105
|
return res
|
|
98
106
|
|
|
99
107
|
def delete(self, path, data=None, **kwargs):
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
-
# source: docker_controler.proto
|
|
5
|
-
# Protobuf Python Version: 5.28.1
|
|
6
|
-
"""Generated protocol buffer code."""
|
|
7
|
-
from google.protobuf import descriptor as _descriptor
|
|
8
|
-
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
-
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
-
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
-
from google.protobuf.internal import builder as _builder
|
|
12
|
-
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
-
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
5,
|
|
15
|
-
28,
|
|
16
|
-
1,
|
|
17
|
-
'',
|
|
18
|
-
'docker_controler.proto'
|
|
19
|
-
)
|
|
20
|
-
# @@protoc_insertion_point(imports)
|
|
21
|
-
|
|
22
|
-
_sym_db = _symbol_database.Default()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x64ocker_controler.proto\x12\x10\x64ocker_controler\"\x1d\n\x1bGetAllContainerNamesRequest\"7\n\x1cGetAllContainerNamesResponse\x12\x17\n\x0f\x63ontainer_names\x18\x01 \x03(\t\"%\n\x15StartContainerRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"2\n\x16StartContainerResponse\x12\x18\n\x10\x63ontainer_status\x18\x01 \x01(\t\"$\n\x14StopContainerRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"1\n\x15StopContainerResponse\x12\x18\n\x10\x63ontainer_status\x18\x01 \x01(\t\"\'\n\x17RestartContainerRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"4\n\x18RestartContainerResponse\x12\x18\n\x10\x63ontainer_status\x18\x01 \x01(\t2\xc9\x03\n\x16\x44ockerControlerService\x12w\n\x14GetAllContainerNames\x12-.docker_controler.GetAllContainerNamesRequest\x1a..docker_controler.GetAllContainerNamesResponse\"\x00\x12\x65\n\x0eStartContainer\x12\'.docker_controler.StartContainerRequest\x1a(.docker_controler.StartContainerResponse\"\x00\x12\x62\n\rStopContainer\x12&.docker_controler.StopContainerRequest\x1a\'.docker_controler.StopContainerResponse\"\x00\x12k\n\x10RestartContainer\x12).docker_controler.RestartContainerRequest\x1a*.docker_controler.RestartContainerResponse\"\x00\x62\x06proto3')
|
|
28
|
-
|
|
29
|
-
_globals = globals()
|
|
30
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'docker_controler_pb2', _globals)
|
|
32
|
-
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
-
DESCRIPTOR._loaded_options = None
|
|
34
|
-
_globals['_GETALLCONTAINERNAMESREQUEST']._serialized_start=44
|
|
35
|
-
_globals['_GETALLCONTAINERNAMESREQUEST']._serialized_end=73
|
|
36
|
-
_globals['_GETALLCONTAINERNAMESRESPONSE']._serialized_start=75
|
|
37
|
-
_globals['_GETALLCONTAINERNAMESRESPONSE']._serialized_end=130
|
|
38
|
-
_globals['_STARTCONTAINERREQUEST']._serialized_start=132
|
|
39
|
-
_globals['_STARTCONTAINERREQUEST']._serialized_end=169
|
|
40
|
-
_globals['_STARTCONTAINERRESPONSE']._serialized_start=171
|
|
41
|
-
_globals['_STARTCONTAINERRESPONSE']._serialized_end=221
|
|
42
|
-
_globals['_STOPCONTAINERREQUEST']._serialized_start=223
|
|
43
|
-
_globals['_STOPCONTAINERREQUEST']._serialized_end=259
|
|
44
|
-
_globals['_STOPCONTAINERRESPONSE']._serialized_start=261
|
|
45
|
-
_globals['_STOPCONTAINERRESPONSE']._serialized_end=310
|
|
46
|
-
_globals['_RESTARTCONTAINERREQUEST']._serialized_start=312
|
|
47
|
-
_globals['_RESTARTCONTAINERREQUEST']._serialized_end=351
|
|
48
|
-
_globals['_RESTARTCONTAINERRESPONSE']._serialized_start=353
|
|
49
|
-
_globals['_RESTARTCONTAINERRESPONSE']._serialized_end=405
|
|
50
|
-
_globals['_DOCKERCONTROLERSERVICE']._serialized_start=408
|
|
51
|
-
_globals['_DOCKERCONTROLERSERVICE']._serialized_end=865
|
|
52
|
-
# @@protoc_insertion_point(module_scope)
|
holado_docker/tools/docker_controller/server/grpc/proto/generated/docker_controler_pb2_grpc.py
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
-
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
-
import grpc
|
|
4
|
-
import warnings
|
|
5
|
-
|
|
6
|
-
import docker_controler_pb2 as docker__controler__pb2
|
|
7
|
-
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.68.1'
|
|
9
|
-
GRPC_VERSION = grpc.__version__
|
|
10
|
-
_version_not_supported = False
|
|
11
|
-
|
|
12
|
-
try:
|
|
13
|
-
from grpc._utilities import first_version_is_lower
|
|
14
|
-
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
-
except ImportError:
|
|
16
|
-
_version_not_supported = True
|
|
17
|
-
|
|
18
|
-
if _version_not_supported:
|
|
19
|
-
raise RuntimeError(
|
|
20
|
-
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
-
+ f' but the generated code in docker_controler_pb2_grpc.py depends on'
|
|
22
|
-
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
-
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
-
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class DockerControlerServiceStub(object):
|
|
29
|
-
"""DockerControlerService represents the querying service provided by docker controler.
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
def __init__(self, channel):
|
|
33
|
-
"""Constructor.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
channel: A grpc.Channel.
|
|
37
|
-
"""
|
|
38
|
-
self.GetAllContainerNames = channel.unary_unary(
|
|
39
|
-
'/docker_controler.DockerControlerService/GetAllContainerNames',
|
|
40
|
-
request_serializer=docker__controler__pb2.GetAllContainerNamesRequest.SerializeToString,
|
|
41
|
-
response_deserializer=docker__controler__pb2.GetAllContainerNamesResponse.FromString,
|
|
42
|
-
_registered_method=True)
|
|
43
|
-
self.StartContainer = channel.unary_unary(
|
|
44
|
-
'/docker_controler.DockerControlerService/StartContainer',
|
|
45
|
-
request_serializer=docker__controler__pb2.StartContainerRequest.SerializeToString,
|
|
46
|
-
response_deserializer=docker__controler__pb2.StartContainerResponse.FromString,
|
|
47
|
-
_registered_method=True)
|
|
48
|
-
self.StopContainer = channel.unary_unary(
|
|
49
|
-
'/docker_controler.DockerControlerService/StopContainer',
|
|
50
|
-
request_serializer=docker__controler__pb2.StopContainerRequest.SerializeToString,
|
|
51
|
-
response_deserializer=docker__controler__pb2.StopContainerResponse.FromString,
|
|
52
|
-
_registered_method=True)
|
|
53
|
-
self.RestartContainer = channel.unary_unary(
|
|
54
|
-
'/docker_controler.DockerControlerService/RestartContainer',
|
|
55
|
-
request_serializer=docker__controler__pb2.RestartContainerRequest.SerializeToString,
|
|
56
|
-
response_deserializer=docker__controler__pb2.RestartContainerResponse.FromString,
|
|
57
|
-
_registered_method=True)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class DockerControlerServiceServicer(object):
|
|
61
|
-
"""DockerControlerService represents the querying service provided by docker controler.
|
|
62
|
-
"""
|
|
63
|
-
|
|
64
|
-
def GetAllContainerNames(self, request, context):
|
|
65
|
-
"""Get all container names.
|
|
66
|
-
"""
|
|
67
|
-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
68
|
-
context.set_details('Method not implemented!')
|
|
69
|
-
raise NotImplementedError('Method not implemented!')
|
|
70
|
-
|
|
71
|
-
def StartContainer(self, request, context):
|
|
72
|
-
"""Start a container.
|
|
73
|
-
"""
|
|
74
|
-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
75
|
-
context.set_details('Method not implemented!')
|
|
76
|
-
raise NotImplementedError('Method not implemented!')
|
|
77
|
-
|
|
78
|
-
def StopContainer(self, request, context):
|
|
79
|
-
"""Stop a container.
|
|
80
|
-
"""
|
|
81
|
-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
82
|
-
context.set_details('Method not implemented!')
|
|
83
|
-
raise NotImplementedError('Method not implemented!')
|
|
84
|
-
|
|
85
|
-
def RestartContainer(self, request, context):
|
|
86
|
-
"""Restart a container.
|
|
87
|
-
"""
|
|
88
|
-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
89
|
-
context.set_details('Method not implemented!')
|
|
90
|
-
raise NotImplementedError('Method not implemented!')
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def add_DockerControlerServiceServicer_to_server(servicer, server):
|
|
94
|
-
rpc_method_handlers = {
|
|
95
|
-
'GetAllContainerNames': grpc.unary_unary_rpc_method_handler(
|
|
96
|
-
servicer.GetAllContainerNames,
|
|
97
|
-
request_deserializer=docker__controler__pb2.GetAllContainerNamesRequest.FromString,
|
|
98
|
-
response_serializer=docker__controler__pb2.GetAllContainerNamesResponse.SerializeToString,
|
|
99
|
-
),
|
|
100
|
-
'StartContainer': grpc.unary_unary_rpc_method_handler(
|
|
101
|
-
servicer.StartContainer,
|
|
102
|
-
request_deserializer=docker__controler__pb2.StartContainerRequest.FromString,
|
|
103
|
-
response_serializer=docker__controler__pb2.StartContainerResponse.SerializeToString,
|
|
104
|
-
),
|
|
105
|
-
'StopContainer': grpc.unary_unary_rpc_method_handler(
|
|
106
|
-
servicer.StopContainer,
|
|
107
|
-
request_deserializer=docker__controler__pb2.StopContainerRequest.FromString,
|
|
108
|
-
response_serializer=docker__controler__pb2.StopContainerResponse.SerializeToString,
|
|
109
|
-
),
|
|
110
|
-
'RestartContainer': grpc.unary_unary_rpc_method_handler(
|
|
111
|
-
servicer.RestartContainer,
|
|
112
|
-
request_deserializer=docker__controler__pb2.RestartContainerRequest.FromString,
|
|
113
|
-
response_serializer=docker__controler__pb2.RestartContainerResponse.SerializeToString,
|
|
114
|
-
),
|
|
115
|
-
}
|
|
116
|
-
generic_handler = grpc.method_handlers_generic_handler(
|
|
117
|
-
'docker_controler.DockerControlerService', rpc_method_handlers)
|
|
118
|
-
server.add_generic_rpc_handlers((generic_handler,))
|
|
119
|
-
server.add_registered_method_handlers('docker_controler.DockerControlerService', rpc_method_handlers)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# This class is part of an EXPERIMENTAL API.
|
|
123
|
-
class DockerControlerService(object):
|
|
124
|
-
"""DockerControlerService represents the querying service provided by docker controler.
|
|
125
|
-
"""
|
|
126
|
-
|
|
127
|
-
@staticmethod
|
|
128
|
-
def GetAllContainerNames(request,
|
|
129
|
-
target,
|
|
130
|
-
options=(),
|
|
131
|
-
channel_credentials=None,
|
|
132
|
-
call_credentials=None,
|
|
133
|
-
insecure=False,
|
|
134
|
-
compression=None,
|
|
135
|
-
wait_for_ready=None,
|
|
136
|
-
timeout=None,
|
|
137
|
-
metadata=None):
|
|
138
|
-
return grpc.experimental.unary_unary(
|
|
139
|
-
request,
|
|
140
|
-
target,
|
|
141
|
-
'/docker_controler.DockerControlerService/GetAllContainerNames',
|
|
142
|
-
docker__controler__pb2.GetAllContainerNamesRequest.SerializeToString,
|
|
143
|
-
docker__controler__pb2.GetAllContainerNamesResponse.FromString,
|
|
144
|
-
options,
|
|
145
|
-
channel_credentials,
|
|
146
|
-
insecure,
|
|
147
|
-
call_credentials,
|
|
148
|
-
compression,
|
|
149
|
-
wait_for_ready,
|
|
150
|
-
timeout,
|
|
151
|
-
metadata,
|
|
152
|
-
_registered_method=True)
|
|
153
|
-
|
|
154
|
-
@staticmethod
|
|
155
|
-
def StartContainer(request,
|
|
156
|
-
target,
|
|
157
|
-
options=(),
|
|
158
|
-
channel_credentials=None,
|
|
159
|
-
call_credentials=None,
|
|
160
|
-
insecure=False,
|
|
161
|
-
compression=None,
|
|
162
|
-
wait_for_ready=None,
|
|
163
|
-
timeout=None,
|
|
164
|
-
metadata=None):
|
|
165
|
-
return grpc.experimental.unary_unary(
|
|
166
|
-
request,
|
|
167
|
-
target,
|
|
168
|
-
'/docker_controler.DockerControlerService/StartContainer',
|
|
169
|
-
docker__controler__pb2.StartContainerRequest.SerializeToString,
|
|
170
|
-
docker__controler__pb2.StartContainerResponse.FromString,
|
|
171
|
-
options,
|
|
172
|
-
channel_credentials,
|
|
173
|
-
insecure,
|
|
174
|
-
call_credentials,
|
|
175
|
-
compression,
|
|
176
|
-
wait_for_ready,
|
|
177
|
-
timeout,
|
|
178
|
-
metadata,
|
|
179
|
-
_registered_method=True)
|
|
180
|
-
|
|
181
|
-
@staticmethod
|
|
182
|
-
def StopContainer(request,
|
|
183
|
-
target,
|
|
184
|
-
options=(),
|
|
185
|
-
channel_credentials=None,
|
|
186
|
-
call_credentials=None,
|
|
187
|
-
insecure=False,
|
|
188
|
-
compression=None,
|
|
189
|
-
wait_for_ready=None,
|
|
190
|
-
timeout=None,
|
|
191
|
-
metadata=None):
|
|
192
|
-
return grpc.experimental.unary_unary(
|
|
193
|
-
request,
|
|
194
|
-
target,
|
|
195
|
-
'/docker_controler.DockerControlerService/StopContainer',
|
|
196
|
-
docker__controler__pb2.StopContainerRequest.SerializeToString,
|
|
197
|
-
docker__controler__pb2.StopContainerResponse.FromString,
|
|
198
|
-
options,
|
|
199
|
-
channel_credentials,
|
|
200
|
-
insecure,
|
|
201
|
-
call_credentials,
|
|
202
|
-
compression,
|
|
203
|
-
wait_for_ready,
|
|
204
|
-
timeout,
|
|
205
|
-
metadata,
|
|
206
|
-
_registered_method=True)
|
|
207
|
-
|
|
208
|
-
@staticmethod
|
|
209
|
-
def RestartContainer(request,
|
|
210
|
-
target,
|
|
211
|
-
options=(),
|
|
212
|
-
channel_credentials=None,
|
|
213
|
-
call_credentials=None,
|
|
214
|
-
insecure=False,
|
|
215
|
-
compression=None,
|
|
216
|
-
wait_for_ready=None,
|
|
217
|
-
timeout=None,
|
|
218
|
-
metadata=None):
|
|
219
|
-
return grpc.experimental.unary_unary(
|
|
220
|
-
request,
|
|
221
|
-
target,
|
|
222
|
-
'/docker_controler.DockerControlerService/RestartContainer',
|
|
223
|
-
docker__controler__pb2.RestartContainerRequest.SerializeToString,
|
|
224
|
-
docker__controler__pb2.RestartContainerResponse.FromString,
|
|
225
|
-
options,
|
|
226
|
-
channel_credentials,
|
|
227
|
-
insecure,
|
|
228
|
-
call_credentials,
|
|
229
|
-
compression,
|
|
230
|
-
wait_for_ready,
|
|
231
|
-
timeout,
|
|
232
|
-
metadata,
|
|
233
|
-
_registered_method=True)
|
|
File without changes
|
|
File without changes
|