From fc9cb23c4e8dc0ba7920ee0f2ee85bf52def0863 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:18:42 -0700 Subject: [PATCH 01/21] add test workflow --- .github/workflows/update-docs.yml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/update-docs.yml diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 00000000..50ff2014 --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,45 @@ +on: + push: + paths: + - 'openapi/yaml/*.yaml' + +jobs: + update-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout vast-cli + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run combine script + run: python combine_api_yamls.py + + - name: Convert YAML to JSON + run: | + # example: using yq + pip install yq + yq -o=json combined.yaml > openapi.json + + - name: Checkout docs repo + uses: actions/checkout@v3 + with: + repository: your-org/docs + token: ${{ secrets.DOCS_REPO_TOKEN }} + path: docs-repo + + - name: Copy openapi.json to docs + run: cp openapi.json docs-repo/openapi.json + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.DOCS_REPO_TOKEN }} + path: docs-repo + commit-message: 'Update openapi.json from vast-cli' + title: 'Automated update of openapi.json' + body: 'This PR updates the openapi.json based on latest changes in vast-cli.' \ No newline at end of file From 750af755bd99cf71f2606f5e96a1fda683225b5a Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:20:23 -0700 Subject: [PATCH 02/21] update description --- openapi/yaml/create_endpoint.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openapi/yaml/create_endpoint.yaml b/openapi/yaml/create_endpoint.yaml index 2758ab70..f4494c6c 100644 --- a/openapi/yaml/create_endpoint.yaml +++ b/openapi/yaml/create_endpoint.yaml @@ -15,13 +15,11 @@ paths: /api/v0/endptjobs/: post: summary: create endpoint - description: 'This endpoint creates a new job processing endpoint with specified + description: | + This endpoint creates a new job processing endpoint with specified parameters. - - CLI Usage: vast-ai create endpoint - - ' + CLI Usage: `vast-ai create endpoint` security: - BearerAuth: [] requestBody: From 45dea67027acf51d9e09da149e3503641ffbced7 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:24:33 -0700 Subject: [PATCH 03/21] Update --- .github/workflows/update-docs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 50ff2014..c43a52a6 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -13,9 +13,6 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 - - name: Install dependencies - run: pip install -r requirements.txt - - name: Run combine script run: python combine_api_yamls.py From 0f49b43b6116144ec751c932b060c883da2ce2cb Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:25:02 -0700 Subject: [PATCH 04/21] update --- openapi/yaml/change_bid.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/change_bid.yaml b/openapi/yaml/change_bid.yaml index aa9143ee..97d8bfee 100644 --- a/openapi/yaml/change_bid.yaml +++ b/openapi/yaml/change_bid.yaml @@ -10,7 +10,7 @@ paths: /api/v0/instances/bid_price/{id}/: put: summary: change bid - description: 'Change the current bid price of an instance to a specified price. + description: 'Change current bid price of an instance to a specified price. CLI Usage: vastai change bid id [--price PRICE]' security: From ba1dcf297ac1ac580790b53ac6878ed86de079b6 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:28:09 -0700 Subject: [PATCH 05/21] update --- .github/workflows/update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index c43a52a6..3cd21867 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -14,7 +14,7 @@ jobs: uses: actions/setup-python@v4 - name: Run combine script - run: python combine_api_yamls.py + run: python openapi/combine_api_yamls.py - name: Convert YAML to JSON run: | From 372ac52d1b4c886729ee0e777bede91e5db38ceb Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:28:34 -0700 Subject: [PATCH 06/21] Test --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c9049dcc..c75e006a 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts a cloud copy operation by sending a command to the remote + description: 'Starts cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 8c8fb2d303bcc040b3e8e5f4a66032ad9138f5f0 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:30:26 -0700 Subject: [PATCH 07/21] update --- .github/workflows/update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 3cd21867..c349e4c8 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -20,7 +20,7 @@ jobs: run: | # example: using yq pip install yq - yq -o=json combined.yaml > openapi.json + yq eval -o=json combined.yaml > openapi.json - name: Checkout docs repo uses: actions/checkout@v3 From e3e68b600f6851a832d9e8d0b27adb6c6b42d495 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:30:39 -0700 Subject: [PATCH 08/21] update --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c75e006a..289b1859 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts cloud copy operation by sending a command to the remote + description: 'Starts the cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 716bef65b709b4a260812489913b77d304ef2dcb Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:32:57 -0700 Subject: [PATCH 09/21] update --- .github/workflows/update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index c349e4c8..3cd21867 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -20,7 +20,7 @@ jobs: run: | # example: using yq pip install yq - yq eval -o=json combined.yaml > openapi.json + yq -o=json combined.yaml > openapi.json - name: Checkout docs repo uses: actions/checkout@v3 From d9ab59af412fa78008548f7adbb5756719be16bd Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:33:13 -0700 Subject: [PATCH 10/21] update --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index 289b1859..c75e006a 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts the cloud copy operation by sending a command to the remote + description: 'Starts cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From aa064108454ad9f6d88bc0c26fc3380098af058b Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:35:00 -0700 Subject: [PATCH 11/21] update --- .github/workflows/update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 3cd21867..76b9ebb4 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -20,7 +20,7 @@ jobs: run: | # example: using yq pip install yq - yq -o=json combined.yaml > openapi.json + yq . combined.yaml > openapi.json - name: Checkout docs repo uses: actions/checkout@v3 From 2a3b09a57a90dcc8806e060dbb6be36d17c785f9 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:35:17 -0700 Subject: [PATCH 12/21] Test --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c75e006a..c9049dcc 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts cloud copy operation by sending a command to the remote + description: 'Starts a cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From a33fcc86932f419d104aa47dc209f4ac98f17f98 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:36:26 -0700 Subject: [PATCH 13/21] Test --- .github/workflows/update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 76b9ebb4..7bd2e2eb 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -20,7 +20,7 @@ jobs: run: | # example: using yq pip install yq - yq . combined.yaml > openapi.json + yq . openapi/yaml/combined_api.yaml > openapi.json - name: Checkout docs repo uses: actions/checkout@v3 From 168602fd2b7ac2f951a2f020e5eca2db9713f456 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 15:36:54 -0700 Subject: [PATCH 14/21] update yaml --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c9049dcc..c75e006a 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts a cloud copy operation by sending a command to the remote + description: 'Starts cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 08b64866c20e95d0c584e1ec9701bad6ad65ee4a Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 16:00:03 -0700 Subject: [PATCH 15/21] test --- .github/workflows/update-docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index 7bd2e2eb..f97089c1 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -25,8 +25,8 @@ jobs: - name: Checkout docs repo uses: actions/checkout@v3 with: - repository: your-org/docs - token: ${{ secrets.DOCS_REPO_TOKEN }} + repository: vast-ai/docs + token: ${{ secrets.UPDATE_API_DOCS_TOKEN }} path: docs-repo - name: Copy openapi.json to docs @@ -35,7 +35,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.DOCS_REPO_TOKEN }} + token: ${{ secrets.UPDATE_API_DOCS_TOKEN }} path: docs-repo commit-message: 'Update openapi.json from vast-cli' title: 'Automated update of openapi.json' From 4e2ad2cdd0d0326acf7d075300b3dd42ec16d75a Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 16:00:16 -0700 Subject: [PATCH 16/21] test --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c75e006a..c9049dcc 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts cloud copy operation by sending a command to the remote + description: 'Starts a cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 8e046f65f3de4c60b2689356eaf0f59ac3f07fb5 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 16:01:52 -0700 Subject: [PATCH 17/21] test --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c9049dcc..c75e006a 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts a cloud copy operation by sending a command to the remote + description: 'Starts cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 2df9fc19db420055a4b98319d19340e12d715992 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 16:09:43 -0700 Subject: [PATCH 18/21] test --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c75e006a..c9049dcc 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts cloud copy operation by sending a command to the remote + description: 'Starts a cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 7260604f92dd84c7fecd70f0b1c2f6b88d2e3c18 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 16:13:51 -0700 Subject: [PATCH 19/21] test --- .github/workflows/update-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index f97089c1..e4a5ea70 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -30,7 +30,7 @@ jobs: path: docs-repo - name: Copy openapi.json to docs - run: cp openapi.json docs-repo/openapi.json + run: cp openapi.json docs-repo/api-reference/openapi.json - name: Create Pull Request uses: peter-evans/create-pull-request@v5 From bbfdc01b301b043f21092743ad005eaa897293cb Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Tue, 14 Oct 2025 16:14:03 -0700 Subject: [PATCH 20/21] Test --- openapi/yaml/cloud_copy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/cloud_copy.yaml b/openapi/yaml/cloud_copy.yaml index c9049dcc..c75e006a 100644 --- a/openapi/yaml/cloud_copy.yaml +++ b/openapi/yaml/cloud_copy.yaml @@ -6,7 +6,7 @@ paths: /api/v0/commands/rclone/: post: summary: cloud copy - description: 'Starts a cloud copy operation by sending a command to the remote + description: 'Starts cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service. ' From 8525de306f4de79714be806fd614eeb0ebcaef2e Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 15 Oct 2025 12:03:20 -0700 Subject: [PATCH 21/21] remove period --- openapi/yaml/start_instances.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/yaml/start_instances.yaml b/openapi/yaml/start_instances.yaml index a79ca5f1..442ef448 100644 --- a/openapi/yaml/start_instances.yaml +++ b/openapi/yaml/start_instances.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Vast.ai Start Instances API - description: API endpoint to start a list of instances on Vast.ai. + description: API endpoint to start a list of instances on Vast.ai version: 1.0.0 servers: - url: https://console.vast.ai