Docks
API Endpoint
http://127.0.0.1:8080Docks API
Authentication ¶
Headers
Content-Type: application/json
Body
{
"username": "admin",
"password": "admin"
}
Valid credentials
Headers
Content-Type: application/json
Body
{
"jwt": "8HhsbJ86AFjjhzj.ASKI9ghA7778ah.blahlbalhlb"
}
Invalid credentials
Headers
Content-Type: application/json
Body
{
"message": "Invalid username or password"
}
Request new JWTPOST/api/auth/token
Request a new JWT for use in Authenticated requests
User Management ¶
User Collection ¶
Headers
Content-Type: application/json
Body
{
"data": [
{
"username": "bob"
},
{
"username": "john"
}
]
}
Get All UsersGET/users
Returns all users in the database.
Headers
Content-Type: application/json
Body
{
"username": "fred",
"password": "pass",
}
Username already exists
Create UserPOST/users
Create a new user
User ¶
Headers
Content-Type: application/json
Body
{
"password": "BetterPass333"
}
User does not exist
User does not exist
Delete UserDELETE/users/{username}
Delete a user from the system
- username
string
(required)The username used to login
Docker Stacks ¶
Stack Collection ¶
Headers
Content-Type: application/json
Body
{
"data": [
{
"stackName": "docks-api",
"servicesCount": 3
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
}
List StacksGET/stacks
Get all stacks running in the Swarm
Headers
Content-Type: application/json
Body
{
"stackName": "docks-api",
"stackFile": "IyBEZXBsb3kgdG...V09SRD1leGFtcGxl"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"stackName": {
"type": "string",
"description": "Unique stack name"
},
"stackFile": {
"type": "string",
"description": "Base64 encoded docker-compose file"
}
},
"required": [
"stackName",
"stackFile"
]
}
Stack created successfully
Stack name already exists
Deploy New StackPOST/stacks
Deploy a new stack to the Swarm. The stack name should not exist
Stack ¶
Headers
Content-Type: application/json
Body
{
"stackFile": "IyBEZXBsb3kgdG...V09SRD1leGFtcGxl"
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"stackFile": {
"type": "string",
"description": "Base64 encoded docker-compose file"
}
},
"required": [
"stackFile"
]
}
Stack updated successfully
Stack name does not exist
Update Existing StackPUT/stacks/{stackName}
- stackName
string
(required)The unique stack name
Stack does not exist
Headers
Content-Type: application/json
Body
{
"data": [
{
"ID": "",
"Version": {},
"CreatedAt": "",
"UpdatedAt": "",
"Spec": {},
"Endpoint": {}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array"
}
}
}
Get Services in StackGET/stacks/{stackName}/services
Returns an array of Services associated with the given stack from Docker API.
The Schema for the service is defined in the Docker API, the Schema displayed here is only for demonstration purposes.
- stackName
string
(required)The unique stack name
Headers
Content-Type: application/json
Body
{
"data": [
{
"ID": "",
"Version": {},
"CreatedAt": "",
"UpdatedAt": "",
"Name": "",
"Labels": {},
"Spec": {}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ID": {
"type": "string",
"enum": [
""
]
},
"Version": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"CreatedAt": {
"type": "string",
"enum": [
""
]
},
"UpdatedAt": {
"type": "string",
"enum": [
""
]
},
"Name": {
"type": "string",
"enum": [
""
],
"description": "Name of the task."
},
"Labels": {
"type": "object",
"properties": {},
"additionalProperties": false,
"description": "User defined key/value metadata."
},
"Spec": {
"type": "object",
"properties": {},
"additionalProperties": false,
"description": "User modifiable task configuration."
}
},
"required": [
"ID",
"Version",
"CreatedAt",
"UpdatedAt",
"Name",
"Labels",
"Spec"
],
"additionalProperties": false
}
}
},
"required": [
"data"
]
}
Stack does not exist
Get Tasks in StackGET/stacks/{stackName}/tasks
Returns an array of Tasks associated with the given stack.
The Schema for the tasks is defined in the Docker API, the Schema displayed here is only for demonstration purposes.
- stackName
string
(required)The unique stack name
Headers
Content-Type: application/json
Body
{
"data": {
"stackFile": "IyBEZXBsb3kgdG...V09SRD1leGFtcGxl"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"stackFile": {
"type": "string",
"enum": [
"IyBEZXBsb3kgdG...V09SRD1leGFtcGxl"
],
"description": "Base64 encoded docker-compose file"
}
},
"required": [
"stackFile"
],
"additionalProperties": false
}
},
"required": [
"data"
]
}
Stack does not exist
Get StackfileGET/stacks/{stackName}/stackfile
Returns the Base64 encoded docker-compose file generated from the current Docker Swarm state
- stackName
string
(required)The unique stack name
Docker ¶
Proxy ¶
All requests to the /docker
endpoint will be forwarded to the Docker API
Headers
Authorization: Bearer <jwt>
Headers
Content-Type: application/json
List ServicesGET/docker/services
Generated by aglio on 19 Jul 2018