Beispiel #1
0
 def __get_task_ip_log(kwargs, target_ips):
     """
     根据业务实例id查询和IP信息查询对应作业执行日志结果
     """
     result_message = {}
     for ip in target_ips:
         query_kwargs = kwargs
         query_kwargs['ip'] = ip
         result = JobV3Api.get_job_instance_ip_log(query_kwargs, raw=True)
         if result["result"]:
             result_message[ip] = result["data"].get("log_content")
         else:
             logger.error('{}:{}'.format(ip, result["message"]))
     return result_message
Beispiel #2
0
    def get_task_ip_log(self, kwargs):
        """
        根据业务实例id查询和IP信息查询对应作业执行日志结果
        """
        result_message = {}

        kwargs.update({"bk_username": self.bk_username})

        for ip in self.ip_list:
            query_kwargs = kwargs
            query_kwargs['ip'] = ip
            result = JobV3Api.get_job_instance_ip_log(query_kwargs, raw=True)
            if result["result"]:
                result_message[ip] = result["data"].get("log_content")
            else:
                logger.error('{}:{}'.format(ip, result["message"]))
        return result_message