forked from libopenstorage/openstorage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.proto
5937 lines (5320 loc) · 191 KB
/
api.proto
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
/// Please use the following editor setup for this file:
// Tab size=2; Tabs as spaces; Clean up trailing whitepsace
//
// In vim add: au FileType proto setl sw=2 ts=2 expandtab list
//
// Note, the documentation provided here for can be created in
// markdown format plus the use of 'codetabs' are supported. The documentation
// will then be rendered by github.com/openstoreage/libopenstoreage.github.io and
// provided on https://libopenstorage.github.io
//
syntax = "proto3";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
package openstorage.api;
option go_package = "./api;api";
option java_multiple_files = true;
option java_package = "com.openstorage.api";
enum Status {
STATUS_NONE = 0;
STATUS_INIT = 1;
STATUS_OK = 2;
STATUS_OFFLINE = 3;
STATUS_ERROR = 4;
STATUS_NOT_IN_QUORUM = 5;
STATUS_DECOMMISSION = 6;
STATUS_MAINTENANCE = 7;
STATUS_STORAGE_DOWN = 8;
STATUS_STORAGE_DEGRADED = 9;
STATUS_NEEDS_REBOOT = 10;
STATUS_STORAGE_REBALANCE = 11;
STATUS_STORAGE_DRIVE_REPLACE = 12;
STATUS_NOT_IN_QUORUM_NO_STORAGE = 13;
STATUS_POOLMAINTENANCE = 14;
// Add statuses before MAX and update the number for MAX
STATUS_MAX = 15;
}
enum DriverType {
DRIVER_TYPE_NONE = 0;
DRIVER_TYPE_FILE = 1;
DRIVER_TYPE_BLOCK = 2;
DRIVER_TYPE_OBJECT = 3;
DRIVER_TYPE_CLUSTERED = 4;
DRIVER_TYPE_GRAPH = 5;
}
enum FSType {
FS_TYPE_NONE = 0;
FS_TYPE_BTRFS = 1;
FS_TYPE_EXT4 = 2;
FS_TYPE_FUSE = 3;
FS_TYPE_NFS = 4;
FS_TYPE_VFS = 5;
FS_TYPE_XFS = 6;
FS_TYPE_ZFS = 7;
FS_TYPE_XFSv2 = 8;
}
enum GraphDriverChangeType {
GRAPH_DRIVER_CHANGE_TYPE_NONE = 0;
GRAPH_DRIVER_CHANGE_TYPE_MODIFIED = 1;
GRAPH_DRIVER_CHANGE_TYPE_ADDED = 2;
GRAPH_DRIVER_CHANGE_TYPE_DELETED = 3;
}
enum SeverityType {
SEVERITY_TYPE_NONE = 0;
SEVERITY_TYPE_ALARM = 1;
SEVERITY_TYPE_WARNING = 2;
SEVERITY_TYPE_NOTIFY = 3;
}
enum ResourceType {
RESOURCE_TYPE_NONE = 0;
RESOURCE_TYPE_VOLUME = 1;
RESOURCE_TYPE_NODE = 2;
RESOURCE_TYPE_CLUSTER = 3;
RESOURCE_TYPE_DRIVE = 4;
RESOURCE_TYPE_POOL = 5;
}
enum AlertActionType {
ALERT_ACTION_TYPE_NONE = 0;
ALERT_ACTION_TYPE_DELETE = 1;
ALERT_ACTION_TYPE_CREATE = 2;
ALERT_ACTION_TYPE_UPDATE = 3;
}
enum VolumeActionParam {
VOLUME_ACTION_PARAM_NONE = 0;
// Maps to the boolean value false
VOLUME_ACTION_PARAM_OFF = 1;
// Maps to the boolean value true.
VOLUME_ACTION_PARAM_ON = 2;
}
enum CosType {
NONE = 0;
LOW = 1;
MEDIUM = 2;
HIGH = 3;
}
enum IoProfile {
IO_PROFILE_SEQUENTIAL = 0;
IO_PROFILE_RANDOM= 1;
IO_PROFILE_DB = 2;
IO_PROFILE_DB_REMOTE = 3;
IO_PROFILE_CMS = 4;
IO_PROFILE_SYNC_SHARED = 5;
IO_PROFILE_AUTO = 6;
IO_PROFILE_NONE = 7;
}
// VolumeState represents the state of a volume.
enum VolumeState {
VOLUME_STATE_NONE = 0;
// Volume is transitioning to new state
VOLUME_STATE_PENDING = 1;
// Volume is ready to be assigned to a container
VOLUME_STATE_AVAILABLE = 2;
// Volume is attached to container
VOLUME_STATE_ATTACHED = 3;
// Volume is detached but associated with a container
VOLUME_STATE_DETACHED = 4;
// Volume detach is in progress
VOLUME_STATE_DETATCHING = 5;
// Volume is in error state
VOLUME_STATE_ERROR = 6;
// Volume is deleted, it will remain in this state
// while resources are asynchronously reclaimed
VOLUME_STATE_DELETED = 7;
// Volume is trying to be detached
VOLUME_STATE_TRY_DETACHING = 8;
// Volume is undergoing restore
VOLUME_STATE_RESTORE = 9;
}
// VolumeStatus represents a health status for a volume.
enum VolumeStatus {
VOLUME_STATUS_NONE = 0;
// Volume is not present
VOLUME_STATUS_NOT_PRESENT = 1;
// Volume is healthy
VOLUME_STATUS_UP = 2;
// Volume is in fail mode
VOLUME_STATUS_DOWN = 3;
// Volume is up but with degraded performance
// In a RAID group, this may indicate a problem with one or more drives
VOLUME_STATUS_DEGRADED = 4;
}
enum FilesystemHealthStatus {
// filesystem health status is unknown
FS_HEALTH_STATUS_UNKNOWN = 0;
// filesystem is a healthy
FS_HEALTH_STATUS_HEALTHY = 1;
// filesystem has errors, but can be fixed safely
FS_HEALTH_STATUS_SAFE_TO_FIX = 2;
// filesystem has errors, these cannot be fixed automatically,
// user needs to review the reported errors and take appropriate action
FS_HEALTH_STATUS_NEEDS_INSPECTION = 3;
}
enum StorageMedium {
// Magnetic spinning disk.
STORAGE_MEDIUM_MAGNETIC = 0;
// SSD disk
STORAGE_MEDIUM_SSD = 1;
// NVME disk
STORAGE_MEDIUM_NVME = 2;
}
enum AttachState {
// Attached and available externally
ATTACH_STATE_EXTERNAL = 0;
// Attached but only available internally
ATTACH_STATE_INTERNAL = 1;
// Switching from External to Internal
ATTACH_STATE_INTERNAL_SWITCH = 2;
}
enum OperationFlags {
OP_FLAGS_UNKNOWN = 0;
OP_FLAGS_NONE = 1;
// Perform a force_detach during detach operation
OP_FLAGS_DETACH_FORCE = 2;
}
enum HardwareType {
// When we do not know the machine type alsp the default
UnknownMachine = 0;
// when we are running on virtual machine
VirtualMachine = 1;
// when we are running on physical hardware
BareMetalMachine = 2;
}
// StorageResource groups properties of a storage device.
message StorageResource {
// Id is the LUN identifier.
string id = 1;
// Path device path for this storage resource.
string path = 2;
// Storage medium.
StorageMedium medium = 3;
// True if this device is online.
bool online = 4;
// IOPS
uint64 iops = 5;
// SeqWrite
double seq_write = 6;
// SeqRead
double seq_read = 7;
// RandRW
double randRW = 8;
// Total size in bytes.
uint64 size = 9;
// Physical Bytes used.
uint64 used = 10;
// True if this device is rotational.
string rotation_speed = 11;
// Timestamp of last time this device was scanned.
google.protobuf.Timestamp last_scan = 12;
// True if dedicated for metadata.
bool metadata = 13;
// True if dedicated as cache
bool cache = 14;
// True if the resource is used as thin pool metadata disk
bool pool_metadata_dev = 15;
}
// StoragePool groups different storage devices based on their CosType
message StoragePool {
// Deprecated! Use `uuid` instead. ID pool ID
int32 ID = 1;
// Cos reflects the capabilities of this drive pool
CosType Cos = 2;
// Medium underlying storage type
StorageMedium Medium = 3;
// RaidLevel storage raid level
string RaidLevel = 4;
// TotalSize of the pool
uint64 TotalSize = 7;
// Used size of the pool
uint64 Used = 8;
// Labels is a list of user defined name-value pairs
map<string, string> labels = 9;
// UUID is the unique identifier for a storage pool
string uuid = 10;
// LastOperation is the most recent operation being performed on a storage pool
StoragePoolOperation last_operation = 11;
}
// SchedulerTopology defines the topology information of the storage node
// in scheduler context
message SchedulerTopology {
// Key-value pairs defining the topology of the node
map<string, string> labels = 1;
}
// StoragePoolOperation defines an operation being performed on a storage pool
message StoragePoolOperation {
// Type is the type of the operation
SdkStoragePool.OperationType type = 1;
// Msg is a user friendly message for the operation
string msg = 2;
// Params for the parameters for the operation
map<string, string> params = 3;
// Status is the status of the operation
SdkStoragePool.OperationStatus status = 4;
}
// TopologyRequirement defines the topology requirement for a volume
message TopologyRequirement {
// Key-value pairs defining the required topology for a volume
map<string, string> labels = 1;
}
// VolumeLocator is a structure that is attached to a volume
// and is used to carry opaque metadata.
message VolumeLocator {
// User friendly identifier
string name = 1;
// A set of name-value pairs that acts as search filters
map<string, string> volume_labels = 2;
// Filter with ownership
Ownership ownership = 3;
// Filter by group
Group group = 4;
// Volume Ids to match
repeated string volume_ids = 5;
}
// Options used for volume inspection
message VolumeInspectOptions {
// Deep inspection is used to collect more information about
// the volume. Setting this value may delay the request.
bool deep = 1;
}
// Source is a structure that can be given to a volume
// to seed the volume with data.
message Source {
// A volume id, if specified will create a clone of the parent.
string parent = 1;
// Seed will seed the volume from the specified URI
// Any additional config for the source comes from the labels in the spec
string seed = 2;
}
// Group represents VolumeGroup / namespace
// All volumes in the same group share this object.
message Group {
// Id common identifier across volumes that have the same group.
string id = 1;
}
// IoStrategy defines how I/O should be performed to backing storage media.
message IoStrategy {
// AsyncIO enables kaio.
bool async_io = 1;
// EarlyAck enables acks for async I/O at the source.
bool early_ack = 2;
// Enable direct I/O on the backing datastore
bool direct_io = 3;
}
// Xattr defines implementation specific volume attribute
message Xattr {
enum Value {
// Value is uninitialized or unknown
UNSPECIFIED = 0;
// Enable on-demand copy-on-write on the volume
COW_ON_DEMAND = 1;
}
}
// ExportProtocol defines how the device is exported..
enum ExportProtocol {
// Invalid uninitialized value
INVALID = 0;
// PXD the volume is exported over Portworx block interface.
PXD = 1;
// ISCSI the volume is exported over ISCSI.
ISCSI = 2;
// NFS the volume is exported over NFS.
NFS = 3;
// Custom the volume is exported over custom interface.
CUSTOM = 4;
}
// ExportSpec defines how the volume is exported..
message ExportSpec {
// ExportProtocol defines how the volume is exported.
ExportProtocol export_protocol = 1;
// ExportOptions options exporting the volume.
string export_options = 2;
}
// ProxyProtocol defines the protocol used for proxy.
enum ProxyProtocol {
// Invalid uninitialized value
PROXY_PROTOCOL_INVALID = 0;
// NFS indicates that the external data source is NFS and the volume
// will be reflected over NFS protocol
PROXY_PROTOCOL_NFS = 1;
// S3 indicates that the external data source is an object store.
PROXY_PROTOCOL_S3 = 2;
// PXD indicates that the external data source is a Portworx block volume.
PROXY_PROTOCOL_PXD = 3;
// PURE_BLOCK indicates that the external data source is a pure_block volume.
PROXY_PROTOCOL_PURE_BLOCK = 4;
// PURE_FILE indicates that the external data source is a pure_file volume.
PROXY_PROTOCOL_PURE_FILE = 5;
}
// NFSProxySpec is the spec for proxying an NFS share.
message NFSProxySpec {
// ExportPath is the NFS export path on the NFS server
string export_path = 1;
// SubPath is the sub-directory from an NFS share that should be reflected.
string sub_path = 2;
}
// S3ProxySpec is the spec for proxying an external object store.
message S3ProxySpec {
// BucketName is the name of the bucket from the object store
string bucket_name = 1;
}
// PXDProxySpec is the spec for proxying a Portworx volume
message PXDProxySpec {
// ID of the remote portworx volume
string id = 1;
}
// PureBlockSpec is the spec for proxying a volume on pure_block backends
message PureBlockSpec {
string serial_num = 1;
string full_vol_name = 2;
}
// PureFileSpec is the spec for proxying a volume on pure_file backends
message PureFileSpec {
string export_rules = 1;
string full_vol_name = 2;
}
// ProxySpec defines how this volume will reflect an external data source.
message ProxySpec {
// ProxyProtocol defines the protocol used for proxy.
ProxyProtocol proxy_protocol = 1;
// Endpoint is the external endpoint which can be used for accessing the
// external data source.
string endpoint = 2;
// NFSProxySpec is the spec for proxying an NFS share
NFSProxySpec nfs_spec = 3;
// S3ProxySpec is the spec for proxying an external object store
S3ProxySpec s3_spec = 4;
// PXDProxySpec is the spec for proxying a Portworx volume
PXDProxySpec pxd_spec = 5;
// PureFileSpec is the spec for proxying a volume on pure_file backends
PureBlockSpec pure_block_spec = 6;
// PureFileSpec is the spec for proxying a volume on pure_file backends
PureFileSpec pure_file_spec = 7;
}
// Sharedv4ServiceSpec when set, creates a service endpoint for accessing
// a sharedv4 volume.
message Sharedv4ServiceSpec {
// Name of the service. If not provided the name of the volume will be
// used for setting up a service
string name = 1;
// Indicates what kind of service would be created for this volume.
ServiceType type = 2;
// Indicates whether the service needs to be accessed outside of the cluster
bool external_access = 3;
// Type of sharedv4 service. Values are governed by the different types
// of services supported by container orchestrators such as Kubernetes.
enum ServiceType {
// Unspecified
UNSPECIFIED = 0;
// Export the sharedv4 service on each Node's IP.
// In this mode the sharedv4 volume can be accessed from outside the
// cluster using one of the node's IPs.
NODEPORT = 1;
// Export the shared4 service on an internal cluster IP.
// In this mode the sharedv4 volume will only be accessible
// within the cluster via this service.
CLUSTERIP = 2;
// Expose the sharedv4 service on cloud provider's load balancer.
// Applicable when running in cloud. In this mode the sharedv4 volume
// can be accessed from outside the cluster.
LOADBALANCER = 3;
// Do not use sharedv4 service feature. Use legacy sharedv4 volumes instead.
NONE = 4;
}
}
// Sharedv4FailoverStrategy specifies how long to wait before failing over to a new server.
message Sharedv4FailoverStrategy {
enum Value {
// Unspecified
UNSPECIFIED = 0;
// Fail over to the new NFS server quickly. This is appropriate for
// the apps with sharedv4 service volumes. It can also be used
// for the apps with sharedv4 volumes when such apps are able
// to restart quickly.
AGGRESSIVE = 1;
// Give the old NFS server more time to come back up before
// triggering the failover. This is appropriate for the apps
// with sharedv4 volumes (non-service).
NORMAL = 2;
}
}
// Sharedv4Spec specifies common properties of sharedv4 and sharedv4 service volumes
message Sharedv4Spec {
// Indicates how aggressively to fail over to a new server.
Sharedv4FailoverStrategy.Value failover_strategy = 1;
}
// MountOptions defines the mount options with which a volume is mounted.
message MountOptions {
// Options are opaque key value pairs that are passed as mount options when
// a volume is mounted.
// If an empty value is provided only the key will be passed as an option
// If both key and value are provided then 'key=value' will be passed as an
// option
map<string, string> options = 1;
}
// fastpath extensions
enum FastpathStatus {
// backward compatible state
FASTPATH_UNKNOWN = 0;
// fastpath activated and enabled
FASTPATH_ACTIVE = 1;
// fastpath inactive
FASTPATH_INACTIVE = 2;
// fastpath unsupported, disabled
FASTPATH_UNSUPPORTED = 3;
// fastpath operation setup in progress
FASTPATH_PENDING = 4;
// fastpath error'd, possible stuck failure
FASTPATH_ERRORED = 5;
}
enum FastpathProtocol {
FASTPATH_PROTO_UNKNOWN = 0;
FASTPATH_PROTO_NVMEOF_TCP = 1;
FASTPATH_PROTO_ISCSI = 2;
FASTPATH_PROTO_LOCAL = 3;
}
message FastpathReplState {
uint64 dev_id = 1;
uint32 node_id = 2;
FastpathProtocol protocol = 3;
bool acl = 4;
// target info
string exported_device = 5;
bool block = 6;
string target = 7;
bool exported = 8;
// initiator info
bool imported = 9;
string devpath = 10;
// node_uuid added to enhance UI reporting
string node_uuid = 11;
}
// FastpathConfig part of volume
message FastpathConfig {
// fastpath setup on this node
int32 setup_on = 1;
// Fastpath temporary promotion during attach
bool promote = 2;
// Fastpath consolidated current status across replicas
FastpathStatus status = 3;
// Fastpath replica state for each replica in replica set
repeated FastpathReplState replicas = 4;
// Dirty flag on volume - was attached in userspace
bool dirty = 5;
// fastpath coordinator node uuid to enhance reporting
string coord_uuid = 6;
// fastpath force failover, disable auto promote to fastpath
bool force_failover = 7;
}
// ScanPolicy defines when a filesystem check is triggered and what action to take
// User can specify *one* of the following valid policies
// 1. trigger=SCAN_TRIGGER_ON_MOUNT, action=SCAN_ACTION_SCAN_ONLY
// 2. trigger=SCAN_TRIGGER_ON_MOUNT, action=SCAN_ACTION_SCAN_REPAIR
// 3. trigger=SCAN_TRIGGER_ON_NEXT_MOUNT, action=SCAN_ACTION_SCAN_ONLY
// 4. trigger=SCAN_TRIGGER_ON_NEXT_MOUNT, action=SCAN_ACTION_SCAN_REPAIR
// 5. trigger=SCAN_TRIGGER_NONE, action=SCAN_ACTION_NONE
// Note: When trigger == SCAN_TRIGGER_ON_NEXT_MOUNT, the associated action is
// performed once on the next mount and the scanpolicy gets reset to
// `trigger=SCAN_TRIGGER_NONE, action=SCAN_ACTION_NONE`, irrespective of the
// output of the action.
message ScanPolicy {
enum ScanTrigger {
SCAN_TRIGGER_NONE = 0;
SCAN_TRIGGER_ON_MOUNT = 1;
SCAN_TRIGGER_ON_NEXT_MOUNT = 2;
}
enum ScanAction {
SCAN_ACTION_NONE = 0;
SCAN_ACTION_SCAN_ONLY = 1;
SCAN_ACTION_SCAN_REPAIR = 2;
}
ScanTrigger trigger = 1;
ScanAction action = 2;
}
// IoThrottle defines IO throttle limits for a volume
// read_iops : maximum read iops this volume is allowed
// write_iops : maximum write iops this volume is allowed
// read_bw_mbytes : maximum read bandwidth this volume is allowed in MegaBytes
// write_bw_mbytes : maximum write bandwidth this volume is allowed in MegaBytes
message IoThrottle {
uint32 read_iops = 1;
uint32 write_iops = 2;
uint32 read_bw_mbytes = 3;
uint32 write_bw_mbytes = 4;
}
enum NearSyncReplicationStrategy {
NEAR_SYNC_STRATEGY_NONE = 0;
NEAR_SYNC_STRATEGY_AGGRESSIVE = 1;
NEAR_SYNC_STRATEGY_OPTIMIZED = 2;
}
// VolumeSpec has the properties needed to create a volume.
message VolumeSpec {
// Ephemeral storage
bool ephemeral = 1;
// Size specifies the thin provisioned volume size in bytes
uint64 size = 2;
// Format specifies the filesystem for this volume.
FSType format = 3;
// BlockSize for the filesystem.
int64 block_size = 4;
// HaLevel specifies the number of copies of data.
int64 ha_level = 5;
// Cos specifies the relative class of service.
CosType cos = 6;
// IoProfile provides a hint about application using this volume.
IoProfile io_profile = 7;
// Dedupe specifies if the volume data is to be de-duplicated.
bool dedupe = 8;
// SnapshotInterval in minutes, set to 0 to disable snapshots
uint32 snapshot_interval = 9;
// (deprecated, do not use) VolumeLabels configuration labels
map<string, string> volume_labels = 10;
// Shared is true if this volume can be concurrently accessed by multiple users.
bool shared = 11;
// ReplicaSet is the desired set of nodes for the volume data.
ReplicaSet replica_set = 12;
// Aggregation level Specifies the number of parts the volume can be aggregated from.
uint32 aggregation_level = 13;
// Encrypted is true if this volume will be cryptographically secured.
bool encrypted = 14;
// Passphrase for an encrypted volume
string passphrase = 15;
// SnapshotSchedule a well known string that specifies when snapshots should be taken.
string snapshot_schedule = 16;
// Scale allows autocreation of volumes.
uint32 scale = 17;
// Sticky volumes cannot be deleted until the flag is removed.
bool sticky = 18;
// Group identifies a consistency group
Group group = 21;
// GroupEnforced is true if consistency group creation is enforced.
bool group_enforced = 22;
// Compressed is true if this volume is to be compressed.
bool compressed = 23;
// Cascaded is true if this volume can be populated on any node from an external source.
bool cascaded = 24;
// Journal is true if data for the volume goes into the journal.
bool journal = 25;
// Sharedv4 is true if this volume can be accessed via sharedv4.
bool sharedv4 = 26;
// QueueDepth defines the desired block device queue depth
uint32 queue_depth = 27;
// Use to force a file system type which is not recommended.
// The driver may still refuse to use the file system type.
bool force_unsupported_fs_type = 28;
// Nodiscard specifies if the volume will be mounted with discard support disabled.
// i.e. FS will not release allocated blocks back to the backing storage pool.
bool nodiscard = 29;
// IoStrategy preferred strategy for I/O.
IoStrategy io_strategy = 30;
// PlacementStrategy specifies a spec to indicate where to place the volume.
VolumePlacementStrategy placement_strategy = 31;
// StoragePolicy if applied/specified while creating volume
string storage_policy = 32;
// Ownership
Ownership ownership = 33;
// ExportSpec defines how the volume should be exported.
ExportSpec export_spec = 34;
// fastpath extensions
bool fp_preference = 35;
// Xattr specifies implementation specific volume attributes
Xattr.Value xattr = 36;
// ScanPolicy specifies the filesystem check policy
ScanPolicy scan_policy = 37;
// MountOptions defines the options that will be used while mounting this volume
MountOptions mount_options = 38;
// Sharedv4MountOptions defines the options that will be used while mounting a sharedv4 volume
// from a node where the volume replica does not exist
MountOptions sharedv4_mount_options = 39;
// Proxy_write if true, per volume proxy write replication enabled
bool proxy_write = 40;
// ProxySpec indicates that this volume is used for proxying an external data source
ProxySpec proxy_spec = 41;
// Sharedv4ServiceSpec specifies a spec for configuring a service for a sharedv4 volume
Sharedv4ServiceSpec sharedv4_service_spec = 42;
// Sharedv4Spec specifies common properties of sharedv4 and sharedv4 service volumes
Sharedv4Spec sharedv4_spec = 43;
// Autofstrim indicates that fstrim would be run on this volume automatically, without user intervention
bool auto_fstrim = 44;
// IoThrottle specifies maximum io(iops/bandwidth) this volume is restricted to
IoThrottle io_throttle = 45;
// NumberOfChunks indicates how many chunks must be created, 0 and 1 both mean 1
uint32 number_of_chunks = 46;
// Enable readahead for the volume
bool readahead = 47;
// TopologyRequirement topology requirement for this volume
TopologyRequirement topology_requirement = 48;
// winshare is true if this volume can be accessed from windows pods.
bool winshare = 49;
// Filesystem create options to be honored.
string fa_create_options = 50;
// NearSync specifies the volume has a near-sync replica
bool near_sync = 51;
// NearSyncReplicationStrategy is replication startegy for near sync volumes
NearSyncReplicationStrategy near_sync_replication_strategy = 52;
}
// VolumeSpecUpdate provides a method to set any of the VolumeSpec of an existing volume
message VolumeSpecUpdate {
// Size specifies the thin provisioned volume size in bytes
oneof size_opt { uint64 size = 2; }
// HaLevel specifies the number of copies of data.
oneof ha_level_opt { int64 ha_level = 5; }
// Cos specifies the relative class of service.
oneof cos_opt { CosType cos = 6; }
// IoProfile provides a hint about application using this volume.
oneof io_profile_opt { IoProfile io_profile = 7; }
// Dedupe specifies if the volume data is to be de-duplicated.
oneof dedupe_opt { bool dedupe = 8; }
// SnapshotInterval in minutes, set to 0 to disable snapshots
oneof snapshot_interval_opt { uint32 snapshot_interval = 9; }
// Shared is true if this volume can be remotely accessed.
oneof shared_opt { bool shared = 11; }
// ReplicaSet is the desired set of nodes for the volume data.
ReplicaSet replica_set = 12;
// Passphrase for an encrypted volume
oneof passphrase_opt { string passphrase = 15; }
// SnapshotSchedule a well known string that specifies when snapshots should be taken.
oneof snapshot_schedule_opt { string snapshot_schedule = 16; }
// Scale allows autocreation of volumes.
oneof scale_opt { uint32 scale = 17; }
// Sticky volumes cannot be deleted until the flag is removed.
oneof sticky_opt { bool sticky = 18; }
// Group identifies a consistency group
oneof group_opt { Group group = 19; }
// Journal is true if data for the volume goes into the journal.
oneof journal_opt { bool journal = 23; }
// Sharedv4 is true if this volume can be accessed via sharedv4.
oneof sharedv4_opt { bool sharedv4 = 24; }
// QueueDepth defines the desired block device queue depth
oneof queue_depth_opt { uint32 queue_depth = 25; }
// Ownership volume information to update. If the value of `owner` in the
// `ownership` message is an empty string then the value of `owner` in
// the `VolumeSpec.Ownership.owner` will not be updated.
Ownership ownership = 26;
// Nodiscard specifies if the volume will be mounted with discard support disabled.
// i.e. FS will not release allocated blocks back to the backing storage pool.
oneof nodiscard_opt { bool nodiscard = 27; }
// IoStrategy preferred strategy for I/O.
IoStrategy io_strategy = 28;
// ExportSpec volume export spec
oneof export_spec_opt { ExportSpec export_spec = 29; }
// fastpath preference
oneof fastpath_opt { bool fastpath = 30; }
// Xattr specifies implementation specific volume attributes
oneof xattr_opt { Xattr.Value xattr = 31; }
// scan_policy_opt defines the filesystem check policy for the volume
oneof scan_policy_opt { ScanPolicy scan_policy = 32;}
// mount_opt provides the mount time options for a volume
oneof mount_opt { MountOptions mount_opt_spec = 33;}
// sharedv4_mount_opt provides the client side mount time options for a sharedv4 volume
oneof sharedv4_mount_opt { MountOptions sharedv4_mount_opt_spec = 34;}
// Proxy_write is true if proxy write replication is enabled for the volume
oneof proxy_write_opt { bool proxy_write = 35; }
// proxy_spec_opt provides the spec for a proxy volume
oneof proxy_spec_opt { ProxySpec proxy_spec = 36;}
// sharedv4_service_spec_opt provides the spec for sharedv4 volume service
oneof sharedv4_service_spec_opt { Sharedv4ServiceSpec sharedv4_service_spec = 37;}
// Sharedv4Spec specifies common properties of sharedv4 and sharedv4 service volumes
oneof sharedv4_spec_opt { Sharedv4Spec sharedv4_spec = 38; }
// Autofstrim is set to true, to enable automatic fstrim on this volume
oneof auto_fstrim_opt { bool auto_fstrim = 39; }
// io_throttle_opt defines the io throttle limits for the volume
oneof io_throttle_opt { IoThrottle io_throttle = 40;}
// Enable readahead for the volume
oneof readahead_opt { bool readahead = 41; }
// winshare is true if this volume can be accessed from windows pods.
oneof winshare_opt { bool winshare = 42; }
// NearSyncReplicationStrategy is replication startegy for near sync volumes
oneof near_sync_replication_strategy_opt { NearSyncReplicationStrategy near_sync_replication_strategy = 43;}
}
// VolumeSpecPolicy provides a method to set volume storage policy
message VolumeSpecPolicy {
// This defines an operator for the policy comparisons
enum PolicyOp {
// Policy will make sure the value must be equal
Equal = 0;
// Policy will make sure the requested value must be greater than or equal
Minimum = 1;
// Policy will make sure the requested value must be less than or equal
Maximum = 2;
}
// Size specifies the thin provisioned volume size in bytes.
// Use `size_operator` to show if this value is the min, max, or set.
oneof size_opt { uint64 size = 1; }
// HaLevel specifies the number of copies of data.
// Use `ha_level_operator` to show if this value is the min, max, or set.
oneof ha_level_opt { int64 ha_level = 2; }
// Cos specifies the relative class of service.
oneof cos_opt { CosType cos = 3; }
// IoProfile provides a hint about application using this volume.
oneof io_profile_opt { IoProfile io_profile = 4; }
// Dedupe specifies if the volume data is to be de-duplicated.
oneof dedupe_opt { bool dedupe = 5; }
// SnapshotInterval in minutes, set to 0 to disable snapshots
oneof snapshot_interval_opt { uint32 snapshot_interval = 6; }
// VolumeLabels configuration labels
map<string, string> volume_labels = 7;
// Shared is true if this volume can be remotely accessed.
oneof shared_opt { bool shared = 8; }
// ReplicaSet is the desired set of nodes for the volume data.
ReplicaSet replica_set = 9;
// Passphrase for an encrypted volume
oneof passphrase_opt { string passphrase = 10; }
// SnapshotSchedule a well known string that specifies when snapshots should be taken.
oneof snapshot_schedule_opt { string snapshot_schedule = 11; }
// Scale allows autocreation of volumes.
oneof scale_opt { uint32 scale = 12; }
// Sticky volumes cannot be deleted until the flag is removed.
oneof sticky_opt { bool sticky = 13; }
// Group identifies a consistency group
oneof group_opt { Group group = 14; }
// Journal is true if data for the volume goes into the journal.
oneof journal_opt { bool journal = 15; }
// Sharedv4 is true if this volume can be accessed via sharedv4.
oneof sharedv4_opt { bool sharedv4 = 16; }
// QueueDepth defines the desired block device queue depth
oneof queue_depth_opt { uint32 queue_depth = 17; }
// Encrypted is true if this volume will be cryptographically secured.
oneof encrypted_opt { bool encrypted = 18; }
// Aggregation level Specifies the number of parts the volume can be aggregated from.
oneof aggregation_level_opt { uint32 aggregation_level = 19; }
// Operator to check size
PolicyOp size_operator = 50;
// Operator to check ha_level
PolicyOp ha_level_operator = 51;
// Operator to check scale
PolicyOp scale_operator = 52;
// Operator to check snapshot_interval
PolicyOp snapshot_interval_operator = 53;
// Nodiscard specifies if the volume will be mounted with discard support disabled.
// i.e. FS will not release allocated blocks back to the backing storage pool.
oneof nodiscard_opt { bool nodiscard = 54; }
// IoStrategy preferred strategy for I/O.
IoStrategy io_strategy = 55;
// ExportSpec preferred volume export options.
oneof export_spec_opt { ExportSpec export_spec = 56; }
// scan_policy_opt defines the filesystem check policy for the volume
oneof scan_policy_opt { ScanPolicy scan_policy = 57;}
// mount_opt provides the mount time options for a volume
oneof mount_opt { MountOptions mount_opt_spec = 58;}
// sharedv4_mount_opt provides the client side mount time options for a sharedv4 volume
oneof sharedv4_mount_opt { MountOptions sharedv4_mount_opt_spec = 59;}
// Proxy_write is true if proxy write replication is enabled for the volume
oneof proxy_write_opt { bool proxy_write = 60; }
// proxy_spec_opt provides the spec for a proxy volume.
oneof proxy_spec_opt { ProxySpec proxy_spec = 61; }
// fastpath preference
oneof fastpath_opt { bool fastpath = 62; }
// sharedv4_service_spec_opt provides the spec for sharedv4 volume service
oneof sharedv4_service_spec_opt { Sharedv4ServiceSpec sharedv4_service_spec = 63; }
// Sharedv4Spec specifies common properties of sharedv4 and sharedv4 service volumes
oneof sharedv4_spec_opt { Sharedv4Spec sharedv4_spec = 64; }
// Autofstrim is set to true, to enable automatic fstrim on this volume
oneof auto_fstrim_opt { bool auto_fstrim = 65; }
// io_throttle_opt defines the io throttle limits for the volume
oneof io_throttle_opt { IoThrottle io_throttle = 66;}
// Enable readahead for the volume
oneof readahead_opt { bool readahead = 67; }
// winshare is true if this volume can be accessed from windows.
oneof winshare_opt { bool winshare = 68; }
}
// ReplicaSet set of machine IDs (nodes) to which part of this volume is erasure
// coded - for clustered storage arrays
message ReplicaSet {
repeated string nodes = 1;
// Unique IDs of the storage pools for this replica set
repeated string pool_uuids = 2;
// ID is the unique ID of this replica set
uint32 id = 3;
}
// RuntimeStateMap is a list of name value mapping of driver specific runtime
// information.
message RuntimeStateMap {
map<string, string> runtime_state = 1;
}
// Ownership information for resource.
// Administrators are users who belong to the group `*`, meaning, every group.
message Ownership {
// Access types can be set by owner to have different levels of access to
// a resource.
//
// It is up to the resource to interpret what the types mean and are
// used for.
enum AccessType {
// Read access only and cannot affect the resource.
Read = 0;
// Write access and can affect the resource.
// This type automatically provides Read access also.
Write = 1;
// Administrator access.
// This type automatically provides Read and Write access also.
Admin = 2;
}
// PublicAccessControl allows assigning public ownership
message PublicAccessControl {
// AccessType declares which level of public access is allowed
AccessType type = 1;
}
message AccessControl {
// Group access to resource which must match the group set in the
// authorization token.
// Can be set by the owner or the system administrator only.
// Possible values are:
// 1. no groups: Means no groups are given access.
// 2. `["*"]`: All groups are allowed.
// 3. `["group1", "group2"]`: Only certain groups are allowed. In this example only
// _group1_ and _group2_ are allowed.
map <string, AccessType> groups = 1;
// Collaborator access to resource gives access to other user.
// Must be the username (unique id) set in the authorization token.
// The owner or the administrator can set this value. Possible values are:
// 1. no collaborators: Means no users are given access.
// 2. `["*"]`: All users are allowed.
// 3. `["username1", "username2"]`: Only certain usernames are allowed. In this example only
// _username1_ and _username2_ are allowed.
map <string, AccessType> collaborators = 2;
// Public access to resource may be assigned for access by the public userd
PublicAccessControl public = 3;
}
// Username of owner.
//
// The storage system uses the username taken from the security authorization
// token and is saved on this field. Only users with system administration
// can edit this value.
string owner = 1;
// Permissions to share resource which can be set by the owner.
//
// NOTE: To create an "admin" user which has access to any resource set the group value
// in the token of the user to `*`.
AccessControl acls = 2;
}
// Volume represents an abstract storage volume.
message Volume {
// Self referential volume ID.
string id = 1;
// Source specified seed data for the volume.
Source source = 2;
// Group volumes in the same group have the same group id.
Group group = 3;
// Readonly is true if this volume is to be mounted with readonly access.
bool readonly = 4;
// User specified locator
VolumeLocator locator = 5;
// Volume creation time
google.protobuf.Timestamp ctime = 6;
// User specified VolumeSpec
VolumeSpec spec = 7;
// Usage is bytes consumed by this volume.
uint64 usage = 8;
// LastScan is the time when an integrity check was run.
google.protobuf.Timestamp last_scan = 9;
// Format specifies the filesytem for this volume.
FSType format = 10;
// VolumeStatus is the availability status of this volume.
VolumeStatus status = 11;
// VolumeState is the current runtime state of this volume.
VolumeState state = 12;
// AttachedOn is the node instance identifier for clustered systems.
string attached_on = 13;
// AttachState shows whether the device is attached for internal or external use.
AttachState attached_state = 14;
// DevicePath is the device exported by block device implementations.
string device_path = 15;
// SecureDevicePath is the device path for an encrypted volume.
string secure_device_path = 16;
// AttachPath is the mounted path in the host namespace.
repeated string attach_path = 17;
// AttachInfo is a list of name value mappings that provides attach information.
map<string, string> attach_info = 18;
// ReplicatSets storage for this volumefor clustered storage arrays.
repeated ReplicaSet replica_sets = 19;
// RuntimeState is a lst of name value mapping of driver specific runtime
// information.
repeated RuntimeStateMap runtime_state = 20;
// Error is the Last recorded error.