blob: da27de9db26c080dc8ce174d086aacfcb02adf33 [file] [log] [blame]
Jian Li841a8b92017-11-23 01:31:22 +09001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Jian Li485a2cd2017-07-18 18:16:38 +090016syntax="proto3";
17option java_package = "org.onosproject.grpc.nb.net.device";
18
19package nb.net.device;
20
21import "net/DeviceProto.proto";
22import "net/device/DeviceEnumsProto.proto";
Jian Lid8e72072017-11-21 10:50:02 +090023import "net/MastershipRoleProto.proto";
Jian Li485a2cd2017-07-18 18:16:38 +090024import "net/device/PortStatisticsProto.proto";
25import "net/PortProto.proto";
26import "net/ConnectPointProto.proto";
27
28message getDeviceCountRequest {
29}
30
31message getDeviceCountReply {
32 int32 device_count = 1;
33}
34
35message getDevicesRequest {
36}
37
38message getDevicesReply {
39 repeated .net.DeviceProto device = 1;
40}
41
42message getAvailableDevicesReply {
43 repeated .net.DeviceProto device = 1;
44}
45
46message getAvailableDevicesRequest {
47 .net.device.DeviceTypeProto type = 1;
48}
49
50message getDeviceRequest {
51 string device_id = 1;
52}
53
54message getDeviceReply {
55 .net.DeviceProto device = 1;
56}
57
58message getRoleRequest {
59 string device_id = 1;
60}
61
62message getRoleReply {
Jian Lid8e72072017-11-21 10:50:02 +090063 .net.MastershipRoleProto role = 1;
Jian Li485a2cd2017-07-18 18:16:38 +090064}
65
66message getPortsRequest {
67 string device_id = 1;
68}
69
70message getPortsReply {
71 repeated .net.PortProto port = 1;
72}
73
74message getPortStatisticsRequest {
75 string device_id = 1;
76}
77
78message getPortStatisticsReply {
79 repeated .net.device.PortStatisticsProto port_statistics = 1;
80}
81
82message getPortDeltaStatisticsRequest {
83 string device_id = 1;
84}
85
86message getPortDeltaStatisticsReply {
87 repeated .net.device.PortStatisticsProto port_statistics = 1;
88}
89
90message getStatisticsForPortRequest {
91 string device_id = 1;
92 uint64 port_number = 2;
93}
94
95message getStatisticsForPortReply {
96 .net.device.PortStatisticsProto port_statistics = 1;
97}
98
99message getDeltaStatisticsForPortRequest {
100 string device_id = 1;
101 uint64 port_number = 2;
102}
103
104message getDeltaStatisticsForPortReply {
105 .net.device.PortStatisticsProto port_statistics = 1;
106}
107
108message getPortRequest {
109 .net.ConnectPointProto connect_point = 1;
110}
111
112message getPortReply {
113 .net.PortProto port = 1;
114}
115
116message isAvailableRequest {
117 string device_id = 1;
118}
119
120message isAvailableReply {
121 bool is_available = 1;
122}
123
124message localStatusRequest {
125 string device_id = 1;
126}
127
128message localStatusReply {
129 string status = 1;
130}
131
132service DeviceService {
133 rpc getDeviceCount(getDeviceCountRequest) returns (getDeviceCountReply) {}
134 rpc getDevices(getDevicesRequest) returns (getDevicesReply) {}
135 rpc getAvailableDevices(getAvailableDevicesRequest) returns (getAvailableDevicesReply) {}
136 rpc getDevice(getDeviceRequest) returns (getDeviceReply) {}
137 rpc getRole(getRoleRequest) returns (getRoleReply) {}
138 rpc getPorts(getPortsRequest) returns (getPortsReply) {}
139 rpc getPortStatistics(getPortStatisticsRequest) returns (getPortStatisticsReply) {}
140 rpc getPortDeltaStatistics(getPortDeltaStatisticsRequest)
141 returns (getPortDeltaStatisticsReply) {}
142 rpc getStatisticsForPort(getStatisticsForPortRequest)
143 returns (getStatisticsForPortReply) {}
144 rpc getDeltaStatisticsForPort(getDeltaStatisticsForPortRequest)
145 returns (getDeltaStatisticsForPortReply) {}
146 rpc getPort(getPortRequest) returns (getPortReply) {}
147 rpc isAvailable(isAvailableRequest) returns (isAvailableReply) {}
148 rpc localStatus(localStatusRequest) returns (localStatusReply) {}
149}