blob: f58315955c7dbccb865f2add8a0b58ea8d0077b3 [file] [log] [blame]
{
"openapi" : "3.0.1",
"info" : {
"title" : "Submarine Experiment API",
"description" : "The Submarine REST API allows you to create, list, and get experiments. The\nAPI is hosted under the /v1/experiment route on the Submarine server. For example,\nto list experiments on a server hosted at http://localhost:8080, access\nhttp://localhost:8080/api/v1/experiment/",
"termsOfService" : "http://swagger.io/terms/",
"contact" : {
"email" : "dev@submarine.apache.org"
},
"license" : {
"name" : "Apache 2.0",
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version" : "0.4.0"
},
"servers" : [ {
"url" : "/api"
} ],
"paths" : {
"/v1/experiment/{id}" : {
"get" : {
"tags" : [ "experiment" ],
"summary" : "Get the experiment's detailed info by id",
"operationId" : "getExperiment",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
},
"404" : {
"description" : "Experiment not found"
}
}
},
"delete" : {
"tags" : [ "experiment" ],
"summary" : "Delete the experiment",
"operationId" : "deleteExperiment",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
},
"404" : {
"description" : "Experiment not found"
}
}
},
"patch" : {
"tags" : [ "experiment" ],
"summary" : "Update the experiment in the submarine server with spec",
"operationId" : "patchExperiment",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"requestBody" : {
"content" : {
"application/yaml" : {
"schema" : {
"$ref" : "#/components/schemas/ExperimentSpec"
}
},
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ExperimentSpec"
}
}
}
},
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
},
"404" : {
"description" : "Experiment not found"
}
}
}
},
"/v1/experiment/logs" : {
"get" : {
"tags" : [ "experiment" ],
"summary" : "List experiment's log",
"operationId" : "listLog",
"parameters" : [ {
"name" : "status",
"in" : "query",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
}
}
}
},
"/v1/experiment" : {
"get" : {
"tags" : [ "experiment" ],
"summary" : "List experiments",
"operationId" : "listExperiments",
"parameters" : [ {
"name" : "status",
"in" : "query",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
}
}
},
"post" : {
"tags" : [ "experiment" ],
"summary" : "Create an experiment",
"operationId" : "createExperiment",
"requestBody" : {
"content" : {
"application/yaml" : {
"schema" : {
"$ref" : "#/components/schemas/ExperimentSpec"
}
},
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ExperimentSpec"
}
}
}
},
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
}
}
}
},
"/v1/experiment/logs/{id}" : {
"get" : {
"tags" : [ "experiment" ],
"summary" : "Log experiment by id",
"operationId" : "getLog",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"default" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"$ref" : "#/components/schemas/JsonResponse"
}
}
}
},
"404" : {
"description" : "Experiment not found"
}
}
}
},
"/v1/experiment/ping" : {
"get" : {
"tags" : [ "experiment" ],
"summary" : "Ping submarine server",
"description" : "Return the Pong message for test the connectivity",
"operationId" : "ping",
"responses" : {
"200" : {
"description" : "successful operation",
"content" : {
"application/json; charset=utf-8" : {
"schema" : {
"type" : "string"
}
}
}
}
}
}
}
},
"components" : {
"schemas" : {
"JsonResponse" : {
"type" : "object",
"properties" : {
"code" : {
"type" : "integer",
"format" : "int32"
},
"success" : {
"type" : "boolean"
},
"result" : {
"type" : "object"
},
"attributes" : {
"type" : "object",
"additionalProperties" : {
"type" : "object"
}
}
}
},
"Environment" : {
"type" : "object",
"properties" : {
"image" : {
"type" : "string"
}
}
},
"ExperimentMeta" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"namespace" : {
"type" : "string"
},
"framework" : {
"type" : "string"
},
"cmd" : {
"type" : "string"
},
"envVars" : {
"type" : "object",
"additionalProperties" : {
"type" : "string"
}
}
}
},
"ExperimentSpec" : {
"type" : "object",
"properties" : {
"meta" : {
"$ref" : "#/components/schemas/ExperimentMeta"
},
"environment" : {
"$ref" : "#/components/schemas/Environment"
},
"spec" : {
"type" : "object",
"additionalProperties" : {
"$ref" : "#/components/schemas/ExperimentTaskSpec"
}
}
}
},
"ExperimentTaskSpec" : {
"type" : "object",
"properties" : {
"replicas" : {
"type" : "integer",
"format" : "int32"
},
"resources" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"image" : {
"type" : "string"
},
"cmd" : {
"type" : "string"
},
"envVars" : {
"type" : "object",
"additionalProperties" : {
"type" : "string"
}
},
"cpu" : {
"type" : "string"
},
"gpu" : {
"type" : "string"
},
"memory" : {
"type" : "string"
}
}
}
}
}
}