From ee23cd664cf929b79389575e73a29cd964f5db5f Mon Sep 17 00:00:00 2001 From: Bryce Lewis Date: Tue, 11 Mar 2025 15:31:04 -0700 Subject: [PATCH 1/4] virtual provider isos --- .../infrastructure/virtual-providers/Iso.yml | 129 ++++++++++++++++++ .../VirtualProviderGenerateIsoAction.yml | 21 +-- ...derTask.yml => VirtualProviderIsoTask.yml} | 4 +- platform/api.yml | 15 +- .../virtual-providers/isos/isos.yml | 129 ++++++++++++++++++ .../virtual-providers/{ => isos}/tasks.yml | 14 +- 6 files changed, 280 insertions(+), 32 deletions(-) create mode 100644 components/schemas/infrastructure/virtual-providers/Iso.yml rename components/schemas/infrastructure/virtual-providers/tasks/{VirtualProviderTask.yml => VirtualProviderIsoTask.yml} (53%) create mode 100644 platform/paths/infrastructure/virtual-providers/isos/isos.yml rename platform/paths/infrastructure/virtual-providers/{ => isos}/tasks.yml (63%) diff --git a/components/schemas/infrastructure/virtual-providers/Iso.yml b/components/schemas/infrastructure/virtual-providers/Iso.yml new file mode 100644 index 00000000..1ef08d0f --- /dev/null +++ b/components/schemas/infrastructure/virtual-providers/Iso.yml @@ -0,0 +1,129 @@ +title: Iso +description: The ISO image for a virtual provider. +type: object +required: + - id + - creator + - hub_id + - integration_id + - config + - state + - events +properties: + id: + $ref: ../../ID.yml + creator: + $ref: ../../creators/CreatorScope.yml + hub_id: + $ref: ../../ID.yml + integration_id: + $ref: ../../ID.yml + config: + type: object + required: + - token + properties: + token: + type: string + description: Authentication token for the ISO. + ipxe: + type: object + properties: + vlan_id: + type: + - integer + - "null" + description: VLAN ID for the ISO configuration. + static_ip: + type: + - string + - "null" + description: Static IP assigned to the ISO. + gateway_ip: + type: + - string + - "null" + description: Gateway IP assigned to the ISO. + dns_ip: + type: + - string + - "null" + description: DNS IP assigned to the ISO. + server: + type: object + properties: + vlan_id: + type: + - integer + - "null" + description: VLAN ID for the ISO configuration. + static_ip: + type: + - string + - "null" + description: Static IP assigned to the ISO. + gateway_ip: + type: + - string + - "null" + description: Gateway IP assigned to the ISO. + dns_ip: + type: + - string + - "null" + description: DNS IP assigned to the ISO. + backend: + oneOf: + - type: object + properties: + provider: + type: string + enum: + - AWS + - Azure + - GCP + - Local + description: The provider responsible for storing the ISO. + file_name: + type: string + description: Name of the ISO file. + file_id: + type: string + description: Unique identifier for the ISO file. + size: + type: integer + format: int64 + description: Size of the ISO file in bytes. + - type: "null" + state: + allOf: + - required: + - current + properties: + current: + description: The current state of the environment. + type: string + enum: + - new + - building + - live + - deleting + - deleted + - $ref: ../../State.yml + events: + type: object + description: A collection of timestamps for each event in the ISO's lifetime. + required: + - created + - updated + - deleted + properties: + created: + description: The timestamp of when the ISO was created. + $ref: ../../DateTime.yml + updated: + description: The timestamp of when the ISO was updated. + $ref: ../../DateTime.yml + deleted: + description: The timestamp of when the ISO was deleted. + $ref: ../../DateTime.yml diff --git a/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml index b7533a65..0ad8fb9f 100644 --- a/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml +++ b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml @@ -2,28 +2,9 @@ title: VirtualProviderGenerateIsoAction type: object required: - action - - contents properties: action: type: string enum: - - iso.generate + - generate description: The action to take. - contents: - type: object - properties: - vxlan_id: - type: - - integer - - "null" - description: The VXLAN ID that the target server should initialize with when booted. - vlan_id: - type: - - integer - - "null" - description: The VLAN ID that the target server should initialize with when booted. - static_ip: - type: - - string - - "null" - description: The static IP that the target server should initialize with when booted. diff --git a/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderIsoTask.yml similarity index 53% rename from components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml rename to components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderIsoTask.yml index 615321e3..1bfb6436 100644 --- a/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml +++ b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderIsoTask.yml @@ -1,7 +1,7 @@ -title: VirtualProviderTask.yml +title: VirtualProviderIsoTask.yml discriminator: propertyName: action mapping: - "iso.generate": VirtualProviderGenerateIsoAction.yml + "generate": VirtualProviderGenerateIsoAction.yml oneOf: - $ref: VirtualProviderGenerateIsoAction.yml diff --git a/platform/api.yml b/platform/api.yml index 3adce65c..f1cf58b5 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -382,10 +382,10 @@ paths: $ref: "./paths/containers/instances/tasks.yml" "/v1/containers/{containerId}/instances/{instanceId}/volumes": $ref: "./paths/containers/instances/volumes.yml" - ? "/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/report" - : $ref: paths/containers/instances/telemetry/report.yml - ? "/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/stream" - : $ref: paths/containers/instances/telemetry/stream.yml + "/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/report": + $ref: paths/containers/instances/telemetry/report.yml + "/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/stream": + $ref: paths/containers/instances/telemetry/stream.yml "/v1/containers/{containerId}/instances/{instanceId}/console": $ref: "paths/containers/instances/console.yml" "/v1/containers/{containerId}/functions/tasks": @@ -591,8 +591,11 @@ paths: $ref: "./paths/infrastructure/providers/locations.yml" ## Virtual Providers - "/v1/infrastructure/virtual-providers/{integrationId}/tasks": - $ref: "./paths/infrastructure/virtual-providers/tasks.yml" + "/v1/infrastructure/virtual-providers/{integrationId}/isos/{isoId}/tasks": + $ref: "./paths/infrastructure/virtual-providers/isos/tasks.yml" + + "/v1/infrastructure/virtual-providers/{integrationId}/isos": + $ref: "./paths/infrastructure/virtual-providers/isos/isos.yml" ## Clusters "/v1/infrastructure/clusters": diff --git a/platform/paths/infrastructure/virtual-providers/isos/isos.yml b/platform/paths/infrastructure/virtual-providers/isos/isos.yml new file mode 100644 index 00000000..471ae9a7 --- /dev/null +++ b/platform/paths/infrastructure/virtual-providers/isos/isos.yml @@ -0,0 +1,129 @@ +post: + operationId: "createVirtualProviderIso" + summary: Create Virtual Provider Iso + description: | + Create an ISO for a virtual provider. + + Requires the `servers-manage` capability. + tags: + - Virtual Providers + parameters: + - name: integrationId + description: The ID of the virtual provider integration to execute the job on. + in: path + required: true + schema: + type: string + requestBody: + description: Parameters for creating a new virtual provider job. + content: + application/json: + schema: + type: object + required: + - config + properties: + config: + type: object + required: + - token + properties: + token: + type: string + description: Authentication token for the ISO. + ipxe: + oneOf: + - type: object + properties: + vlan_id: + type: + - integer + - "null" + description: VLAN ID for the IPXE boot. + static_ip: + type: + - string + - "null" + description: Static IP assigned to the IPXE boot. + gateway_ip: + type: + - string + - "null" + description: Gateway IP assigned to the IPXE boot. + dns_ip: + type: + - string + - "null" + description: DNS IP assigned to the IPXE boot. + - type: "null" + server: + oneOf: + - type: object + properties: + vlan_id: + type: + - integer + - "null" + description: VLAN ID for the serer. + static_ip: + type: + - string + - "null" + description: Static IP assigned to the server. + gateway_ip: + type: + - string + - "null" + description: Gateway IP assigned to the server. + dns_ip: + type: + - string + - "null" + description: DNS IP assigned to the server. + - type: "null" + responses: + 201: + description: Returns an ISO. + content: + application/json: + schema: + title: "TaskResponse" + type: object + required: + - data + properties: + data: + $ref: ../../../../../components/schemas/infrastructure/virtual-providers/Iso.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml + +get: + operationId: getVirtualProviderIsos + summary: Get ISOs for a virtual provider + description: | + Create an ISO for a virtual provider. + + Requires the `servers-manage` capability. + tags: + - Virtual Providers + parameters: + - name: integrationId + description: The ID of the integration linked to requested ISOs. + in: path + required: true + schema: + type: string + responses: + 200: + description: Returns an Environment. + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: ../../../../../components/schemas/infrastructure/virtual-providers/Iso.yml diff --git a/platform/paths/infrastructure/virtual-providers/tasks.yml b/platform/paths/infrastructure/virtual-providers/isos/tasks.yml similarity index 63% rename from platform/paths/infrastructure/virtual-providers/tasks.yml rename to platform/paths/infrastructure/virtual-providers/isos/tasks.yml index 6bed8e11..d66a7afd 100644 --- a/platform/paths/infrastructure/virtual-providers/tasks.yml +++ b/platform/paths/infrastructure/virtual-providers/isos/tasks.yml @@ -1,5 +1,5 @@ post: - operationId: "createVirtualProviderJob" + operationId: "createVirtualProviderIsoJob" summary: Create Virtual Provider Job description: | Create a job for a virtual provider. @@ -14,12 +14,18 @@ post: required: true schema: type: string + - name: isoId + description: The ID for the container backup. + in: path + required: true + schema: + type: string requestBody: description: Parameters for creating a new virtual provider job. content: application/json: schema: - $ref: ../../../../components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml + $ref: ../../../../../components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderIsoTask.yml responses: 202: @@ -33,6 +39,6 @@ post: - data properties: data: - $ref: ../../../../components/schemas/jobs/JobDescriptor.yml + $ref: ../../../../../components/schemas/jobs/JobDescriptor.yml default: - $ref: ../../../../components/responses/errors/DefaultError.yml + $ref: ../../../../../components/responses/errors/DefaultError.yml From 5a89cc940b6893b740b41dbf0ca5e7ad428f863c Mon Sep 17 00:00:00 2001 From: Bryce Lewis Date: Wed, 12 Mar 2025 08:35:43 -0700 Subject: [PATCH 2/4] update descriptions --- .../infrastructure/virtual-providers/Iso.yml | 92 ++++++++++--------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/components/schemas/infrastructure/virtual-providers/Iso.yml b/components/schemas/infrastructure/virtual-providers/Iso.yml index 1ef08d0f..50bd6459 100644 --- a/components/schemas/infrastructure/virtual-providers/Iso.yml +++ b/components/schemas/infrastructure/virtual-providers/Iso.yml @@ -27,51 +27,55 @@ properties: type: string description: Authentication token for the ISO. ipxe: - type: object - properties: - vlan_id: - type: - - integer - - "null" - description: VLAN ID for the ISO configuration. - static_ip: - type: - - string - - "null" - description: Static IP assigned to the ISO. - gateway_ip: - type: - - string - - "null" - description: Gateway IP assigned to the ISO. - dns_ip: - type: - - string - - "null" - description: DNS IP assigned to the ISO. + oneOf: + - type: object + properties: + vlan_id: + type: + - integer + - "null" + description: VLAN ID for the IPXE boot. + static_ip: + type: + - string + - "null" + description: Static IP assigned to the IPXE boot. + gateway_ip: + type: + - string + - "null" + description: Gateway IP assigned to the IPXE boot. + dns_ip: + type: + - string + - "null" + description: DNS IP assigned to the IPXE boot. + - type: "null" server: - type: object - properties: - vlan_id: - type: - - integer - - "null" - description: VLAN ID for the ISO configuration. - static_ip: - type: - - string - - "null" - description: Static IP assigned to the ISO. - gateway_ip: - type: - - string - - "null" - description: Gateway IP assigned to the ISO. - dns_ip: - type: - - string - - "null" - description: DNS IP assigned to the ISO. + oneOf: + - type: object + properties: + vlan_id: + type: + - integer + - "null" + description: VLAN ID for the serer. + static_ip: + type: + - string + - "null" + description: Static IP assigned to the server. + gateway_ip: + type: + - string + - "null" + description: Gateway IP assigned to the server. + dns_ip: + type: + - string + - "null" + description: DNS IP assigned to the server. + - type: "null" backend: oneOf: - type: object From 7aebcc3018702df0c8e7f29cc07a21b0b2beb3a9 Mon Sep 17 00:00:00 2001 From: Bryce Lewis Date: Wed, 12 Mar 2025 08:41:41 -0700 Subject: [PATCH 3/4] update spec --- .../infrastructure/virtual-providers/isos/isos.yml | 6 +++--- .../infrastructure/virtual-providers/isos/tasks.yml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/paths/infrastructure/virtual-providers/isos/isos.yml b/platform/paths/infrastructure/virtual-providers/isos/isos.yml index 471ae9a7..70497d37 100644 --- a/platform/paths/infrastructure/virtual-providers/isos/isos.yml +++ b/platform/paths/infrastructure/virtual-providers/isos/isos.yml @@ -101,21 +101,21 @@ get: operationId: getVirtualProviderIsos summary: Get ISOs for a virtual provider description: | - Create an ISO for a virtual provider. + Get ISOs for a virtual provider. Requires the `servers-manage` capability. tags: - Virtual Providers parameters: - name: integrationId - description: The ID of the integration linked to requested ISOs. + description: The ID of the integration. in: path required: true schema: type: string responses: 200: - description: Returns an Environment. + description: Returns an a list of ISOs. content: application/json: schema: diff --git a/platform/paths/infrastructure/virtual-providers/isos/tasks.yml b/platform/paths/infrastructure/virtual-providers/isos/tasks.yml index d66a7afd..a975aaee 100644 --- a/platform/paths/infrastructure/virtual-providers/isos/tasks.yml +++ b/platform/paths/infrastructure/virtual-providers/isos/tasks.yml @@ -1,27 +1,27 @@ post: operationId: "createVirtualProviderIsoJob" - summary: Create Virtual Provider Job + summary: Create Virtual Provider Iso Job description: | - Create a job for a virtual provider. + Create a job for a virtual provider iso. Requires the `servers-manage` capability. tags: - Virtual Providers parameters: - name: integrationId - description: The ID of the virtual provider integration to execute the job on. + description: The ID of the virtual provider intergration. in: path required: true schema: type: string - name: isoId - description: The ID for the container backup. + description: The ID for the virtual provider ISO. in: path required: true schema: type: string requestBody: - description: Parameters for creating a new virtual provider job. + description: Parameters for creating a new virtual provider iso job. content: application/json: schema: From 61e1772db2d9787203377fb90c65b4f98f7d1daa Mon Sep 17 00:00:00 2001 From: Bryce Lewis Date: Wed, 12 Mar 2025 08:51:58 -0700 Subject: [PATCH 4/4] update name to virtualProviderIso --- .../virtual-providers/{Iso.yml => VirtualProviderIso.yml} | 2 +- platform/paths/infrastructure/virtual-providers/isos/isos.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename components/schemas/infrastructure/virtual-providers/{Iso.yml => VirtualProviderIso.yml} (99%) diff --git a/components/schemas/infrastructure/virtual-providers/Iso.yml b/components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml similarity index 99% rename from components/schemas/infrastructure/virtual-providers/Iso.yml rename to components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml index 50bd6459..2d99385d 100644 --- a/components/schemas/infrastructure/virtual-providers/Iso.yml +++ b/components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml @@ -1,4 +1,4 @@ -title: Iso +title: VirtualProviderIso description: The ISO image for a virtual provider. type: object required: diff --git a/platform/paths/infrastructure/virtual-providers/isos/isos.yml b/platform/paths/infrastructure/virtual-providers/isos/isos.yml index 70497d37..895a5e67 100644 --- a/platform/paths/infrastructure/virtual-providers/isos/isos.yml +++ b/platform/paths/infrastructure/virtual-providers/isos/isos.yml @@ -93,7 +93,7 @@ post: - data properties: data: - $ref: ../../../../../components/schemas/infrastructure/virtual-providers/Iso.yml + $ref: ../../../../../components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml @@ -126,4 +126,4 @@ get: data: type: array items: - $ref: ../../../../../components/schemas/infrastructure/virtual-providers/Iso.yml + $ref: ../../../../../components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml