声明:
- 上述的所有接口无自定义状态码情况, 通常返回200(成功), 401(未认证), 403(无权限), 消息类型为application/json
- 请求参数有三种类型, QueryParameter(请求参数), Path(path变量), Body(请求体)
-
/
表示同上
- 基本类型(
Integer
, Long
, Array
, String
)外的其他类型为自定义类型, 在第二节有详细的类型说明
- filters是过滤字符串, 示例:
[["id", ">", 5], ["name", "like", "a"]]
- 任务状态是一个枚举值
QUEUED
(队列中), SCHEDULED
(已调度), RUNNING
(运行中), IDLE
(闲置), OBSOLETED
(取消中), FAILED
(失败), CANCELLED
(已取消), COMPLETE
(成功), TERMINATED
(终止) 中的一种
- JobInput.type为枚举值
STRING
, STRING_ARRAY
, NUMBER
, NUMBER_ARRAY
, BOOLEAN
, BOOLEAN_ARRAY
, FILE
, FILE_ARRAY
若为array 例如STRING_ARRAY NUMBER_ARRAY...
,则input的值应该放到values中, 因为有多个值, 就否则放到value中
1.接口描述
1.1 列出系统支持的DEA APP
GET /api/v1/apps
Parameters
Type |
Name |
Description |
Schema |
Default |
QueryParamter |
filters |
过滤字符串 |
String |
"" |
/ |
size |
页大小 |
Integer |
10 |
/ |
page |
页码 |
Integer |
0 |
/ |
sort |
排序的属性 |
String |
"" |
/ |
direction |
排序的类型, ASC或者DESC |
String |
"ASC" |
Responses
Http Code |
Description |
Schema |
200 |
OK |
Page<App> |
1.2 根据用户输入提供合适的机型和报价
GET /api/v1/instanceTypes/recommendation
Parameters
Type |
Name |
Description |
Schema |
QueryParamter |
vcpu |
cpu数量 |
Integer |
/ |
memory |
内存大小, 单位GB |
Double |
/ |
storage |
存储容量, 单位GB |
Long |
/ |
time |
使用时长, 单位小时 |
Long |
Responses
Http Code |
Description |
Schema |
200 |
OK |
RecommendationInstance |
1.3 返回用户运行的EDA APP的所需要输入的参数
GET /api/v1/apps/{id}
Parameters
Type |
Name |
Description |
Schema |
Path |
id |
应用的id |
Long |
Responses
Http Code |
Description |
Schema |
200 |
OK |
App |
1.4 开启运行EDA APP所需要的集群环境(start cluster request)
POST /api/v1/jobs
Parameters
Type |
Description |
Schema |
Body |
任务 |
FastoneJob |
Responses
Http Code |
Description |
Schema |
200 |
OK |
FastoneJob |
1.5 terminate EDA app的集群环境(修改任务状态为TERMINATED)
PATCH /api/v1/jobs/{id}
Parameters
Type |
Description |
Schema |
Path |
任务id, fastone的任务id |
Long |
Responses
Http Code |
Description |
Schema |
200 |
OK |
FastoneJob |
1.6 计算本次任务和备份所需的费用
GET /api/v1/jobs/{id}/billing
Parameters
Type |
Description |
Schema |
Path |
任务id, fastone的任务id |
Long |
Responses
Http Code |
Description |
Schema |
200 |
OK |
JobBilling |
2 响应结果描述
2.1 Page<App>
Name |
Schema |
Description |
content |
Array<App> |
内容 |
empty |
Boolean |
content是否为空 |
first |
Boolean |
是否首页 |
last |
Boolean |
是否末页 |
number |
Integer |
页码 |
size |
Integer |
内容大小 |
totalElements |
Integer |
内容总大小 |
totalPages |
Integer |
总页数 |
2.2 RecommendationInstance
Name |
Schema |
Description |
Example |
number |
Integer |
实例数量 |
5 |
instanceType |
String |
实例类型 |
"c4.large" |
2.3 App
Name |
Schema |
Description |
id |
Long |
应用id |
name |
String |
应用名 |
icon |
Sring |
图标名 |
inputs |
Array<JobInput> |
应用的输入定义 |
2.4 JobInput
Name |
Schema |
Description |
inputId |
String |
输入id |
description |
String |
描述 |
type |
String |
Input类型, 详情看声明7 |
name |
String |
名称 |
required |
Boolean |
值是否是必须的 |
value |
String |
值 |
values |
Array<String> |
值 |
2.5 FastoneJob
Name |
Schema |
Description |
id |
Long |
job的id |
jobId |
Long |
smic保存的任务id |
inputs |
Array<JobInput> |
任务输入 |
createdBy |
Long |
该请求对应的user |
command |
String |
输入的命令 |
state |
String |
job的状态 |
cluster |
Cluster |
创建cluster所需要的数据 |
2.6 Cluster
Name |
Schema |
Description |
request |
ClusterRequest |
集群创建请求 |
2.7 ClusterRequest
Name |
Schema |
Description |
backup |
Boolean |
是否需要备份 |
lisence |
String |
lisence文件位置 |
cloudImage |
String |
ami镜像名 |
computeNodeSpecs |
Array<ComputeNodeSpec> |
节点信息 |
2.8 ComputeNodeSpec
Name |
Schema |
Description |
instanceType |
String |
实例类型 |
count |
Integer |
数量 |
storage |
Integer |
存储大小 |
2.9 JobBilling
Name |
Schema |
Description |
schedulingExpense |
Double |
调度费用 |
backupExpense |
Double |
备份费用 |
3. 消息队列的消息格式
3.1 fastone 通知smic任务状态改变, json格式
Name |
Schema |
Description |
jobId |
Long |
smic保存对应任务的id |
state |
String |
任务状态, 详情见声明6 |
示例:
// 例如修改id为1的任务的状态为运行中
{
"jobId": 1,
"state": "RUNNING"
}
网友评论