Coder Social home page Coder Social logo

Comments (3)

george518 avatar george518 commented on August 28, 2024

增加接口的方式应该可以满足这个要求。
先增加三个基本接口简单实现:
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.

nicolaslh avatar nicolaslh commented on August 28, 2024

使用/task/apitask创建任务后, 调用/task/apistart开始任务,返回{ "message": "创建任务失败", "status": -1 }

from ppgo_job.

nicolaslh avatar nicolaslh commented on August 28, 2024

使用/task/apitask创建任务后, 调用/task/apistart开始任务,返回{ "message": "创建任务失败", "status": -1 }

查看发现文档创建的参数为server_id, 代码接收的参数为server_ids, server_ids获取不到值, 导致开始的时候找不到启动的服务器

from ppgo_job.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.