-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathservice.proto
186 lines (162 loc) · 4.05 KB
/
service.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
syntax = "proto2";
option optimize_for = SPEED;
package ceph_disk;
message Osd {
optional string fsid = 1;
required uint64 id = 2;
optional string block_device = 3;
// If journal isn't set then it's collocated
optional string journal = 4;
// Active or spare
required bool active = 5;
// Usage details
required uint64 used_space = 6;
required uint64 total_space = 7;
}
// This will be added in a future version
// message RepairResponse {
// required bool corrupted = 1;
// required bool repaired = 2;
// required bool in_progress = 3;
// required string tracking_ticket_id = 4;
// required Disk disk = 5;
// optional string mount_path = 6;
//}
// GPT partition information
message Partition {
required string uuid = 1;
required uint64 first_lba = 2;
required uint64 last_lba = 3;
required uint64 flags = 4;
optional string name = 5;
}
message PartitionInfo { repeated Partition partition = 1; }
message Disk {
required DiskType type = 1;
required string dev_path = 2;
required PartitionInfo partitions = 3;
optional string serial_number = 4;
}
enum DiskType {
// Special loopback device
LOOPBACK = 0;
// Logical volume device
LVM = 1;
MDRAID = 2;
NVME = 3;
// Ramdisk
RAM = 4;
// Regular rotational device
ROTATIONAL = 5;
// AKA SSD
SOLID_STATE = 6;
VIRTUAL = 7;
UNKNOWN = 8;
}
message Disks { repeated Disk disk = 1; }
message OpResult {
required ResultType result = 1;
optional string error_msg = 2;
}
enum ResultType {
OK = 0;
ERR = 1;
}
message OpBoolResult {
required ResultType result = 1;
// Value is set if OK
optional bool value = 2;
// error_msg is set if ERR
optional string error_msg = 3;
// the type of the operation
required Op op_type = 4;
}
message OpStringResult {
required ResultType result = 1;
// Value is set if OK
optional string value = 2;
// error_msg is set if ERR
optional string error_msg = 3;
// the type of the operation
required Op op_type = 4;
}
message OpOutcomeResult{
required ResultType result = 1;
// outcome set if OK
optional OpOutcome outcome = 2;
// value set if OK and needs to return a boolean
optional bool value = 3;
// error_msg set if ERR
optional string error_msg = 4;
// the type of the operation
required Op op_type = 5;
// the disk/partition the operation was performed on
optional string disk = 6;
}
enum OpOutcome {
// Operation Succeeded
Success = 1;
// Skipped this disk for some reason (boot disk, cannot run operation on specific device, etc.)
Skipped = 2;
// The operation has already been done on the disk
SkipRepeat = 3;
}
message JiraInfo{
required string ticket_id = 1;
required string server_name = 2;
}
message OpJiraTicketsResult {
required ResultType result = 1;
// Values is set if OK
repeated JiraInfo tickets = 2;
// error_msg is set if ERR
optional string error_msg = 3;
}
enum Op {
// Generic Add Disk. Returns OpResult
Add = 1;
// returns OpResult
AddPartition = 6;
// Returns Disks
List = 3;
// Returns OpResult
Remove = 4;
// Returns bool
SafeToRemove = 5;
//return tickets created
GetCreatedTickets = 7;
}
// Datacenter related API's
enum DatacenterOp {
// All require server_id as a param
// Returns OpStringResult
GetDc = 1;
// Returns OpStringResult
GetRack = 2;
// Returns OpStringResult
GetRow = 3;
// Returns OpStringResult
GetElevation = 4;
}
message DatacenterOperation {
required DatacenterOp Op_type = 1;
required string server_id = 2;
}
// Datacenter related API's
// Service operations that can be performed
message Operation {
required Op Op_type = 1;
// Used for Add and Remove
optional string disk = 2;
// Used for Add, Remove and SafeToRemove
optional bool simulate = 3;
// Optional AddPartition fields
optional uint64 partition_start = 4;
optional uint64 partition_end = 5;
optional string partition_name = 6;
// Optional Ceph related fields
optional uint64 osd_id = 7;
// Optional gluster related fields
// Host:/dev/disk strings for gluster replica sets
repeated string replica_set = 10;
}