-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.proto
185 lines (153 loc) · 4.37 KB
/
types.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
// Generate cmd: protoc --go_out=plugins=grpc:. types.proto
syntax = "proto3";
package types;
service Networks {
rpc Active(ActiveRequest) returns (ActivateResponse) {}
rpc GetNetwork(GetNetworkRequest) returns (GetNetworkResponse) {}
rpc CreateNetwork(CreateNetworkRequest) returns (CommonResponse) {}
rpc UpdateNetwork(UpdateNetworkRequest) returns (CommonResponse) {}
rpc DeleteNetwork(DeleteNetworkRequest) returns (CommonResponse) {}
}
service LoadBalancers {
rpc GetLoadBalancer(GetLoadBalancerRequest) returns (GetLoadBalancerResponse) {}
rpc CreateLoadBalancer(CreateLoadBalancerRequest) returns (CreateLoadBalancerResponse) {}
rpc UpdateLoadBalancer(UpdateLoadBalancerRequest) returns (UpdateLoadBalancerResponse) {}
rpc DeleteLoadBalancer(DeleteLoadBalancerRequest) returns (CommonResponse) {}
}
service Pods {
rpc SetupPod(SetupPodRequest) returns (CommonResponse) {}
rpc TeardownPod(TeardownPodRequest) returns (CommonResponse) {}
rpc PodStatus(PodStatusRequest) returns (PodStatusResponse) {}
}
message ActiveRequest {
}
message ActivateResponse {
bool result = 1;
string error = 2;
}
message CommonResponse {
string error = 1;
}
// Subnet is a representaion of a subnet
message Subnet {
string name = 1;
string uid = 2;
string cidr = 3;
string gateway = 4;
string tenantid = 5;
repeated string dnsservers = 6;
repeated Route routes = 7;
}
// Route is a representation of an advanced routing rule.
message Route {
string name = 1;
string nexthop = 2;
string destinationCIDR = 3;
}
message Network {
string name = 1;
string uid = 2;
string tenantID = 3;
int32 segmentID = 4;
repeated Subnet subnets = 5;
// Status of network
// Valid value: Initializing, Active, Pending, Failed, Terminating
string status = 6;
}
message GetNetworkRequest {
string name = 1;
string id = 2;
}
message GetNetworkResponse {
Network network = 1;
string error = 2;
}
message CreateNetworkRequest {
Network network = 1;
}
message UpdateNetworkRequest {
Network network = 1;
}
message DeleteNetworkRequest {
string networkName = 1;
}
message GetLoadBalancerRequest {
string name = 1;
}
message GetLoadBalancerResponse {
LoadBalancer loadBalancer = 1;
string error = 2;
}
message HostPort {
string name = 1;
string ipaddress = 2;
int32 servicePort = 3;
int32 targetPort = 4;
}
// LoadBalancer is a replace of kube-proxy, so load-balancing can be handled
// by network providers so as to overcome iptables overhead
message LoadBalancer {
string name = 1;
string uid = 2;
string vip = 3;
// Valid values: "TCP", "UDP", "HTTP", "HTTPS"
string loadBalanceType = 4;
string status = 5;
string tenantID = 6;
repeated string externalIPs = 7;
repeated Subnet subnets = 8;
repeated HostPort hosts = 9;
}
message CreateLoadBalancerRequest {
LoadBalancer loadBalancer = 1;
// Valid value: ClientIP, None
string affinity = 2;
}
message CreateLoadBalancerResponse {
string vip = 1;
string error = 2;
}
message UpdateLoadBalancerRequest {
string name = 1;
repeated string externalIPs = 2;
repeated HostPort hosts = 3;
}
message UpdateLoadBalancerResponse {
string vip = 1;
string error = 2;
}
message DeleteLoadBalancerRequest {
string name = 1;
}
message CheckTenantIDRequest {
string tenantID = 1;
}
message CheckTenantIDResponse {
bool result = 1;
string error = 2;
}
message SetupPodRequest {
string podName = 1;
string namespace = 2;
string containerRuntime = 3;
string podInfraContainerID = 4;
Network network = 5;
}
message TeardownPodRequest {
string podName = 1;
string namespace = 2;
string containerRuntime = 3;
string podInfraContainerID = 4;
Network network = 5;
}
message PodStatusRequest {
string podName = 1;
string namespace = 2;
string containerRuntime = 3;
string podInfraContainerID = 4;
Network network = 5;
}
message PodStatusResponse {
string ip = 1;
string error = 2;
}