def status(self, uuids): """ Get the status of the agent. Relies on heartbeat. @param uuids: A list of uuids. @type uuids: list @return: {} """ rest = Rest() path = '/agenthub/agent/%s/' % uuids[0] reply = rest.get(path) return reply[1]
def status(self, uuids): """ Get the status of the agent. Relies on heartbeat. @param uuids: A list of uuids. @type uuids: list @return: {} """ rest = Rest() result = {} for uuid in uuids: path = '/agenthub/agent/%s/' % uuid status, body = rest.get(path) if status == 200: result[uuid] = body else: raise Exception('Status Failed') return result
def status(cls, uuids): """ Get the status of the agent. Relies on heartbeat. @param uuids: A list of uuids. @type uuids: list @return: {} """ rest = Rest() result = {} for uuid in uuids: path = '/agenthub/agent/%s/' % uuid status, body = rest.get(path) if status == 200: result[uuid] = body else: raise Exception('Status Failed') return result