diff --git a/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml new file mode 100644 index 00000000..21cd6ea0 --- /dev/null +++ b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml @@ -0,0 +1,23 @@ +title: VirtualProviderGenerateIsoAction +type: object +required: + - action + - contents +properties: + action: + type: string + enum: + - iso.generate + description: The action to take. + contents: + type: object + properties: + vxlan_id: + type: integer + description: The VXLAN ID that the target server should initialize with when booted. + vlan_id: + type: integer + description: The VLAN ID that the target server should initialize with when booted. + static_ip: + type: string + 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/VirtualProviderTask.yml new file mode 100644 index 00000000..615321e3 --- /dev/null +++ b/components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml @@ -0,0 +1,7 @@ +title: VirtualProviderTask.yml +discriminator: + propertyName: action + mapping: + "iso.generate": VirtualProviderGenerateIsoAction.yml +oneOf: + - $ref: VirtualProviderGenerateIsoAction.yml diff --git a/platform/api.yml b/platform/api.yml index e8cdea16..1e5a440c 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -121,6 +121,7 @@ x-tagGroups: - Auto-Scale Groups - Clusters - Providers + - Virtual Providers - Servers - IPs - name: Jobs @@ -238,6 +239,8 @@ tags: description: Endpoints related to managing infrastructure clusters. - name: Providers description: Endpoints related to providers configured for a hub. + - name: Virtual Providers + description: Endpoints related to virtual provider configurations. - name: Servers description: Endpoints related to managing servers on Cycle. - name: IPs @@ -587,6 +590,10 @@ paths: "/v1/infrastructure/providers/{providerVendor}/locations": $ref: "./paths/infrastructure/providers/locations.yml" + ## Virtual Providers + "/v1/infrastructure/virtual-providers/{integrationId}/tasks": + $ref: "./paths/infrastructure/virtual-providers/tasks.yml" + ## Clusters "/v1/infrastructure/clusters": $ref: "./paths/infrastructure/clusters/clusters.yml" diff --git a/platform/paths/infrastructure/virtual-providers/tasks.yml b/platform/paths/infrastructure/virtual-providers/tasks.yml new file mode 100644 index 00000000..259e8153 --- /dev/null +++ b/platform/paths/infrastructure/virtual-providers/tasks.yml @@ -0,0 +1,38 @@ +post: + operationId: "createVirtualProviderJob" + summary: Create Virtual Provider Job + description: | + Create a job 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: + $ref: ../../../../components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.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