Jian Li | 841a8b9 | 2017-11-23 01:31:22 +0900 | [diff] [blame] | 1 | /* |
| 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 Li | 485a2cd | 2017-07-18 18:16:38 +0900 | [diff] [blame] | 16 | syntax="proto3"; |
| 17 | option java_package = "org.onosproject.grpc.nb.net.device"; |
| 18 | |
| 19 | package nb.net.device; |
| 20 | |
| 21 | import "net/DeviceProto.proto"; |
| 22 | import "net/device/DeviceEnumsProto.proto"; |
Jian Li | d8e7207 | 2017-11-21 10:50:02 +0900 | [diff] [blame] | 23 | import "net/MastershipRoleProto.proto"; |
Jian Li | 485a2cd | 2017-07-18 18:16:38 +0900 | [diff] [blame] | 24 | import "net/device/PortStatisticsProto.proto"; |
| 25 | import "net/PortProto.proto"; |
| 26 | import "net/ConnectPointProto.proto"; |
| 27 | |
| 28 | message getDeviceCountRequest { |
| 29 | } |
| 30 | |
| 31 | message getDeviceCountReply { |
| 32 | int32 device_count = 1; |
| 33 | } |
| 34 | |
| 35 | message getDevicesRequest { |
| 36 | } |
| 37 | |
| 38 | message getDevicesReply { |
| 39 | repeated .net.DeviceProto device = 1; |
| 40 | } |
| 41 | |
| 42 | message getAvailableDevicesReply { |
| 43 | repeated .net.DeviceProto device = 1; |
| 44 | } |
| 45 | |
| 46 | message getAvailableDevicesRequest { |
| 47 | .net.device.DeviceTypeProto type = 1; |
| 48 | } |
| 49 | |
| 50 | message getDeviceRequest { |
| 51 | string device_id = 1; |
| 52 | } |
| 53 | |
| 54 | message getDeviceReply { |
| 55 | .net.DeviceProto device = 1; |
| 56 | } |
| 57 | |
| 58 | message getRoleRequest { |
| 59 | string device_id = 1; |
| 60 | } |
| 61 | |
| 62 | message getRoleReply { |
Jian Li | d8e7207 | 2017-11-21 10:50:02 +0900 | [diff] [blame] | 63 | .net.MastershipRoleProto role = 1; |
Jian Li | 485a2cd | 2017-07-18 18:16:38 +0900 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | message getPortsRequest { |
| 67 | string device_id = 1; |
| 68 | } |
| 69 | |
| 70 | message getPortsReply { |
| 71 | repeated .net.PortProto port = 1; |
| 72 | } |
| 73 | |
| 74 | message getPortStatisticsRequest { |
| 75 | string device_id = 1; |
| 76 | } |
| 77 | |
| 78 | message getPortStatisticsReply { |
| 79 | repeated .net.device.PortStatisticsProto port_statistics = 1; |
| 80 | } |
| 81 | |
| 82 | message getPortDeltaStatisticsRequest { |
| 83 | string device_id = 1; |
| 84 | } |
| 85 | |
| 86 | message getPortDeltaStatisticsReply { |
| 87 | repeated .net.device.PortStatisticsProto port_statistics = 1; |
| 88 | } |
| 89 | |
| 90 | message getStatisticsForPortRequest { |
| 91 | string device_id = 1; |
| 92 | uint64 port_number = 2; |
| 93 | } |
| 94 | |
| 95 | message getStatisticsForPortReply { |
| 96 | .net.device.PortStatisticsProto port_statistics = 1; |
| 97 | } |
| 98 | |
| 99 | message getDeltaStatisticsForPortRequest { |
| 100 | string device_id = 1; |
| 101 | uint64 port_number = 2; |
| 102 | } |
| 103 | |
| 104 | message getDeltaStatisticsForPortReply { |
| 105 | .net.device.PortStatisticsProto port_statistics = 1; |
| 106 | } |
| 107 | |
| 108 | message getPortRequest { |
| 109 | .net.ConnectPointProto connect_point = 1; |
| 110 | } |
| 111 | |
| 112 | message getPortReply { |
| 113 | .net.PortProto port = 1; |
| 114 | } |
| 115 | |
| 116 | message isAvailableRequest { |
| 117 | string device_id = 1; |
| 118 | } |
| 119 | |
| 120 | message isAvailableReply { |
| 121 | bool is_available = 1; |
| 122 | } |
| 123 | |
| 124 | message localStatusRequest { |
| 125 | string device_id = 1; |
| 126 | } |
| 127 | |
| 128 | message localStatusReply { |
| 129 | string status = 1; |
| 130 | } |
| 131 | |
| 132 | service 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 | } |