python 停止 EasyScheduler 调度 工作流任务 脚本分享

Posted 闭关苦炼内功

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 停止 EasyScheduler 调度 工作流任务 脚本分享相关的知识,希望对你有一定的参考价值。

python 停止 EasyScheduler 调度 工作流任务 脚本分享

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import requests

pageUrl = "http://192.168.1.6:12345/escheduler/projects/dw/instance/list-paging?searchVal=&pageSize=1000&pageNo=1" \\
          "&host=&stateType=RUNNING_EXEUTION&startDate=&endDate= "

resp = requests.post(url='http://192.168.1.6:12345/escheduler/login',
                     headers='Content-Type': 'application/x-www-form-urlencoded',
                     data='userName': 'zhangsan', 'userPassword': '123456')

sessionId = resp.headers.get('Set-Cookie').split("=")[1]

resp2 = requests.get(url=pageUrl, headers='Cookie': 'sessionId=' + sessionId + ';language=zh_CN')

data = resp2.json()['data']['totalList']

for e in data:
    resp2 = requests.post(url='http://192.168.1.6:12345/escheduler/projects/dw/executors/execute',
                         headers='Content-Type': 'application/x-www-form-urlencoded',
                                  'Cookie': 'sessionId=' + sessionId + ';language=zh_CN',
                         data = 'processInstanceId': e['id'], 'executeType': 'STOP')

以上是关于python 停止 EasyScheduler 调度 工作流任务 脚本分享的主要内容,如果未能解决你的问题,请参考以下文章