convox/pkg/api/manifest.yml
2019-08-20 16:05:16 -04:00

1332 lines
30 KiB
YAML

swagger: "2.0"
info:
version: 1.0.0
title: Convox Rack API
description: Enter your Convox API key from your <a href="https://console.convox.com/grid/user/profile">account settings</a> in the field above and click Authorize. <br><b>Caution:</b> Commands on this page will really be applied to your resources. <br>For help, see the <a href="https://convox.com/docs/api-keys/">documentation</a>.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
host: console.convox.com
schemes:
- https
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
paths:
############
### apps ###
############
/apps:
get:
description: List apps
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
responses:
200:
description: List the apps created with `convox apps create`.
schema:
type: array
items:
$ref: '#/definitions/app'
400:
description: Rack not found
schema:
$ref: '#/definitions/error'
500:
description: Error locating rack
schema:
$ref: '#/definitions/error'
post:
description: Create an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: name
description: app name
type: string
in: formData
required: true
responses:
200:
description: app
schema:
$ref: '#/definitions/app'
400:
description: Rack not found
schema:
$ref: '#/definitions/error'
403:
description: invalid name, or app already exists
schema:
$ref: '#/definitions/error'
502:
description: rack not running
schema:
$ref: '#/definitions/error'
/apps/{app}:
get:
description: Get an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: app
schema:
$ref: '#/definitions/app'
400:
description: rack not found
schema:
$ref: '#/definitions/error'
404:
description: app not found
schema:
$ref: '#/definitions/error'
500:
description: no rack specified
schema:
$ref: '#/definitions/error'
delete:
description: Delete an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
400:
description: rack not found
schema:
$ref: '#/definitions/error'
404:
description: app not found
schema:
$ref: '#/definitions/error'
/apps/{app}/builds:
get:
description: Builds for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: builds
schema:
type: array
items:
$ref: '#/definitions/build'
400:
description: rack not found
schema:
$ref: '#/definitions/error'
# FIXME: this should be a 404
500:
description: app not found
schema:
$ref: '#/definitions/error'
post:
description: Start a build for an app
consumes:
- multipart/form-data
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: cache
description: set to false to avoid cache
type: boolean
in: formData
required: false
- name: config
description: docker compose yaml file. DEPRECATED in favor of manifest parameter.
type: string
in: formData
required: false
- name: description
description: build description
type: string
in: formData
required: false
- name: manifest
default: "docker-compose.yml"
description: path to a docker compose yaml file that declares what images to build and processes to run
type: string
in: formData
required: false
- name: repo
description: repository URL with an optional \#commit-ish fragment
type: string
in: formData
required: false
- name: source
description: source tarball
type: file
in: formData
required: false
responses:
200:
description: build
schema:
$ref: '#/definitions/build'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/builds/{build}:
get:
description: List builds for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: build
description: build id
type: string
in: path
required: true
responses:
200:
description: build
schema:
$ref: '#/definitions/build'
404:
description: not found
schema:
$ref: '#/definitions/error'
delete:
description: Delete a build and its artifacts
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: build
description: build id
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
put:
description: Update build status
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: build
description: build id
type: string
in: path
required: true
- name: description
description: build description
type: string
in: formData
required: false
- name: manifest
description: release manifest extracted during build
type: string
in: formData
required: false
- name: reason
description: reason with status "failed"
type: string
in: formData
required: false
- name: status
description: final build status "complete" or "failed"
type: string
in: formData
required: false
responses:
200:
description: build
schema:
$ref: '#/definitions/build'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/environment:
get:
description: List environment for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: environment
schema:
$ref: '#/definitions/environment'
404:
description: not found
schema:
$ref: '#/definitions/error'
post:
description: Set environment for an app
consumes:
- text/plain
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: body
description: environment
in: body
schema:
type: string
required: true
responses:
200:
description: environment
schema:
$ref: '#/definitions/environment'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/environment/{key}:
delete:
description: Delete an environment variable for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: key
description: environment key
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/formation:
get:
description: List formation for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: formation
schema:
type: array
items:
$ref: '#/definitions/formation'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/formation/{process}:
post:
description: Set formation for a process
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: process
description: process name
type: string
in: path
required: true
- name: count
description: process count
type: integer
in: formData
required: false
- name: memory
description: process memory
type: integer
in: formData
required: false
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/parameters:
get:
description: List advanced parameters for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: parameters
schema:
$ref: '#/definitions/parameters'
404:
description: not found
schema:
$ref: '#/definitions/error'
post:
description: Set advanced parameters for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: body
description: parameters (as formdata)
in: body
schema:
type: string
required: true
responses:
200:
description: environment
schema:
$ref: '#/definitions/environment'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/processes:
get:
description: List processes for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: stats
description: return cpu/memory stats
type: boolean
in: query
required: false
responses:
200:
description: processes
schema:
type: array
items:
$ref: '#/definitions/process'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/processes/{process}:
get:
description: Get a process for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: process
description: process id
type: string
in: path
required: true
responses:
200:
description: process
schema:
$ref: '#/definitions/process'
404:
description: not found
schema:
$ref: '#/definitions/error'
delete:
description: Stop a process
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: process
description: process id
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/processes/{process}/run:
post:
description: Run a detached process
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: process
description: process name
type: string
in: path
required: true
- name: command
description: command
type: string
in: formData
required: false
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/releases:
get:
description: List releases for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: releases
schema:
type: array
items:
$ref: '#/definitions/release'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/releases/{release}:
get:
description: Get a release for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: release
description: release id
type: string
in: path
required: true
responses:
200:
description: release
schema:
$ref: '#/definitions/release'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/releases/{release}/promote:
post:
description: Promote a release for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: release
description: release id
type: string
in: path
required: true
responses:
200:
description: release
schema:
$ref: '#/definitions/release'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/ssl:
get:
description: List SSL listeners for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: ssls
schema:
type: array
items:
$ref: '#/definitions/ssl'
404:
description: not found
schema:
$ref: '#/definitions/error'
/apps/{app}/ssl/{process}/{port}:
put:
description: List SSL listeners for an app
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
- name: app
description: app name
type: string
in: path
required: true
- name: process
description: process name
type: string
in: path
required: true
- name: port
description: port number
type: integer
in: path
required: true
responses:
200:
description: ssl
schema:
$ref: '#/definitions/ssl'
404:
description: not found
schema:
$ref: '#/definitions/error'
####################
### certificates ###
####################
/certificates:
get:
description: List certificates
responses:
200:
description: certificate list
schema:
type: array
items:
$ref: '#/definitions/certificate'
post:
description: Upload a certificate
parameters:
- name: public
description: public key
type: string
in: formData
required: true
- name: private
description: private key
type: string
in: formData
required: true
- name: chain
description: intermediate chain
type: string
in: formData
required: false
responses:
200:
description: certificate
schema:
$ref: '#/definitions/certificate'
403:
description: invalid certificate
schema:
$ref: '#/definitions/error'
/certificates/generate:
post:
description: Request a certificate
parameters:
- name: domains
description: public key
type: array
items:
type: string
responses:
200:
description: certificate
schema:
$ref: '#/definitions/certificate'
403:
description: invalid domains
schema:
$ref: '#/definitions/error'
/certificates/{id}:
delete:
description: Remove a certificate
parameters:
- name: id
description: certificate id
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
#################
### instances ###
#################
/instances:
get:
description: List instances.
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
responses:
200:
description: instance list
schema:
type: array
items:
$ref: '#/definitions/instance'
/instances/keyroll:
post:
description: Regenerate and store EC2 KeyPair.
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
/instances/{id}:
delete:
description: Terminate an instance.
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
##################
### registries ###
##################
/registries:
get:
description: List registries
responses:
200:
description: List the registries added with `convox registry add`.
schema:
type: array
items:
$ref: '#/definitions/registry'
post:
description: Add a registry (`convox registry add`)
parameters:
- name: server
description: registry server
type: string
in: formData
required: false
- name: username
description: registry username
type: string
in: formData
required: false
- name: password
description: registry password
type: string
in: formData
require: false
responses:
200:
description: success
schema:
type: array
items:
$ref: '#/definitions/registry'
403:
description: Error
schema:
$ref: '#/definitions/error'
delete:
description: Remove a registry (`convox registry remove`)
parameters:
- name: server
description: registry server
type: string
in: path
required: false
- name: rack
description: Rack name
type: string
in: header
required: false
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
################################################
### services ###
### (will be renamed to 'resources' shortly) ###
################################################
/services:
get:
description: List services
responses:
200:
description: service list
schema:
type: array
items:
$ref: '#/definitions/service'
post:
description: Create a service
parameters:
- name: name
description: service name
type: string
in: formData
required: true
- name: type
description: service type
type: string
in: formData
required: true
responses:
200:
description: service
schema:
$ref: '#/definitions/service'
403:
description: invalid name
schema:
$ref: '#/definitions/error'
/services/{service}:
get:
description: Get a service
parameters:
- name: service
description: service name
type: string
in: path
required: true
responses:
200:
description: app
schema:
$ref: '#/definitions/service'
404:
description: not found
schema:
$ref: '#/definitions/error'
delete:
description: Delete a service (AKA resource)
parameters:
- name: service
description: service name
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
/services/{service}/links:
post:
description: Create a link between a service and an app
parameters:
- name: service
description: service name
type: string
in: path
required: true
- name: app
description: app name
type: string
in: formData
required: true
responses:
200:
description: service
schema:
$ref: '#/definitions/service'
403:
description: invalid name
schema:
$ref: '#/definitions/error'
/services/{service}/links/{app}:
delete:
description: Delete a link between a service and an app
parameters:
- name: service
description: service name
type: string
in: path
required: true
- name: app
description: app name
type: string
in: path
required: true
responses:
200:
description: success
schema:
$ref: '#/definitions/success'
404:
description: not found
schema:
$ref: '#/definitions/error'
##############
### system ###
##############
/system:
get:
description: Get system information
parameters:
- name: rack
description: rack name
type: string
in: header
required: false
responses:
200:
description: system
schema:
$ref: '#/definitions/system'
put:
description: Update system information
parameters:
- name: count
description: instance count
type: integer
in: formData
required: false
- name: type
description: instance type
type: string
in: formData
required: false
- name: version
description: system version
type: string
in: formData
required: false
responses:
200:
description: system
schema:
$ref: '#/definitions/system'
/system/capacity:
get:
description: Get system information
responses:
200:
description: system
schema:
$ref: '#/definitions/capacity'
###################
### definitions ###
###################
definitions:
rack:
properties:
id:
type: string
name:
type: string
host:
type: string
organization-id:
type: string
status:
type: string
version:
type: string
organization:
$ref: '#/definitions/organization'
organization:
properties:
id:
type: string
name:
type: string
DeveloperIds:
type: array
items:
type: string
app:
properties:
name:
type: string
status:
type: string
release:
type: string
build:
properties:
app:
type: string
id:
type: string
logs:
type: string
manifest:
type: string
release:
type: string
status:
type: string
started:
type: string
ended:
type: string
capacity:
properties:
cluster-memory:
type: integer
instance-memory:
type: integer
process-count:
type: integer
process-memory:
type: integer
process-width:
type: integer
certificate:
properties:
domain:
type: string
expiration:
type: string
id:
type: string
error:
properties:
error:
type: string
environment:
additionalProperties:
type: string
example:
foo: bar
hello: world
formation:
properties:
balancer:
type: string
name:
type: string
count:
type: integer
ports:
type: array
items:
type: integer
instance:
properties:
agent:
type: boolean
cpu:
type: number
id:
type: string
memory:
type: number
private-ip:
type: string
processes:
type: number
public-ip:
type: string
status:
type: string
parameters:
additionalProperties:
type: string
process:
properties:
id:
type: string
app:
type: string
command:
type: string
cpu:
type: number
host:
type: string
image:
type: string
memory:
type: number
name:
type: string
ports:
type: array
items:
type: string
release:
type: string
registry:
properties:
password:
type: string
server:
type: string
username:
type: string
release:
properties:
app:
type: string
build:
type: string
env:
type: string
id:
type: string
manifest:
type: string
created:
type: string
service:
properties:
name:
type: string
status:
type: string
type:
type: string
url:
type: string
ssl:
properties:
certificate:
type: string
domain:
type: string
expiration:
type: string
port:
type: integer
process:
type: string
secure:
type: boolean
success:
properties:
success:
type: boolean
system:
properties:
count:
type: integer
name:
type: string
region:
type: string
status:
type: string
type:
type: string
version:
type: string