Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
602 lines (601 sloc) 13.7 KB
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Blox cluster-state-service",
"description": "APIs supported by the Blox cluster-state-service",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-copyright": "Copyright 2016, Amazon.com Inc. or Affiliates."
},
"host": "localhost:3000",
"basePath": "/v1",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/instances/{cluster}/{arn}": {
"get": {
"description": "Get instance using cluster name and instance ARN",
"operationId": "GetInstance",
"parameters": [
{
"name": "cluster",
"in": "path",
"description": "Cluster name of the instance to fetch",
"required": true,
"type": "string"
},
{
"name": "arn",
"in": "path",
"description": "ARN of the instance to fetch",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get instance using cluster name and instance ARN - success",
"schema": {
"$ref": "#/definitions/ContainerInstance"
}
},
"404": {
"description": "Get instance using cluster name and instance ARN - instance not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Get instance using cluster name and instance ARN - unexpected error",
"schema": {
"type": "string"
}
}
}
}
},
"/instances": {
"get": {
"description": "Lists all instances, after applying filters if any",
"operationId": "ListInstances",
"parameters": [
{
"name": "status",
"in": "query",
"description": "Status to filter instances by",
"type": "string"
},
{
"name": "cluster",
"in": "query",
"description": "Cluster name or ARN to filter instances by",
"type": "string"
}
],
"responses": {
"200": {
"description": "List instances - success",
"schema": {
"$ref": "#/definitions/ContainerInstances"
}
},
"400": {
"description": "List instances - bad input",
"schema": {
"type": "string"
}
},
"500": {
"description": "List instances - unexpected error",
"schema": {
"type": "string"
}
}
}
}
},
"/stream/instances": {
"get": {
"description": "Streams all instances",
"operationId": "StreamInstances",
"consumes": [
"application/octet-stream"
],
"produces": [
"application/octet-stream"
],
"parameters": [
{
"name": "entityVersion",
"in": "query",
"description": "Entity version to start streaming from",
"type": "string"
}
],
"responses": {
"200": {
"description": "Stream instances - success",
"schema": {
"type": "string",
"format": "binary"
}
},
"500": {
"description": "Stream instances - unexpected error",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks/{cluster}/{arn}": {
"get": {
"description": "Get task using cluster name and task ARN",
"operationId": "GetTask",
"parameters": [
{
"name": "cluster",
"in": "path",
"description": "Cluster name of the task to fetch",
"required": true,
"type": "string"
},
{
"name": "arn",
"in": "path",
"description": "ARN of the task to fetch",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get task using cluster name and task ARN - success",
"schema": {
"$ref": "#/definitions/Task"
}
},
"404": {
"description": "Get task using cluster name and task ARN - task not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Get task using cluster name and task ARN - unexpected error",
"schema": {
"type": "string"
}
}
}
}
},
"/tasks": {
"get": {
"description": "Lists all tasks, after applying filters if any",
"operationId": "ListTasks",
"parameters": [
{
"name": "status",
"in": "query",
"description": "Status to filter tasks by",
"type": "string"
},
{
"name": "cluster",
"in": "query",
"description": "Cluster name or ARN to filter tasks by",
"type": "string"
},
{
"name": "startedBy",
"in": "query",
"description": "StartedBy to filter tasks by",
"type": "string"
}
],
"responses": {
"200": {
"description": "List tasks - success",
"schema": {
"$ref": "#/definitions/Tasks"
}
},
"400": {
"description": "List tasks - bad input",
"schema": {
"type": "string"
}
},
"500": {
"description": "List tasks - unexpected error",
"schema": {
"type": "string"
}
}
}
}
},
"/stream/tasks": {
"get": {
"description": "Streams all tasks",
"operationId": "StreamTasks",
"consumes": [
"application/octet-stream"
],
"produces": [
"application/octet-stream"
],
"parameters": [
{
"name": "entityVersion",
"in": "query",
"description": "Entity version to start streaming from",
"type": "string"
}
],
"responses": {
"200": {
"description": "Stream tasks - success",
"schema": {
"type": "string",
"format": "binary"
}
},
"500": {
"description": "Stream tasks - unexpected error",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"Metadata": {
"type": "object",
"required": [
"entityVersion"
],
"properties": {
"entityVersion": {
"type": "string"
}
}
},
"ContainerInstance": {
"type": "object",
"properties": {
"metadata": {
"$ref": "#/definitions/Metadata"
},
"entity": {
"$ref": "#/definitions/ContainerInstanceDetail"
}
}
},
"ContainerInstanceDetail": {
"type": "object",
"required": [
"agentConnected",
"clusterARN",
"containerInstanceARN",
"registeredResources",
"remainingResources",
"status",
"versionInfo"
],
"properties": {
"agentConnected": {
"type": "boolean"
},
"agentUpdateStatus": {
"type": "string"
},
"attributes": {
"type": "array",
"items": {
"$ref": "#/definitions/ContainerInstanceAttribute"
}
},
"clusterARN": {
"type": "string"
},
"containerInstanceARN": {
"type": "string"
},
"EC2InstanceID": {
"type": "string"
},
"registeredResources": {
"type": "array",
"items": {
"$ref": "#/definitions/ContainerInstanceResource"
}
},
"remainingResources": {
"type": "array",
"items": {
"$ref": "#/definitions/ContainerInstanceResource"
}
},
"status": {
"type": "string"
},
"versionInfo": {
"$ref": "#/definitions/ContainerInstanceVersionInfo"
}
}
},
"ContainerInstances": {
"description": "List of container instances",
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/ContainerInstance"
}
}
}
},
"ContainerInstanceAttribute": {
"type": "object",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"ContainerInstanceResource": {
"type": "object",
"required": [
"name",
"type",
"value"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"ContainerInstanceVersionInfo": {
"type": "object",
"properties": {
"agentHash": {
"type": "string"
},
"agentVersion": {
"type": "string"
},
"dockerVersion": {
"type": "string"
}
}
},
"Task": {
"type": "object",
"properties": {
"metadata": {
"$ref": "#/definitions/Metadata"
},
"entity": {
"$ref": "#/definitions/TaskDetail"
}
}
},
"TaskDetail": {
"type": "object",
"required": [
"clusterARN",
"containerInstanceARN",
"containers",
"createdAt",
"desiredStatus",
"lastStatus",
"overrides",
"taskARN",
"taskDefinitionARN"
],
"properties": {
"clusterARN": {
"type": "string"
},
"containerInstanceARN": {
"type": "string"
},
"containers": {
"type": "array",
"items": {
"$ref": "#/definitions/TaskContainer"
}
},
"createdAt": {
"type": "string"
},
"desiredStatus": {
"type": "string"
},
"lastStatus": {
"type": "string"
},
"overrides": {
"$ref": "#/definitions/TaskOverride"
},
"startedAt": {
"type": "string"
},
"startedBy": {
"type": "string"
},
"stoppedAt": {
"type": "string"
},
"stoppedReason": {
"type": "string"
},
"taskARN": {
"type": "string"
},
"taskDefinitionARN": {
"type": "string"
}
}
},
"Tasks": {
"description": "List of tasks",
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/Task"
}
}
}
},
"TaskContainer": {
"type": "object",
"required": [
"containerARN",
"lastStatus",
"name"
],
"properties": {
"containerARN": {
"type": "string"
},
"exitCode": {
"type": "integer",
"format": "int64"
},
"lastStatus": {
"type": "string"
},
"name": {
"type": "string"
},
"networkBindings": {
"type": "array",
"items": {
"$ref": "#/definitions/TaskNetworkBinding"
}
},
"reason": {
"type": "string"
}
}
},
"TaskNetworkBinding": {
"type": "object",
"required": [
"bindIP",
"containerPort",
"hostPort"
],
"properties": {
"bindIP": {
"type": "string"
},
"containerPort": {
"type": "integer",
"format": "int64"
},
"hostPort": {
"type": "integer",
"format": "int64"
},
"protocol": {
"type": "string"
}
}
},
"TaskOverride": {
"type": "object",
"required": [
"containerOverrides"
],
"properties": {
"containerOverrides": {
"type": "array",
"items": {
"$ref": "#/definitions/TaskContainerOverride"
}
},
"taskRoleArn": {
"type": "string"
}
}
},
"TaskContainerOverride": {
"type": "object",
"required": [
"name"
],
"properties": {
"command": {
"type": "array",
"items": {
"type": "string"
}
},
"environment": {
"type": "array",
"items": {
"$ref": "#/definitions/TaskEnvironment"
}
},
"name": {
"type": "string"
}
}
},
"TaskEnvironment": {
"type": "object",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}