提供cluster service 按條件查詢cluster 信息
/api/v1/clusters GET
參數(shù) 名state 值為 QUEUED,CREATED,STARTING,RUNNING,ERROR,TERMINATED;
參數(shù)名為deployMode 值為 ON_DEMAND末捣,ON_PREMISE,HYBRID
比如/api/cluster?state=QUEUED&deployMode =ON_PREMISE
返回json
[
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"deployMode": "onPremise",
"clusterId": -1,
"state": "running",
"request": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"name": "master",
"computeNodeSpecs": [
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "compute",
"instanceType": "c4.large",
"count": 2
},
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "master",
"instanceType": "c4.large",
"count": 1
}
]
}
}
]
提供cluster service 更新cluster 信息
/api/v1/clusters/{id} PUT
{id}替換成cluster的 id
請求json
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"deployMode": "onPremise",
"masterIp": "127.0.0.1",
"masterPublicIp": "127.0.0.1",
"apiToken": "2213wqfdsgwy234234sfdsfsfsf",
"clusterId": -1,
"state": "running",
"request": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"name": "master",
"computeNodeSpecs": [
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "compute",
"instanceType": "c4.large",
"count": 2
},
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "master",
"instanceType": "c4.large",
"count": 1
}
]
}
}
提供cluster service 或者 scheduler 創(chuàng)建cluster,scheduler用戶信息
//目前先通過客戶端自行創(chuàng)建用戶。
/api/v1/users post
請求json
{
"name": "cluster",
"username": "這里最好拼接一個全局唯一的字符串污它,比如UUID",
"email": "請用全局唯一的字符串拼接上@等等",
"password": "大于6位"
}
返回json
{
"id": 1,
"name": "cluster",
"username": "這里最好拼接一個全局唯一的字符串师崎,比如UUID",
"email": "請用全局唯一的字符串拼接上@等等",
}
提供cluster service 或者 scheduler 刪除cluster,scheduler用戶信息
//目前先通過客戶端自行創(chuàng)建用戶脑沿。
/api/v1/users/{id} delete
此處 {id}替換成 上面創(chuàng)建的用戶id
提供scheduler 按條件 查詢job信息
/api/v1/jobs get
參數(shù)
state徘钥, 值為 job
UN_COMMITTED,
COMMITTED,
QUEUED,
RUNNING,
CANCELLED,
COMPLETE,
FAILED;
返回 json
[ {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"appId": 609,
"type":"RAW",
"name": "fastone",
"description": "desc",
"priority": 1,
"parentId": 2,
"inputs": [
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"type": "File",
"description": "receptors file",
"name": "receptors",
"required": true,
"value": "/fastone/vina-input/pro.pdb",
"displayValue": "vina data set/pro.pdb"
}
],
"options":[
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"vcpu": "1",
"memory":"13232323232",
"priority": 1,
"logLevel": "debug",
"subTaskErrorStop": true
}
],
"command": ["cwl-runner", "--local", "--api=containers", "--disable-reuse", "--verbose", "--priority", "1", "--on-error", "continue", "--trash-intermediate", "/var/lib/cwl/workflow.json#main", "/var/lib/cwl/cwl.input.json"],
"containerImage": "fastone/jobs",
"state": "COMPLETE",
"lockedBy": null,
"output": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"output": "/test/output",
"log": "/test/log",
"exitCode": 0
},
"finishedAt": "2018-12-21T13:53:53.0594292+08:00",
"startedAt": "2018-12-21T13:53:53.0594292+08:00",
"cluster": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"deployMode": "ON_PREMISE",
"clusterId": -1,
"state": "RUNNING",
"request": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"name": "master",
"computeNodeSpecs": [
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "COMPUTE",
"instanceType": "c4.large",
"count": 2
},
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "MASTER",
"instanceType": "c4.large",
"count": 1
}
]
}
}
}
提供 job id查詢job信息
/api/v1/job/{id} get
返回 json
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"appId": 609,
"type":"RAW",
"name": "fastone",
"description": "desc",
"priority": 1,
"parentId": 2,
"inputs": [
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"type": "File",
"description": "receptors file",
"name": "receptors",
"required": true,
"value": "/fastone/vina-input/pro.pdb",
"displayValue": "vina data set/pro.pdb"
}
],
"options":[
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"vcpu": "1",
"memory":"13232323232",
"priority": 1,
"logLevel": "debug",
"subTaskErrorStop": true
}
],
"command": ["cwl-runner", "--local", "--api=containers", "--disable-reuse", "--verbose", "--priority", "1", "--on-error", "continue", "--trash-intermediate", "/var/lib/cwl/workflow.json#main", "/var/lib/cwl/cwl.input.json"],
"containerImage": "fastone/jobs",
"state": "COMPLETE",
"lockedBy": null,
"output": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"output": "/test/output",
"log": "/test/log",
"exitCode": 0
},
"finishedAt": "2018-12-21T13:53:53.0594292+08:00",
"startedAt": "2018-12-21T13:53:53.0594292+08:00",
"cluster": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"deployMode": "ON_PREMISE",
"clusterId": -1,
"state": "RUNNING",
"request": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"name": "master",
"computeNodeSpecs": [
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "COMPUTE",
"instanceType": "c4.large",
"count": 2
},
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"role": "MASTER",
"instanceType": "c4.large",
"count": 1
}
]
}
}
}
提供scheduler 按條件 更新job信息
/api/v1/jobs PUT
請求 json
{
"id": 737,
"parentId": 2,
"containerImage": "fastone/jobs",
"state": "COMPLETE",
"lockedBy": null,
"output": {
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"output": "/test/output",
"log": "/test/log",
"exitCode": 0
},
"finishedAt": "2018-12-21T13:53:53.0594292+08:00",
"startedAt": "2018-12-21T13:53:53.0594292+08:00",
}
提供scheduler 鎖 job
/api/v1/job/lock/{id} PUT
{id} 替換成 job(父親)的id
提供scheduler 解放鎖 job
/api/v1/job/unlock/{id} PUT
{id} 替換成 job(父親)的id
創(chuàng)建
app json
{
"id": 609,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T10:55:28.651035+08:00",
"updatedAt": "2018-12-21T10:55:28.651035+08:00",
"name": "vina",
"description": "desc",
"definition": "創(chuàng)建app 時 定義文件的json格式",
"inputs": [
{
"id": 705,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:39:23.010261+08:00",
"updatedAt": "2018-12-21T13:39:23.010261+08:00",
"type": "File",
"description": "receptors file",
"name": "receptors",
"required": true
}
]
}
folder json
{
"id": 737,
"createdBy": 3,
"updatedBy": 3,
"createdAt": "2018-12-21T13:53:53.0594292+08:00",
"updatedAt": "2018-12-21T13:53:53.0594292+08:00",
"name": "文件夾名稱",
"description": "desc",
"fileNumber": 10,
"path": "/test"
}