File: storage_pool.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 (100 lines) | stat: -rw-r--r-- 2,856 bytes parent folder | download | duplicates (6)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package api

// StoragePoolStatusPending storage pool is pending creation on other cluster nodes.
const StoragePoolStatusPending = "Pending"

// StoragePoolStatusCreated storage pool is fully created.
const StoragePoolStatusCreated = "Created"

// StoragePoolStatusErrored storage pool is in error status.
const StoragePoolStatusErrored = "Errored"

// StoragePoolStatusUnknown storage pool is in unknown status.
const StoragePoolStatusUnknown = "Unknown"

// StoragePoolStatusUnvailable storage pool failed to initialize.
const StoragePoolStatusUnvailable = "Unavailable"

// StoragePoolsPost represents the fields of a new storage pool
//
// swagger:model
//
// API extension: storage.
type StoragePoolsPost struct {
	StoragePoolPut `yaml:",inline"`

	// Storage pool name
	// Example: local
	Name string `json:"name" yaml:"name"`

	// Storage pool driver (btrfs, ceph, cephfs, cephobject, dir, lvm, lvmcluster or zfs)
	// Example: zfs
	Driver string `json:"driver" yaml:"driver"`
}

// StoragePool represents the fields of a storage pool.
//
// swagger:model
//
// API extension: storage.
type StoragePool struct {
	StoragePoolPut `yaml:",inline"`

	// Storage pool name
	// Example: local
	Name string `json:"name" yaml:"name"`

	// Storage pool driver (btrfs, ceph, cephfs, cephobject, dir, lvm, lvmcluster or zfs)
	// Example: zfs
	Driver string `json:"driver" yaml:"driver"`

	// List of URLs of objects using this storage pool
	// Example: ["/1.0/profiles/default", "/1.0/instances/c1"]
	UsedBy []string `json:"used_by" yaml:"used_by"`

	// Pool status (Pending, Created, Errored or Unknown)
	// Read only: true
	// Example: Created
	//
	// API extension: clustering
	Status string `json:"status" yaml:"status"`

	// Cluster members on which the storage pool has been defined
	// Read only: true
	// Example: ["server01", "server02", "server03"]
	//
	// API extension: clustering
	Locations []string `json:"locations" yaml:"locations"`
}

// StoragePoolPut represents the modifiable fields of a storage pool.
//
// swagger:model
//
// API extension: storage.
type StoragePoolPut struct {
	// Storage pool configuration map (refer to doc/storage.md)
	// Example: {"volume.block.filesystem": "ext4", "volume.size": "50GiB"}
	Config map[string]string `json:"config" yaml:"config"`

	// Description of the storage pool
	// Example: Local SSD pool
	//
	// API extension: entity_description
	Description string `json:"description" yaml:"description"`
}

// Writable converts a full StoragePool struct into a StoragePoolPut struct
// (filters read-only fields).
func (storagePool *StoragePool) Writable() StoragePoolPut {
	return storagePool.StoragePoolPut
}

// StoragePoolState represents the state of a storage pool.
//
// swagger:model
//
// API extension: cluster_member_state.
type StoragePoolState struct {
	ResourcesStoragePool `yaml:",inline"`
}