Skip to content

Commit f666037

Browse files
stevsmitSteven Smith
andauthored
Fixes date (quay#1212) (quay#1221)
Co-authored-by: Steven Smith <[email protected]>
1 parent bbdac79 commit f666037

8 files changed

+418
-0
lines changed

api/master.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ include::modules/robot-account-permissions-api.adoc[leveloffset=+3]
108108
include::modules/deleting-robot-account-api.adoc[leveloffset=+3]
109109
//search
110110
include::modules/search-api.adoc[leveloffset=+2]
111+
//sec-scan
112+
include::modules/security-scanning-api.adoc[leveloffset=+2]
113+
//superuser
114+
include::modules/superuser-manage-api.adoc[leveloffset=+2]
115+
include::modules/creating-user-account-quay-api.adoc[leveloffset=+3]
116+
include::modules/deleting-user-cli-api.adoc[leveloffset=+3]
117+
include::modules/managing-organization-superuser-api.adoc[leveloffset=+3]
118+
include::modules/listing-repos-superuser-api.adoc[leveloffset=+3]
119+
include::modules/managing-organization-quota-superuser-api.adoc[leveloffset=+3]
120+
include::modules/managing-user-quota-superuser-api.adoc[leveloffset=+3]
121+
include::modules/retrieving-build-info-superuser-api.adoc[leveloffset=+3]
122+
123+
124+
include::modules/managing-service-keys-api.adoc[leveloffset=+3]
111125
112126
// team member management?
113127
include::modules/managing-team-members-api.adoc[leveloffset=+3]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[id="listing-logs-superuser-api"]
2+
= Listing logs as a superuser with the {productname} API
3+
4+
{productname} superusers can list usage logs for the current system.
5+
6+
.Procedure
7+
8+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#listalllogs[`GET /api/v1/superuser/logs`] endpoint to list the usage logs for the current system:
9+
+
10+
[source,terminal]
11+
----
12+
$ curl -X GET \
13+
-H "Authorization: Bearer <bearer_token>" \
14+
"https://<quay_server>/api/v1/superuser/logs?starttime=<start_time>&endtime=<end_time>&page=<page_number>&next_page=<next_page_token>"
15+
----
16+
+
17+
.Example output
18+
+
19+
[source,terminal]
20+
----
21+
{"start_time": "Mon, 17 Feb 2025 19:29:14 -0000", "end_time": "Wed, 19 Feb 2025 19:29:14 -0000", "logs": [{"kind": "login_success", "metadata": {"type": "quayauth", "useragent": "Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0"}, "ip": "192.168.1.131", "datetime": "Tue, 18 Feb 2025 19:28:15 -0000", "namespace": {"kind": "user", "name": "quayadmin", "avatar": {"name": "quayadmin", "hash": "6d640d802fe23b93779b987c187a4b7a4d8fbcbd4febe7009bdff58d84498fba", "color": "#f7b6d2", "kind": "user"}}}], "next_page": "gAAAAABntN-KbPJDI0PpcHmWjRCmQTLiCprE_KXiOSidbGZ7Ireu8pVTgGUIstijNhmiLzlAv_S3HOsCrKWnuBmoQYZ3F53Uxg=="}
22+
----
23+
24+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#getregistrysize[`GET /api/v1/superuser/registrysize/`] end point to obtain information about the size of the registry:
25+
+
26+
[source,terminal]
27+
----
28+
$ curl -X GET \
29+
-H "Authorization: Bearer <bearer_token>" \
30+
"https://<quay_server>/api/v1/superuser/registrysize/"
31+
----
32+
+
33+
.Example output
34+
+
35+
[source,terminal]
36+
----
37+
{"size_bytes": 0, "last_ran": null, "running": false, "queued": false}
38+
----
39+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#getregistrysize[`POST /api/v1/superuser/registrysize/`] end point to define registry size information:
40+
+
41+
[source,terminal]
42+
----
43+
$ curl -X POST "https://quay-server.example.com/api/v1/superuser/registrysize/" \
44+
-H "Authorization: Bearer <ACCESS_TOKEN>" \
45+
-H "Content-Type: application/json" \
46+
-d '{
47+
"namespace": "<namespace>",
48+
"last_ran": 1700000000,
49+
"queued": true,
50+
"running": false
51+
}'
52+
----
53+
+
54+
This command does not return output in the CLI.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[id="managing-organization-quota-superuser-api"]
2+
= Managing organization quota with the {productname} API
3+
4+
Quota can be managed with the {productname} API with superuser admin privileges. These endpoints allow superusers to manage quota policies for all organizations within the registry.
5+
6+
.Procedure
7+
8+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#createuserquotasuperuser[`POST /api/v1/superuser/organization/{namespace}/quota`] API endpoint to create a quota policy for an organization:
9+
+
10+
[source,terminal]
11+
----
12+
$ curl -X POST "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota" \
13+
-H "Authorization: Bearer <ACCESS_TOKEN>" \
14+
-H "Content-Type: application/json" \
15+
-d '{
16+
"limit_bytes": 10737418240
17+
}'
18+
----
19+
+
20+
.Example output
21+
+
22+
[source,terminal]
23+
----
24+
"Created"
25+
----
26+
27+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#listuserquotasuperuser[`GET /api/v1/superuser/organization/{namespace}/quota`] API endpoint to obtain information about the policy, including the quota ID:
28+
+
29+
[source,terminal]
30+
----
31+
$ curl -X GET "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota" \
32+
-H "Authorization: Bearer <ACCESS_TOKEN>"
33+
----
34+
+
35+
.Example output
36+
+
37+
[source,terminal]
38+
----
39+
[{"id": 2, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}], "default_config_exists": false}]
40+
----
41+
42+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#changeuserquotasuperuser[`PUT /api/v1/superuser/organization/{namespace}/quota/{quota_id}`] API endpoint to change the quota policy:
43+
+
44+
[source,terminal]
45+
----
46+
$ curl -X PUT "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota/<quota_id>" \
47+
-H "Authorization: Bearer <ACCESS_TOKEN>" \
48+
-H "Content-Type: application/json" \
49+
-d '{
50+
"limit_bytes": <NEW_QUOTA_LIMIT>
51+
}'
52+
----
53+
+
54+
.Example output
55+
+
56+
[source,terminal]
57+
----
58+
{"id": 2, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}], "default_config_exists": false}
59+
----
60+
61+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#deleteuserquotasuperuser[`DELETE /api/v1/superuser/organization/{namespace}/quota/{quota_id}`] API endpoint to
62+
+
63+
[source,terminal]
64+
----
65+
$ curl -X DELETE "https://quay-server.example.com/api/v1/superuser/organization/<namespace>/quota/<quota_id>" \
66+
-H "Authorization: Bearer <ACCESS_TOKEN>"
67+
----
68+
+
69+
This command does not return output in the CLI.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[id="organization-manage-api"]
2+
= Managing organizations as a superuser with the {productname} API
3+
4+
Superusers have the ability to list, change, and delete organizations by using the {productname} API.
5+
6+
.Procedure
7+
8+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#listallorganizations[`GET /api/v1/superuser/organizations`] endpoint to list all organizations:
9+
+
10+
[source,terminal]
11+
----
12+
$ curl -L -X GET \
13+
-H "Authorization: Bearer <bearer_token>" \
14+
"https://<quay_server>/api/v1/superuser/organizations?name=<organization_name>"
15+
----
16+
+
17+
.Example output
18+
+
19+
[source,terminal]
20+
----
21+
{"organizations": [{"name": "fed_test", "email": "fe11fc59-bd09-459a-a21c-b57692d151c9", "avatar": {"name": "fed_test", "hash": "e2ce1fb42ec2e0602362beb64b5ebd1e6ad291b710a0355f9296c16157bef3cb", "color": "#ff7f0e", "kind": "org"}, "quotas": [{"id": 3, "limit_bytes": 10737418240, "limits": []}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}, {"name": "test", "email": "[email protected]", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}]}
22+
----
23+
24+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#changeorganizatio[`PUT /api/v1/superuser/organizations/{name}`] endpoint to change or update information for an organization:
25+
+
26+
[source,terminal]
27+
----
28+
$ curl -X PUT \
29+
-H "Authorization: Bearer <bearer_token>" \
30+
-H "Content-Type: application/json" \
31+
-d '{
32+
"email": "<contact_email>",
33+
"invoice_email": <boolean_value>,
34+
"invoice_email_address": "<invoice_email_address>",
35+
"tag_expiration_s": <expiration_seconds>
36+
}' \
37+
"https://<quay_server>/api/v1/superuser/organizations/<organization_name>"
38+
----
39+
+
40+
.Example output
41+
+
42+
[source,terminal]
43+
----
44+
{"name": "test", "email": "[email protected]", "avatar": {"name": "test", "hash": "a15d479002b20f211568fd4419e76686d2b88a4980a5b4c4bc10420776c5f6fe", "color": "#aec7e8", "kind": "org"}, "quotas": [{"id": 2, "limit_bytes": 10737418240, "limits": [{"id": 1, "type": "Reject", "limit_percent": 90}]}], "quota_report": {"quota_bytes": 0, "configured_quota": 10737418240, "running_backfill": "complete", "backfill_status": "complete"}}
45+
----
46+
47+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#deleteorganization[`DELETE /api/v1/superuser/organizations/{name}`] endpoint to delete and organization:
48+
+
49+
[source,terminal]
50+
----
51+
$ curl -X DELETE \
52+
-H "Authorization: Bearer <bearer_token>" \
53+
"https://<quay_server>/api/v1/superuser/organizations/<organization_name>"
54+
----
55+
+
56+
This command does not return output in the CLI.
57+
58+
* Use the link:[``] endpoint to
59+
+
60+
[source,terminal]
61+
----
62+
63+
----
64+
+
65+
.Example output
66+
+
67+
[source,terminal]
68+
----
69+
70+
----
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
[id="service-key-manage-api"]
2+
= Managing service keys as a superuser with the {productname} API
3+
4+
Superusers have the ability to create, list, change, and delete service keys by using the {productname} API.
5+
6+
.Procedure
7+
8+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#createservicekey[`POST /api/v1/superuser/keys`] endpoint to create a service key:
9+
+
10+
[source,terminal]
11+
----
12+
$ curl -X POST \
13+
-H "Authorization: Bearer <bearer_token>" \
14+
-H "Content-Type: application/json" \
15+
-d '{
16+
"service": "<service_name>",
17+
"expiration": <unix_timestamp>
18+
}' \
19+
"<quay_server>/api/v1/superuser/keys"
20+
----
21+
+
22+
.Example output
23+
+
24+
[source,terminal]
25+
----
26+
{"message":""}
27+
----
28+
29+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#approveservicekey[`POST /api/v1/superuser/approvedkeys/{kid}`] endpoint to approved a service key:
30+
+
31+
[source,terminal]
32+
----
33+
$ curl -X POST \
34+
-H "Authorization: Bearer <bearer_token>" \
35+
-H "Content-Type: application/json" \
36+
-d '{
37+
"notes": "<approval_notes>"
38+
}' \
39+
"https://<quay_server>/api/v1/superuser/approvedkeys/<kid>"
40+
----
41+
+
42+
This command does not return output in the CLI.
43+
44+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/{producty}/html-single/red_hat_quay_api_guide/index#listservicekeys[`GET /api/v1/superuser/keys`] endpoint to list service keys:
45+
+
46+
[source,terminal]
47+
----
48+
$ curl -X GET \
49+
-H "Authorization: Bearer <bearer_token>" \
50+
"https://<quay_server>/api/v1/superuser/keys"
51+
----
52+
+
53+
.Example output
54+
+
55+
[source,terminal]
56+
----
57+
{"keys":[{"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Wed, 05 Feb 2025 22:03:37 GMT","jwk":{"e":"AQAB","kid":"<example>","kty":"RSA","n":"<example>"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool"},"name":"http://quay-server.example.com:80","rotation_duration":null,"service":"quay"}]}
58+
----
59+
60+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#getservicekey[`GET /api/v1/superuser/keys/{kid}`] endpoint to retrieve information about a service account by its kid:
61+
+
62+
[source,terminal]
63+
----
64+
$ curl -X GET \
65+
-H "Authorization: Bearer <bearer_token>" \
66+
"https://<quay_server>/api/v1/superuser/keys/<kid>"
67+
----
68+
+
69+
.Example output
70+
+
71+
[source,terminal]
72+
----
73+
{"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Wed, 05 Feb 2025 22:03:37 GMT","jwk":{"e":"AQAB","kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","kty":"RSA","n":"5iMX7RQ_4F_zdb1qonMsuWUDauCOqEyRpD8L_EhgnwDxrgMHuOlJ4_7sEOrOa3Jkx3QhwIW6LJCP69PR5X0wvz6vmC1DoWEaWv41bAq23Knzj7gUU9-N_fkZPZN9NQwZ-D-Zqg9L1c_cJF93Dy93py8_JswWFDj1FxMaThJmrX68wBwjhF-JLYqgCAGFyezzJ3oTpO-esV9v6R7skfkaqtx_cjLZk_0cKB4VKTtxiy2A8D_5nANTOSSbZLXNh2Vatgh3yrOmnTTNLIs0YO3vFIuylEkczHlln-40UMAzRB3HNspUySyzImO_2yGdrA762LATQrOzJN8E1YKCADx5CQ"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool"},"name":"http://quay-server.example.com:80","rotation_duration":null,"service":"quay"}
74+
----
75+
76+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#updateservicekey[`PUT /api/v1/superuser/keys/{kid}`] endpoint to update your service key, such as the metadata:
77+
+
78+
[source,terminal]
79+
----
80+
$ curl -X PUT \
81+
-H "Authorization: Bearer <bearer_token>" \
82+
-H "Content-Type: application/json" \
83+
-d '{
84+
"name": "<service_key_name>",
85+
"metadata": {"<key>": "<value>"},
86+
"expiration": <unix_timestamp>
87+
}' \
88+
"https://<quay_server>/api/v1/superuser/keys/<kid>"
89+
----
90+
+
91+
.Example output
92+
+
93+
[source,terminal]
94+
----
95+
{"approval":{"approval_type":"ServiceKeyApprovalType.AUTOMATIC","approved_date":"Mon, 20 Jan 2025 14:46:01 GMT","approver":null,"notes":""},"created_date":"Mon, 20 Jan 2025 14:46:01 GMT","expiration_date":"Mon, 03 Mar 2025 10:40:00 GMT","jwk":{"e":"AQAB","kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","kty":"RSA","n":"5iMX7RQ_4F_zdb1qonMsuWUDauCOqEyRpD8L_EhgnwDxrgMHuOlJ4_7sEOrOa3Jkx3QhwIW6LJCP69PR5X0wvz6vmC1DoWEaWv41bAq23Knzj7gUU9-N_fkZPZN9NQwZ-D-Zqg9L1c_cJF93Dy93py8_JswWFDj1FxMaThJmrX68wBwjhF-JLYqgCAGFyezzJ3oTpO-esV9v6R7skfkaqtx_cjLZk_0cKB4VKTtxiy2A8D_5nANTOSSbZLXNh2Vatgh3yrOmnTTNLIs0YO3vFIuylEkczHlln-40UMAzRB3HNspUySyzImO_2yGdrA762LATQrOzJN8E1YKCADx5CQ"},"kid":"7fr8soqXGgea8JqjwgItjjJT9GKlt-bMyMCDmvzy6WQ","metadata":{"created_by":"CLI tool","environment":"production"},"name":"quay-service-key-updated","rotation_duration":null,"service":"quay"}
96+
----
97+
98+
* Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#deleteservicekey[`DELETE /api/v1/superuser/keys/{kid}`] endpoint to delete a service key:
99+
+
100+
[source,terminal]
101+
----
102+
$ curl -X DELETE \
103+
-H "Authorization: Bearer <bearer_token>" \
104+
"https://<quay_server>/api/v1/superuser/keys/<kid>"
105+
----
106+
+
107+
This command does not return output in the CLI.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[id="managing-user-quota-superuser-api"]
2+
= Managing user quota with the {productname} API
3+
4+
As a superuser, you can manage user quota for specified organizations.
5+
6+
.Procedure
7+
8+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#createorganizationquotasuperuser[`POST /api/v1/superuser/users/{namespace}/quota`] endpoint to create a quota policy for specific users within an organization:
9+
+
10+
[source,terminal]
11+
----
12+
$ curl -X POST "https://quay-server.example.com/api/v1/superuser/users/<username>/quota" \
13+
-H "Authorization: Bearer <ACCESS_TOKEN>" \
14+
-H "Content-Type: application/json" \
15+
-d '{
16+
"limit_bytes": <QUOTA_LIMIT>
17+
}'
18+
----
19+
+
20+
.Example output
21+
+
22+
[source,terminal]
23+
----
24+
"Created"
25+
----
26+
27+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#listorganizationquotasuperuser[`GET /api/v1/superuser/users/{namespace}/quota`] endpoint to return a list of a user's allotted quota:
28+
+
29+
[source,terminal]
30+
----
31+
$ curl -X GET "https://quay-server.example.com/api/v1/superuser/users/<username>/quota" \
32+
-H "Authorization: Bearer <ACCESS_TOKEN>"
33+
----
34+
+
35+
.Example output
36+
+
37+
[source,terminal]
38+
----
39+
[{"id": 6, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}]
40+
----
41+
42+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#changeorganizationquotasuperuser[`PUT /api/v1/superuser/users/{namespace}/quota/{quota_id}`] endpoint to adjust the user's policy:
43+
+
44+
[source,terminal]
45+
----
46+
$ curl -X PUT "https://quay-server.example.com/api/v1/superuser/users/<username>/quota/<quota_id>" \
47+
-H "Authorization: Bearer <ACCESS_TOKEN>" \
48+
-H "Content-Type: application/json" \
49+
-d '{
50+
"limit_bytes": <NEW_QUOTA_LIMIT>
51+
}'
52+
----
53+
+
54+
.Example output
55+
+
56+
[source,terminal]
57+
----
58+
{"id": 6, "limit_bytes": 10737418240, "limit": "10.0 GiB", "default_config": false, "limits": [], "default_config_exists": false}
59+
----
60+
61+
. Use the link:https://docs.redhat.com/en/documentation/red_hat_quay/3.13/html-single/red_hat_quay_api_guide/index#deleteorganizationquotasuperuser[`DELETE /api/v1/superuser/users/{namespace}/quota/{quota_id}`] endpoint to delete a user's policy:
62+
+
63+
[source,terminal]
64+
----
65+
$ curl -X DELETE "https://quay-server.example.com/api/v1/superuser/users/<username>/quota/<quota_id>" \
66+
-H "Authorization: Bearer <ACCESS_TOKEN>"
67+
----
68+
+
69+
This command does not return output in the CLI.

0 commit comments

Comments
 (0)