diff --git a/shakedown/dcos/agent.py b/shakedown/dcos/agent.py index b66400e..7d6903a 100644 --- a/shakedown/dcos/agent.py +++ b/shakedown/dcos/agent.py @@ -4,6 +4,7 @@ import os from dcos import (marathon, mesos) + def get_public_agents(): """Provides a list of hostnames / IPs that are public agents in the cluster""" agent_list = [] @@ -15,6 +16,7 @@ def get_public_agents(): return agent_list + def get_private_agents(): """Provides a list of hostnames / IPs that are private agents in the cluster""" @@ -34,6 +36,7 @@ def get_private_agents(): return agent_list + def get_agents(): """Provides a list of hostnames / IPs of all agents in the cluster""" @@ -118,6 +121,7 @@ def restart_agent( run_command_on_agent(hostname, "sudo systemctl restart dcos-mesos-slave") + def stop_agent( hostname ): @@ -140,6 +144,13 @@ def start_agent( run_command_on_agent(hostname, "sudo systemctl start dcos-mesos-slave") +def restart_agent_node(hostname): + """ Restarts the agent node + """ + + run_command_on_agent(hostname, "sudo /sbin/shutdown -r now") + + def delete_agent_log( hostname ): diff --git a/shakedown/dcos/master.py b/shakedown/dcos/master.py index 64d2740..783fc26 100644 --- a/shakedown/dcos/master.py +++ b/shakedown/dcos/master.py @@ -37,6 +37,19 @@ def reconnect_master(): reconnect_node(shakedown.master_ip()) +def restart_master_node(): + """ Restarts the master node + """ + + run_command_on_master("sudo /sbin/shutdown -r now") + + +def systemctl_master(command='restart'): + """ Used to start, stop or restart the master process + """ + run_command_on_master('sudo systemctl {} dcos-mesos-master'.format(command)) + + @contextlib.contextmanager def disconnected_master(incoming=True, outgoing=True):