Преглед изворни кода

Merge pull request #9840 from nhsiehgit/searchapidocs

updated search api docs to include pagination changes
James Turnbull пре 10 година
родитељ
комит
25a8602cba

+ 2 - 0
docs/man/docker-search.1.md

@@ -19,6 +19,8 @@ of images returned displays the name, description (truncated by default),
 number of stars awarded, whether the image is official, and whether it
 number of stars awarded, whether the image is official, and whether it
 is automated.
 is automated.
 
 
+*Note* - Search queries will only return up to 25 results
+
 # OPTIONS
 # OPTIONS
 **--automated**=*true*|*false*
 **--automated**=*true*|*false*
    Only show automated builds. The default is *false*.
    Only show automated builds. The default is *false*.

+ 19 - 6
docs/sources/reference/api/registry_api.md

@@ -514,28 +514,41 @@ Search the Index given a search term. It accepts
 
 
 **Example request**:
 **Example request**:
 
 
-        GET /v1/search?q=search_term HTTP/1.1
+        GET /v1/search?q=search_term&page=1&n=25 HTTP/1.1
         Host: index.docker.io
         Host: index.docker.io
         Accept: application/json
         Accept: application/json
 
 
+Query Parameters:
+
+- **q** – what you want to search for
+- **n** - number of results you want returned per page (default: 25, min:1, max:100)
+- **page** - page number of results
+
 **Example response**:
 **Example response**:
 
 
         HTTP/1.1 200 OK
         HTTP/1.1 200 OK
         Vary: Accept
         Vary: Accept
         Content-Type: application/json
         Content-Type: application/json
 
 
-        {"query":"search_term",
+        {"num_pages": 1,
           "num_results": 3,
           "num_results": 3,
           "results" : [
           "results" : [
              {"name": "ubuntu", "description": "An ubuntu image..."},
              {"name": "ubuntu", "description": "An ubuntu image..."},
              {"name": "centos", "description": "A centos image..."},
              {"name": "centos", "description": "A centos image..."},
              {"name": "fedora", "description": "A fedora image..."}
              {"name": "fedora", "description": "A fedora image..."}
-           ]
+           ],
+          "page_size": 25,
+          "query":"search_term",
+          "page": 1
          }
          }
 
 
-Query Parameters:
-
-- **q** – what you want to search for
+Response Items:
+- **num_pages** - Total number of pages returned by query
+- **num_results** - Total number of results returned by query
+- **results** - List of results for the current page
+- **page_size** - How many results returned per page
+- **query** - Your search term
+- **page** - Current page number
 
 
 Status Codes:
 Status Codes:
 
 

+ 3 - 0
docs/sources/reference/commandline/cli.md

@@ -1969,6 +1969,9 @@ See [*Find Public Images on Docker Hub*](
 /userguide/dockerrepos/#searching-for-images) for
 /userguide/dockerrepos/#searching-for-images) for
 more details on finding shared images from the command line.
 more details on finding shared images from the command line.
 
 
+> **Note:** 
+> Search queries will only return up to 25 results 
+
 ## start
 ## start
 
 
     Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]
     Usage: docker start [OPTIONS] CONTAINER [CONTAINER...]