forked from canonical/lxd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage_pool.go
54 lines (42 loc) · 1.59 KB
/
storage_pool.go
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
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"
// StoragePoolsPost represents the fields of a new LXD storage pool
//
// API extension: storage
type StoragePoolsPost struct {
StoragePoolPut `yaml:",inline"`
Name string `json:"name" yaml:"name"`
Driver string `json:"driver" yaml:"driver"`
}
// StoragePool represents the fields of a LXD storage pool.
//
// API extension: storage
type StoragePool struct {
StoragePoolPut `yaml:",inline"`
Name string `json:"name" yaml:"name"`
Driver string `json:"driver" yaml:"driver"`
UsedBy []string `json:"used_by" yaml:"used_by"`
// API extension: clustering
Status string `json:"status" yaml:"status"`
Locations []string `json:"locations" yaml:"locations"`
}
// StoragePoolPut represents the modifiable fields of a LXD storage pool.
//
// API extension: storage
type StoragePoolPut struct {
Config map[string]string `json:"config" yaml:"config"`
// 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
}