矩池云开放API
  1. PaaS API
矩池云开放API
  • PaaS API
    • 新增任务
      POST
    • 查询单个任务详情
      GET
    • 查询所有任务状态
      GET
    • 查询所有任务详情
      GET
    • 取消任务
      DELETE
  1. PaaS API

查询所有任务详情

GET
/v1/job/jobs
该接口用于获取所有任务的具体信息,支持分页和排序,返回的数据 schema 和创建任务接口的返回是一致的,但是不管是创建任务接口还是获取任务信息,返回的都是响应的时候任务的当前信息。

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Query 参数
page
string 
分页数量
可选
示例值:
2
per_page
string 
每页任务数量
可选
示例值:
10
order
boolean 
可选
是否排序,fasle为创建时间倒序,true为创建时间正序
示例值:
true

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://paas.matpool.com/v1/job/jobs?page=2&per_page=10&order=true'

返回响应

🟢200成功
application/json
Body
code
integer 
错误码
必需
msg
string 
错误消息
必需
pagination
object 
分页信息
必需
total
integer 
总任务数
必需
numPages
integer 
总页数
必需
page
integer 
当前页
必需
perPage
integer 
每页的任务数量
必需
job
array [object {15}] 
任务信息
必需
id
integer 
任务ID
必需
PaaS API内部的任务ID
ctx
object 
必需
state
object 
必需
status
integer 
任务状态
必需
app
object 
必需
res
object 
必需
createTime
object 
必需
vols
null 
必需
queueLen
integer 
必需
nets
array[string]
必需
displayID
string 
任务ID
必需
在我的任务界面展示的I D,在界面可通过此ID搜索任务
autoRelease
boolean 
必需
releaseTime
null 
必需
updateTime
null 
必需
desc
string 
必需
示例
{
  "code": 0,
  "msg": "",
  "pagination": {
    "total": 2,
    "numPages": 2,
    "page": 1,
    "perPage": 2
  },
  "job": [
    {
      "id": 421236,
      "ctx": {
        "ownerId": 724,
        "nodeId": 1699158,
        "clientID": 10001,
        "nodeDisplayID": "q5zRJv",
        "class": "",
        "aotuRelease": false,
        "releaseTime": null,
        "nodeDomain": 0
      },
      "state": {
        "status": 3,
        "log": [
          {
            "id": 2499018,
            "status": 6,
            "ts": {
              "seconds": 1744082021
            },
            "sourceId": 421236
          },
          {
            "id": 2499019,
            "status": 1,
            "ts": {
              "seconds": 1744082021
            },
            "sourceId": 421236
          },
          {
            "id": 2499024,
            "status": 2,
            "ts": {
              "seconds": 1744082049
            },
            "sourceId": 421236
          },
          {
            "id": 2499028,
            "status": 3,
            "ts": {
              "seconds": 1744082070
            },
            "sourceId": 421236
          }
        ]
      },
      "status": 3,
      "app": {
        "name": "",
        "ver": "",
        "envs": "model_code=3;env=hello",
        "format": 2,
        "files": null,
        "cmd": "tail -f /dev/null",
        "hostname": "",
        "creds": "",
        "ports": [
          {
            "port": 8989,
            "protocol": 1,
            "extraData": null
          },
          {
            "port": 8895,
            "protocol": 2,
            "extraData": null
          },
          {
            "port": 22,
            "protocol": 1,
            "extraData": null
          },
          {
            "port": 8888,
            "protocol": 2,
            "extraData": null
          }
        ],
        "urls": {
          "port_22": {
            "urls": [
              "ssh://hz-4.matpool.com:26749"
            ]
          },
          "port_8888": {
            "urls": [
              "https://hz-4.matpool.com:26133?token=J90T8W3lU8"
            ]
          },
          "port_8895": {
            "urls": [
              "https://hz-4.matpool.com:26441?token=J90T8W3lU8"
            ]
          },
          "port_8989": {
            "urls": [
              "ssh://hz-t3.matpool.com:27770"
            ]
          }
        },
        "fromSnapshotId": 0,
        "SSHAuths": [
          {
            "BaseOn": {
              "Cred": {
                "id": 1887310,
                "user": "root",
                "password": "D]3F[wZ%pWS%oM0g"
              }
            }
          }
        ],
        "netConfig": null,
        "remark": "job & instance's name",
        "fromImageId": 633839
      },
      "res": {
        "cpus": 0,
        "gpus": 0,
        "diskGB": 0,
        "gpuName": "NVIDIA A16",
        "domain": "all",
        "agentDomain": 0
      },
      "createTime": {
        "seconds": 1744082021
      },
      "vols": null,
      "queueLen": 0,
      "nets": [],
      "displayID": "PVpNKd",
      "autoRelease": false,
      "releaseTime": null,
      "updateTime": null,
      "desc": ""
    },
    {
      "id": 421235,
      "ctx": {
        "ownerId": 724,
        "nodeId": 1699157,
        "clientID": 10001,
        "nodeDisplayID": "Pxorx2",
        "class": "",
        "aotuRelease": false,
        "releaseTime": null,
        "nodeDomain": 0
      },
      "state": {
        "status": 3,
        "log": [
          {
            "id": 2499016,
            "status": 6,
            "ts": {
              "seconds": 1744082018
            },
            "sourceId": 421235
          },
          {
            "id": 2499017,
            "status": 1,
            "ts": {
              "seconds": 1744082018
            },
            "sourceId": 421235
          },
          {
            "id": 2499023,
            "status": 2,
            "ts": {
              "seconds": 1744082046
            },
            "sourceId": 421235
          },
          {
            "id": 2499027,
            "status": 3,
            "ts": {
              "seconds": 1744082064
            },
            "sourceId": 421235
          }
        ]
      },
      "status": 3,
      "app": {
        "name": "",
        "ver": "",
        "envs": "model_code=3;env=hello",
        "format": 2,
        "files": null,
        "cmd": "tail -f /dev/null",
        "hostname": "",
        "creds": "",
        "ports": [
          {
            "port": 22,
            "protocol": 1,
            "extraData": null
          },
          {
            "port": 8888,
            "protocol": 2,
            "extraData": null
          },
          {
            "port": 8989,
            "protocol": 1,
            "extraData": null
          },
          {
            "port": 8895,
            "protocol": 2,
            "extraData": null
          }
        ],
        "urls": {
          "port_22": {
            "urls": [
              "ssh://hz-t3.matpool.com:27438"
            ]
          },
          "port_8888": {
            "urls": [
              "https://hz-t3.matpool.com:27106?token=9ucJ9ZY3a8"
            ]
          },
          "port_8895": {
            "urls": [
              "https://hz-4.matpool.com:26123?token=9ucJ9ZY3a8"
            ]
          },
          "port_8989": {
            "urls": [
              "ssh://hz-4.matpool.com:29815"
            ]
          }
        },
        "fromSnapshotId": 0,
        "SSHAuths": [
          {
            "BaseOn": {
              "Cred": {
                "id": 1887309,
                "user": "root",
                "password": "Eddlx9t#C7ICJ@@9"
              }
            }
          }
        ],
        "netConfig": null,
        "remark": "job & instance's name",
        "fromImageId": 633839
      },
      "res": {
        "cpus": 0,
        "gpus": 0,
        "diskGB": 0,
        "gpuName": "NVIDIA A16",
        "domain": "all",
        "agentDomain": 0
      },
      "createTime": {
        "seconds": 1744082018
      },
      "vols": null,
      "queueLen": 0,
      "nets": [],
      "displayID": "lJv2bq",
      "autoRelease": false,
      "releaseTime": null,
      "updateTime": null,
      "desc": ""
    }
  ]
}
上一页
查询所有任务状态
下一页
取消任务
Built with