Skip to content

Commit d214fef

Browse files
stevsmitSteven Smith
andauthored
Updates api guide with search commands (quay#1208)
Co-authored-by: Steven Smith <[email protected]>
1 parent b529ea3 commit d214fef

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

api/master.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ include::modules/robot-account-manage-api.adoc[leveloffset=+2]
106106
include::modules/creating-robot-account-api.adoc[leveloffset=+3]
107107
include::modules/robot-account-permissions-api.adoc[leveloffset=+3]
108108
include::modules/deleting-robot-account-api.adoc[leveloffset=+3]
109-
110-
109+
//search
110+
include::modules/search-api.adoc[leveloffset=+2]
111111
112112
// team member management?
113113
include::modules/managing-team-members-api.adoc[leveloffset=+3]

modules/search-api.adoc

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
// module included in the following assemblies:
3+
4+
// * use_quay/master.adoc
5+
// * quay_io/master.adoc
6+
:_content-type: CONCEPT
7+
[id="search-api"]
8+
= Searching against registry context
9+
10+
You can use `search` API endpoints to perform searches against all registry context.
11+
12+
.Procedure
13+
14+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/{producty}/html-single/red_hat_quay_api_guide/index#conductreposearch[`GET /api/v1/find/repositories`] endpoint to get a list of apps and repositories that match the specified query:
15+
16+
+
17+
[source,terminal]
18+
----
19+
$ curl -X GET "https://quay-server.example.com/api/v1/find/repositories?query=<repo_name>&page=1&includeUsage=true" \
20+
-H "Authorization: Bearer <bearer_token>"
21+
----
22+
+
23+
.Example output
24+
+
25+
[source,terminal]
26+
----
27+
{"results": [], "has_additional": false, "page": 2, "page_size": 10, "start_index": 10}
28+
----
29+
30+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/{producty}/html-single/red_hat_quay_api_guide/index#conductsearch[`GET /api/v1/find/all`] endpoint to get a list of entities and resources that match the specified query:
31+
+
32+
[source,terminal]
33+
----
34+
$ curl -X GET "https://quay-server.example.com/api/v1/find/all?query=<mysearchterm>" \
35+
-H "Authorization: Bearer <bearer_token>"
36+
----
37+
+
38+
.Example output
39+
+
40+
[source,terminal]
41+
----
42+
{"results": [{"kind": "repository", "title": "repo", "namespace": {"title": "user", "kind": "user", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}, "name": "quayadmin", "score": 1, "href": "/user/quayadmin"}, "name": "busybox", "description": null, "is_public": false, "score": 4.0, "href": "/repository/quayadmin/busybox"}]}
43+
----
44+
45+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/{producty}/html-single/red_hat_quay_api_guide/index#getmatchingentities[`GET /api/v1/entities/{prefix}`] endpoint to get a list of entities that match the specified prefix.
46+
+
47+
[source,terminal]
48+
----
49+
$ curl -X GET "https://quay-server.example.com/api/v1/entities/<prefix>?includeOrgs=<true_or_false>&includeTeams=<true_or_false>&namespace=<namespace>" \
50+
-H "Authorization: Bearer <bearer_token>"
51+
----
52+
+
53+
.Example output
54+
+
55+
[source,terminal]
56+
----
57+
{"results": [{"name": "quayadmin", "kind": "user", "is_robot": false, "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}}]}
58+
----

0 commit comments

Comments
 (0)