From 49e5edd9f1e1835d66ced64a6ee394e6d45f9807 Mon Sep 17 00:00:00 2001
From: Elizabeth Vo <65384387+ensvo@users.noreply.github.com>
Date: Wed, 11 Sep 2024 16:00:51 +0900
Subject: [PATCH 1/2] api docs for registry create
---
pages/apis/rest_api/packages/registries.md | 54 +++++++++++++++++++++-
1 file changed, 52 insertions(+), 2 deletions(-)
diff --git a/pages/apis/rest_api/packages/registries.md b/pages/apis/rest_api/packages/registries.md
index 33b264021b..765716bd1e 100644
--- a/pages/apis/rest_api/packages/registries.md
+++ b/pages/apis/rest_api/packages/registries.md
@@ -2,6 +2,56 @@
The registries API lets you create and manage registries in your organization.
+## Create a registry
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+ -X POST "https://api.buildkite.com/v2/packages/organizations/#{org.slug}/registries" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "my registry",
+ "ecosystem": "ruby"
+ }'
+```
+
+```json
+{
+ "id": "0191df84-85e4-77aa-83ba-6579084728eb",
+ "graphql_id": "UmVnaXN0cnktLS0wMTkxZGY4NC04NWU0LTc3YWEtODNiYS02NTc5MDg0NzI4ZWI=",
+ "slug": "my-registry",
+ "url": "https://api.buildkite.com/v2/packages/organizations/my-org/registries/my-registry",
+ "web_url": "https://buildkite.com/organizations/my-org/registries/my-registry",
+ "name": "my registry",
+ "ecosystem": "ruby",
+ "description": null,
+ "emoji": null,
+ "color": null,
+ "public": false,
+ "oidc_policy": null
+}
+```
+
+Required [request body properties](/docs/api#request-body-properties):
+
+
+
+ name | Name of the new registry. Example: "my registry" . |
+ ecosystem | Registry ecosystem based on the package ecosystem for the new registry. Example: "ruby" . |
+
+
+
+Optional [request body properties](/docs/api#request-body-properties):
+
+
+
+ description | Description of the registry. Default value: null . |
+
+
+
+Required scope: `create_registries`
+
+Success response: `200 OK`
+
## List all registries
Returns a list of an organization's registries.
@@ -21,7 +71,7 @@ curl -H "Authorization: Bearer $TOKEN" \
"web_url": "https://buildkite.com/organizations/my-org/packages/registries/my-registry",
"name": "my registry",
"ecosystem": "ruby",
- "description": "registry containing ruby gems",
+ "description": null,
"emoji": null,
"color": null,
"public": false,
@@ -52,7 +102,7 @@ curl -H "Authorization: Bearer $TOKEN" \
"web_url": "https://buildkite.com/organizations/my-org/registries/my-registry",
"name": "my registry",
"ecosystem": "ruby",
- "description": "registry containing ruby gems",
+ "description": null,
"emoji": null,
"color": null,
"public": false,
From ca53b43eec8e7a630aef8644a1ffe877b9cd8fe2 Mon Sep 17 00:00:00 2001
From: Elizabeth Vo <65384387+ensvo@users.noreply.github.com>
Date: Wed, 11 Sep 2024 16:14:12 +0900
Subject: [PATCH 2/2] api docs for registry update
---
pages/apis/rest_api/packages/registries.md | 53 ++++++++++++++++++++--
1 file changed, 48 insertions(+), 5 deletions(-)
diff --git a/pages/apis/rest_api/packages/registries.md b/pages/apis/rest_api/packages/registries.md
index 765716bd1e..33fc90093a 100644
--- a/pages/apis/rest_api/packages/registries.md
+++ b/pages/apis/rest_api/packages/registries.md
@@ -10,7 +10,8 @@ curl -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my registry",
- "ecosystem": "ruby"
+ "ecosystem": "ruby",
+ "description": "registry containing ruby gems"
}'
```
@@ -23,7 +24,7 @@ curl -H "Authorization: Bearer $TOKEN" \
"web_url": "https://buildkite.com/organizations/my-org/registries/my-registry",
"name": "my registry",
"ecosystem": "ruby",
- "description": null,
+ "description": "registry containing ruby gems",
"emoji": null,
"color": null,
"public": false,
@@ -71,7 +72,7 @@ curl -H "Authorization: Bearer $TOKEN" \
"web_url": "https://buildkite.com/organizations/my-org/packages/registries/my-registry",
"name": "my registry",
"ecosystem": "ruby",
- "description": null,
+ "description": "registry containing ruby gems",
"emoji": null,
"color": null,
"public": false,
@@ -102,7 +103,7 @@ curl -H "Authorization: Bearer $TOKEN" \
"web_url": "https://buildkite.com/organizations/my-org/registries/my-registry",
"name": "my registry",
"ecosystem": "ruby",
- "description": null,
+ "description": "registry containing ruby gems",
"emoji": null,
"color": null,
"public": false,
@@ -112,4 +113,46 @@ curl -H "Authorization: Bearer $TOKEN" \
Required scope: `read_registries`
-Success response: `200 OK`
\ No newline at end of file
+Success response: `200 OK`
+
+## Update a registry
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+ -X POST "https://api.buildkite.com/v2/packages/organizations/#{org.slug}/registries/#{registry.slug}" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "my registry",
+ "description": "registry containing ruby gems"
+ }'
+```
+
+```json
+{
+ "id": "0191df84-85e4-77aa-83ba-6579084728eb",
+ "graphql_id": "UmVnaXN0cnktLS0wMTkxZGY4NC04NWU0LTc3YWEtODNiYS02NTc5MDg0NzI4ZWI=",
+ "slug": "my-registry",
+ "url": "https://api.buildkite.com/v2/packages/organizations/my-org/registries/my-registry",
+ "web_url": "https://buildkite.com/organizations/my-org/registries/my-registry",
+ "name": "my registry",
+ "ecosystem": "ruby",
+ "description": "registry containing ruby gems",
+ "emoji": null,
+ "color": null,
+ "public": false,
+ "oidc_policy": null
+}
+```
+
+Optional [request body properties](/docs/api#request-body-properties):
+
+
+
+ name | Name of the registry. Example: my registry . |
+ description | Description of the registry. Example: registry containing ruby gems . |
+
+
+
+Required scope: `write_registries`
+
+Success response: `200 OK`