@@ -12,7 +12,7 @@ type PluginInfo struct {
12
12
// System represents a storage system.
13
13
// * A hardware RAID card
14
14
// * A storage area network (SAN)
15
- // * A software solutions running on commidity hardware
15
+ // * A software solutions running on commodity hardware
16
16
// * A Linux system running NFS Service
17
17
type System struct {
18
18
Class string `json:"class"`
@@ -94,8 +94,8 @@ type JobStatusType uint32
94
94
95
95
const (
96
96
97
- // JobStatusInprogress indicated job is in progress
98
- JobStatusInprogress JobStatusType = 1 + iota
97
+ // JobStatusInProgress indicated job is in progress
98
+ JobStatusInProgress JobStatusType = 1 + iota
99
99
100
100
// JobStatusComplete indicates job is complete
101
101
JobStatusComplete
@@ -211,8 +211,8 @@ const (
211
211
// PoolUnsupportedVolumeGrow this pool does not allow growing volumes
212
212
PoolUnsupportedVolumeGrow PoolUnsupportedType = 1 << iota
213
213
214
- // PoolUnsupportedVolumeShink this pool does not allow shrinking volumes
215
- PoolUnsupportedVolumeShink
214
+ // PoolUnsupportedVolumeShrink this pool does not allow shrinking volumes
215
+ PoolUnsupportedVolumeShrink
216
216
)
217
217
218
218
// PoolStatusType type used to describe the status of pool
@@ -405,7 +405,7 @@ const (
405
405
//DiskStatusRemoved Disk was removed by administrator
406
406
DiskStatusRemoved
407
407
408
- // DiskStatusStarting Disk is in the process of becomming ready.
408
+ // DiskStatusStarting Disk is in the process of becoming ready.
409
409
DiskStatusStarting
410
410
411
411
// DiskStatusStopping Disk is shutting down.
@@ -414,7 +414,7 @@ const (
414
414
// DiskStatusStopped Disk is stopped by administrator.
415
415
DiskStatusStopped
416
416
417
- // DiskStatusInitializing Disk is not yet functional, could be initializing eg. RAID, zeroed or scrubed etc.
417
+ // DiskStatusInitializing Disk is not yet functional, could be initializing eg. RAID, zeroed or scrubbed etc.
418
418
DiskStatusInitializing
419
419
420
420
// DiskStatusMaintenanceMode In maintenance for bad sector scan, integrity check and etc
@@ -699,10 +699,10 @@ const (
699
699
// CapAgsGrantedToVol list access groups with access to volume
700
700
CapAgsGrantedToVol CapabilityType = 44
701
701
702
- // CapHasChildDep indicates support for determing if volume has child dep.
702
+ // CapHasChildDep indicates support for determining if volume has child dep.
703
703
CapHasChildDep CapabilityType = 45
704
704
705
- // CapChildDepRm indiates support for removing child dep.
705
+ // CapChildDepRm indicates support for removing child dep.
706
706
CapChildDepRm CapabilityType = 46
707
707
708
708
// CapAccessGroupCreateIscsiIqn supports ag creating with iSCSI initiator
@@ -985,7 +985,7 @@ const (
985
985
WriteCachePolicyWriteThrough
986
986
)
987
987
988
- // WriteCacheStatus represente write cache status type
988
+ // WriteCacheStatus represents write cache status type
989
989
type WriteCacheStatus uint32
990
990
991
991
const (
@@ -1028,7 +1028,7 @@ const (
1028
1028
ReadCacheStatusDisabled
1029
1029
)
1030
1030
1031
- // PhysicalDiskCache represents pyhsical disk caching type
1031
+ // PhysicalDiskCache represents physical disk caching type
1032
1032
type PhysicalDiskCache uint32
1033
1033
1034
1034
const (
@@ -1045,7 +1045,7 @@ const (
1045
1045
PhysicalDiskCacheUseDiskSetting
1046
1046
)
1047
1047
1048
- // VolumeCacheInfo contains informationa about volume caching values
1048
+ // VolumeCacheInfo contains information about volume caching values
1049
1049
type VolumeCacheInfo struct {
1050
1050
WriteSetting WriteCachePolicy
1051
1051
WriteStatus WriteCacheStatus
@@ -1097,3 +1097,45 @@ const (
1097
1097
// DiskLedStatusFaultUnknown fault LED is unknown
1098
1098
DiskLedStatusFaultUnknown
1099
1099
)
1100
+
1101
+ func append_s (dest string , append string , sep string ) string {
1102
+ if len (dest ) > 0 {
1103
+ return sep + append
1104
+ }
1105
+ return append
1106
+ }
1107
+
1108
+ func (s DiskLedStatusBitField ) String () string {
1109
+ var rc string
1110
+ var sep = ", "
1111
+
1112
+ if s & DiskLedStatusUnknown == DiskLedStatusUnknown {
1113
+ rc += append_s (rc , "Unknown" , sep )
1114
+ }
1115
+
1116
+ if s & DiskLedStatusIdentOn == DiskLedStatusIdentOn {
1117
+ rc += append_s (rc , "Ident On" , sep )
1118
+ }
1119
+
1120
+ if s & DiskLedStatusIdentOff == DiskLedStatusIdentOff {
1121
+ rc += append_s (rc , "Ident Off" , sep )
1122
+ }
1123
+
1124
+ if s & DiskLedStatusIdentUnknown == DiskLedStatusIdentUnknown {
1125
+ rc += append_s (rc , "Ident Unknown" , sep )
1126
+ }
1127
+
1128
+ if s & DiskLedStatusFaultOn == DiskLedStatusFaultOn {
1129
+ rc += append_s (rc , "Fault On" , sep )
1130
+ }
1131
+
1132
+ if s & DiskLedStatusFaultOff == DiskLedStatusFaultOff {
1133
+ rc += append_s (rc , "Fault Off" , sep )
1134
+ }
1135
+
1136
+ if s & DiskLedStatusFaultUnknown == DiskLedStatusFaultUnknown {
1137
+ rc += append_s (rc , "Fault Unknown" , sep )
1138
+ }
1139
+
1140
+ return rc
1141
+ }
0 commit comments