mirror of https://github.com/docker/docs.git
Merge pull request #500 from kencochrane/registry-api-doc
added Docker Index search API doc
This commit is contained in:
commit
58ca46af39
|
@ -0,0 +1,2 @@
|
||||||
|
Sphinx==1.1.3
|
||||||
|
sphinxcontrib-httpdomain==1.1.8
|
|
@ -9,7 +9,7 @@ Commands
|
||||||
Contents:
|
Contents:
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 3
|
||||||
|
|
||||||
basics
|
basics
|
||||||
workingwithrepository
|
workingwithrepository
|
||||||
|
|
|
@ -25,7 +25,7 @@ import sys, os
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||||
extensions = []
|
extensions = ['sphinxcontrib.httpdomain']
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
|
|
|
@ -16,6 +16,7 @@ This documentation has the following resources:
|
||||||
contributing/index
|
contributing/index
|
||||||
commandline/index
|
commandline/index
|
||||||
registry/index
|
registry/index
|
||||||
|
index/index
|
||||||
faq
|
faq
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
:title: Docker Index documentation
|
||||||
|
:description: Documentation for docker Index
|
||||||
|
:keywords: docker, index, api
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Index
|
||||||
|
=====
|
||||||
|
|
||||||
|
Contents:
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
search
|
|
@ -0,0 +1,38 @@
|
||||||
|
=======================
|
||||||
|
Docker Index Search API
|
||||||
|
=======================
|
||||||
|
|
||||||
|
Search
|
||||||
|
------
|
||||||
|
|
||||||
|
.. http:get:: /v1/search
|
||||||
|
|
||||||
|
Search the Index given a search term. It accepts :http:method:`get` only.
|
||||||
|
|
||||||
|
**Example request**:
|
||||||
|
|
||||||
|
.. sourcecode:: http
|
||||||
|
|
||||||
|
GET /v1/search?q=search_term HTTP/1.1
|
||||||
|
Host: example.com
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
**Example response**:
|
||||||
|
|
||||||
|
.. sourcecode:: http
|
||||||
|
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Vary: Accept
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{"query":"search_term",
|
||||||
|
"num_results": 2,
|
||||||
|
"results" : [
|
||||||
|
{"name": "dotcloud/base", "description": "A base ubuntu64 image..."},
|
||||||
|
{"name": "base2", "description": "A base ubuntu64 image..."},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
:query q: what you want to search for
|
||||||
|
:statuscode 200: no error
|
||||||
|
:statuscode 500: server error
|
|
@ -84,7 +84,9 @@ It’s possible to run docker pull https://<registry>/repositories/samalba/busyb
|
||||||
|
|
||||||
Currently registry redirects to s3 urls for downloads, going forward all downloads need to be streamed through the registry. The Registry will then abstract the calls to S3 by a top-level class which implements sub-classes for S3 and local storage.
|
Currently registry redirects to s3 urls for downloads, going forward all downloads need to be streamed through the registry. The Registry will then abstract the calls to S3 by a top-level class which implements sub-classes for S3 and local storage.
|
||||||
|
|
||||||
Token is only returned when it is a private repo, public repos do not require tokens to be returned. The Registry will still contact the Index to make sure the pull is authorized (“is it ok to download this repos without a Token?”).
|
Token is only returned when the 'X-Docker-Token' header is sent with request.
|
||||||
|
|
||||||
|
Basic Auth is required to pull private repos. Basic auth isn't required for pulling public repos, but if one is provided, it needs to be valid and for an active account.
|
||||||
|
|
||||||
API (pulling repository foo/bar):
|
API (pulling repository foo/bar):
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -426,6 +428,8 @@ You have 3 options:
|
||||||
- X-Docker-Token: true
|
- X-Docker-Token: true
|
||||||
|
|
||||||
In this case, along with the 200 response, you’ll get a new token (if user auth is ok):
|
In this case, along with the 200 response, you’ll get a new token (if user auth is ok):
|
||||||
|
If authorization isn't correct you get a 401 response.
|
||||||
|
If account isn't active you will get a 403 response.
|
||||||
|
|
||||||
**Response**:
|
**Response**:
|
||||||
- 200 OK
|
- 200 OK
|
||||||
|
|
Loading…
Reference in New Issue