From f8a14c0df9c7d82e1ac7d28d93854ec02ec7ed72 Mon Sep 17 00:00:00 2001 From: Elizabeth Vo <65384387+ensvo@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:36:23 +0900 Subject: [PATCH 1/2] api docs for registry tokens index --- data/nav.yml | 6 ++- .../apis/rest_api/packages/registry_tokens.md | 50 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 pages/apis/rest_api/packages/registry_tokens.md diff --git a/data/nav.yml b/data/nav.yml index 605e8cae2e..0655d53365 100644 --- a/data/nav.yml +++ b/data/nav.yml @@ -557,7 +557,11 @@ - name: "Members" path: "apis/rest-api/organizations/members" pill: "beta" - - name: "Pipelines " + - name: "Packages" + children: + - name: "Registry Tokens" + path: "apis/rest-api/packages/registry-tokens" + - name: "Pipelines" children: - name: "Overview" path: "apis/rest-api/pipelines" diff --git a/pages/apis/rest_api/packages/registry_tokens.md b/pages/apis/rest_api/packages/registry_tokens.md new file mode 100644 index 0000000000..e8a1ce7965 --- /dev/null +++ b/pages/apis/rest_api/packages/registry_tokens.md @@ -0,0 +1,50 @@ +# Registry Tokens API + +The registry tokens API lets you create and manage credentials needed to install and use packages in a registry. + +## List all registry tokens + +Returns a list of a registry's tokens. + +```bash +curl -H "Authorization: Bearer $TOKEN" \ + -X GET "https://api.buildkite.com/v2/packages/organizations/#{org.slug}/registries/#{registry.slug}/tokens" \ + -H "Content-Type: application/json" +``` + +```json +[ + { + "id": "0191b6a2-aa51-70d0-8a5f-aabce115b0fd", + "graphql_id": "UmVnaXN0cnlUb2tlbi0tLTAxOTFiNmEyLWFhNTEtNzBkMC04YTVmLWFhYmNlMTE1YjBmZA==", + "description": "Usher", + "url": "http://api.buildkite.com/v2/packages/organizations/my_great_org/registries/my-registry/tokens/0191b6a2-aa51-70d0-8a5f-aabce115b0fd", + "created_at": "2024-09-03T06:46:39.441Z", + "created_by": { + "id": "0191b13b-0eb6-470d-a4c0-2085974f3580", + "graphql_id": "VXNlci0tLTAxOTFiMTNiLTBlYjYtNDcwZC1hNGMwLTIwODU5NzRmMzU4MA==", + "name": "Eminem", + "email": "eminem@buildkite.com", + "avatar_url": null, + "created_at": "2024-09-02T05:35:23.318Z" + }, + "organization": { + "id": "018a456f-e581-44b6-c5a4-1d8a5f7094ee", + "slug": "my_great_org", + "url": "https://api.buildkite.com/v2/analytics/organizations/my_great_org", + "web_url": "https://buildkite.com/organizations/my_great_org" + }, + "registry": { + "id": "018f56ef-9ef4-70f0-aba2-0f4578e3d69d", + "graphql_id": "UmVnaXN0cnktLS0wMThmNTZlZi05ZWY0LTcwZjAtYWJhMi0wZjQ1NzhlM2Q2OWQ=", + "slug": "my-registry", + "url": "http://api.buildkite.com/v2/packages/organizations/my_great_org/registries/my-registry", + "web_url": "http://buildkite.com/organizations/buildkite/my_great_org/registries/my-registry" + } + } +] +``` + +Required scope: `read_registries` + +Success response: `200 OK` From 4e017fd740e17c4b512b7c9b6be85041ca1a8a12 Mon Sep 17 00:00:00 2001 From: Giles Gaskell Date: Thu, 12 Sep 2024 15:23:24 +1000 Subject: [PATCH 2/2] Fix heading in line with style guide and to please linter, as well as add word 'endpoint' for consistency across REST API docs. --- pages/apis/rest_api/packages/registry_tokens.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/apis/rest_api/packages/registry_tokens.md b/pages/apis/rest_api/packages/registry_tokens.md index e8a1ce7965..be8bf0e9a9 100644 --- a/pages/apis/rest_api/packages/registry_tokens.md +++ b/pages/apis/rest_api/packages/registry_tokens.md @@ -1,6 +1,6 @@ -# Registry Tokens API +# Registry tokens API -The registry tokens API lets you create and manage credentials needed to install and use packages in a registry. +The registry tokens API endpoint lets you create and manage credentials needed to install and use packages in a registry. ## List all registry tokens