HIGUCHI Yuta | e3e9063 | 2016-05-11 16:44:01 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | option java_package = "org.onosproject.grpc.net.device"; |
| 3 | |
| 4 | import "Device.proto"; |
| 5 | import "Port.proto"; |
| 6 | |
| 7 | package Device; |
| 8 | |
| 9 | message DeviceConnected { |
| 10 | // DeviceID as String DeviceId#toString |
| 11 | string device_id = 1; |
| 12 | DeviceDescription device_description = 2; |
| 13 | } |
| 14 | |
| 15 | message DeviceDisconnected { |
| 16 | // DeviceID as String DeviceId#toString |
| 17 | string device_id = 1; |
| 18 | } |
| 19 | |
| 20 | message UpdatePorts { |
| 21 | // DeviceID as String DeviceId#toString |
| 22 | string device_id = 1; |
| 23 | repeated Port.PortDescription port_descriptions= 2; |
| 24 | } |
| 25 | |
| 26 | message PortStatusChanged { |
| 27 | // DeviceID as String DeviceId#toString |
| 28 | string device_id = 1; |
| 29 | Port.PortDescription port_description= 2; |
| 30 | } |
| 31 | |
| 32 | message ReceivedRoleReply { |
| 33 | // DeviceID as String DeviceId#toString |
| 34 | string device_id = 1; |
| 35 | MastershipRole requested = 2; |
| 36 | MastershipRole response = 3; |
| 37 | } |
| 38 | |
| 39 | message UpdatePortStatistics { |
| 40 | // DeviceID as String DeviceId#toString |
| 41 | string device_id = 1; |
| 42 | repeated Port.PortStatistics port_statistics = 2; |
| 43 | } |
| 44 | |
| 45 | message RegisterProvider { |
| 46 | // DeviceProvider's ProviderId scheme |
| 47 | string provider_scheme = 1; |
| 48 | } |
| 49 | |
| 50 | message DeviceProviderServiceMsg { |
| 51 | oneof method { |
| 52 | DeviceConnected device_connected= 1; |
| 53 | DeviceDisconnected device_disconnected = 2; |
| 54 | UpdatePorts update_ports= 3; |
| 55 | PortStatusChanged port_status_changed = 4; |
| 56 | ReceivedRoleReply received_role_reply = 5; |
| 57 | UpdatePortStatistics update_port_statistics = 6; |
| 58 | |
| 59 | // This message is for return value of DeviceProvider#isReachable |
| 60 | IsReachableResponse is_reachable_response = 7; |
| 61 | |
| 62 | // This MUST be the 1st message over the stream |
| 63 | RegisterProvider register_provider = 8; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | message TriggerProbe { |
| 68 | // DeviceID as String DeviceId#toString |
| 69 | string device_id = 1; |
| 70 | } |
| 71 | |
| 72 | message RoleChanged { |
| 73 | // DeviceID as String DeviceId#toString |
| 74 | string device_id = 1; |
| 75 | MastershipRole new_role = 2; |
| 76 | } |
| 77 | |
| 78 | message IsReachableRequest { |
| 79 | int32 xid = 1; |
| 80 | // DeviceID as String DeviceId#toString |
| 81 | string device_id = 2; |
| 82 | } |
| 83 | |
| 84 | message IsReachableResponse { |
| 85 | int32 xid = 1; |
| 86 | bool is_reachable = 2; |
| 87 | } |
| 88 | |
| 89 | message DeviceProviderMsg { |
| 90 | oneof method { |
| 91 | TriggerProbe trigger_probe = 1; |
| 92 | RoleChanged role_changed = 2; |
| 93 | IsReachableRequest is_reachable_request= 3; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | service DeviceProviderRegistryRpc { |
| 98 | rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg); |
| 99 | } |