blob: 7ac84894e3ad9e760a2e350e79b00b87f53c2cad [file] [log] [blame]
HIGUCHI Yutae3e90632016-05-11 16:44:01 -07001syntax = "proto3";
2option java_package = "org.onosproject.grpc.net.device";
3
4import "Device.proto";
5import "Port.proto";
6
7package Device;
8
9message DeviceConnected {
10 // DeviceID as String DeviceId#toString
11 string device_id = 1;
12 DeviceDescription device_description = 2;
13}
14
15message DeviceDisconnected {
16 // DeviceID as String DeviceId#toString
17 string device_id = 1;
18}
19
20message UpdatePorts {
21 // DeviceID as String DeviceId#toString
22 string device_id = 1;
23 repeated Port.PortDescription port_descriptions= 2;
24}
25
26message PortStatusChanged {
27 // DeviceID as String DeviceId#toString
28 string device_id = 1;
29 Port.PortDescription port_description= 2;
30}
31
32message ReceivedRoleReply {
33 // DeviceID as String DeviceId#toString
34 string device_id = 1;
35 MastershipRole requested = 2;
36 MastershipRole response = 3;
37}
38
39message UpdatePortStatistics {
40 // DeviceID as String DeviceId#toString
41 string device_id = 1;
42 repeated Port.PortStatistics port_statistics = 2;
43}
44
45message RegisterProvider {
46 // DeviceProvider's ProviderId scheme
47 string provider_scheme = 1;
48}
49
50message 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
67message TriggerProbe {
68 // DeviceID as String DeviceId#toString
69 string device_id = 1;
70}
71
72message RoleChanged {
73 // DeviceID as String DeviceId#toString
74 string device_id = 1;
75 MastershipRole new_role = 2;
76}
77
78message IsReachableRequest {
79 int32 xid = 1;
80 // DeviceID as String DeviceId#toString
81 string device_id = 2;
82}
83
84message IsReachableResponse {
85 int32 xid = 1;
86 bool is_reachable = 2;
87}
88
89message DeviceProviderMsg {
90 oneof method {
91 TriggerProbe trigger_probe = 1;
92 RoleChanged role_changed = 2;
93 IsReachableRequest is_reachable_request= 3;
94 }
95}
96
97service DeviceProviderRegistryRpc {
98 rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg);
99}