2018-12-20

提供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"
}
最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末派殷,一起剝皮案震驚了整個濱河市茴肥,隨后出現(xiàn)的幾起案子坚踩,更是在濱河造成了極大的恐慌,老刑警劉巖瓤狐,帶你破解...
    沈念sama閱讀 206,311評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件瞬铸,死亡現(xiàn)場離奇詭異批幌,居然都是意外死亡,警方通過查閱死者的電腦和手機赴捞,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,339評論 2 382
  • 文/潘曉璐 我一進店門逼裆,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人赦政,你說我怎么就攤上這事胜宇。” “怎么了恢着?”我有些...
    開封第一講書人閱讀 152,671評論 0 342
  • 文/不壞的土叔 我叫張陵桐愉,是天一觀的道長。 經(jīng)常有香客問我掰派,道長从诲,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,252評論 1 279
  • 正文 為了忘掉前任靡羡,我火速辦了婚禮系洛,結果婚禮上,老公的妹妹穿的比我還像新娘略步。我一直安慰自己描扯,他們只是感情好,可當我...
    茶點故事閱讀 64,253評論 5 371
  • 文/花漫 我一把揭開白布趟薄。 她就那樣靜靜地躺著绽诚,像睡著了一般。 火紅的嫁衣襯著肌膚如雪杭煎。 梳的紋絲不亂的頭發(fā)上恩够,一...
    開封第一講書人閱讀 49,031評論 1 285
  • 那天,我揣著相機與錄音羡铲,去河邊找鬼蜂桶。 笑死,一個胖子當著我的面吹牛犀勒,可吹牛的內(nèi)容都是我干的屎飘。 我是一名探鬼主播,決...
    沈念sama閱讀 38,340評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼贾费,長吁一口氣:“原來是場噩夢啊……” “哼钦购!你這毒婦竟也來了?” 一聲冷哼從身側響起褂萧,我...
    開封第一講書人閱讀 36,973評論 0 259
  • 序言:老撾萬榮一對情侶失蹤押桃,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后导犹,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體唱凯,經(jīng)...
    沈念sama閱讀 43,466評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡羡忘,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,937評論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了磕昼。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片卷雕。...
    茶點故事閱讀 38,039評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖票从,靈堂內(nèi)的尸體忽然破棺而出漫雕,到底是詐尸還是另有隱情,我是刑警寧澤峰鄙,帶...
    沈念sama閱讀 33,701評論 4 323
  • 正文 年R本政府宣布浸间,位于F島的核電站,受9級特大地震影響吟榴,放射性物質發(fā)生泄漏魁蒜。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,254評論 3 307
  • 文/蒙蒙 一吩翻、第九天 我趴在偏房一處隱蔽的房頂上張望兜看。 院中可真熱鬧,春花似錦狭瞎、人聲如沸铣减。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,259評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至缔刹,卻和暖如春球涛,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背校镐。 一陣腳步聲響...
    開封第一講書人閱讀 31,485評論 1 262
  • 我被黑心中介騙來泰國打工亿扁, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人鸟廓。 一個月前我還...
    沈念sama閱讀 45,497評論 2 354
  • 正文 我出身青樓从祝,卻偏偏與公主長得像,于是被迫代替她去往敵國和親引谜。 傳聞我的和親對象是個殘疾皇子牍陌,可洞房花燭夜當晚...
    茶點故事閱讀 42,786評論 2 345

推薦閱讀更多精彩內(nèi)容