forked from opencurve/curve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli2.proto
executable file
·118 lines (97 loc) · 3.38 KB
/
cli2.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
/*
* Copyright (c) 2020 NetEase Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax="proto2";
import "proto/common.proto";
package curve.chunkserver;
option cc_generic_services = true;
option go_package = "proto/cli2";
// cli.proto 供老的使用保证
message AddPeerRequest2 {
required uint32 logicPoolId = 1; // 逻辑池id
required uint32 copysetId = 2; // 复制组id
required common.Peer leader = 3; // leader
required common.Peer addPeer = 4; // 新增peer
}
message AddPeerResponse2 {
repeated common.Peer oldPeers = 1; // 老配置
repeated common.Peer newPeers = 2; // 新配置
}
message RemovePeerRequest2 {
required uint32 logicPoolId = 1;
required uint32 copysetId = 2;
required common.Peer leader = 3;
required common.Peer removePeer = 4;
}
message RemovePeerResponse2 {
repeated common.Peer oldPeers = 1;
repeated common.Peer newPeers = 2;
}
message TransferLeaderRequest2 {
required uint32 logicPoolId = 1;
required uint32 copysetId = 2;
required common.Peer leader = 3;
required common.Peer transferee = 4;
}
message TransferLeaderResponse2 {}
message ChangePeersRequest2 {
required uint32 logicPoolId = 1;
required uint32 copysetId = 2;
required common.Peer leader = 3;
repeated common.Peer newPeers = 4;
}
message ChangePeersResponse2 {
repeated common.Peer oldPeers = 1;
repeated common.Peer newPeers = 2;
}
message SnapshotRequest2 {
required uint32 logicPoolId = 1;
required uint32 copysetId = 2;
optional common.Peer peer = 3;
};
message SnapshotResponse2 {
}
message SnapshotAllRequest {
};
message SnapshotAllResponse {
};
message GetLeaderRequest2 {
required uint32 logicPoolId = 1;
required uint32 copysetId = 2;
optional common.Peer peer = 3; // 可以不指定peer查leader
}
message GetLeaderResponse2 {
required common.Peer leader = 1; // 通过peer判空来判断是否返回leader
}
message ResetPeerRequest2 {
required uint32 logicPoolId = 1;
required uint32 copysetId = 2;
required common.Peer requestPeer = 3;
repeated common.Peer oldPeers = 4;
repeated common.Peer newPeers = 5;
}
message ResetPeerResponse2 {
}
// service
service CliService2 {
rpc AddPeer(AddPeerRequest2) returns (AddPeerResponse2);
rpc RemovePeer(RemovePeerRequest2) returns (RemovePeerResponse2);
rpc ChangePeers(ChangePeersRequest2) returns (ChangePeersResponse2);
rpc GetLeader(GetLeaderRequest2) returns (GetLeaderResponse2);
rpc TransferLeader(TransferLeaderRequest2) returns (TransferLeaderResponse2);
rpc ResetPeer(ResetPeerRequest2) returns (ResetPeerResponse2);
rpc Snapshot(SnapshotRequest2) returns (SnapshotResponse2);
rpc SnapshotAll(SnapshotAllRequest) returns (SnapshotAllResponse);
};