Skip to content

Commit 285d384

Browse files
committed
feat: updated swagger file with new block device fields
Updated swagger for `drive` api with new descriptions and fields for vhost-user-block. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent b1e12b7 commit 285d384

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

src/api_server/swagger/firecracker.yaml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -858,41 +858,54 @@ definitions:
858858
type: object
859859
required:
860860
- drive_id
861-
- is_read_only
862861
- is_root_device
863-
- path_on_host
864862
properties:
865863
drive_id:
866864
type: string
865+
partuuid:
866+
type: string
867+
description:
868+
Represents the unique id of the boot partition of this device. It is
869+
optional and it will be taken into account only if the is_root_device
870+
field is true.
871+
is_root_device:
872+
type: boolean
867873
cache_type:
868874
type: string
869875
description:
870876
Represents the caching strategy for the block device.
871877
enum: ["Unsafe", "Writeback"]
872878
default: "Unsafe"
879+
880+
# VirtioBlock specific parameters
873881
is_read_only:
874882
type: boolean
875-
is_root_device:
876-
type: boolean
877-
partuuid:
878-
type: string
879883
description:
880-
Represents the unique id of the boot partition of this device. It is
881-
optional and it will be taken into account only if the is_root_device
882-
field is true.
884+
Is block read only.
885+
This field is required for virtio-block config and should be omitted for vhost-user-block configuration.
883886
path_on_host:
884887
type: string
885-
description: Host level path for the guest drive
888+
description:
889+
Host level path for the guest drive.
890+
This field is required for virtio-block config and should be omitted for vhost-user-block configuration.
886891
rate_limiter:
887892
$ref: "#/definitions/RateLimiter"
888893
io_engine:
889894
type: string
890895
description:
891896
Type of the IO engine used by the device. "Async" is supported on
892897
host kernels newer than 5.10.51.
898+
This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
893899
enum: ["Sync", "Async"]
894900
default: "Sync"
895901

902+
# VhostUserBlock specific parameters
903+
socket:
904+
type: string
905+
description:
906+
Path to the socket of vhost-user-block backend.
907+
This field is required for vhost-user-block config should be omitted for virtio-block configuration.
908+
896909
Error:
897910
type: object
898911
properties:
@@ -1151,6 +1164,7 @@ definitions:
11511164
description:
11521165
Defines an IO rate limiter with independent bytes/s and ops/s limits.
11531166
Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
1167+
This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
11541168
properties:
11551169
bandwidth:
11561170
$ref: "#/definitions/TokenBucket"

0 commit comments

Comments
 (0)