forked from juju/juju
/
volume.go
75 lines (60 loc) · 2.22 KB
/
volume.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package storage
import "gopkg.in/juju/names.v2"
// Volume identifies and describes a volume (disk, logical volume, etc.)
type Volume struct {
// Name is a unique name assigned by Juju to the volume.
Tag names.VolumeTag
VolumeInfo
}
// VolumeInfo describes a volume (disk, logical volume etc.)
type VolumeInfo struct {
// VolumeId is a unique provider-supplied ID for the volume.
// VolumeId is required to be unique for the lifetime of the
// volume, but may be reused.
VolumeId string
// HardwareId is the volume's hardware ID. Not all volumes have
// a hardware ID, so this may be left blank.
HardwareId string
// Size is the size of the volume, in MiB.
Size uint64
// Persistent reflects whether the volume is destroyed with the
// machine to which it is attached.
Persistent bool
}
// VolumeAttachment identifies and describes machine-specific volume
// attachment information, including how the volume is exposed on the
// machine.
type VolumeAttachment struct {
// Volume is the unique tag assigned by Juju for the volume
// that this attachment corresponds to.
Volume names.VolumeTag
// Machine is the unique tag assigned by Juju for the machine that
// this attachment corresponds to.
Machine names.MachineTag
VolumeAttachmentInfo
}
// VolumeAttachmentInfo describes machine-specific volume attachment
// information, including how the volume is exposed on the machine.
type VolumeAttachmentInfo struct {
// DeviceName is the volume's OS-specific device name (e.g. "sdb").
//
// If the device name may change (e.g. on machine restart), then this
// field must be left blank.
DeviceName string
// DeviceLink is an OS-specific device link that must exactly match
// one of the block device's links when attached.
//
// If no device link is known, or it may change (e.g. on machine
// restart), then this field must be left blank.
DeviceLink string
// BusAddress is the bus address, where the volume is attached to
// the machine.
//
// The format of this field must match the field of the same name
// in BlockDevice.
BusAddress string
// ReadOnly signifies whether the volume is read only or writable.
ReadOnly bool
}