-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdata.go
1141 lines (839 loc) · 30.5 KB
/
data.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// SPDX-License-Identifier: 0BSD
package libstoragemgmt
// PluginInfo - Information about a specific plugin
type PluginInfo struct {
Version string
Description string
Name string
}
// System represents a storage system.
// * A hardware RAID card
// * A storage area network (SAN)
// * A software solutions running on commodity hardware
// * A Linux system running NFS Service
type System struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
Status SystemStatusType `json:"status"`
StatusInfo string `json:"status_info"`
PluginData *string `json:"plugin_data"`
FwVersion string `json:"fw_version"`
ReadCachePct int8 `json:"read_cache_pct"`
SystemMode SystemModeType `json:"mode"`
}
const (
// SystemReadCachePctNoSupport System read cache percentage not supported.
SystemReadCachePctNoSupport int8 = -2 + iota
// SystemReadCachePctUnknown System read cache percentage unknown.
SystemReadCachePctUnknown
)
// SystemStatusType type representing system status.
type SystemStatusType uint32
const (
// SystemStatusUnknown System status is unknown.
SystemStatusUnknown SystemStatusType = 1 << iota
// SystemStatusOk System status is OK.
SystemStatusOk
// SystemStatusError System is in error state.
SystemStatusError
// SystemStatusDegraded System is degraded in some way
SystemStatusDegraded
// SystemStatusPredictiveFailure System has potential failure.
SystemStatusPredictiveFailure
// SystemStatusOther Vendor specific status.
SystemStatusOther
)
// SystemModeType type representing system mode.
type SystemModeType int8
const (
// SystemModeUnknown Plugin failed to query system mode.
SystemModeUnknown SystemModeType = -2 + iota
// SystemModeNoSupport Plugin does not support querying system mode.
SystemModeNoSupport
//SystemModeHardwareRaid The storage system is a hardware RAID card
SystemModeHardwareRaid
// SystemModeHba The physical disks can be exposed to OS directly without any
// configurations.
SystemModeHba
)
// Volume represents a storage volume, aka. a logical unit
type Volume struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
Enabled LsmBool `json:"admin_state"`
BlockSize uint64 `json:"block_size"`
NumOfBlocks uint64 `json:"num_of_blocks"`
PluginData *string `json:"plugin_data"`
Vpd83 string `json:"vpd83"`
SystemID string `json:"system_id"`
PoolID string `json:"pool_id"`
}
// JobStatusType is enumerated type returned from Job control
type JobStatusType uint32
const (
// JobStatusInProgress indicated job is in progress
JobStatusInProgress JobStatusType = 1 + iota
// JobStatusComplete indicates job is complete
JobStatusComplete
// JobStatusError indicated job has errored
JobStatusError
)
// VolumeReplicateType enumerated type for VolumeReplicate
type VolumeReplicateType int
const (
// VolumeReplicateTypeUnknown plugin failed to detect volume replication type
VolumeReplicateTypeUnknown VolumeReplicateType = -1 + iota
// Reserved "0"
_
// Reserved "1"
_
// VolumeReplicateTypeClone Point in time read writeable space efficient copy of data
VolumeReplicateTypeClone
// VolumeReplicateTypeCopy Full bitwise copy of the data (occupies full space)
VolumeReplicateTypeCopy
// VolumeReplicateTypeMirrorSync I/O will be blocked until I/O reached
// both source and target storage systems. There will be no data difference
// between source and target storage systems.
VolumeReplicateTypeMirrorSync
// VolumeReplicateTypeMirrorAsync I/O will be blocked until I/O
// reached source storage systems. The source storage system will use
// copy the changes data to target system in a predefined interval.
// There will be a small data differences between source and target.
VolumeReplicateTypeMirrorAsync
)
// VolumeProvisionType enumerated type for volume creation provisioning
type VolumeProvisionType int
const (
// VolumeProvisionTypeUnknown provision type unknown
VolumeProvisionTypeUnknown VolumeProvisionType = -1 + iota
// Reserved "0"
_
// VolumeProvisionTypeThin thin provision volume
VolumeProvisionTypeThin
// VolumeProvisionTypeFull fully provision volume
VolumeProvisionTypeFull
// VolumeProvisionTypeDefault use the default for the storage provider
VolumeProvisionTypeDefault
)
// Pool represents the unit of storage where block
// devices and/or file systems are created from.
type Pool struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
ElementType PoolElementType `json:"element_type"`
UnsupportedActions PoolUnsupportedType `json:"unsupported_actions"`
TotalSpace uint64 `json:"total_space"`
FreeSpace uint64 `json:"free_space"`
Status PoolStatusType `json:"status"`
StatusInfo string `json:"status_info"`
PluginData *string `json:"plugin_data"`
SystemID string `json:"system_id"`
}
// PoolElementType type used to describe what things can be created from pool
type PoolElementType uint64
const (
// PoolElementPool This pool could allocate space for sub pool.
PoolElementPool PoolElementType = 1 << (iota + 1)
// PoolElementTypeVolume This pool can be used for volume creation.
PoolElementTypeVolume
// PoolElementTypeFs this pool can be used to for FS creation.
PoolElementTypeFs
// PoolElementTypeDelta this pool can hold delta data for snapshots.
PoolElementTypeDelta
// PoolElementTypeVolumeFull this pool could be used to create fully allocated volume.
PoolElementTypeVolumeFull
// PoolElementTypeVolumeThin this pool could be used to create thin provisioned volume.
PoolElementTypeVolumeThin
// Reserved 1 << 7
_
// Reserved 1 << 8
_
// Reserved 1 << 9
_
// PoolElementTypeSysReserved this pool is reserved for internal use.
PoolElementTypeSysReserved
)
// PoolUnsupportedType type used to describe what actions are unsupported
type PoolUnsupportedType uint64
const (
// PoolUnsupportedVolumeGrow this pool does not allow growing volumes
PoolUnsupportedVolumeGrow PoolUnsupportedType = 1 << iota
// PoolUnsupportedVolumeShrink this pool does not allow shrinking volumes
PoolUnsupportedVolumeShrink
)
// PoolStatusType type used to describe the status of pool
type PoolStatusType uint64
const (
// PoolStatusUnknown Plugin failed to query pool status.
PoolStatusUnknown PoolStatusType = 1 << iota
// PoolStatusOk The data of this pool is accessible with no data loss. But it might
// be set with PoolStatusDegraded to indicate redundancy loss.
PoolStatusOk
// PoolStatusOther Vendor specific status, check Pool.StatusInfo for more information.
PoolStatusOther
// Reserved 1 << 3
_
// PoolStatusDegraded indicates pool has lost data redundancy.
PoolStatusDegraded
// PoolStatusError indicates pool data is not accessible due to some members offline.
PoolStatusError
// Reserved 1 << 6
_
// Reserved 1 << 7
_
// Reserved 1 << 8
_
// PoolStatusStopped pool is stopped by administrator.
PoolStatusStopped
// PoolStatusStarting is reviving from STOPPED status. Pool data is not accessible yet.
PoolStatusStarting
// Reserved 1 << 11
_
// PoolStatusReconstructing pool is be reconstructing hash or mirror data.
PoolStatusReconstructing
// PoolStatusVerifying indicates array is running integrity check(s).
PoolStatusVerifying
// PoolStatusInitializing indicates pool is not accessible and performing initialization.
PoolStatusInitializing
// PoolStatusGrowing indicates pool is growing in size. PoolStatusInfo can contain more
// information about this task. If PoolStatusOk is set, data is still accessible.
PoolStatusGrowing
)
// Disk represents a physical device.
type Disk struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
DiskType DiskType `json:"disk_type"`
BlockSize uint64 `json:"block_size"`
NumOfBlocks uint64 `json:"num_of_blocks"`
Status DiskStatusType `json:"status"`
PluginData *string `json:"plugin_data"`
SystemID string `json:"system_id"`
Location string `json:"location"`
Rpm int `json:"rpm"`
LinkType DiskLinkType `json:"link_type"`
Vpd83 string `json:"vpd83"`
}
// DiskType is an enumerated type representing different types of disks.
type DiskType int
const (
// DiskTypeUnknown Plugin failed to query disk type
DiskTypeUnknown DiskType = iota
// DiskTypeOther Vendor specific disk type
DiskTypeOther
// Reserved "2"
_
// DiskTypeAta IDE disk type.
DiskTypeAta
// DiskTypeSata SATA disk
DiskTypeSata
// DiskTypeSas SAS disk.
DiskTypeSas
// DiskTypeFc FC disk.
DiskTypeFc
// DiskTypeSop SCSI over PCI-Express.
DiskTypeSop
// DiskTypeScsi SCSI disk.
DiskTypeScsi
// DiskTypeLun Remote LUN from SAN array.
DiskTypeLun
// Reserved 10 - 50
// DiskTypeNlSas Near-Line SAS, just SATA disk + SAS port
DiskTypeNlSas DiskType = iota + 41
// DiskTypeHdd Normal HDD, fall back value if failed to detect HDD type(SAS/SATA/etc).
DiskTypeHdd
// DiskTypeSsd Solid State Drive.
DiskTypeSsd
// DiskTypeHybrid Hybrid disk uses a combination of HDD and SSD.
DiskTypeHybrid
)
// DiskLinkType is an enumerated type representing different types of disk connection.
type DiskLinkType int
const (
// DiskLinkTypeNoSupport Plugin does not support querying disk link type.
DiskLinkTypeNoSupport DiskLinkType = iota + -2
// DiskLinkTypeUnknown Plugin failed to query disk link type
DiskLinkTypeUnknown
// DiskLinkTypeFc Fibre channel
DiskLinkTypeFc
// Skip enumerated value "1" which is unused
_
//DiskLinkTypeSsa Serial Storage Architecture
DiskLinkTypeSsa
// DiskLinkTypeSbp Serial Bus Protocol, used by IEEE 1394.
DiskLinkTypeSbp
// DiskLinkTypeSrp SCSI RDMA Protocol
DiskLinkTypeSrp
// DiskLinkTypeIscsi Internet Small Computer System Interface
DiskLinkTypeIscsi
// DiskLinkTypeSas Serial Attached SCSI.
DiskLinkTypeSas
// DiskLinkTypeAdt Automation/Drive Interface Transport. Often used by tape.
DiskLinkTypeAdt
// DiskLinkTypeAta PATA/IDE or SATA.
DiskLinkTypeAta
// DiskLinkTypeUsb USB
DiskLinkTypeUsb
// DiskLinkTypeSop SCSI over PCI-E.
DiskLinkTypeSop
// DiskLinkTypePciE PCI-E, e.g. NVMe.
DiskLinkTypePciE
)
// DiskStatusType base type for bitfield
type DiskStatusType uint64
// These constants are bitfields, eg. more than one bit can be set at the same time.
const (
// DiskStatusUnknown Plugin failed to query out the status of disk.
DiskStatusUnknown DiskStatusType = 1 << iota
// DiskStatusOk Disk is up and healthy.
DiskStatusOk
//DiskStatusOther Vendor specific status.
DiskStatusOther
//DiskStatusPredictiveFailure Disk is functional but will fail soon
DiskStatusPredictiveFailure
//DiskStatusError Disk is not functional
DiskStatusError
//DiskStatusRemoved Disk was removed by administrator
DiskStatusRemoved
// DiskStatusStarting Disk is in the process of becoming ready.
DiskStatusStarting
// DiskStatusStopping Disk is shutting down.
DiskStatusStopping
// DiskStatusStopped Disk is stopped by administrator.
DiskStatusStopped
// DiskStatusInitializing Disk is not yet functional, could be initializing eg. RAID, zeroed or scrubbed etc.
DiskStatusInitializing
// DiskStatusMaintenanceMode In maintenance for bad sector scan, integrity check and etc
DiskStatusMaintenanceMode
// DiskStatusSpareDisk Disk is configured as a spare disk.
DiskStatusSpareDisk
// DiskStatusReconstruct Disk is reconstructing its data.
DiskStatusReconstruct
// DiskStatusFree Disk is not holding any data and it not designated as a spare.
DiskStatusFree
)
// FileSystem represents a file systems information
type FileSystem struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
TotalSpace uint64 `json:"total_space"`
FreeSpace uint64 `json:"free_space"`
PluginData *string `json:"plugin_data"`
SystemID string `json:"system_id"`
PoolID string `json:"pool_id"`
}
// NfsExport represents exported file systems over NFS.
type NfsExport struct {
Class string `json:"class"`
ID string `json:"id"`
FsID string `json:"fs_id"`
ExportPath string `json:"export_path"`
Auth string `json:"auth"`
Root []string `json:"root"`
Rw []string `json:"rw"`
Ro []string `json:"ro"`
AnonUID int64 `json:"anonuid"`
AnonGID int64 `json:"anongid"`
Options string `json:"options"`
PluginData *string `json:"plugin_data"`
}
// NfsAccess argument for exporting a filesystem
type NfsAccess struct {
Root []string
Rw []string
Ro []string
AnonUID int64
AnonGID int64
}
// AnonUIDGIDNotApplicable use when anonUID or anonGID not applicable for NfsAccess.
const AnonUIDGIDNotApplicable int64 = -1
// AccessGroup represents a collection of initiators.
type AccessGroup struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
InitIDs []string `json:"init_ids"`
InitiatorType InitiatorType `json:"init_type"`
PluginData *string `json:"plugin_data"`
SystemID string `json:"system_id"`
}
// InitiatorType is enumerated type of initiators
type InitiatorType int
const (
// InitiatorTypeUnknown plugin failed to query initiator type
InitiatorTypeUnknown InitiatorType = iota
// InitiatorTypeOther vendor specific initiator type
InitiatorTypeOther
// InitiatorTypeWwpn FC or FCoE WWPN
InitiatorTypeWwpn
// Reserved "3"
_
// Reserved "4"
_
// InitiatorTypeIscsiIqn iSCSI IQN
InitiatorTypeIscsiIqn
// Reserved "6"
_
// InitiatorTypeMixed this access group contains more than 1 type of initiator
InitiatorTypeMixed
)
// TargetPort represents information about target ports.
type TargetPort struct {
Class string `json:"class"`
ID string `json:"id"`
PortType PortType `json:"port_type"`
ServiceAddress string `json:"service_address"`
NetworkAddress string `json:"network_address"`
PhysicalAddress string `json:"physical_address"`
PhysicalName string `json:"physical_name"`
PluginData *string `json:"plugin_data"`
SystemID string `json:"system_id"`
}
// PortType in enumerated type of port
type PortType int32
const (
// PortTypeOther is a vendor specific port type
PortTypeOther PortType = 1 + iota
// PortTypeFc indicates FC port type
PortTypeFc
// PortTypeFCoE indicates FC over Ethernet type
PortTypeFCoE
// PortTypeIscsi indicates FC over iSCSI type
PortTypeIscsi
)
// Battery represents a battery in the system.
type Battery struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
BatteryType BatteryType `json:"type"`
PluginData *string `json:"plugin_data"`
Status BatteryStatus `json:"status"`
SystemID string `json:"system_id"`
}
// BatteryType indicates enumerated type of battery
type BatteryType int32
const (
// BatteryTypeUnknown plugin failed to detect battery type
BatteryTypeUnknown BatteryType = 1 + iota
// BatteryTypeOther vendor specific battery type
BatteryTypeOther
// BatteryTypeChemical indicates li-ion etc.
BatteryTypeChemical
// BatteryTypeCapacitor indicates capacitor
BatteryTypeCapacitor
)
// BatteryStatus indicates bitfield for status of battery
type BatteryStatus uint64
const (
// BatteryStatusUnknown plugin failed to query battery status
BatteryStatusUnknown BatteryStatus = 1 << iota
// BatteryStatusOther vendor specific status
BatteryStatusOther
// BatteryStatusOk indicated battery is healthy and operational
BatteryStatusOk
// BatteryStatusDischarging indicates battery is discharging
BatteryStatusDischarging
// BatteryStatusCharging battery is charging
BatteryStatusCharging
// BatteryStatusLearning indicated battery system is optimizing battery use
BatteryStatusLearning
// BatteryStatusDegraded indicated battery should be checked and/or replaced
BatteryStatusDegraded
// BatteryStatusError indicates battery is in bad state
BatteryStatusError
)
// Capabilities representation
type Capabilities struct {
Class string `json:"class"`
Cap string `json:"cap"`
}
// IsSupported used to determine if a capability is supported
func (c *Capabilities) IsSupported(cap CapabilityType) bool {
var capIdx = int32(cap) * 2
if c.Cap[capIdx:capIdx+2] == "01" {
return true
}
return false
}
// IsSupportedSet is used to determine if 1 or more capabilities
// are supported.
func (c *Capabilities) IsSupportedSet(cap []CapabilityType) bool {
for _, i := range cap {
if !c.IsSupported(i) {
return false
}
}
return true
}
// CapabilityType Enumerated type for capabilities
type CapabilityType uint32
const (
// CapVolumes supports retrieving Volumes
CapVolumes CapabilityType = 20
// CapVolumeCreate supports VolumeCreate
CapVolumeCreate CapabilityType = 21
// CapVolumeCResize supports VolumeResize
CapVolumeCResize CapabilityType = 22
// CapVolumeCReplicate supports VolumeReplicate
CapVolumeCReplicate CapabilityType = 23
// CapVolumeCReplicateClone supports volume replication via clone
CapVolumeCReplicateClone CapabilityType = 24
// CapVolumeCReplicateCopy supports volume replication via copy
CapVolumeCReplicateCopy CapabilityType = 25
// CapVolumeCReplicateMirrorAsync supports volume replication via async. mirror
CapVolumeCReplicateMirrorAsync CapabilityType = 26
// CapVolumeCReplicateMirrorSync supports volume replication via sync. mirror
CapVolumeCReplicateMirrorSync CapabilityType = 27
// CapVolumeCopyRangeBlockSize supports reporting of what block size to be used in Copy Range
CapVolumeCopyRangeBlockSize CapabilityType = 28
// CapVolumeCopyRange supports copying a range of a Volume
CapVolumeCopyRange CapabilityType = 29
// CapVolumeCopyRangeClone supports a range clone of a volume
CapVolumeCopyRangeClone CapabilityType = 30
// CapVolumeCopyRangeCopy supports a range copy of a volume
CapVolumeCopyRangeCopy CapabilityType = 31
// CapVolumeDelete supports volume deletion
CapVolumeDelete CapabilityType = 33
// CapVolumeEnable admin. volume enable
CapVolumeEnable CapabilityType = 34
// CapVolumeDisable admin. volume disable
CapVolumeDisable CapabilityType = 35
// CapVolumeMask support volume masking
CapVolumeMask CapabilityType = 36
// CapVolumeUnmask support volume unmasking
CapVolumeUnmask CapabilityType = 37
// CapAccessGroups supports AccessGroups
CapAccessGroups CapabilityType = 38
// CapAccessGroupCreateWwpn supports access group wwpn creation
CapAccessGroupCreateWwpn CapabilityType = 39
// CapAccessGroupDelete delete an access group
CapAccessGroupDelete CapabilityType = 40
// CapAccessGroupInitiatorAddWwpn support adding WWPN to an access group
CapAccessGroupInitiatorAddWwpn CapabilityType = 41
// CapAccessGroupInitiatorDel supports removal of an initiator from access group
CapAccessGroupInitiatorDel CapabilityType = 42
// CapVolumesMaskedToAg supports listing of volumes masked to access group
CapVolumesMaskedToAg CapabilityType = 43
// CapAgsGrantedToVol list access groups with access to volume
CapAgsGrantedToVol CapabilityType = 44
// CapHasChildDep indicates support for determining if volume has child dep.
CapHasChildDep CapabilityType = 45
// CapChildDepRm indicates support for removing child dep.
CapChildDepRm CapabilityType = 46
// CapAccessGroupCreateIscsiIqn supports ag creating with iSCSI initiator
CapAccessGroupCreateIscsiIqn CapabilityType = 47
// CapAccessGroupInitAddIscsiIqn supports adding iSCSI initiator
CapAccessGroupInitAddIscsiIqn CapabilityType = 48
// CapIscsiChapAuthSet support iSCSI CHAP setting
CapIscsiChapAuthSet CapabilityType = 53
// CapVolRaidInfo supports RAID information
CapVolRaidInfo CapabilityType = 54
// CapVolumeThin supports creating thinly provisioned Volumes.
CapVolumeThin CapabilityType = 55
// CapBatteries supports Batteries Call
CapBatteries CapabilityType = 56
// CapVolCacheInfo supports CacheInfo
CapVolCacheInfo CapabilityType = 57
// CapVolPhyDiskCacheSet support VolPhyDiskCacheSet
CapVolPhyDiskCacheSet CapabilityType = 58
// CapVolPhysicalDiskCacheSetSystemLevel supports VolPhyDiskCacheSet
CapVolPhysicalDiskCacheSetSystemLevel CapabilityType = 59
// CapVolWriteCacheSetEnable supports VolWriteCacheSet
CapVolWriteCacheSetEnable CapabilityType = 60
// CapVolWriteCacheSetAuto supports VolWriteCacheSet
CapVolWriteCacheSetAuto CapabilityType = 61
// CapVolWriteCacheSetDisabled supported VolWriteCacheSet
CapVolWriteCacheSetDisabled CapabilityType = 62
// CapVolWriteCacheSetImpactRead indicates the VolWriteCacheSet might also
// impact read cache policy.
CapVolWriteCacheSetImpactRead CapabilityType = 63
// CapVolWriteCacheSetWbImpactOther Indicate the VolWriteCacheSet with
// `wcp=Cache::Enabled` might impact other volumes in the same
// system.
CapVolWriteCacheSetWbImpactOther CapabilityType = 64
// CapVolReadCacheSet Support VolReadCacheSet()
CapVolReadCacheSet CapabilityType = 65
// VolReadCacheSetImpactWrite Indicates the VolReadCacheSet might
// also impact write cache policy.
VolReadCacheSetImpactWrite CapabilityType = 66
// CapFs support Fs listing.
CapFs CapabilityType = 100
// CapFsDelete supports FsDelete
CapFsDelete CapabilityType = 101
// CapFsResize Support FsResize
CapFsResize CapabilityType = 102
// CapFsCreate support FsCreate
CapFsCreate CapabilityType = 103
// CapFsClone support FsClone
CapFsClone CapabilityType = 104
// CapFsFileClone support FsFileClone
CapFsFileClone CapabilityType = 105
// CapFsSnapshots support FsSnapshots
CapFsSnapshots CapabilityType = 106
// CapFsSnapshotCreate support FsSnapshotCreate
CapFsSnapshotCreate CapabilityType = 107
// CapFsSnapshotDelete support FfsSnapshotDelete
CapFsSnapshotDelete CapabilityType = 109
// CapFsSnapshotRestore support FsSnapshotRestore
CapFsSnapshotRestore CapabilityType = 110
// CapFsSnapshotRestoreSpecificFiles support FsSnapshotRestore with `files` argument.
CapFsSnapshotRestoreSpecificFiles CapabilityType = 111
// CapFsHasChildDep support FsHasChildDep
CapFsHasChildDep CapabilityType = 112
// CapFsChildDepRm support FsChildDepRm
CapFsChildDepRm CapabilityType = 113
// CapFsChildDepRmSpecificFiles support FsChildDepRm with `files` argument.
CapFsChildDepRmSpecificFiles CapabilityType = 114
// CapNfsExportAuthTypeList support NfsExpAuthTypeList
CapNfsExportAuthTypeList CapabilityType = 120
// CapNfsExports support NfsExports
CapNfsExports CapabilityType = 121
// CapFsExport support FsExport
CapFsExport CapabilityType = 122
// CapFsUnexport support FsUnexport
CapFsUnexport CapabilityType = 123
// CapFsExportCustomPath support FsExport
CapFsExportCustomPath CapabilityType = 124
// CapSysReadCachePctSet support SystemReadCachePctSet
CapSysReadCachePctSet CapabilityType = 158
// CapSysReadCachePctGet support Systems() `ReadCachePct` property
CapSysReadCachePctGet CapabilityType = 159
// CapSysFwVersionGet support Systems() with valid `FwVersion` property.
CapSysFwVersionGet CapabilityType = 160
// CapSysModeGet support `Systems()` with valid `mode` property.
CapSysModeGet CapabilityType = 161
// CapDiskLocation support Disks with valid `Location` property.
CapDiskLocation CapabilityType = 163
// CapDiskRpm support `Disks()` with valid `Rpm` property.
CapDiskRpm CapabilityType = 164
// CapDiskLinkType support `Disks()` with valid `LinkType` property.
CapDiskLinkType CapabilityType = 165
// CapVolumeLed support `VolIdentLedOn()` and `VolIdentLedOff()`.
CapVolumeLed CapabilityType = 171
// CapTargetPorts Support TargetPorts()
CapTargetPorts CapabilityType = 216
// CapDisks support Disks()
CapDisks CapabilityType = 220
// CapPoolMemberInfo support `PoolMemberInfo()`
CapPoolMemberInfo CapabilityType = 221
// CapVolumeRaidCreate support `VolRaidCreateCapGet()` and
// VolRaidCreate().
CapVolumeRaidCreate CapabilityType = 222
//CapDiskVpd83Get support `Disks()` with valid `Vpd83` property.
CapDiskVpd83Get CapabilityType = 223
)
// BlockRange defines a source block, destination block and number of blocks
type BlockRange struct {
Class string `json:"class"`
SrcBlkAddr uint64 `json:"src_block"`
DstBlkAddr uint64 `json:"dest_block"`
BlkCount uint64 `json:"block_count"`
}
// FileSystemSnapShot defines information relating to a file system snapshot
type FileSystemSnapShot struct {
Class string `json:"class"`
ID string `json:"id"`
Name string `json:"name"`
Ts uint64 `json:"ts"`
PluginData *string `json:"plugin_data"`
}
// RaidType what type of RAID
type RaidType int
const (
// RaidUnknown Plugin failed to detect RAID type.
RaidUnknown RaidType = -1
// Raid0 https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_0
Raid0 RaidType = 0
// Raid1 is disk mirror
Raid1 RaidType = 1
// Raid3 is byte level striping with dedicated parity
Raid3 RaidType = 3
// Raid4 Block-level striping with dedicated parity.
Raid4 RaidType = 4
// Raid5 Block-level striping with distributed parity.
Raid5 RaidType = 5
// Raid6 Block-level striping with two distributed parities. Also known as
// RAID-DP.
Raid6 RaidType = 6
// Raid10 Stripe of mirrors.
Raid10 RaidType = 10
// Raid15 Parity of mirrors.
Raid15 RaidType = 15
// Raid16 Dual parity of mirrors.
Raid16 RaidType = 16
// Raid50 Stripe of parities.
Raid50 RaidType = 50
// Raid60 Stripe of dual parities.
Raid60 RaidType = 60
// Raid51 Mirror of parities.
Raid51 RaidType = 51
// Raid61 Mirror of dual parities.
Raid61 RaidType = 61
// RaidJbod Just bunch of disks, no parity, no striping.
RaidJbod RaidType = 20
// RaidMixed volume contains multiple RAID settings.
RaidMixed RaidType = 21
// RaidOther Vendor specific RAID type
RaidOther RaidType = 22
)
// VolumeRaidInfo information about RAID
type VolumeRaidInfo struct {
Type RaidType
StripSize uint32
DiskCount uint32
MinIOSize uint32
OptIOSize uint32
}
// MemberType represents unique type for pool member type
type MemberType int
const (
// MemberTypeUnknown plugin failed to detect the RAID member type.
MemberTypeUnknown MemberType = iota
// MemberTypeOther vendor specific RAID member type.
MemberTypeOther
// MemberTypeDisk pool is created from RAID group using whole disks.
MemberTypeDisk
// MemberTypePool pool is allocated from other pool.
MemberTypePool
)
// PoolMemberInfo information about what a pool is composed from.
type PoolMemberInfo struct {
Raid RaidType
Member MemberType
ID []string
}
// SupportedRaidCapability is types and stripe sizes RAID storage supports.
type SupportedRaidCapability struct {
Types []RaidType
StripeSizes []uint32
}
// WriteCachePolicy represents write cache policy type
type WriteCachePolicy uint32
const (
// WriteCachePolicyUnknown ...
WriteCachePolicyUnknown WriteCachePolicy = 1 + iota
// WriteCachePolicyWriteBack ...
WriteCachePolicyWriteBack
// WriteCachePolicyAuto ...
WriteCachePolicyAuto
// WriteCachePolicyWriteThrough ...
WriteCachePolicyWriteThrough
)
// WriteCacheStatus represents write cache status type
type WriteCacheStatus uint32
const (
// WriteCacheStatusUnknown ...
WriteCacheStatusUnknown WriteCacheStatus = 1 + iota
// WriteCacheStatusWriteBack ...
WriteCacheStatusWriteBack
// WriteCacheStatusWriteThrough ...
WriteCacheStatusWriteThrough
)