Comments (3)
增加接口的方式应该可以满足这个要求。
先增加三个基本接口简单实现:
1、新增和修改任务接口 /task/apitask
方式post 参数如下:
id:0
create_id:4
group_id:3
task_name:测试API创建任务
description:测试
concurrent:0
server_id:2
cron_spec:*/2 * * * *
command:free -G
timeout:0
is_notify:0
notify_type:0
notify_tpl_id:0
notify_user_ids:0
参数含义详见数据库字段。
需要注意的是id为0为新增,大于0为修改。
2、任务启动接口 /task/apistart
post 参数为
id:11
3、任务暂停接口 /task/apipause
post 参数为
id:11
参数使用form-data的方式
返回json,status=0表示成功,其他为失败,msg是错误理由或id
{
"message": 11,
"status": 0
}
具体可以使用postman测试
from ppgo_job.
使用/task/apitask创建任务后, 调用/task/apistart开始任务,返回{ "message": "创建任务失败", "status": -1 }
from ppgo_job.
使用/task/apitask创建任务后, 调用/task/apistart开始任务,返回
{ "message": "创建任务失败", "status": -1 }
查看发现文档创建的参数为server_id, 代码接收的参数为server_ids, server_ids获取不到值, 导致开始的时候找不到启动的服务器
from ppgo_job.
Related Issues (20)
- 点测试,没有执行任务 HOT 1
- 登陆验证不适合k8s
- must have one register DataBase alias named `default` HOT 1
- 问题和建议
- 问题反馈和建议 HOT 1
- 求助:使用微信通知方式 HOT 3
- 你好作者,请问支持LDAP认证吗? HOT 1
- There is a RCE vulnerability when run agent HOT 1
- 可否增加一个功能,清理pp_task_log表的数据 HOT 1
- agent 跑在k8s pod 怎么与job通信
- info.log 日志 文件运行时间太长之后会很大,请问如何修改日志级别 HOT 1
- 模板内容格式错误,json: cannot unmarshal object into Go value of type string" status: -1 HOT 1
- 你好作者,中文乱码怎么解决 HOT 2
- 执行资源异常 HOT 1
- 支持分布式多机部署吗?
- agent注册上来后必须配置有公网ip才能分发任务
- 任务接口能不能增加运行 HOT 1
- windows版本启动失败 HOT 1
- 运行后报错
- 可否支持下 sqlite 数据库
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ppgo_job.