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..7f66fe5d --- /dev/null +++ b/components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesScanAction.yml @@ -0,0 +1,21 @@ +title: ExternalVolumesScanAction +description: A task to scan for available external volumes on a given cluster. +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 67a1c69a..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" @@ -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/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/rootTasks.yml b/platform/paths/infrastructure/external-volumes/rootTasks.yml new file mode 100644 index 00000000..a6a52003 --- /dev/null +++ b/platform/paths/infrastructure/external-volumes/rootTasks.yml @@ -0,0 +1,32 @@ +post: + operationId: "createExternalVolumesJob" + summary: Create External Volumes Job + description: | + Create a job for external volumes. + + Requires the `external-volumes-manage` capability. + tags: + - External Volumes + parameters: [] + requestBody: + description: Parameters for creating a new external volumes job. + content: + application/json: + schema: + $ref: ../../../../components/schemas/infrastructure/external-volumes/rootTasks/ExternalVolumesTask.yml + + 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