/
cni.proto
75 lines (63 loc) · 1.87 KB
/
cni.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
// Copyright 2019 Antrea Authors
//
// 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 = "proto3";
import "google/protobuf/any.proto";
package antrea_io.antrea.pkg.apis.cni.v1beta1;
option go_package = "pkg/apis/cni/v1beta1";
message CniCmdArgs {
string container_id = 1;
string netns = 2;
string ifname = 3;
string args = 4;
string path = 5;
bytes network_configuration = 6;
}
message CniCmdRequest {
CniCmdArgs cni_args = 1;
}
enum ErrorCode {
UNKNOWN = 0;
INCOMPATIBLE_CNI_VERSION = 1;
UNSUPPORTED_FIELD = 2;
UNKNOWN_CONTAINER = 3;
INVALID_ENVIRONMENT_VARIABLES = 4;
IO_FAILURE = 5;
DECODING_FAILURE = 6;
INVALID_NETWORK_CONFIG = 7;
TRY_AGAIN_LATER = 11;
IPAM_FAILURE = 101;
CONFIG_INTERFACE_FAILURE = 102;
CHECK_INTERFACE_FAILURE = 103;
// these errors are not used by the servers, but we declare them here to
// make sure they are reserved.
UNKNOWN_RPC_ERROR = 201;
INCOMPATIBLE_API_VERSION = 202;
}
message Error {
ErrorCode code = 1;
string message = 2;
repeated google.protobuf.Any details = 3;
}
message CniCmdResponse {
bytes cni_result = 1;
Error error = 2;
}
service Cni {
rpc CmdAdd (CniCmdRequest) returns (CniCmdResponse) {
}
rpc CmdCheck (CniCmdRequest) returns (CniCmdResponse) {
}
rpc CmdDel (CniCmdRequest) returns (CniCmdResponse) {
}
}