File: instance.go

package info (click to toggle)
incus 6.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 23,864 kB
  • sloc: sh: 16,015; ansic: 3,121; python: 456; makefile: 321; ruby: 51; sql: 50; lisp: 6
file content (33 lines) | stat: -rw-r--r-- 1,094 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package scriptlet

import (
	"github.com/lxc/incus/v6/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"

// InstanceResources represents the required resources for an instance.
//
// API extension: instances_placement_scriptlet.
type InstanceResources struct {
	CPUCores     uint64 `json:"cpu_cores"`
	MemorySize   uint64 `json:"memory_size"`
	RootDiskSize uint64 `json:"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"`
	Project string `json:"project"`
}