OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 syntax = "proto3"; | 5 syntax = "proto3"; |
6 | 6 |
7 package crimson; | 7 package crimson; |
8 | 8 |
9 service Crimson { | 9 service Crimson { |
10 rpc CreateIPRange (IPRange) returns (IPRangeStatus) {} | 10 rpc CreateIPRange (IPRange) returns (IPRangeStatus) {} |
11 rpc ReadIPRange (IPRangeQuery) returns (IPRanges) {} | 11 rpc ReadIPRange (IPRangeQuery) returns (IPRanges) {} |
| 12 |
| 13 rpc CreateHost (HostList) returns (HostStatus) {} |
| 14 rpc ReadHost (HostQuery) returns (HostList) {} |
12 } | 15 } |
13 | 16 |
14 message IPRanges { | 17 message IPRanges { |
15 repeated IPRange ranges = 1; | 18 repeated IPRange ranges = 1; |
16 } | 19 } |
17 | 20 |
18 message IPRange { | 21 message IPRange { |
19 string site = 1; | 22 string site = 1; |
20 string vlan = 2; | 23 string vlan = 2; |
21 string start_ip = 3; | 24 string start_ip = 3; |
22 string end_ip = 4; | 25 string end_ip = 4; |
23 } | 26 } |
24 | 27 |
25 message IPRangeStatus { | 28 message IPRangeStatus { |
26 string error = 1; | 29 string error = 1; |
27 } | 30 } |
28 | 31 |
29 message IPRangeQuery { | 32 message IPRangeQuery { |
30 string site = 1; | 33 string site = 1; |
31 string vlan = 2; | 34 string vlan = 2; |
32 uint32 limit = 3; | 35 uint32 limit = 3; |
33 string ip = 4; | 36 string ip = 4; |
34 } | 37 } |
| 38 |
| 39 message Host { |
| 40 string site = 1; |
| 41 string hostname = 2; |
| 42 string mac_addr = 3; |
| 43 string ip = 4; |
| 44 string boot_class = 5; |
| 45 } |
| 46 |
| 47 message HostList { |
| 48 repeated Host hosts = 1; |
| 49 } |
| 50 |
| 51 message HostStatus { } |
| 52 |
| 53 message HostQuery { |
| 54 uint32 limit = 1; |
| 55 string site = 2; |
| 56 string hostname = 3; |
| 57 string mac_addr = 4; |
| 58 string ip = 5; |
| 59 string boot_class = 6; |
| 60 } |
OLD | NEW |