Skip to content

Commit 57d7ce7

Browse files
authored
you get a new name, you get a new name (#25)
1 parent 6ab0c9a commit 57d7ce7

File tree

5 files changed

+90
-89
lines changed

5 files changed

+90
-89
lines changed

cmd/api/api/instances.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,9 @@ func instanceToOAPI(inst instances.Instance) oapi.Instance {
474474

475475
// Convert volume attachments
476476
if len(inst.Volumes) > 0 {
477-
oapiVolumes := make([]oapi.VolumeAttachment, len(inst.Volumes))
477+
oapiVolumes := make([]oapi.VolumeMount, len(inst.Volumes))
478478
for i, vol := range inst.Volumes {
479-
oapiVol := oapi.VolumeAttachment{
479+
oapiVol := oapi.VolumeMount{
480480
VolumeId: vol.VolumeID,
481481
MountPath: vol.MountPath,
482482
Readonly: lo.ToPtr(vol.Readonly),

cmd/api/api/volumes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ func volumeToOAPI(vol volumes.Volume) oapi.Volume {
289289

290290
// Convert attachments
291291
if len(vol.Attachments) > 0 {
292-
attachments := make([]oapi.VolumeAttachedInstance, len(vol.Attachments))
292+
attachments := make([]oapi.VolumeAttachment, len(vol.Attachments))
293293
for i, att := range vol.Attachments {
294-
attachments[i] = oapi.VolumeAttachedInstance{
294+
attachments[i] = oapi.VolumeAttachment{
295295
InstanceId: att.InstanceID,
296296
MountPath: att.MountPath,
297297
Readonly: att.Readonly,

lib/oapi/oapi.go

Lines changed: 79 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ components:
5555
- Stopped: No VMM running, no snapshot exists
5656
- Standby: No VMM running, snapshot exists (can be restored)
5757
58-
VolumeAttachment:
58+
VolumeMount:
5959
type: object
6060
required: [volume_id, mount_path]
6161
properties:
@@ -152,7 +152,7 @@ components:
152152
type: array
153153
description: Volumes to attach to the instance at creation time
154154
items:
155-
$ref: "#/components/schemas/VolumeAttachment"
155+
$ref: "#/components/schemas/VolumeMount"
156156
# Future: port_mappings, timeout_seconds
157157

158158
Instance:
@@ -220,7 +220,7 @@ components:
220220
type: array
221221
description: Volumes attached to the instance
222222
items:
223-
$ref: "#/components/schemas/VolumeAttachment"
223+
$ref: "#/components/schemas/VolumeMount"
224224
created_at:
225225
type: string
226226
format: date-time
@@ -334,7 +334,7 @@ components:
334334
description: Size in gigabytes
335335
example: 10
336336

337-
VolumeAttachedInstance:
337+
VolumeAttachment:
338338
type: object
339339
required: [instance_id, mount_path, readonly]
340340
properties:
@@ -371,7 +371,7 @@ components:
371371
type: array
372372
description: List of current attachments (empty if not attached)
373373
items:
374-
$ref: "#/components/schemas/VolumeAttachedInstance"
374+
$ref: "#/components/schemas/VolumeAttachment"
375375
created_at:
376376
type: string
377377
format: date-time

stainless.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ resources:
7272

7373
instances:
7474
models:
75-
volume_attachment: '#/components/schemas/VolumeAttachment'
75+
volume_mount: '#/components/schemas/VolumeMount'
7676
port_mapping: '#/components/schemas/PortMapping'
7777
instance: '#/components/schemas/Instance'
7878
methods:
@@ -94,6 +94,7 @@ resources:
9494
volumes:
9595
models:
9696
volume: '#/components/schemas/Volume'
97+
volume_attachment: '#/components/schemas/VolumeAttachment'
9798
methods:
9899
list: get /volumes
99100
create: post /volumes

0 commit comments

Comments
 (0)