Commit cd25af4a authored by Daniele Venzano's avatar Daniele Venzano

Remove the service_inspect endpoint, it is redundant

parent 105bbd97
......@@ -100,18 +100,11 @@ class APIEndpoint:
s = self.sql.service_list(id=service_id, only_one=True)
if s is None:
raise zoe_api.exceptions.ZoeNotFoundException('No such execution')
if s.user_id != uid and role != 'admin':
s_exec = self.sql.execution_list(only_one=True, id=s.execution_id)
if s_exec.user_id != uid and role != 'admin':
raise zoe_api.exceptions.ZoeAuthException()
return s
def service_inspect(self, uid, role, service):
ret, data = self.master.service_inspect(service.id)
if not ret:
raise zoe_api.exceptions.ZoeException(data)
if service.user_id != uid and role != 'admin':
raise zoe_api.exceptions.ZoeAuthException()
def retry_submit_error_executions(self):
waiting_execs = self.sql.execution_list(status=zoe_lib.sql_manager.Execution.SUBMIT_STATUS)
if waiting_execs is None or len(waiting_execs) == 0:
......
......@@ -78,15 +78,6 @@ class APIManager:
if execution is not None:
zoe_master.execution_manager.execution_delete(execution)
self._reply_ok()
elif message['command'] == 'service_inspect':
service_id = message['service_id']
service = config.singletons['sql_manager'].service_list(id=service_id, only_one=True)
if service is None:
self._reply_error('no such service')
else:
swarm = SwarmClient(config.get_conf())
info = swarm.inspect_container(service.docker_id)
self._reply_ok(info)
else:
log.error('Unknown command: {}'.format(message['command']))
self._reply_error('unknown command')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment