From afe2e0fb01d1886962d52fcfa7cc6e075e151616 Mon Sep 17 00:00:00 2001 From: Bryce Date: Wed, 26 Nov 2025 14:51:23 -0800 Subject: [PATCH 1/4] external volumes tasks --- platform/api.yml | 2 + .../external-volumes/bulkTasks.yml | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 platform/paths/infrastructure/external-volumes/bulkTasks.yml diff --git a/platform/api.yml b/platform/api.yml index 67a1c69a..f9a8ce70 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -586,6 +586,8 @@ paths: ## External Volumes "/v1/infrastructure/external-volumes": $ref: "./paths/infrastructure/external-volumes/external-volumes.yml" + "/v1/infrastructure/external-volumes/tasks": + $ref: "./paths/infrastructure/external-volumes/bulkTasks.yml" "/v1/infrastructure/external-volumes/{externalVolumeId}": $ref: "./paths/infrastructure/external-volumes/external-volume.yml" "/v1/infrastructure/external-volumes/sources": diff --git a/platform/paths/infrastructure/external-volumes/bulkTasks.yml b/platform/paths/infrastructure/external-volumes/bulkTasks.yml new file mode 100644 index 00000000..6f365b86 --- /dev/null +++ b/platform/paths/infrastructure/external-volumes/bulkTasks.yml @@ -0,0 +1,49 @@ +post: + operationId: "createExternalVolumesJob" + summary: Create External Volumes Job + description: | + Requires the `external-volumes-manage` capability. + tags: + - External Volumes + parameters: [] + requestBody: + description: Parameters for creating a new external volumes job. + content: + application/json: + schema: + type: object + required: + - action + - contents + properties: + action: + type: string + description: The action for the external volumes job. + enum: + - scan + contents: + type: object + description: Scan options used by the platform to create the Job. + required: + - cluster + properties: + cluster: + type: string + description: | + ID of the cluster to scan for external volumes. + + responses: + 202: + description: Returns a job descriptor. + content: + application/json: + schema: + title: "TaskResponse" + type: object + required: + - data + properties: + data: + $ref: ../../../../components/schemas/jobs/JobDescriptor.yml + default: + $ref: ../../../../components/responses/errors/DefaultError.yml From a39fe5db18a4fa6cd666d9ff5e3094dc856a7be8 Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 2 Dec 2025 07:09:09 -0800 Subject: [PATCH 2/4] add description --- platform/paths/infrastructure/external-volumes/bulkTasks.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/paths/infrastructure/external-volumes/bulkTasks.yml b/platform/paths/infrastructure/external-volumes/bulkTasks.yml index 6f365b86..37857ceb 100644 --- a/platform/paths/infrastructure/external-volumes/bulkTasks.yml +++ b/platform/paths/infrastructure/external-volumes/bulkTasks.yml @@ -2,6 +2,8 @@ post: operationId: "createExternalVolumesJob" summary: Create External Volumes Job description: | + Create a job for external volumes. + Requires the `external-volumes-manage` capability. tags: - External Volumes From e6151c4fdccfb8eca0b4f522c6792960aa61bafc Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 2 Dec 2025 07:38:18 -0800 Subject: [PATCH 3/4] refactor --- .../rootTasks/ExternalVolumesScanAction.yml | 21 +++++++++++++++++++ .../rootTasks/ExternalVolumesTask.yml | 7 +++++++ platform/api.yml | 4 ++-- .../images/{bulkTasks.yml => rootTasks.yml} | 2 +- .../{bulkTasks.yml => rootTasks.yml} | 21 +------------------ 5 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml create mode 100644 components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesTask.yml rename platform/paths/images/{bulkTasks.yml => rootTasks.yml} (98%) rename platform/paths/infrastructure/external-volumes/{bulkTasks.yml => rootTasks.yml} (56%) diff --git a/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml new file mode 100644 index 00000000..196af152 --- /dev/null +++ b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml @@ -0,0 +1,21 @@ +title: ExternalVolumesScanAction +description: A task to reconfigure mountable destination servers for external volume. +type: object +required: + - action +properties: + action: + type: string + description: The action for the external volumes job. + enum: + - scan + contents: + type: object + description: Scan options used by the platform to create the job. + required: + - cluster + properties: + cluster: + type: string + description: | + ID of the cluster to scan for external volumes. diff --git a/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesTask.yml b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesTask.yml new file mode 100644 index 00000000..2c06a822 --- /dev/null +++ b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesTask.yml @@ -0,0 +1,7 @@ +title: ExternalVolumesTask +discriminator: + propertyName: action + mapping: + scan: ExternalVolumesScanAction.yml +oneOf: + - $ref: ExternalVolumesScanAction.yml diff --git a/platform/api.yml b/platform/api.yml index f9a8ce70..6e722ac4 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -563,7 +563,7 @@ paths: "/v1/images/{imageId}/build-log": $ref: "./paths/images/buildLog.yml" "/v1/images/tasks": - $ref: paths/images/bulkTasks.yml + $ref: paths/images/rootTasks.yml "/v1/images/{imageId}/tasks": $ref: "./paths/images/tasks.yml" @@ -587,7 +587,7 @@ paths: "/v1/infrastructure/external-volumes": $ref: "./paths/infrastructure/external-volumes/external-volumes.yml" "/v1/infrastructure/external-volumes/tasks": - $ref: "./paths/infrastructure/external-volumes/bulkTasks.yml" + $ref: "./paths/infrastructure/external-volumes/rootTasks.yml" "/v1/infrastructure/external-volumes/{externalVolumeId}": $ref: "./paths/infrastructure/external-volumes/external-volume.yml" "/v1/infrastructure/external-volumes/sources": diff --git a/platform/paths/images/bulkTasks.yml b/platform/paths/images/rootTasks.yml similarity index 98% rename from platform/paths/images/bulkTasks.yml rename to platform/paths/images/rootTasks.yml index 0aff2fce..c6e1ccc8 100644 --- a/platform/paths/images/bulkTasks.yml +++ b/platform/paths/images/rootTasks.yml @@ -25,7 +25,7 @@ post: - prune contents: type: object - description: Additional contents needed by the platform to create the Job. + description: Additional contents needed by the platform to create the job. required: - source_ids properties: diff --git a/platform/paths/infrastructure/external-volumes/bulkTasks.yml b/platform/paths/infrastructure/external-volumes/rootTasks.yml similarity index 56% rename from platform/paths/infrastructure/external-volumes/bulkTasks.yml rename to platform/paths/infrastructure/external-volumes/rootTasks.yml index 37857ceb..a6a52003 100644 --- a/platform/paths/infrastructure/external-volumes/bulkTasks.yml +++ b/platform/paths/infrastructure/external-volumes/rootTasks.yml @@ -13,26 +13,7 @@ post: content: application/json: schema: - type: object - required: - - action - - contents - properties: - action: - type: string - description: The action for the external volumes job. - enum: - - scan - contents: - type: object - description: Scan options used by the platform to create the Job. - required: - - cluster - properties: - cluster: - type: string - description: | - ID of the cluster to scan for external volumes. + $ref: ../../../../components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesTask.yml responses: 202: From d56191bf3616e8c43719b459f37637f5789962e1 Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 2 Dec 2025 07:42:31 -0800 Subject: [PATCH 4/4] update description --- .../external-volumes/rootTasks/ExternalVolumesScanAction.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml index 196af152..7f66fe5d 100644 --- a/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml +++ b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml @@ -1,5 +1,5 @@ title: ExternalVolumesScanAction -description: A task to reconfigure mountable destination servers for external volume. +description: A task to scan for available external volumes on a given cluster. type: object required: - action