diff --git a/components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml b/components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml new file mode 100644 index 00000000..2d99385d --- /dev/null +++ b/components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml @@ -0,0 +1,133 @@ +title: VirtualProviderIso +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: + 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" + 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..895a5e67 --- /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/VirtualProviderIso.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml + +get: + operationId: getVirtualProviderIsos + summary: Get ISOs for a virtual provider + description: | + Get ISOs for a virtual provider. + + Requires the `servers-manage` capability. + tags: + - Virtual Providers + parameters: + - name: integrationId + description: The ID of the integration. + in: path + required: true + schema: + type: string + responses: + 200: + description: Returns an a list of ISOs. + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: ../../../../../components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml diff --git a/platform/paths/infrastructure/virtual-providers/tasks.yml b/platform/paths/infrastructure/virtual-providers/isos/tasks.yml similarity index 50% rename from platform/paths/infrastructure/virtual-providers/tasks.yml rename to platform/paths/infrastructure/virtual-providers/isos/tasks.yml index 6bed8e11..a975aaee 100644 --- a/platform/paths/infrastructure/virtual-providers/tasks.yml +++ b/platform/paths/infrastructure/virtual-providers/isos/tasks.yml @@ -1,25 +1,31 @@ post: - operationId: "createVirtualProviderJob" - summary: Create Virtual Provider Job + operationId: "createVirtualProviderIsoJob" + 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 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: - $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