Skip to content

Commit d7a71d8

Browse files
committed
Extend the RecycleRequest specification to handle RecyleProto used by the
EOS console. Keep both the old recycle request type and the new one for compatibility.
1 parent cc744ad commit d7a71d8

File tree

2 files changed

+118
-36
lines changed

2 files changed

+118
-36
lines changed

Recycle.proto

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
syntax="proto3";
2+
package eos.console;
3+
4+
option go_package = "eos.rest.gateway.service";
5+
6+
message RecycleProto {
7+
enum RecycleType {
8+
UID = 0;
9+
RID = 1;
10+
ALL = 2;
11+
}
12+
13+
message LsProto {
14+
bool FullDetails = 1;
15+
bool NumericIds = 2;
16+
bool MonitorFmt = 3;
17+
string Date = 4;
18+
int32 Maxentries = 5;
19+
RecycleType Type = 6;
20+
string RecycleId = 7;
21+
}
22+
23+
message PurgeProto {
24+
string Date = 1;
25+
string Key = 2;
26+
RecycleType Type = 3;
27+
string RecycleId = 4;
28+
}
29+
30+
message RestoreProto {
31+
bool ForceOrigName = 1;
32+
bool RestoreVersions = 2;
33+
bool MakePath = 3;
34+
string Key = 4;
35+
}
36+
37+
message ConfigProto {
38+
enum OpType {
39+
ADD_BIN = 0;
40+
RM_BIN = 1;
41+
LIFETIME = 2;
42+
RATIO = 3;
43+
SIZE = 4;
44+
INODES = 5;
45+
POLL_INTERVAL = 6;
46+
COLLECT_INTERVAL = 7;
47+
REMOVE_INTERVAL = 8;
48+
DRY_RUN = 9;
49+
DUMP = 10;
50+
}
51+
52+
OpType op = 1;
53+
string Subtree = 2;
54+
int32 LifetimeSec = 3;
55+
float Ratio = 4;
56+
uint64 Size = 5; // Use by either SIZE or INODES
57+
string value = 6;
58+
}
59+
60+
message ProjectProto {
61+
string path = 1;
62+
string acl = 2;
63+
}
64+
65+
oneof subcmd {
66+
LsProto ls = 1;
67+
PurgeProto purge = 2;
68+
RestoreProto restore = 3;
69+
ConfigProto config = 4;
70+
ProjectProto project = 5;
71+
}
72+
}

Rpc.proto

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ option java_outer_classname = "EosProto";
2929
option objc_class_prefix = "EOS";
3030
option go_package = "go-eosgrpc";
3131

32+
import "Recycle.proto";
3233

3334
service Eos {
3435
// Replies to a ping
@@ -41,7 +42,7 @@ service Eos {
4142
// NAMESPACE
4243
// ---------------------------------------------------------------------
4344

44-
// Replies to MD requests with a stream
45+
// Replies to MD requests with a stream
4546
rpc MD (MDRequest) returns (stream MDResponse) {}
4647

4748
rpc Notification (NotificationRequest) returns (stream NotificationResponse) {}
@@ -53,7 +54,7 @@ service Eos {
5354
rpc NsStat (NsStatRequest) returns (NsStatResponse) {}
5455

5556
// Replies to an insert
56-
rpc ContainerInsert (ContainerInsertRequest) returns (InsertReply) {}
57+
rpc ContainerInsert (ContainerInsertRequest) returns (InsertReply) {}
5758
rpc FileInsert (FileInsertRequest) returns (InsertReply) {}
5859

5960
// Replies to a NsRequest operation
@@ -149,20 +150,20 @@ message ContainerMdProto {
149150
uint64 containers = 17;
150151
}
151152

152-
enum TYPE { FILE = 0; CONTAINER = 1; LISTING = 2; STAT = 3;}
153+
enum TYPE { FILE = 0; CONTAINER = 1; LISTING = 2; STAT = 3;}
153154

154155
enum QUOTATYPE { USER = 0; GROUP = 2; PROJECT = 3;}
155156

156157
enum QUOTAOP { GET = 0; SET = 1; RM = 2; RMNODE = 3;}
157158

158159
enum QUOTAENTRY { NONE = 0; VOLUME = 1; INODE = 2;}
159-
160-
message QuotaProto {
160+
161+
message QuotaProto {
161162
bytes path = 1; // quota node path
162163
string name = 2; // associated name for the given type
163164
QUOTATYPE type = 3; // user,group,project or all quota
164165
uint64 usedbytes = 4; // bytes used physical
165-
uint64 usedlogicalbytes = 5; // bytes used logical
166+
uint64 usedlogicalbytes = 5; // bytes used logical
166167
uint64 usedfiles = 6; // number of files used
167168
uint64 maxbytes = 7; // maximum number of bytes (volume quota)
168169
uint64 maxlogicalbytes = 8; // maximum number of logical bytes (logical volume quota)
@@ -172,7 +173,7 @@ message QuotaProto {
172173
string statusbytes = 12; // status string for volume quota ok,warning,exceeded
173174
string statusfiles = 13; // status string for inode quota ok,warning,exceeded
174175
}
175-
176+
176177
message RoleId {
177178
uint64 uid = 1;
178179
uint64 gid = 2;
@@ -243,7 +244,7 @@ message MDNotification {
243244
message FindRequest {
244245
TYPE type = 1;
245246
MDId id = 2;
246-
RoleId role = 3;
247+
RoleId role = 3;
247248
string authkey = 4;
248249
uint64 maxdepth = 5;
249250
MDSelection selection = 6;
@@ -281,11 +282,11 @@ message NSRequest {
281282
bool recursive = 2;
282283
int64 mode = 3;
283284
}
284-
285+
285286
message RmdirRequest {
286287
MDId id = 1;
287288
}
288-
289+
289290
message TouchRequest {
290291
MDId id = 1;
291292
}
@@ -325,15 +326,18 @@ message NSRequest {
325326
}
326327

327328
message RecycleRequest {
328-
string key = 1;
329+
enum DisplayType {
330+
UID = 0;
331+
RID = 1;
332+
ALL = 2;
333+
}
334+
329335
enum RECYCLE_CMD {
330336
RESTORE = 0;
331-
PURGE = 1;
332-
LIST = 2;
337+
PURGE = 1;
338+
LIST = 2;
333339
}
334340

335-
RECYCLE_CMD cmd = 2;
336-
337341
message RestoreFlags {
338342
bool force = 1;
339343
bool mkpath = 2;
@@ -347,16 +351,21 @@ message NSRequest {
347351
}
348352

349353
message ListFlags {
350-
int32 maxentries = 1;
351-
int32 year = 2;
352-
int32 month = 3;
353-
int32 day = 4;
354-
int32 index = 5;
354+
int32 maxentries = 1;
355+
int32 year = 2;
356+
int32 month = 3;
357+
int32 day = 4;
358+
int32 index = 5;
359+
DisplayType display = 6;
360+
string display_val = 7;
355361
}
356362

357-
RestoreFlags restoreflag = 3;
358-
PurgeDate purgedate = 4;
359-
ListFlags listflag = 5;
363+
string key = 1;
364+
string recycleId = 2;
365+
RECYCLE_CMD cmd = 3;
366+
RestoreFlags restoreflag = 4;
367+
PurgeDate purgedate = 5;
368+
ListFlags listflag = 6;
360369
}
361370

362371
message SetXAttrRequest {
@@ -369,7 +378,7 @@ message NSRequest {
369378

370379
message ChownRequest {
371380
MDId id = 1;
372-
RoleId owner = 2;
381+
RoleId owner = 2;
373382
}
374383

375384
message ChmodRequest {
@@ -417,7 +426,7 @@ message NSRequest {
417426
NONE = 0; //
418427
MONITORING = 1; // [-m]
419428
LISTING = 2; // [-l]
420-
JSON = 3; // [grpc]
429+
JSON = 3; // [grpc]
421430
}
422431
OutFormat outformat = 1; //
423432
string selection = 2; //
@@ -459,14 +468,15 @@ message NSRequest {
459468
RenameRequest rename = 26;
460469
SymlinkRequest symlink = 27;
461470
VersionRequest version = 28;
462-
RecycleRequest recycle = 29;
471+
RecycleRequest old_recycle = 29;
463472
SetXAttrRequest xattr = 30;
464473
ChownRequest chown = 31;
465474
ChmodRequest chmod = 32;
466475
AclRequest acl = 33;
467476
TokenRequest token = 34;
468477
QuotaRequest quota = 35;
469478
ShareRequest share = 36;
479+
eos.console.RecycleProto recycle = 37;
470480
}
471481
}
472482

@@ -475,7 +485,7 @@ message NSRequest {
475485
message NSResponse {
476486
message ErrorResponse {
477487
int64 code = 1;
478-
string msg = 2;
488+
string msg = 2;
479489
}
480490

481491
message VersionResponse {
@@ -484,14 +494,14 @@ message NSResponse {
484494
Time mtime = 2;
485495
}
486496
int64 code = 1;
487-
string msg = 2;
497+
string msg = 2;
488498
repeated VersionInfo versions = 3;
489499
}
490500

491501
message RecycleResponse {
492502
int64 code = 1;
493-
string msg = 2;
494-
503+
string msg = 2;
504+
495505
message RecycleInfo {
496506
enum DELETIONTYPE { FILE = 0; TREE = 1; }
497507
MDId id = 1;
@@ -500,20 +510,20 @@ message NSResponse {
500510
uint64 size = 4;
501511
DELETIONTYPE type = 5;
502512
string key = 6;
503-
}
504-
513+
}
514+
505515
repeated RecycleInfo recycles = 3;
506516
}
507517

508518
message AclResponse {
509519
int64 code = 1;
510-
string msg = 2;
520+
string msg = 2;
511521
string rule = 3;
512522
}
513523

514524
message QuotaResponse {
515-
int64 code = 1;
516-
string msg = 2;
525+
int64 code = 1;
526+
string msg = 2;
517527
repeated QuotaProto quotanode = 3;
518528
}
519529

@@ -532,7 +542,7 @@ message NSResponse {
532542

533543
message ShareResponse {
534544
int64 code = 1;
535-
string msg = 2;
545+
string msg = 2;
536546
repeated ShareInfo shares = 3;
537547
repeated ShareAccess access = 4;
538548
}

0 commit comments

Comments
 (0)