2014-06-01 16:48:04 -04:00
|
|
|
|
page_title: Docker Hub API
|
|
|
|
|
page_description: API Documentation for the Docker Hub API
|
|
|
|
|
page_keywords: API, Docker, index, REST, documentation, Docker Hub, registry
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-06-01 16:48:04 -04:00
|
|
|
|
# Docker Hub API
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-06-01 16:48:04 -04:00
|
|
|
|
- This is the REST API for [Docker Hub](https://hub.docker.com).
|
2014-04-15 20:53:12 -04:00
|
|
|
|
- Authorization is done with basic auth over SSL
|
|
|
|
|
- Not all commands require authentication, only those noted as such.
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
# Repositories
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## User Repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Create a user repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`PUT /v1/repositories/(namespace)/(repo_name)/`
|
|
|
|
|
|
|
|
|
|
Create a user repository with the given `namespace` and `repo_name`.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/repositories/foo/bar/ HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
X-Docker-Token: true
|
|
|
|
|
|
|
|
|
|
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"}]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – the namespace for the repo
|
|
|
|
|
- **repo_name** – the name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
WWW-Authenticate: Token signature=123abc,repository="foo/bar",access=write
|
|
|
|
|
X-Docker-Token: signature=123abc,repository="foo/bar",access=write
|
|
|
|
|
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – Created
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Delete a user repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`DELETE /v1/repositories/(namespace)/(repo_name)/`
|
|
|
|
|
|
|
|
|
|
Delete a user repository with the given `namespace` and `repo_name`.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
DELETE /v1/repositories/foo/bar/ HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
X-Docker-Token: true
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – the namespace for the repo
|
|
|
|
|
- **repo_name** – the name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 202
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
WWW-Authenticate: Token signature=123abc,repository="foo/bar",access=delete
|
|
|
|
|
X-Docker-Token: signature=123abc,repository="foo/bar",access=delete
|
|
|
|
|
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – Deleted
|
|
|
|
|
- **202** – Accepted
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Library Repository
|
|
|
|
|
|
|
|
|
|
### Create a library repository
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
`PUT /v1/repositories/(repo_name)/`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Create a library repository with the given `repo_name`.
|
|
|
|
|
This is a restricted feature only available to docker admins.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
> When namespace is missing, it is assumed to be `library`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/repositories/foobar/ HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
X-Docker-Token: true
|
|
|
|
|
|
|
|
|
|
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f"}]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **repo_name** – the library name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
WWW-Authenticate: Token signature=123abc,repository="library/foobar",access=write
|
|
|
|
|
X-Docker-Token: signature=123abc,repository="foo/bar",access=write
|
|
|
|
|
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – Created
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Delete a library repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`DELETE /v1/repositories/(repo_name)/`
|
|
|
|
|
|
2014-09-21 20:05:58 -04:00
|
|
|
|
Delete a library repository with the given `repo_name`.
|
2014-04-23 16:48:28 -04:00
|
|
|
|
This is a restricted feature only available to docker admins.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
> When namespace is missing, it is assumed to be `library`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
DELETE /v1/repositories/foobar/ HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
X-Docker-Token: true
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **repo_name** – the library name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 202
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
WWW-Authenticate: Token signature=123abc,repository="library/foobar",access=delete
|
|
|
|
|
X-Docker-Token: signature=123abc,repository="foo/bar",access=delete
|
|
|
|
|
X-Docker-Endpoints: registry-1.docker.io [, registry-2.docker.io]
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – Deleted
|
|
|
|
|
- **202** – Accepted
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
# Repository Images
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## User Repository Images
|
|
|
|
|
|
|
|
|
|
### Update user repository images
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
`PUT /v1/repositories/(namespace)/(repo_name)/images`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Update the images for a user repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/repositories/foo/bar/images HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
|
|
|
|
|
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
|
|
|
|
|
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"}]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – the namespace for the repo
|
|
|
|
|
- **repo_name** – the name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 204
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **204** – Created
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active or permission denied
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### List user repository images
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/repositories/(namespace)/(repo_name)/images`
|
|
|
|
|
|
|
|
|
|
Get the images for a user repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /v1/repositories/foo/bar/images HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – the namespace for the repo
|
|
|
|
|
- **repo_name** – the name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
|
|
|
|
|
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"},
|
|
|
|
|
{"id": "ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds",
|
|
|
|
|
"checksum": "34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew"}]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – OK
|
|
|
|
|
- **404** – Not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Library Repository Images
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Update library repository images
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
`PUT /v1/repositories/(repo_name)/images`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Update the images for a library repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/repositories/foobar/images HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
|
|
|
|
|
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
|
|
|
|
|
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"}]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **repo_name** – the library name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 204
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **204** – Created
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active or permission denied
|
|
|
|
|
|
|
|
|
|
### List library repository images
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`GET /v1/repositories/(repo_name)/images`
|
|
|
|
|
|
|
|
|
|
Get the images for a library repo.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
GET /v1/repositories/foobar/images HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **repo_name** – the library name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
[{"id": "9e89cc6f0bc3c38722009fe6857087b486531f9a779a0c17e3ed29dae8f12c4f",
|
|
|
|
|
"checksum": "b486531f9a779a0c17e3ed29dae8f12c4f9e89cc6f0bc3c38722009fe6857087"},
|
|
|
|
|
{"id": "ertwetewtwe38722009fe6857087b486531f9a779a0c1dfddgfgsdgdsgds",
|
|
|
|
|
"checksum": "34t23f23fc17e3ed29dae8f12c4f9e89cc6f0bsdfgfsdgdsgdsgerwgew"}]
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – OK
|
|
|
|
|
- **404** – Not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
# Repository Authorization
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Library Repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-29 19:58:47 -04:00
|
|
|
|
### Authorize a token for a library
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
`PUT /v1/repositories/(repo_name)/auth`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Authorize a token for a library repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/repositories/foobar/auth HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Authorization: Token signature=123abc,repository="library/foobar",access=write
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **repo_name** – the library name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
"OK"
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
|
|
|
|
|
|
|
|
|
- **200** – OK
|
|
|
|
|
- **403** – Permission denied
|
|
|
|
|
- **404** – Not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## User Repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-10-12 03:03:41 -04:00
|
|
|
|
### Authorize a token for a user repository
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
`PUT /v1/repositories/(namespace)/(repo_name)/auth`
|
|
|
|
|
|
|
|
|
|
Authorize a token for a user repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/repositories/foo/bar/auth HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Authorization: Token signature=123abc,repository="foo/bar",access=write
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **namespace** – the namespace for the repo
|
|
|
|
|
- **repo_name** – the name for the repo
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
"OK"
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – OK
|
|
|
|
|
- **403** – Permission denied
|
|
|
|
|
- **404** – Not found
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
## Users
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### User Login
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
2014-10-12 03:03:41 -04:00
|
|
|
|
`GET /v1/users/`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
If you want to check your login, you can try this endpoint
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-10-12 03:03:41 -04:00
|
|
|
|
GET /v1/users/ HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
OK
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **200** – no error
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### User Register
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
2014-10-12 03:03:41 -04:00
|
|
|
|
`POST /v1/users/`
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-04-23 16:48:28 -04:00
|
|
|
|
Registering a new account.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-10-12 03:03:41 -04:00
|
|
|
|
POST /v1/users/ HTTP/1.1
|
2014-04-15 20:53:12 -04:00
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
2014-07-24 18:19:50 -04:00
|
|
|
|
{"email": "sam@docker.com",
|
2014-04-15 20:53:12 -04:00
|
|
|
|
"password": "toto42",
|
2014-04-18 20:35:45 -04:00
|
|
|
|
"username": "foobar"}
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Json Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **email** – valid email address, that needs to be confirmed
|
|
|
|
|
- **username** – min 4 character, max 30 characters, must match
|
2014-04-23 16:48:28 -04:00
|
|
|
|
the regular expression [a-z0-9_].
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **password** – min 5 characters
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 201 OK
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
"User Created"
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **201** – User Created
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
### Update User
|
2014-04-23 16:48:28 -04:00
|
|
|
|
|
|
|
|
|
`PUT /v1/users/(username)/`
|
|
|
|
|
|
|
|
|
|
Change a password or email address for given user. If you pass in an
|
2014-09-09 01:00:23 -04:00
|
|
|
|
email, it will add it to your account, it will not remove the old
|
|
|
|
|
one. Passwords will be updated.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
It is up to the client to verify that that password that is sent is
|
|
|
|
|
the one that they want. Common approach is to have them type it
|
|
|
|
|
twice.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Request**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
PUT /v1/users/fakeuser/ HTTP/1.1
|
|
|
|
|
Host: index.docker.io
|
|
|
|
|
Accept: application/json
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
Authorization: Basic akmklmasadalkm==
|
|
|
|
|
|
2014-07-24 18:19:50 -04:00
|
|
|
|
{"email": "sam@docker.com",
|
2014-04-15 20:53:12 -04:00
|
|
|
|
"password": "toto42"}
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Parameters:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **username** – username for the person you want to update
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
**Example Response**:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
|
|
HTTP/1.1 204
|
|
|
|
|
Vary: Accept
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
Status Codes:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
2014-09-09 01:00:23 -04:00
|
|
|
|
- **204** – User Updated
|
|
|
|
|
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
|
|
|
|
- **401** – Unauthorized
|
|
|
|
|
- **403** – Account is not Active
|
|
|
|
|
- **404** – User not found
|