From 7004db2ad2754ac024db590e04d43e2989188c4d Mon Sep 17 00:00:00 2001 From: Bryce Date: Thu, 6 Nov 2025 13:02:04 -0800 Subject: [PATCH 1/2] volumes revision --- .../schemas/containers/ContainerSummary.yml | 26 +++++++++++++++++++ .../containers/config/ContainerVolume.yml | 5 ---- .../containers/summaries/VolumeSummary.yml | 5 +++- .../external-volumes/ExternalVolumeMeta.yml | 6 +++-- .../ExternalVolumeOptions.yml | 11 ++++++-- .../volumes/VirtualMachineVolumeConfig.yml | 5 ---- .../external-volumes/external-volume.yml | 2 +- .../external-volumes/external-volumes.yml | 2 +- stackspec/schema/StackSpecContainerVolume.yml | 6 ++--- 9 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 components/schemas/containers/ContainerSummary.yml diff --git a/components/schemas/containers/ContainerSummary.yml b/components/schemas/containers/ContainerSummary.yml new file mode 100644 index 00000000..0c172d8e --- /dev/null +++ b/components/schemas/containers/ContainerSummary.yml @@ -0,0 +1,26 @@ +title: ContainerSummary +type: object +description: Lightweight summary of a container for environment pages and lists. +required: + - id + - name + - state + - image + - environment + - volumes +properties: + id: + $ref: "../ID.yml" + name: + type: string + description: A user defined name for the container. + state: + $ref: "./ContainerState.yml" + image: + $ref: "./summaries/ImageSummary.yml" + environment: + $ref: "./summaries/ContainerEnvironmentSummary.yml" + volumes: + type: array + items: + $ref: "./summaries/VolumeSummary.yml" diff --git a/components/schemas/containers/config/ContainerVolume.yml b/components/schemas/containers/config/ContainerVolume.yml index 407daec3..0789ac6e 100644 --- a/components/schemas/containers/config/ContainerVolume.yml +++ b/components/schemas/containers/config/ContainerVolume.yml @@ -37,11 +37,6 @@ properties: anyOf: - type: object properties: - identifier: - oneOf: - - $ref: ../../Identifier.yml - - type: "null" - description: The identifier of the external volume. id: oneOf: - $ref: ../../ID.yml diff --git a/components/schemas/containers/summaries/VolumeSummary.yml b/components/schemas/containers/summaries/VolumeSummary.yml index 0dc21e23..ed46f3b2 100644 --- a/components/schemas/containers/summaries/VolumeSummary.yml +++ b/components/schemas/containers/summaries/VolumeSummary.yml @@ -16,5 +16,8 @@ properties: external: description: The ID of external volume, if applicable. oneOf: - - $ref: ../../ID.yml + - type: object + properties: + id: + $ref: ../../ID.yml - type: "null" diff --git a/components/schemas/infrastructure/external-volumes/ExternalVolumeMeta.yml b/components/schemas/infrastructure/external-volumes/ExternalVolumeMeta.yml index 237f7954..bf24c843 100644 --- a/components/schemas/infrastructure/external-volumes/ExternalVolumeMeta.yml +++ b/components/schemas/infrastructure/external-volumes/ExternalVolumeMeta.yml @@ -2,5 +2,7 @@ title: ExternalVolumeMeta type: object description: A list of meta fields that can be applied to an attached volume. properties: - container: - $ref: ../../containers/Container.yml + containers: + type: array + items: + $ref: ../../containers/ContainerSummary.yml diff --git a/components/schemas/infrastructure/external-volumes/ExternalVolumeOptions.yml b/components/schemas/infrastructure/external-volumes/ExternalVolumeOptions.yml index c67cda30..4bb2f212 100644 --- a/components/schemas/infrastructure/external-volumes/ExternalVolumeOptions.yml +++ b/components/schemas/infrastructure/external-volumes/ExternalVolumeOptions.yml @@ -5,6 +5,13 @@ required: - create properties: create: - type: boolean description: > - If the volume doesn't exist, attempt to create it on container start. + If the volume doesn't exist, attempt to create it on container start if create struct defined. + oneOf: + - type: object + required: [size] + properties: + size: + description: Indicates the size of volume to create. + $ref: ../../DataSize.yml + - type: "null" diff --git a/components/schemas/vms/config/volumes/VirtualMachineVolumeConfig.yml b/components/schemas/vms/config/volumes/VirtualMachineVolumeConfig.yml index 8e7389f5..4ee0eec1 100644 --- a/components/schemas/vms/config/volumes/VirtualMachineVolumeConfig.yml +++ b/components/schemas/vms/config/volumes/VirtualMachineVolumeConfig.yml @@ -27,11 +27,6 @@ properties: anyOf: - type: object properties: - identifier: - oneOf: - - $ref: ../../../Identifier.yml - - type: "null" - description: The identifier of the external volume. id: oneOf: - $ref: ../../../ID.yml diff --git a/platform/paths/infrastructure/external-volumes/external-volume.yml b/platform/paths/infrastructure/external-volumes/external-volume.yml index 1fb3cabc..6209bd8e 100644 --- a/platform/paths/infrastructure/external-volumes/external-volume.yml +++ b/platform/paths/infrastructure/external-volumes/external-volume.yml @@ -26,7 +26,7 @@ get: items: type: string enum: - - container + - containers responses: 200: description: Returns the requested virtual machine. diff --git a/platform/paths/infrastructure/external-volumes/external-volumes.yml b/platform/paths/infrastructure/external-volumes/external-volumes.yml index 4d00aaa7..6630a029 100644 --- a/platform/paths/infrastructure/external-volumes/external-volumes.yml +++ b/platform/paths/infrastructure/external-volumes/external-volumes.yml @@ -19,7 +19,7 @@ get: items: type: string enum: - - container + - containers - name: filter in: query # Deep nested arrays are undefined https://github.com/OAI/OpenAPI-Specification/issues/1706 diff --git a/stackspec/schema/StackSpecContainerVolume.yml b/stackspec/schema/StackSpecContainerVolume.yml index 0fa5772a..eb83c2dc 100644 --- a/stackspec/schema/StackSpecContainerVolume.yml +++ b/stackspec/schema/StackSpecContainerVolume.yml @@ -31,12 +31,12 @@ properties: required: - mode properties: - identifier: + id: oneOf: - - $ref: ../../components/schemas/Identifier.yml + - $ref: ../../components/schemas/Id.yml - $ref: StackVariable.yml - type: "null" - description: The identifier of the external volume. + description: The ID of the external volume. mode: oneOf: - type: string From e874c7e2ec0817bf76301eb117e35c527a3a5d56 Mon Sep 17 00:00:00 2001 From: Bryce Date: Thu, 6 Nov 2025 13:04:38 -0800 Subject: [PATCH 2/2] capitalization --- stackspec/schema/StackSpecContainerVolume.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackspec/schema/StackSpecContainerVolume.yml b/stackspec/schema/StackSpecContainerVolume.yml index eb83c2dc..adf0ce36 100644 --- a/stackspec/schema/StackSpecContainerVolume.yml +++ b/stackspec/schema/StackSpecContainerVolume.yml @@ -33,7 +33,7 @@ properties: properties: id: oneOf: - - $ref: ../../components/schemas/Id.yml + - $ref: ../../components/schemas/ID.yml - $ref: StackVariable.yml - type: "null" description: The ID of the external volume.