Skip to content

Commit 035440f

Browse files
authored
virtual provider isos (#595)
* virtual provider isos * update descriptions * update spec * update name to virtualProviderIso
1 parent d07454c commit 035440f

File tree

6 files changed

+288
-36
lines changed

6 files changed

+288
-36
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
title: VirtualProviderIso
2+
description: The ISO image for a virtual provider.
3+
type: object
4+
required:
5+
- id
6+
- creator
7+
- hub_id
8+
- integration_id
9+
- config
10+
- state
11+
- events
12+
properties:
13+
id:
14+
$ref: ../../ID.yml
15+
creator:
16+
$ref: ../../creators/CreatorScope.yml
17+
hub_id:
18+
$ref: ../../ID.yml
19+
integration_id:
20+
$ref: ../../ID.yml
21+
config:
22+
type: object
23+
required:
24+
- token
25+
properties:
26+
token:
27+
type: string
28+
description: Authentication token for the ISO.
29+
ipxe:
30+
oneOf:
31+
- type: object
32+
properties:
33+
vlan_id:
34+
type:
35+
- integer
36+
- "null"
37+
description: VLAN ID for the IPXE boot.
38+
static_ip:
39+
type:
40+
- string
41+
- "null"
42+
description: Static IP assigned to the IPXE boot.
43+
gateway_ip:
44+
type:
45+
- string
46+
- "null"
47+
description: Gateway IP assigned to the IPXE boot.
48+
dns_ip:
49+
type:
50+
- string
51+
- "null"
52+
description: DNS IP assigned to the IPXE boot.
53+
- type: "null"
54+
server:
55+
oneOf:
56+
- type: object
57+
properties:
58+
vlan_id:
59+
type:
60+
- integer
61+
- "null"
62+
description: VLAN ID for the serer.
63+
static_ip:
64+
type:
65+
- string
66+
- "null"
67+
description: Static IP assigned to the server.
68+
gateway_ip:
69+
type:
70+
- string
71+
- "null"
72+
description: Gateway IP assigned to the server.
73+
dns_ip:
74+
type:
75+
- string
76+
- "null"
77+
description: DNS IP assigned to the server.
78+
- type: "null"
79+
backend:
80+
oneOf:
81+
- type: object
82+
properties:
83+
provider:
84+
type: string
85+
enum:
86+
- AWS
87+
- Azure
88+
- GCP
89+
- Local
90+
description: The provider responsible for storing the ISO.
91+
file_name:
92+
type: string
93+
description: Name of the ISO file.
94+
file_id:
95+
type: string
96+
description: Unique identifier for the ISO file.
97+
size:
98+
type: integer
99+
format: int64
100+
description: Size of the ISO file in bytes.
101+
- type: "null"
102+
state:
103+
allOf:
104+
- required:
105+
- current
106+
properties:
107+
current:
108+
description: The current state of the environment.
109+
type: string
110+
enum:
111+
- new
112+
- building
113+
- live
114+
- deleting
115+
- deleted
116+
- $ref: ../../State.yml
117+
events:
118+
type: object
119+
description: A collection of timestamps for each event in the ISO's lifetime.
120+
required:
121+
- created
122+
- updated
123+
- deleted
124+
properties:
125+
created:
126+
description: The timestamp of when the ISO was created.
127+
$ref: ../../DateTime.yml
128+
updated:
129+
description: The timestamp of when the ISO was updated.
130+
$ref: ../../DateTime.yml
131+
deleted:
132+
description: The timestamp of when the ISO was deleted.
133+
$ref: ../../DateTime.yml

components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderGenerateIsoAction.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,9 @@ title: VirtualProviderGenerateIsoAction
22
type: object
33
required:
44
- action
5-
- contents
65
properties:
76
action:
87
type: string
98
enum:
10-
- iso.generate
9+
- generate
1110
description: The action to take.
12-
contents:
13-
type: object
14-
properties:
15-
vxlan_id:
16-
type:
17-
- integer
18-
- "null"
19-
description: The VXLAN ID that the target server should initialize with when booted.
20-
vlan_id:
21-
type:
22-
- integer
23-
- "null"
24-
description: The VLAN ID that the target server should initialize with when booted.
25-
static_ip:
26-
type:
27-
- string
28-
- "null"
29-
description: The static IP that the target server should initialize with when booted.

components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml renamed to components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderIsoTask.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
title: VirtualProviderTask.yml
1+
title: VirtualProviderIsoTask.yml
22
discriminator:
33
propertyName: action
44
mapping:
5-
"iso.generate": VirtualProviderGenerateIsoAction.yml
5+
"generate": VirtualProviderGenerateIsoAction.yml
66
oneOf:
77
- $ref: VirtualProviderGenerateIsoAction.yml

platform/api.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ paths:
382382
$ref: "./paths/containers/instances/tasks.yml"
383383
"/v1/containers/{containerId}/instances/{instanceId}/volumes":
384384
$ref: "./paths/containers/instances/volumes.yml"
385-
? "/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/report"
386-
: $ref: paths/containers/instances/telemetry/report.yml
387-
? "/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/stream"
388-
: $ref: paths/containers/instances/telemetry/stream.yml
385+
"/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/report":
386+
$ref: paths/containers/instances/telemetry/report.yml
387+
"/v1/containers/{containerId}/instances/{instanceId}/telemetry/resources/stream":
388+
$ref: paths/containers/instances/telemetry/stream.yml
389389
"/v1/containers/{containerId}/instances/{instanceId}/console":
390390
$ref: "paths/containers/instances/console.yml"
391391
"/v1/containers/{containerId}/functions/tasks":
@@ -591,8 +591,11 @@ paths:
591591
$ref: "./paths/infrastructure/providers/locations.yml"
592592

593593
## Virtual Providers
594-
"/v1/infrastructure/virtual-providers/{integrationId}/tasks":
595-
$ref: "./paths/infrastructure/virtual-providers/tasks.yml"
594+
"/v1/infrastructure/virtual-providers/{integrationId}/isos/{isoId}/tasks":
595+
$ref: "./paths/infrastructure/virtual-providers/isos/tasks.yml"
596+
597+
"/v1/infrastructure/virtual-providers/{integrationId}/isos":
598+
$ref: "./paths/infrastructure/virtual-providers/isos/isos.yml"
596599

597600
## Clusters
598601
"/v1/infrastructure/clusters":
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
post:
2+
operationId: "createVirtualProviderIso"
3+
summary: Create Virtual Provider Iso
4+
description: |
5+
Create an ISO for a virtual provider.
6+
7+
Requires the `servers-manage` capability.
8+
tags:
9+
- Virtual Providers
10+
parameters:
11+
- name: integrationId
12+
description: The ID of the virtual provider integration to execute the job on.
13+
in: path
14+
required: true
15+
schema:
16+
type: string
17+
requestBody:
18+
description: Parameters for creating a new virtual provider job.
19+
content:
20+
application/json:
21+
schema:
22+
type: object
23+
required:
24+
- config
25+
properties:
26+
config:
27+
type: object
28+
required:
29+
- token
30+
properties:
31+
token:
32+
type: string
33+
description: Authentication token for the ISO.
34+
ipxe:
35+
oneOf:
36+
- type: object
37+
properties:
38+
vlan_id:
39+
type:
40+
- integer
41+
- "null"
42+
description: VLAN ID for the IPXE boot.
43+
static_ip:
44+
type:
45+
- string
46+
- "null"
47+
description: Static IP assigned to the IPXE boot.
48+
gateway_ip:
49+
type:
50+
- string
51+
- "null"
52+
description: Gateway IP assigned to the IPXE boot.
53+
dns_ip:
54+
type:
55+
- string
56+
- "null"
57+
description: DNS IP assigned to the IPXE boot.
58+
- type: "null"
59+
server:
60+
oneOf:
61+
- type: object
62+
properties:
63+
vlan_id:
64+
type:
65+
- integer
66+
- "null"
67+
description: VLAN ID for the serer.
68+
static_ip:
69+
type:
70+
- string
71+
- "null"
72+
description: Static IP assigned to the server.
73+
gateway_ip:
74+
type:
75+
- string
76+
- "null"
77+
description: Gateway IP assigned to the server.
78+
dns_ip:
79+
type:
80+
- string
81+
- "null"
82+
description: DNS IP assigned to the server.
83+
- type: "null"
84+
responses:
85+
201:
86+
description: Returns an ISO.
87+
content:
88+
application/json:
89+
schema:
90+
title: "TaskResponse"
91+
type: object
92+
required:
93+
- data
94+
properties:
95+
data:
96+
$ref: ../../../../../components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml
97+
default:
98+
$ref: ../../../../../components/responses/errors/DefaultError.yml
99+
100+
get:
101+
operationId: getVirtualProviderIsos
102+
summary: Get ISOs for a virtual provider
103+
description: |
104+
Get ISOs for a virtual provider.
105+
106+
Requires the `servers-manage` capability.
107+
tags:
108+
- Virtual Providers
109+
parameters:
110+
- name: integrationId
111+
description: The ID of the integration.
112+
in: path
113+
required: true
114+
schema:
115+
type: string
116+
responses:
117+
200:
118+
description: Returns an a list of ISOs.
119+
content:
120+
application/json:
121+
schema:
122+
type: object
123+
required:
124+
- data
125+
properties:
126+
data:
127+
type: array
128+
items:
129+
$ref: ../../../../../components/schemas/infrastructure/virtual-providers/VirtualProviderIso.yml

platform/paths/infrastructure/virtual-providers/tasks.yml renamed to platform/paths/infrastructure/virtual-providers/isos/tasks.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
post:
2-
operationId: "createVirtualProviderJob"
3-
summary: Create Virtual Provider Job
2+
operationId: "createVirtualProviderIsoJob"
3+
summary: Create Virtual Provider Iso Job
44
description: |
5-
Create a job for a virtual provider.
5+
Create a job for a virtual provider iso.
66
77
Requires the `servers-manage` capability.
88
tags:
99
- Virtual Providers
1010
parameters:
1111
- name: integrationId
12-
description: The ID of the virtual provider integration to execute the job on.
12+
description: The ID of the virtual provider intergration.
13+
in: path
14+
required: true
15+
schema:
16+
type: string
17+
- name: isoId
18+
description: The ID for the virtual provider ISO.
1319
in: path
1420
required: true
1521
schema:
1622
type: string
1723
requestBody:
18-
description: Parameters for creating a new virtual provider job.
24+
description: Parameters for creating a new virtual provider iso job.
1925
content:
2026
application/json:
2127
schema:
22-
$ref: ../../../../components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderTask.yml
28+
$ref: ../../../../../components/schemas/infrastructure/virtual-providers/tasks/VirtualProviderIsoTask.yml
2329

2430
responses:
2531
202:
@@ -33,6 +39,6 @@ post:
3339
- data
3440
properties:
3541
data:
36-
$ref: ../../../../components/schemas/jobs/JobDescriptor.yml
42+
$ref: ../../../../../components/schemas/jobs/JobDescriptor.yml
3743
default:
38-
$ref: ../../../../components/responses/errors/DefaultError.yml
44+
$ref: ../../../../../components/responses/errors/DefaultError.yml

0 commit comments

Comments
 (0)