-
Notifications
You must be signed in to change notification settings - Fork 4
/
ipamd.proto
185 lines (140 loc) · 3.64 KB
/
ipamd.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
syntax = "proto3";
package rpc;
option go_package = "./;rpc";
service CNIIpam {
rpc Ping (PingRequest) returns (PingResponse) {}
rpc AddPodNetwork (AddPodNetworkRequest) returns (AddPodNetworkResponse) {}
rpc DelPodNetwork (DelPodNetworkRequest) returns (DelPodNetworkResponse) {}
rpc AddPodNetworkRecord (AddPodNetworkRecordRequest) returns (AddPodNetworkRecordResponse) {}
rpc DelPodNetworkRecord (DelPodNetworkRecordRequest) returns (DelPodNetworkRecordResponse) {}
rpc GetPodNetworkRecord (GetPodNetworkRecordRequest) returns (GetPodNetworkRecordResponse) {}
rpc ListPodNetworkRecord (ListPodNetworkRecordRequest) returns (ListPodNetworkRecordResponse) {}
rpc BorrowIP (BorrowIPRequest) returns (BorrowIPResponse) {}
rpc DescribePool (DescribePoolRequest) returns (DescribePoolResponse) {}
rpc PushPool (PushPoolRequest) returns (PushPoolResponse) {}
rpc PopPool (PopPoolRequest) returns (PopPoolResponse) {}
rpc ListUnuse (ListUnuseRequest) returns (ListUnuseResponse) {}
rpc ReleaseIP (ReleaseIPRequest) returns (ReleaseIPResponse) {}
}
message PingRequest {}
message PingResponse {}
message AddPodNetworkRequest {
string PodName = 1;
string PodNamespace = 2;
string SandboxID = 3;
string Netns = 4;
string IfName = 5;
}
message AddPodNetworkResponse{
CNIErrorCode Code = 1;
PodNetwork PodNetwork =2;
}
message DelPodNetworkRequest {
PodNetwork PodNetwork = 1;
}
message DelPodNetworkResponse {
CNIErrorCode Code = 1;
}
message AddPodNetworkRecordRequest {
PodNetwork PodNetwork = 1;
}
message AddPodNetworkRecordResponse {
CNIErrorCode Code = 1;
}
message DelPodNetworkRecordRequest {
string PodName = 1;
string PodNS = 2;
string SandboxID = 3;
}
message DelPodNetworkRecordResponse {
CNIErrorCode Code = 1;
}
message GetPodNetworkRecordRequest {
string PodName = 1;
string PodNS = 2;
string SandboxID = 3;
}
message GetPodNetworkRecordResponse {
CNIErrorCode Code = 1;
PodNetwork PodNetwork = 2;
}
message ListPodNetworkRecordRequest {}
message ListPodNetworkRecordResponse {
CNIErrorCode Code = 1;
repeated PodNetwork Networks = 2;
}
message PodNetwork {
string PodName = 1;
string PodNS = 2;
string PodUID = 3;
string SandboxID = 4;
string NetNS = 5;
string VPCIP = 6;
string VPCID = 7;
string SubnetID = 8;
string Gateway = 9;
string Mask = 10;
string MacAddress = 11;
bool DedicatedUNI = 12;
string InterfaceID = 13;
string EIPID = 14;
int64 CreateTime = 15;
int64 RecycleTime = 16;
bool Recycled = 17;
}
message BorrowIPRequest {
string MacAddr = 1;
}
message BorrowIPResponse {
CNIErrorCode Code = 1;
PodNetwork IP = 2;
}
message DescribePoolRequest {}
message DescribePoolResponse {
CNIErrorCode Code = 1;
repeated PodNetwork Pool = 2;
repeated PodNetwork Cooldown = 3;
}
message PushPoolRequest {
string IP = 1;
}
message PushPoolResponse {
CNIErrorCode Code = 1;
PodNetwork IP = 2;
}
message PopPoolRequest {
string IP = 1;
}
message PopPoolResponse {
CNIErrorCode Code = 1;
PodNetwork IP = 2;
}
message ListUnuseRequest {}
message ListUnuseResponse {
CNIErrorCode Code = 1;
repeated PodNetwork Unuse = 2;
}
message ReleaseIPRequest {
repeated string IP = 1;
}
message ReleaseIPResponse {
CNIErrorCode Code = 1;
}
enum CNIErrorCode {
CNISuccess = 0;
CNIMissingParameters = 1001;
CNIAllocateSecondaryIPFailure = 1002;
CNIReleaseSecondaryIPFailure = 1003;
CNIAllocateEIPFailure = 1004;
CNIReleaseEIPFailure = 1005;
CNIBindEIPFailure = 1006;
CNIUnbindEIPFailure = 1007;
CNIAllocateUNIFailure = 1008;
CNIReleaseUNIFailure = 1009;
CNIAttachUNIFailure = 1010;
CNIDetachUNIFailure = 1011;
CNIK8SAPIError = 1012;
CNIWriteDBError = 1013;
CNIReadDBError = 1014;
CNIBorrowIPFailure = 1015;
}