Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #255

Merged
merged 5 commits into from
Aug 23, 2023
Merged

Dev #255

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ def start_packetbeats(ip: str, port: int, emulation: str, ip_first_octet: int, i

@staticmethod
def start_docker_statsmanager_thread(ip: str, port: int, emulation: str, ip_first_octet: int) \
-> csle_cluster.cluster_manager.cluster_manager_pb2.OperationOutcomeDTO:
-> csle_cluster.cluster_manager.cluster_manager_pb2.ServiceStatusDTO:
"""
Sends a request to start a docker statsmanager thread for a given execution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ def startHeartbeats(

def startDockerStatsManagerThread(
self, request: csle_cluster.cluster_manager.cluster_manager_pb2.StartDockerStatsManagerThreadMsg,
context: grpc.ServicerContext) -> csle_cluster.cluster_manager.cluster_manager_pb2.OperationOutcomeDTO:
context: grpc.ServicerContext) -> csle_cluster.cluster_manager.cluster_manager_pb2.ServiceStatusDTO:
"""
Starts the docker stats manager

Expand All @@ -1362,11 +1362,11 @@ def startDockerStatsManagerThread(
execution = MetastoreFacade.get_emulation_execution(ip_first_octet=request.ipFirstOctet,
emulation_name=request.emulation)
if execution is None:
return csle_cluster.cluster_manager.cluster_manager_pb2.OperationOutcomeDTO(outcome=False)
return csle_cluster.cluster_manager.cluster_manager_pb2.ServiceStatusDTO(running=False)
ContainerController.start_docker_stats_thread(execution=execution,
physical_server_ip=GeneralUtil.get_host_ip(),
logger=logging.getLogger())
return csle_cluster.cluster_manager.cluster_manager_pb2.OperationOutcomeDTO(outcome=True)
return csle_cluster.cluster_manager.cluster_manager_pb2.ServiceStatusDTO(running=True)

def stopAllExecutionsOfEmulation(
self, request: csle_cluster.cluster_manager.cluster_manager_pb2.StopAllExecutionsOfEmulationMsg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ def start_docker_statsmanager_thread(
stub: csle_cluster.cluster_manager.cluster_manager_pb2_grpc.ClusterManagerStub,
emulation: str, ip_first_octet: int,
timeout=constants.GRPC.OPERATION_TIMEOUT_SECONDS) \
-> csle_cluster.cluster_manager.cluster_manager_pb2.OperationOutcomeDTO:
-> csle_cluster.cluster_manager.cluster_manager_pb2.ServiceStatusDTO:
"""
Starts a docker stats manager thread for a given execution

Expand All @@ -1313,9 +1313,9 @@ def start_docker_statsmanager_thread(
operation_msg = csle_cluster.cluster_manager.cluster_manager_pb2.StartDockerStatsManagerThreadMsg(
emulation=emulation, ipFirstOctet=ip_first_octet
)
operation_outcome_dto: csle_cluster.cluster_manager.cluster_manager_pb2.OperationOutcomeDTO = \
service_status_dto: csle_cluster.cluster_manager.cluster_manager_pb2.ServiceStatusDTO = \
stub.startDockerStatsManagerThread(operation_msg, timeout=timeout)
return operation_outcome_dto
return service_status_dto


def stop_all_executions_of_emulation(
Expand Down
Loading
Loading