fix scale down and add the down query
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -57,7 +57,7 @@ def Check_server_supposed_XXX(generated_db_in,wanted_status,Wanted_hour,Wanted_d
|
|||||||
if wanted_status == "up":
|
if wanted_status == "up":
|
||||||
sql_in = "select machine.namespace, machine.name, machine.replicas from scenario_hour,machine ,scenario_day_of_week where state_at_" + str(Wanted_hour) + "='1' and state_" + str(Wanted_day) + "='1' and machine.hour_behaviour_id=scenario_hour.id_scenario and machine.day_behaviour_id=scenario_day_of_week.id_scenario;"
|
sql_in = "select machine.namespace, machine.name, machine.replicas from scenario_hour,machine ,scenario_day_of_week where state_at_" + str(Wanted_hour) + "='1' and state_" + str(Wanted_day) + "='1' and machine.hour_behaviour_id=scenario_hour.id_scenario and machine.day_behaviour_id=scenario_day_of_week.id_scenario;"
|
||||||
elif wanted_status == "down":
|
elif wanted_status == "down":
|
||||||
sql_in = "select machine.namespace, machine.name, machine.replicas from scenario_hour,machine where state_at_" + str(Wanted_hour) + "='0' and machine.hour_behaviour_id=scenario_hour.id_scenario;"
|
sql_in = "select machine.namespace, machine.name, machine.replicas from scenario_hour,machine ,scenario_day_of_week where state_at_" + str(Wanted_hour) + "='0' or state_" + str(Wanted_day) + "='0' and machine.hour_behaviour_id=scenario_hour.id_scenario and machine.day_behaviour_id=scenario_day_of_week.id_scenario;"
|
||||||
else:
|
else:
|
||||||
print("error value")
|
print("error value")
|
||||||
print(sql_in)
|
print(sql_in)
|
||||||
@@ -82,7 +82,7 @@ def all_operations(request,wanted_state,list_machine):
|
|||||||
if wanted_state == "up":
|
if wanted_state == "up":
|
||||||
kubernetes_connection.scale_up(request,namespace_name=machine_target[0],deploy_name=machine_target[1],replicas=machine_target[2]);
|
kubernetes_connection.scale_up(request,namespace_name=machine_target[0],deploy_name=machine_target[1],replicas=machine_target[2]);
|
||||||
elif wanted_state == "down":
|
elif wanted_state == "down":
|
||||||
kubernetes_connection.scale_down(request,namespace_name=machine_target[0],deploy_name=machine_target[1],replicas=machine_target[2]);
|
kubernetes_connection.scale_down(request,namespace_name=machine_target[0],deploy_name=machine_target[1]);
|
||||||
else:
|
else:
|
||||||
print("Incorrect wanted state")
|
print("Incorrect wanted state")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user