Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically generate Engine API documentation #606

Merged
merged 3 commits into from
Dec 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN svn co https://github.com/docker/docker/branches/$ENGINE_BRANCH/docs/referen
&& wget -O allv/engine/deprecated.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/deprecated.md \
&& svn co https://github.com/docker/distribution/branches/$DISTRIBUTION_BRANCH/docs/spec allv/registry/spec \
&& wget -O allv/registry/configuration.md https://raw.githubusercontent.com/docker/distribution/$DISTRIBUTION_BRANCH/docs/configuration.md \
&& wget -O allv/engine/api/v1.25/swagger.yaml https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/api/swagger.yaml \
&& jekyll build -s allv -d allvbuild \
&& rm -rf allv

Expand Down
46 changes: 25 additions & 21 deletions _data/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ toc:
section:
- path: /docker-id/
title: Docker ID accounts
- path: /docker-id/api-reference/
title: API Reference
- sectiontitle: Docker Engine
section:
- sectiontitle: Install
Expand Down Expand Up @@ -475,28 +477,30 @@ toc:
title: volume rm
- path: /engine/reference/commandline/wait/
title: wait
- sectiontitle: API Reference
- sectiontitle: Engine API
section:
- path: /engine/api/v1.25/
title: Reference
- path: /engine/api/client-libraries/
title: Client libraries
- sectiontitle: Version history
section:
- path: /engine/reference/api/docker_remote_api/
title: Remote API
- path: /engine/reference/api/docker_remote_api_v1.24/
title: Remote API v1.24
- path: /engine/reference/api/docker_remote_api_v1.23/
title: Remote API v1.23
- path: /engine/reference/api/docker_remote_api_v1.22/
title: Remote API v1.22
- path: /engine/reference/api/docker_remote_api_v1.21/
title: Remote API v1.21
- path: /engine/reference/api/docker_remote_api_v1.20/
title: Remote API v1.20
- path: /engine/reference/api/docker_remote_api_v1.19/
title: Remote API v1.19
- path: /engine/reference/api/docker_remote_api_v1.18/
title: Remote API v1.18
- path: /engine/reference/api/remote_api_client_libraries/
title: Remote API client libraries
- path: /engine/reference/api/docker_io_accounts_api/
title: docker.io accounts API
- path: /engine/api/version-history/
title: Overview
- path: /engine/api/v1.24/
title: v1.24 reference
- path: /engine/api/v1.23/
title: v1.23 reference
- path: /engine/api/v1.22/
title: v1.22 reference
- path: /engine/api/v1.21/
title: v1.21 reference
- path: /engine/api/v1.20/
title: v1.20 reference
- path: /engine/api/v1.19/
title: v1.19 reference
- path: /engine/api/v1.18/
title: v1.18 reference
- path: /engine/migration/
title: Migrate to Engine 1.10
- path: /engine/breaking_changes/
Expand Down
2 changes: 1 addition & 1 deletion datacenter/ucp/1.1/install-sandbox-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ UCP allows you to deploy and manage "Dockerized" applications in production. An
application is built using Docker objects, such as images and containers, and
Docker resources, such as volumes and networks.

UCP deploys and manages these objects and resources using remote API calls to
UCP deploys and manages these objects and resources using Engine API calls to
the Engine daemons running on the nodes. For example, the `run` action may
deploy an image in a Docker container. That image might define a service such as
an Nginx web server or a database like Postgres.
Expand Down
4 changes: 2 additions & 2 deletions docker-for-mac/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ experiment a multi-node swarm. Check out the tutorial at [Get started with swarm

### How do I connect to the remote Docker Engine API?

You might need to provide the location of the remote API for Docker clients and development tools.
You might need to provide the location of the Engine API for Docker clients and development tools.

On Docker for Mac, clients can connect to the Docker Engine through a Unix socket: `unix:///var/run/docker.sock`.

See also [Docker Remote API](/engine/reference/api/docker_remote_api.md) and Docker for Mac forums topic [Using pycharm Docker plugin..](https://forums.docker.com/t/using-pycharm-docker-plugin-with-docker-beta/8617).
See also [Docker Engine API](/engine/reference/api/docker_remote_api.md) and Docker for Mac forums topic [Using pycharm Docker plugin..](https://forums.docker.com/t/using-pycharm-docker-plugin-with-docker-beta/8617).

If you are working with applications like [Apache Maven](https://maven.apache.org/) that expect settings for `DOCKER_HOST` and `DOCKER_CERT_PATH` environment variables, specify these to connect to Docker instances through Unix sockets. For example:

Expand Down
6 changes: 3 additions & 3 deletions docker-for-windows/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ swarm mode](/engine/swarm/swarm-tutorial/index.md).

### How do I connect to the remote Docker Engine API?

You might need to provide the location of the remote API for Docker clients and development tools.
You might need to provide the location of the Engine API for Docker clients and development tools.

On Docker for Windows, clients can connect to the Docker Engine through a **named pipe**: `npipe:////./pipe/docker_engine`, or **TCP socket** at this URL: `http://localhost:2375`.

This sets `DOCKER_HOST` and `DOCKER_CERT_PATH` environment variables to the given values (for the named pipe or TCP socket, whichever you use).

See also [Docker Remote API](/engine/reference/api/docker_remote_api.md) and the Docker for Windows forums topic [How to find the remote API](https://forums.docker.com/t/how-to-find-the-remote-api/20988).
See also [Docker Engine API](/engine/reference/api/) and the Docker for Windows forums topic [How to find the remote API](https://forums.docker.com/t/how-to-find-the-remote-api/20988).

### Why doesn't `nodemon` pick up file changes in a container mounted on a shared drive?

Expand Down Expand Up @@ -182,4 +182,4 @@ in [Troubleshooting](troubleshoot.md).
You might decide that you do not need Toolbox now that you have Docker for Windows, and want to uninstall it. For
details on how to perform a clean uninstall of Toolbox on Windows, see [How to
uninstall Toolbox](/toolbox/toolbox_install_windows.md#how-to-uninstall-toolbox)
in the Toolbox Windows topics.
in the Toolbox Windows topics.
277 changes: 277 additions & 0 deletions docker-id/api-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
---
title: "docker.io accounts API"
description: "API Documentation for docker.io accounts."
keywords: "API, Docker, accounts, REST, documentation"
redirect_from:
- /reference/api/docker_io_accounts_api/
- /engine/reference/api/docker_io_accounts_api/
---

# Docker ID accounts API

The accounts API is an API for accessing and updating Docker ID accounts.

## Get a single user

`GET /api/v1.1/users/:username/`

Get profile info for the specified user.

Parameters:

- **username** – username of the user whose profile info is being
requested.

Request Headers:

- **Authorization** – required authentication credentials of
either type HTTP Basic or OAuth Bearer Token.

Status Codes:

- **200** – success, user data returned.
- **401** – authentication error.
- **403** – permission error, authenticated user must be the user
whose data is being requested, OAuth access tokens must have
`profile_read` scope.
- **404** – the specified username does not exist.

**Example request**:

GET /api/v1.1/users/janedoe/ HTTP/1.1
Host: www.docker.io
Accept: application/json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

**Example response**:

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 2,
"username": "janedoe",
"url": "https://www.docker.io/api/v1.1/users/janedoe/",
"date_joined": "2014-02-12T17:58:01.431312Z",
"type": "User",
"full_name": "Jane Doe",
"location": "San Francisco, CA",
"company": "Success, Inc.",
"profile_url": "https://docker.io/",
"gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
"email": "jane.doe@example.com",
"is_active": true
}

## Update a single user

`PATCH /api/v1.1/users/:username/`

Update profile info for the specified user.

Parameters:

- **username** – username of the user whose profile info is being
updated.

Json Parameters:

- **full_name** (*string*) – (optional) the new name of the user.
- **location** (*string*) – (optional) the new location.
- **company** (*string*) – (optional) the new company of the user.
- **profile_url** (*string*) – (optional) the new profile url.
- **gravatar_email** (*string*) – (optional) the new Gravatar
email address.

Request Headers:

- **Authorization** – required authentication credentials of
either type HTTP Basic or OAuth Bearer Token.
- **Content-Type** – MIME Type of post data. JSON, url-encoded
form data, etc.

Status Codes:

- **200** – success, user data updated.
- **400** – post data validation error.
- **401** – authentication error.
- **403** – permission error, authenticated user must be the user
whose data is being updated, OAuth access tokens must have
`profile_write` scope.
- **404** – the specified username does not exist.

**Example request**:

PATCH /api/v1.1/users/janedoe/ HTTP/1.1
Host: www.docker.io
Accept: application/json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

{
"location": "Private Island",
"profile_url": "http://janedoe.com/",
"company": "Retired",
}

**Example response**:

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 2,
"username": "janedoe",
"url": "https://www.docker.io/api/v1.1/users/janedoe/",
"date_joined": "2014-02-12T17:58:01.431312Z",
"type": "User",
"full_name": "Jane Doe",
"location": "Private Island",
"company": "Retired",
"profile_url": "http://janedoe.com/",
"gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
"email": "jane.doe@example.com",
"is_active": true
}

## List email addresses for a user

`GET /api/v1.1/users/:username/emails/`

List email info for the specified user.

Parameters:

- **username** – username of the user whose profile info is being
updated.

Request Headers:

- **Authorization** – required authentication credentials of
either type HTTP Basic or OAuth Bearer Token

Status Codes:

- **200** – success, user data updated.
- **401** – authentication error.
- **403** – permission error, authenticated user must be the user
whose data is being requested, OAuth access tokens must have
`email_read` scope.
- **404** – the specified username does not exist.

**Example request**:

GET /api/v1.1/users/janedoe/emails/ HTTP/1.1
Host: www.docker.io
Accept: application/json
Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM

**Example response**:

HTTP/1.1 200 OK
Content-Type: application/json

[
{
"email": "jane.doe@example.com",
"verified": true,
"primary": true
}
]

## Add email address for a user

`POST /api/v1.1/users/:username/emails/`

Add a new email address to the specified user's account. The email
address must be verified separately, a confirmation email is not
automatically sent.

Json Parameters:

- **email** (*string*) – email address to be added.

Request Headers:

- **Authorization** – required authentication credentials of
either type HTTP Basic or OAuth Bearer Token.
- **Content-Type** – MIME Type of post data. JSON, url-encoded
form data, etc.

Status Codes:

- **201** – success, new email added.
- **400** – data validation error.
- **401** – authentication error.
- **403** – permission error, authenticated user must be the user
whose data is being requested, OAuth access tokens must have
`email_write` scope.
- **404** – the specified username does not exist.

**Example request**:

POST /api/v1.1/users/janedoe/emails/ HTTP/1.1
Host: www.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM

{
"email": "jane.doe+other@example.com"
}

**Example response**:

HTTP/1.1 201 Created
Content-Type: application/json

{
"email": "jane.doe+other@example.com",
"verified": false,
"primary": false
}

## Delete email address for a user

`DELETE /api/v1.1/users/:username/emails/`

Delete an email address from the specified user's account. You
cannot delete a user's primary email address.

Json Parameters:

- **email** (*string*) – email address to be deleted.

Request Headers:

- **Authorization** – required authentication credentials of
either type HTTP Basic or OAuth Bearer Token.
- **Content-Type** – MIME Type of post data. JSON, url-encoded
form data, etc.

Status Codes:

- **204** – success, email address removed.
- **400** – validation error.
- **401** – authentication error.
- **403** – permission error, authenticated user must be the user
whose data is being requested, OAuth access tokens must have
`email_write` scope.
- **404** – the specified username or email address does not
exist.

**Example request**:

DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1
Host: www.docker.io
Accept: application/json
Content-Type: application/json
Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM

{
"email": "jane.doe+other@example.com"
}

**Example response**:

HTTP/1.1 204 NO CONTENT
Content-Length: 0
Loading