incus-mirror/shared/api/scriptlet/instance.go
Stéphane Graber 40dd4f151d
Rewrite Go import path to v7
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2026-05-02 01:18:25 +02:00

37 lines
1.3 KiB
Go

package scriptlet
import (
"github.com/lxc/incus/v7/shared/api"
)
// 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"
// InstancePlacementReasonRebalance is when an existing instance is being migrated as part of automatic cluster re-balancing.
const InstancePlacementReasonRebalance = "rebalance"
// InstanceResources represents the required resources for an instance.
//
// API extension: instances_placement_scriptlet.
type InstanceResources struct {
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"`
}
// InstancePlacement represents the instance placement request.
//
// API extension: instances_placement_scriptlet.
type InstancePlacement struct {
api.InstancesPost `yaml:",inline"`
Reason string `json:"reason" yaml:"reason"`
Project string `json:"project" yaml:"project"`
}