forked from libopenstorage/openstorage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.proto
3861 lines (3445 loc) · 118 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";
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;
// Add statuses before MAX and update the number for MAX
STATUS_MAX = 14;
}
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;
}
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;
}
// 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 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;
}
// StoragePool groups different storage devices based on their CosType
message StoragePool {
// 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;
}
// 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;
}
// 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;
// Owner
Ownership ownership = 33;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
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;
}
// 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 vtheis 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;
// Status is the availability status of this volume.
VolumeStatus status = 11;
// State is the current runtime state of this volume.
VolumeState state = 12;
// AttachedOn is the node instance identifier for clustered systems.
string attached_on = 13;
// AttachedState 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.
string error = 21;
// VolumeConsumers are entities that consume this volume
repeated VolumeConsumer volume_consumers = 22;
// FsResizeRequired if an FS resize is required on the volume.
bool fs_resize_required = 23;
}
// Stats is a structure that represents last collected stats for a volume
message Stats {
// Reads completed successfully
uint64 reads = 1;
// Time spent in reads in ms
uint64 read_ms = 2;
// Number of bytes read
uint64 read_bytes = 3;
// Writes completed successfully
uint64 writes = 4;
// Time spent in writes in ms
uint64 write_ms = 5;
// Number of bytes written
uint64 write_bytes = 6;
// IOs curently in progress
uint64 io_progress = 7;
// Time spent doing IOs ms
uint64 io_ms = 8;
// BytesUsed
uint64 bytes_used = 9;
// Interval in ms during which stats were collected
uint64 interval_ms = 10;
}
// Provides details on exclusive and shared storage used by
// snapshot/volume specifically for copy-on-write(COW) snapshots. Deletion
// of snapshots and overwirte of volume will affect the exclusive storage
// used by the other dependent snaps and parent volume.
message CapacityUsageInfo {
// Storage consumed exclusively by this single snapshot. Deletion of this
// snapshot may increase the free storage available by this amount.
int64 exclusive_bytes = 1;
// Storage consumed by this snapshot that is shared with parent and children
int64 shared_bytes = 2;
// TotalBytes used by this volume
int64 total_bytes = 3;
}
// A SdkStoragePolicy represents minimum set of volume specs to be
// follow while creating volumes.
// If storage policy is set default in OpenStoragePolicy service, VolumeSpecPolicy will be
// used before creating volume to validate volume specs or ensure minimum volume creation
// rules followed
message SdkStoragePolicy {
// Name of storage policy.
string name = 1;
// VolumeSpecs to apply while creating volume.
VolumeSpecPolicy policy = 2;
// Force if set to true volume specs will be overwritten, otherwise
// volume creation will fail if the volume specifications are not inline with storage policy
bool force = 3;
// If set a volume can be updated without storage Policy
// restriction, otherwise volume update will be followed as per storage policy
// specification
bool allow_update = 4;
// Owner info of storage policy
Ownership ownership = 5;
}
// Alert is a structure that represents an alert object
message Alert {
// Id for Alert
int64 id = 1;
// Severity of the Alert
SeverityType severity = 2;
// AlertType user defined alert type
int64 alert_type = 3;
// Message describing the Alert
string message = 4;
//Timestamp when Alert occured
google.protobuf.Timestamp timestamp = 5;
// ResourceId where Alert occured
string resource_id = 6;
// Resource where Alert occured
ResourceType resource = 7;
// Cleared Flag
bool cleared = 8;
// Time-to-live in seconds for this Alert
uint64 ttl = 9;
// UniqueTag helps identify a unique alert for a given resouce
string unique_tag = 10;
// Count of such alerts raised so far.
int64 count = 11;
// Timestamp when such alert was raised the very first time.
google.protobuf.Timestamp first_seen = 12;
}
// SdkAlertsTimeSpan to store time window information.
message SdkAlertsTimeSpan {
//Start timestamp when Alert occured
google.protobuf.Timestamp start_time = 1;
//End timestamp when Alert occured
google.protobuf.Timestamp end_time = 2;
}
// SdkAlertsCountSpan to store count range information.
message SdkAlertsCountSpan {
// Min count of such alerts raised so far.
int64 min_count = 1;
// Max count of such alerts raised so far.
int64 max_count = 2;
}
// SdkAlertsOption contains options for filtering alerts.
message SdkAlertsOption {
oneof opt {
// Query using minimum severity type.
SeverityType min_severity_type = 1;
// Query using cleared flag.
bool is_cleared = 2;
// Query using a time span during which alert was last seen.
SdkAlertsTimeSpan time_span = 3;
// Query using a count span in which alert count exists.
SdkAlertsCountSpan count_span = 4;
}
}
// SdkAlertsResourceTypeQuery queries for alerts using only resource id.
message SdkAlertsResourceTypeQuery {
// Resource type used to build query.
ResourceType resource_type = 1;
}
// SdkAlertsAlertTypeQuery queries for alerts using alert type
// and it requires that resource type be provided as well.
message SdkAlertsAlertTypeQuery {
// Resource type used to build query.
ResourceType resource_type = 1;
// Alert type used to build query.
int64 alert_type = 2;
}
// SdkAlertsResourceIdQuery queries for alerts using resource id
// and it requires that both alert type and resource type be provided
// as well.
message SdkAlertsResourceIdQuery {
// Resource type used to build query.
ResourceType resource_type = 1;
// Alert type used to build query.
int64 alert_type = 2;
// Resource ID used to build query.
string resource_id = 3;
}
// SdkAlertsQuery is one of the query types and a list of options.
// Each query object is one of the three query types and a list of
// options.
message SdkAlertsQuery {
// One of the query types can be used to build SdkAlertsQuery.
oneof query {
// Query only using resource type.
SdkAlertsResourceTypeQuery resource_type_query = 1;
// Query using alert type and resource type.
SdkAlertsAlertTypeQuery alert_type_query = 2;
// Query using resource id, alert type and resource type.
SdkAlertsResourceIdQuery resource_id_query = 3;
}
// Opts is a list of options associated with one of the queries.
repeated SdkAlertsOption opts = 4;
}
// SdkAlertsEnumerateRequest is a request message to enumerate alerts.
message SdkAlertsEnumerateWithFiltersRequest {
// It is a list of queries to find matching alerts.
// Output of each of these queries is added to a global pool
// and returned as output of an RPC call.
// In that sense alerts are fetched if they match any of the
// queries.
repeated SdkAlertsQuery queries = 1;
}
// SdkAlertsEnumerateResponse is a list of alerts.
message SdkAlertsEnumerateWithFiltersResponse {
// Response contains a list of alerts.
repeated Alert alerts = 1;
}
// SdkAlertsDeleteRequest is a request message to delete alerts.
message SdkAlertsDeleteRequest {
// It takes a list of queries to find matching alerts.
// Matching alerts are deleted.
repeated SdkAlertsQuery queries = 1;
}
// SdkAlertsDeleteResponse is empty.
message SdkAlertsDeleteResponse {}
// OpenStorageAlerts defines rpc's for alerts.
service OpenStorageAlerts {
// Allows querying alerts.
//
// EnumerateWithFilters allows 3 different types of queries as defined below:
//
// * Query that takes only resource type as input
// * Query that takes resource type and alert type as input and
// * Query that takes resource id, alert type and resource type as input.
//
// #### Input
// SdkAlertsEnumerateRequest takes a list of such queries and the returned
// output is a collective ouput from each of these queries. In that sense,
// the filtering of these queries has a behavior of OR operation.
// Each query also has a list of optional options. These options allow
// narrowing down the scope of alerts search. These options have a
// behavior of an AND operation.
//
// #### Examples
// To search by a resource type in a given time window would require
// initializing SdkAlertsResourceTypeQuery query and pass in
// SdkAlertsTimeSpan option into SdkAlertsQuery struct and finally
// packing any other such queries into SdkAlertsEnumerateRequest object.
// Alternatively, to search by both resource type and alert type, use
// SdkAlertsAlertTypeQuery as query builder.
// Finally to search all alerts of a given resource type and some
// alerts of another resource type but with specific alert type,
// use two queries, first initialized with SdkAlertsResourceTypeQuery
// and second initialized with SdkAlertsAlertTypeQuery and both
// eventually packed as list in SdkAlertsEnumerateRequest.
rpc EnumerateWithFilters(SdkAlertsEnumerateWithFiltersRequest)
returns (stream SdkAlertsEnumerateWithFiltersResponse) {
option(google.api.http) = {
post: "/v1/alerts/filters"
body: "*"
};
}
// Delete alerts
//
// #### Delete
// Delete allows 3 different types of queries as defined below:
//
// * Query that takes only resource type as input
// * Query that takes resource type and alert type as input and
// * Query that takes resource id, alert type and resource type as input.
//
// #### Input
// SdkAlertsDeleteRequest takes a list of such queries and all alerts
// that match at least one of the queries are deleted.
rpc Delete(SdkAlertsDeleteRequest)
returns (SdkAlertsDeleteResponse) {
option(google.api.http) = {
post: "/v1/alerts"
body: "*"
};
}
}
// Alerts is an array of Alert objects
message Alerts {
repeated Alert alert = 1;
}
// ObjectstoreInfo is a structure that has current objectstore info
message ObjectstoreInfo {
// UUID of objectstore
string uuid = 1;
// VolumeID of volume used by object store
string volume_id = 2;
// Enable/Disable created objectstore
bool enabled = 3;
// Status of objectstore running/failed
string status = 4;
// Action being taken on this objectstore
int64 action = 5;
// AccessKey for login into objectstore
string access_key = 6;
// SecretKey for login into objectstore
string secret_key = 7;
// Endpoints for accessing objectstore
repeated string endpoints = 8;
// CurrentEndpoint on which objectstore server is accessible
string current_endpoint = 9;
// AccessPort is objectstore server port
int64 access_port = 10;
// Region for this objectstore
string region = 11;
}
// VolumeCreateRequest is a structure that has the locator, source and spec
// to create a volume
message VolumeCreateRequest {
// User specified volume name and labels
VolumeLocator locator = 1;
// Source to create volume
Source source = 2;
// The storage spec for the volume
VolumeSpec spec = 3;
}
// VolumeResponse is a structure that wraps an error.
message VolumeResponse {
// Error message
//
// in: body
// Required: true
string error = 1;
}
// VolumeCreateResponse
message VolumeCreateResponse {
// ID of the newly created volume
//
// in: body
// Required: true
string id = 1;
// Volume Response
//
// in: body
// Required: true
VolumeResponse volume_response = 2;
}
// VolumeStateAction specifies desired actions.
message VolumeStateAction {
// Attach or Detach volume
VolumeActionParam attach = 1;
// Mount or unmount volume
VolumeActionParam mount = 2;
// MountPath Path where the device is mounted
string mount_path = 3;
// DevicePath Path returned in attach
string device_path = 4;
}
// VolumeSet specifies a request to update a volume.
message VolumeSetRequest {
// User specified volume name and labels
VolumeLocator locator = 1;
// The storage spec for the volume
VolumeSpec spec = 2;
// State modification on this volume.
VolumeStateAction action = 3;
// additional options
// required for the Set operation.
map<string, string> options = 4;
}
// VolumeSetResponse
message VolumeSetResponse {
// Volume
Volume volume = 1;
//VolumeResponse
VolumeResponse volume_response = 2;
}
// SnapCreateRequest specifies a request to create a snapshot of given volume.
message SnapCreateRequest {
// volume id
string id = 1;
VolumeLocator locator = 2;
bool readonly = 3;
// NoRetry indicates not to retry snapshot creation in the background.
bool no_retry = 4;
}
// SnapCreateRequest specifies a response that get's returned when creating a snapshot.
message SnapCreateResponse {
// VolumeCreateResponse
//
// in: body
// Required: true
VolumeCreateResponse volume_create_response = 1;
}
// VolumeInfo
message VolumeInfo {
string volume_id = 1;
string path = 2;
VolumeSpec storage = 3;
}
// VolumeConsumer identifies a consumer for a Volume. An example of a VolumeConsumer
// would be a Pod in Kubernetes who has mounted the PersistentVolumeClaim for the
// Volume
message VolumeConsumer {
// Name is the name of the volume consumer
string name = 1;
// Namespace is the namespace of the volume consumer
string namespace = 2;
// Type is the type of the consumer. E.g a Kubernetes pod
string type = 3;
// NodeID is the identifier of the node on which the consumer is running. This
// identifier would be from the perspective of the container runtime or
// orchestrator under which the volume consumer resides. For example, NodeID
// can be name of a minion in Kubernetes.
string node_id = 4;
// OwnerName is the name of the entity who owns this volume consumer
string owner_name = 5;
// OwnerType is the type of the entity who owns this volume consumer. The type would
// be from the perspective of the container runtime or the orchestrator under which
// the volume consumer resides. For e.g OwnerType can be a Deployment in Kubernetes.
string owner_type = 6;
}
// GraphDriverChanges represent a list of changes between the filesystem layers
// specified by the ID and Parent. // Parent may be an empty string, in which
// case there is no parent.
// Where the Path is the filesystem path within the layered filesystem
message GraphDriverChanges {
string path = 1;
GraphDriverChangeType kind = 2;
}
// ClusterResponse specifies a response that gets returned when requesting the cluster
message ClusterResponse {
// Error code
//
// in: body
string error = 1;
}
// Active Request
message ActiveRequest {
map<int64, string> ReqestKV = 1;
}
// Active Requests
message ActiveRequests {
int64 RequestCount = 1;
repeated ActiveRequest ActiveRequest = 2;
}