diff --git a/components/schemas/containers/config/ContainerVolume.yml b/components/schemas/containers/config/ContainerVolume.yml index 5683b5ac..407daec3 100644 --- a/components/schemas/containers/config/ContainerVolume.yml +++ b/components/schemas/containers/config/ContainerVolume.yml @@ -36,18 +36,17 @@ properties: external: anyOf: - type: object - required: - - mode properties: identifier: oneOf: - $ref: ../../Identifier.yml - type: "null" description: The identifier of the external volume. - mode: - type: string - description: The attachment mode for the external volume - enum: [instance, host] + id: + oneOf: + - $ref: ../../ID.yml + - type: "null" + description: The id of the external volume. - type: "null" destination: type: string diff --git a/components/schemas/infrastructure/external-volumes/ExternalVolume.yml b/components/schemas/infrastructure/external-volumes/ExternalVolume.yml index b86b91d6..0d4310da 100644 --- a/components/schemas/infrastructure/external-volumes/ExternalVolume.yml +++ b/components/schemas/infrastructure/external-volumes/ExternalVolume.yml @@ -11,6 +11,7 @@ required: - about - cluster - location_id + - server_ids - source - options - state @@ -28,23 +29,25 @@ properties: cluster: $ref: "../../Identifier.yml" identifier: - anyOf: + oneOf: - $ref: "../../Identifier.yml" - type: "null" location_id: $ref: "../../ID.yml" + server_ids: + type: array + items: + $ref: "../../ID.yml" source: $ref: "./sources/ExternalVolumeSource.yml" attachment: description: Information about the resource the external volume is currently attached to. - anyOf: - - $ref: "./ExternalVolumeAttachment.yml" - - type: "null" + $ref: "./attachment/ExternalVolumeAttachment.yml" size: description: > Size of the external volume; may be null or omitted if the size has not yet been determined. - anyOf: + oneOf: - $ref: "../../DataSize.yml" - type: "null" options: diff --git a/components/schemas/infrastructure/external-volumes/ExternalVolumeAttachment.yml b/components/schemas/infrastructure/external-volumes/ExternalVolumeAttachment.yml deleted file mode 100644 index 5a1a7cb0..00000000 --- a/components/schemas/infrastructure/external-volumes/ExternalVolumeAttachment.yml +++ /dev/null @@ -1,22 +0,0 @@ -title: ExternalVolumeAttachment -type: object -description: > - Represents where the volume is currently attached. -required: - - mode - - server_id - - container_id - - instance_id -properties: - mode: - type: string - description: The mode of attachment. `instance` means attached to a single container instance, while `host` makes it available across multiple containers on the same host. - enum: - - instance - - host - server_id: - $ref: "../../ID.yml" - container_id: - $ref: "../../ID.yml" - instance_id: - $ref: "../../ID.yml" diff --git a/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachment.yml b/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachment.yml new file mode 100644 index 00000000..009c8402 --- /dev/null +++ b/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachment.yml @@ -0,0 +1,11 @@ +title: ExternalVolumeAttachment +type: object +description: Attachment configuration for an external volume. +discriminator: + propertyName: type + mapping: + block: ./ExternalVolumeAttachmentBlock.yml + filesystem: ./ExternalVolumeAttachmentFileSystem.yml +oneOf: + - $ref: ./ExternalVolumeAttachmentBlock.yml + - $ref: ./ExternalVolumeAttachmentFileSystem.yml diff --git a/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachmentBlock.yml b/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachmentBlock.yml new file mode 100644 index 00000000..1c940380 --- /dev/null +++ b/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachmentBlock.yml @@ -0,0 +1,24 @@ +title: ExternalVolumeAttachmentBlock +type: object +description: Configuration for a block volume attachment. +required: [type, mode, details] +properties: + type: + type: string + enum: [block] + mode: + type: string + description: The access mode for the attachment. + enum: + - single-instance-writer + - single-instance-read-only + - single-node-writer + - single-node-read-only + - multi-node-writer + - multi-node-read-only + details: + type: object + description: Details for a block attachment. Present when `type` is `block`. + # No fields today, reserved for future expansion + properties: {} + additionalProperties: false diff --git a/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachmentFileSystem.yml b/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachmentFileSystem.yml new file mode 100644 index 00000000..72414a38 --- /dev/null +++ b/components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachmentFileSystem.yml @@ -0,0 +1,24 @@ +title: ExternalVolumeAttachmentFileSystem +type: object +description: Configuration for a filesystem volume attachment. +required: [type, mode, details] +properties: + type: + type: string + enum: [filesystem] + mode: + type: string + description: The access mode for the attachment. + enum: + - single-instance-writer + - single-instance-read-only + - single-node-writer + - single-node-read-only + - multi-node-writer + - multi-node-read-only + details: + type: object + description: Details for a filesystem attachment. Present when `type` is `filesystem`. + # No fields today, reserved for future expansion + properties: {} + additionalProperties: false diff --git a/components/schemas/infrastructure/external-volumes/tasks/ExternalVolumeAttachAction.yml b/components/schemas/infrastructure/external-volumes/tasks/ExternalVolumeAttachAction.yml index 77836e2f..b84ad001 100644 --- a/components/schemas/infrastructure/external-volumes/tasks/ExternalVolumeAttachAction.yml +++ b/components/schemas/infrastructure/external-volumes/tasks/ExternalVolumeAttachAction.yml @@ -11,9 +11,4 @@ properties: - attach description: The name of the action to perform (attach). contents: - type: object - required: - - instance_id - properties: - instance_id: - $ref: ../../../ID.yml + $ref: ../attachment/ExternalVolumeAttachment.yml diff --git a/platform/api.yml b/platform/api.yml index 6114ea4c..23acaa6a 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -649,14 +649,6 @@ paths: "/v1/infrastructure/servers/{serverId}/console": $ref: "./paths/infrastructure/servers/console.yml" - ## SANs - "/v1/infrastructure/san/targets": - $ref: "./paths/infrastructure/san/targets/targets.yml" - "/v1/infrastructure/san/luns": - $ref: "./paths/infrastructure/san/luns/luns.yml" - "/v1/infrastructure/san/tasks": - $ref: "./paths/infrastructure/san/tasks.yml" - ## IPs "/v1/infrastructure/ips/pools": $ref: "./paths/infrastructure/ips/pools.yml" diff --git a/platform/paths/infrastructure/external-volumes/external-volumes.yml b/platform/paths/infrastructure/external-volumes/external-volumes.yml index 4bd40dfe..4d00aaa7 100644 --- a/platform/paths/infrastructure/external-volumes/external-volumes.yml +++ b/platform/paths/infrastructure/external-volumes/external-volumes.yml @@ -87,6 +87,8 @@ post: - name - cluster - location_id + - server_ids + - attachment - source - options properties: @@ -106,8 +108,15 @@ post: description: The cluster this external volume is associated with. location_id: $ref: ../../../../components/schemas/ID.yml + server_ids: + type: array + items: + $ref: ../../../../components/schemas/ID.yml source: $ref: ../../../../components/schemas/infrastructure/external-volumes/sources/ExternalVolumeSource.yml + attachment: + description: Information about the resource the external volume is currently attached to. + $ref: "../../../../components/schemas/infrastructure/external-volumes/attachment/ExternalVolumeAttachment.yml" options: $ref: ../../../../components/schemas/infrastructure/external-volumes/ExternalVolumeOptions.yml about: diff --git a/platform/paths/infrastructure/san/includes/SanLunIncludes.yml b/platform/paths/infrastructure/san/includes/SanLunIncludes.yml deleted file mode 100644 index 31258f47..00000000 --- a/platform/paths/infrastructure/san/includes/SanLunIncludes.yml +++ /dev/null @@ -1,8 +0,0 @@ -title: SanLunIncludes -description: All includable resources linkable to the given LUN. -type: object -properties: - targets: - type: object - additionalProperties: - $ref: ../../../../../components/schemas/infrastructure/san/targets/SanTarget.yml diff --git a/platform/paths/infrastructure/san/luns/luns.yml b/platform/paths/infrastructure/san/luns/luns.yml deleted file mode 100644 index c439bc59..00000000 --- a/platform/paths/infrastructure/san/luns/luns.yml +++ /dev/null @@ -1,85 +0,0 @@ -get: - operationId: "getSanLuns" - summary: Get SAN LUNs - description: Lists any SAN LUNs available for the hub. - security: - - bearerAuth: [] - tags: - - SANs - parameters: - - $ref: "../../../../../components/parameters/SortParam.yml" - - $ref: "../../../../../components/parameters/PageParam.yml" - - name: filter - in: query - required: - false - # Deep nested arrays are undefined https://github.com/OAI/OpenAPI-Specification/issues/1706 - style: deepObject - description: | - ## Filter Field - The filter field is a key-value object, where the key is what you would like to filter, and the value is the value you're filtering for. - schema: - type: object - properties: - server: - description: Get only those SAN LUNs within the specified server. - type: string - location: - description: Get only those SAN LUNs within the specified location. - type: string - cluster: - description: Get only those SAN LUNs within the specified cluster. - type: string - state: - description: Get only those SAN LUNs with the specified state. - type: string - enum: - - new - - live - - deleting - - deleted - - name: meta - in: query - required: false - description: - A comma separated list of meta values. Meta values will show up under a resource's - `meta` field. In the case of applying a meta to a collection of resources, each - resource will have it's own relevant meta data. In some rare cases, meta may not - apply to individual resources, and may appear in the root document. These will be - clearly labeled. - schema: - type: array - items: - type: string - enum: - - container - - name: include - in: query - required: false - description: | - A comma-separated list of include values. Included resources will show up under the root document's `include` field. - In the case of applying an include to a collection of resources, if multiple resources share the same include, it will only appear once in the return. - schema: - type: array - items: - type: string - enum: - - targets - responses: - 200: - description: Returns a list of SAN LUNs. - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: array - items: - $ref: ../../../../../components/schemas/infrastructure/san/luns/SanLun.yml - includes: - $ref: ../includes/SanLunIncludes.yml - default: - $ref: ../../../../../components/responses/errors/DefaultError.yml diff --git a/platform/paths/infrastructure/san/targets/targets.yml b/platform/paths/infrastructure/san/targets/targets.yml deleted file mode 100644 index f74c4efa..00000000 --- a/platform/paths/infrastructure/san/targets/targets.yml +++ /dev/null @@ -1,56 +0,0 @@ -get: - operationId: "getSanTargets" - summary: Get SAN Targets - description: Lists any SAN targets available for the hub. - security: - - bearerAuth: [] - tags: - - SANs - parameters: - - $ref: "../../../../../components/parameters/SortParam.yml" - - $ref: "../../../../../components/parameters/PageParam.yml" - - name: filter - in: query - required: - false - # Deep nested arrays are undefined https://github.com/OAI/OpenAPI-Specification/issues/1706 - style: deepObject - description: | - ## Filter Field - The filter field is a key-value object, where the key is what you would like to filter, and the value is the value you're filtering for. - schema: - type: object - properties: - server: - description: Get only those SAN targets within the specified server. - type: string - location: - description: Get only those SAN targets within the specified location. - type: string - cluster: - description: Get only those SAN targets within the specified cluster. - type: string - state: - description: Get only those SAN targets with the specified state. - type: string - enum: - - new - - live - - deleting - - deleted - responses: - 200: - description: Returns a list of SAN targets. - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: array - items: - $ref: ../../../../../components/schemas/infrastructure/san/targets/SanTarget.yml - default: - $ref: ../../../../../components/responses/errors/DefaultError.yml diff --git a/platform/paths/infrastructure/san/tasks.yml b/platform/paths/infrastructure/san/tasks.yml deleted file mode 100644 index 2de8dcbd..00000000 --- a/platform/paths/infrastructure/san/tasks.yml +++ /dev/null @@ -1,26 +0,0 @@ -post: - operationId: "createSanJob" - summary: Create SAN Job - description: Used to perform different actions related to SANs. Requires the `san-manage` capability. - tags: - - SANs - requestBody: - description: Parameters for creating the new SAN Job. - content: - application/json: - schema: - $ref: ./tasks/SanTask.yml - responses: - 202: - description: Returns a job descriptor. - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - $ref: ../../../../components/schemas/jobs/JobDescriptor.yml - default: - $ref: ../../../../components/responses/errors/DefaultError.yml diff --git a/platform/paths/infrastructure/san/tasks/SanSyncTask.yml b/platform/paths/infrastructure/san/tasks/SanSyncTask.yml deleted file mode 100644 index ffe1550a..00000000 --- a/platform/paths/infrastructure/san/tasks/SanSyncTask.yml +++ /dev/null @@ -1,29 +0,0 @@ -title: SanSyncTask -type: object -required: - - action -properties: - action: - type: string - enum: - - sync - contents: - type: object - properties: - server_id: - $ref: ../../../../../components/schemas/ID.yml - description: The ID of the server to initiate a SAN sync on. - discovery_ip: - description: IP to run discovery on. - oneOf: - - type: string - format: ipv4 - - type: string - format: ipv6 - credentials: - anyOf: - - $ref: ../../../../../components/schemas/infrastructure/san/targets/SanTargetChapCredentials.yml - - type: "null" - required: - - server_id - - discovery_ip diff --git a/platform/paths/infrastructure/san/tasks/SanTask.yml b/platform/paths/infrastructure/san/tasks/SanTask.yml deleted file mode 100644 index 45df07aa..00000000 --- a/platform/paths/infrastructure/san/tasks/SanTask.yml +++ /dev/null @@ -1,7 +0,0 @@ -title: SanTask -discriminator: - propertyName: action - mapping: - sync: SanSyncTask.yml -oneOf: - - $ref: SanSyncTask.yml