blob: aae46d9606d960113313aa22900d955b16b75b67 [file] [log] [blame]
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -08001syntax = "proto3";
2option java_package = "org.onosproject.grpc";
3
4import "Port.proto";
5package Device;
6
7enum DeviceType {
8 OTHER = 0;
9 SWITCH = 1;
10 ROUTER = 2;
11 ROADM = 3;
12 OTN = 4;
13 ROADM_OTN = 5;
14 FIREWALL = 6;
15 BALANCER = 7;
16 IPS = 8;
17 IDS = 9;
18 CONTROLLER = 10;
19 VIRTUAL = 11;
20 FIBER_SWITCH = 12;
21 MICROWAVE = 13;
22}
23
24message DeviceDescription {
25 string device_Uri = 1;
26 DeviceType type = 2;
27 string manufacturer = 3;
28 string hw_version = 4;
29 string sw_version = 5;
30 string serial_number = 6;
31 string chassis_id = 7;
32 map<string, string> annotations = 8;
33}
34
35enum MastershipRole {
36 NONE = 0;
37 MASTER = 1;
38 STANDBY = 2;
39}
40
41message DeviceConnected {
42 // DeviceID as String DeviceId#toString
43 string device_id = 1;
44 DeviceDescription device_description = 2;
45}
46
47message DeviceDisconnected {
48 // DeviceID as String DeviceId#toString
49 string device_id = 1;
50}
51
52message UpdatePorts {
53 // DeviceID as String DeviceId#toString
54 string device_id = 1;
55 repeated Port.PortDescription port_descriptions= 2;
56}
57
58message PortStatusChanged {
59 // DeviceID as String DeviceId#toString
60 string device_id = 1;
61 Port.PortDescription port_description= 2;
62}
63
64message ReceivedRoleReply {
65 // DeviceID as String DeviceId#toString
66 string device_id = 1;
67 MastershipRole requested = 2;
68 MastershipRole response = 3;
69}
70
71message UpdatePortStatistics {
72 // DeviceID as String DeviceId#toString
73 string device_id = 1;
74 repeated Port.PortStatistics port_statistics = 2;
75}
76
77message RegisterProvider {
78 // DeviceProvider's ProviderId scheme
79 string provider_scheme = 1;
80}
81
82message DeviceProviderServiceMsg {
83 oneof method {
84 DeviceConnected device_connected= 1;
85 DeviceDisconnected device_disconnected = 2;
86 UpdatePorts update_ports= 3;
87 PortStatusChanged port_status_changed = 4;
88 ReceivedRoleReply received_role_reply = 5;
89 UpdatePortStatistics update_port_statistics = 6;
90
91 // This message is for return value of DeviceProvider#isReachable
92 IsReachableResponse is_reachable_response = 7;
93
94 // This MUST be the 1st message over the stream
95 RegisterProvider register_provider = 8;
96 }
97}
98
99message TriggerProbe {
100 // DeviceID as String DeviceId#toString
101 string device_id = 1;
102}
103
104message RoleChanged {
105 // DeviceID as String DeviceId#toString
106 string device_id = 1;
107 MastershipRole new_role = 2;
108}
109
110message IsReachableRequest {
111 int32 xid = 1;
112 // DeviceID as String DeviceId#toString
113 string device_id = 2;
114}
115
116message IsReachableResponse {
117 int32 xid = 1;
118 bool is_reachable = 2;
119}
120
121message DeviceProviderMsg {
122 oneof method {
123 TriggerProbe trigger_probe = 1;
124 RoleChanged role_changed = 2;
125 IsReachableRequest is_reachable_request= 3;
126 }
127}
128
129service DeviceProviderRegistryRpc {
130 rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg);
131}