2023-01-19 11:36:36 +00:00
|
|
|
package scriptlet
|
|
|
|
|
|
2023-02-02 16:56:29 +00:00
|
|
|
import (
|
2024-04-05 11:11:08 -04:00
|
|
|
"github.com/lxc/incus/v6/shared/api"
|
2023-02-02 16:56:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// InstancePlacementReasonNew is when a new instance request is received.
|
|
|
|
|
const InstancePlacementReasonNew = "new"
|
|
|
|
|
|
|
|
|
|
// InstancePlacementReasonRelocation is when an existing instance is temporarily migrated because a cluster member is down.
|
|
|
|
|
const InstancePlacementReasonRelocation = "relocation"
|
|
|
|
|
|
|
|
|
|
// InstancePlacementReasonEvacuation is when an existing instance is temporarily migrated because a cluster member is being evacuated.
|
|
|
|
|
const InstancePlacementReasonEvacuation = "evacuation"
|
|
|
|
|
|
2023-01-19 11:36:36 +00:00
|
|
|
// InstanceResources represents the required resources for an instance.
|
|
|
|
|
//
|
|
|
|
|
// API extension: instances_placement_scriptlet.
|
|
|
|
|
type InstanceResources struct {
|
2025-04-22 21:57:03 +02:00
|
|
|
CPUCores uint64 `json:"cpu_cores" yaml:"cpu_cores"`
|
|
|
|
|
MemorySize uint64 `json:"memory_size" yaml:"memory_size"`
|
|
|
|
|
RootDiskSize uint64 `json:"root_disk_size" yaml:"root_disk_size"`
|
2023-01-19 11:36:36 +00:00
|
|
|
}
|
2023-02-02 16:56:29 +00:00
|
|
|
|
|
|
|
|
// InstancePlacement represents the instance placement request.
|
|
|
|
|
//
|
|
|
|
|
// API extension: instances_placement_scriptlet.
|
|
|
|
|
type InstancePlacement struct {
|
|
|
|
|
api.InstancesPost `yaml:",inline"`
|
|
|
|
|
|
2025-04-22 21:57:03 +02:00
|
|
|
Reason string `json:"reason" yaml:"reason"`
|
|
|
|
|
Project string `json:"project" yaml:"project"`
|
2023-02-02 16:56:29 +00:00
|
|
|
}
|