1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

api: Use DevicesMap type for map[string]map[string]string

Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
This commit is contained in:
Lucas Bremgartner
2025-11-25 14:07:53 +01:00
committed by Stéphane Graber
parent 612a10de5f
commit 837d477d31
3 changed files with 6 additions and 6 deletions

View File

@@ -120,7 +120,7 @@ type InstancePost struct {
// Example: {"root": {"type": "disk", "pool": "default", "path": "/"}}
//
// API extension: instance_move_config
Devices map[string]map[string]string
Devices DevicesMap
// List of profiles applied to the instance.
// Example: ["default"]
@@ -164,7 +164,7 @@ type InstancePut struct {
// Instance devices (see doc/instances.md)
// Example: {"root": {"type": "disk", "pool": "default", "path": "/"}}
Devices map[string]map[string]string `json:"devices" yaml:"devices"`
Devices DevicesMap `json:"devices" yaml:"devices"`
// Whether the instance is ephemeral (deleted on shutdown)
// Example: false
@@ -215,7 +215,7 @@ type Instance struct {
// Expanded devices (all profiles and local devices merged)
// Example: {"root": {"type": "disk", "pool": "default", "path": "/"}}
ExpandedDevices map[string]map[string]string `json:"expanded_devices,omitempty" yaml:"expanded_devices,omitempty"`
ExpandedDevices DevicesMap `json:"expanded_devices,omitempty" yaml:"expanded_devices,omitempty"`
// Instance name
// Example: foo

View File

@@ -84,7 +84,7 @@ type InstanceSnapshot struct {
// Instance devices (see doc/instances.md)
// Example: {"root": {"type": "disk", "pool": "default", "path": "/"}}
Devices map[string]map[string]string `json:"devices" yaml:"devices"`
Devices DevicesMap `json:"devices" yaml:"devices"`
// Whether the instance is ephemeral (deleted on shutdown)
// Example: false
@@ -96,7 +96,7 @@ type InstanceSnapshot struct {
// Expanded devices (all profiles and local devices merged)
// Example: {"root": {"type": "disk", "pool": "default", "path": "/"}}
ExpandedDevices map[string]map[string]string `json:"expanded_devices,omitempty" yaml:"expanded_devices,omitempty"`
ExpandedDevices DevicesMap `json:"expanded_devices,omitempty" yaml:"expanded_devices,omitempty"`
// Last start timestamp
// Example: 2021-03-23T20:00:00-04:00

View File

@@ -34,7 +34,7 @@ type ProfilePut struct {
// List of devices
// Example: {"root": {"type": "disk", "pool": "default", "path": "/"}, "eth0": {"type": "nic", "network": "mybr0", "name": "eth0"}}
Devices map[string]map[string]string `json:"devices" yaml:"devices"`
Devices DevicesMap `json:"devices" yaml:"devices"`
}
// Profile represents a profile