From dd0cb89fff1cf4641c25dd3a53e33cb7f2c65159 Mon Sep 17 00:00:00 2001
From: Elizabeth Vo <65384387+ensvo@users.noreply.github.com>
Date: Thu, 12 Sep 2024 03:26:35 +0900
Subject: [PATCH 1/4] api docs for package create
---
pages/apis/rest_api/packages/packages.md | 43 ++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/pages/apis/rest_api/packages/packages.md b/pages/apis/rest_api/packages/packages.md
index 49bf31cbd9..d84bebfcdc 100644
--- a/pages/apis/rest_api/packages/packages.md
+++ b/pages/apis/rest_api/packages/packages.md
@@ -2,6 +2,49 @@
The packages tokens API lets you create and manage packages in a registry.
+## Upload a package
+
+```bash
+curl -H "Authorization: Bearer $TOKEN" \
+ -X POST "https://api.buildkite.com/v2/packages/organizations/#{org.slug}/registries/#{registry.slug}/packages" \
+ -H "Content-Type: application/json" \
+ -F 'file=@path/to/ruby/gem/banana-1.0.0.gem'
+```
+
+```json
+{
+ "id": "0191e23a-4bc8-7683-bfa4-5f73bc9b7c44",
+ "url": "https://api.buildkite.com/v2/packages/organizations/my_great_org/registries/my-registry/packages/0191e23a-4bc8-7683-bfa4-5f73bc9b7c44",
+ "web_url": "https://buildkite.com/organizations/my_great_org/packages/registries/my-registry/packages/0191e23a-4bc8-7683-bfa4-5f73bc9b7c44",
+ "name": "banana",
+ "organization": {
+ "id": "0190e784-eeb7-4ce4-9d2d-87f7aba85433",
+ "slug": "my_great_org",
+ "url": "https://api.buildkite.com/v2/organizations/my_great_org",
+ "web_url": "https://buildkite.com/my_great_org"
+ },
+ "registry": {
+ "id": "0191e238-e0a3-7b0b-bb34-beea0035a39d",
+ "graphql_id": "UmVnaXN0cnktLS0wMTkxZTIzOC1lMGEzLTdiMGItYmIzNC1iZWVhMDAzNWEzOWQ=",
+ "slug": "my-registry",
+ "url": "https://api.buildkite.com/v2/packages/organizations/my_great_org/registries/my-registry",
+ "web_url": "https://buildkite.com/organizations/my_great_org/packages/registries/my-registry"
+ }
+}
+```
+
+Required request form-field content:
+
+
+
+ file | Path to the package. Example: "file=@path/to/ruby/gem/banana-1.0.0.gem" . |
+
+
+
+Required scope: `create_packages`
+
+Success response: `200 OK`
+
## Get a package
Returns the details for a single package.
From 295d3342fc39bc2085c9be3b3ef4d8b0b31e3d44 Mon Sep 17 00:00:00 2001
From: Elizabeth Vo <65384387+ensvo@users.noreply.github.com>
Date: Thu, 12 Sep 2024 12:55:14 +0900
Subject: [PATCH 2/4] reword upload to publish
---
pages/apis/rest_api/packages/packages.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pages/apis/rest_api/packages/packages.md b/pages/apis/rest_api/packages/packages.md
index d84bebfcdc..eef01cb25f 100644
--- a/pages/apis/rest_api/packages/packages.md
+++ b/pages/apis/rest_api/packages/packages.md
@@ -2,7 +2,7 @@
The packages tokens API lets you create and manage packages in a registry.
-## Upload a package
+## Publish a package
```bash
curl -H "Authorization: Bearer $TOKEN" \
From 24d4bda7aed7bf5dd26a72999c523c24988e39c0 Mon Sep 17 00:00:00 2001
From: Giles Gaskell
Date: Thu, 12 Sep 2024 15:04:11 +1000
Subject: [PATCH 3/4] Fix nav.
---
data/nav.yml | 7 -------
1 file changed, 7 deletions(-)
diff --git a/data/nav.yml b/data/nav.yml
index 1e0af20a81..f3a7c62f58 100644
--- a/data/nav.yml
+++ b/data/nav.yml
@@ -557,19 +557,12 @@
- name: "Members"
path: "apis/rest-api/organizations/members"
pill: "beta"
-<<<<<<< HEAD
- - name: "Packages"
- children:
- - name: "Packages"
- path: "apis/rest-api/packages/packages"
-=======
- name: "Packages "
# Keep space at end to prevent "Packages" in global nav bar being
# highlighted when any child page of "API > REST > Packages" is selected.
children:
- name: "Registries"
path: "apis/rest-api/packages/registries"
->>>>>>> docs-public/main
- name: "Pipelines "
# Keep space at end to prevent "Pipelines" in global nav bar being
# highlighted when any child page of "API > REST > Pipelines" is selected.
From a3d40222de970d21a50ea05da0c8496bf3f5b009 Mon Sep 17 00:00:00 2001
From: Elizabeth Vo <65384387+ensvo@users.noreply.github.com>
Date: Fri, 13 Sep 2024 08:56:06 +0900
Subject: [PATCH 4/4] Fix typo for packages API endpoint
Co-authored-by: Giles Gas
---
pages/apis/rest_api/packages/packages.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pages/apis/rest_api/packages/packages.md b/pages/apis/rest_api/packages/packages.md
index eef01cb25f..f64a29cab2 100644
--- a/pages/apis/rest_api/packages/packages.md
+++ b/pages/apis/rest_api/packages/packages.md
@@ -1,6 +1,6 @@
# Packages API
-The packages tokens API lets you create and manage packages in a registry.
+The packages API endpoint lets you create and manage packages in a registry.
## Publish a package