| // Copyright 2018 The LUCI Authors. All rights reserved. |
| // Use of this source code is governed under the Apache License, Version 2.0 |
| // that can be found in the LICENSE file. |
| |
| syntax = "proto3"; |
| |
| package crimson; |
| |
| import "google/protobuf/field_mask.proto"; |
| |
| // A network interface in the database. |
| message NIC { |
| // The name of this NIC. With machine, uniquely identifies this NIC. |
| string name = 1; |
| // The machine this NIC belongs to. With name, uniquely identifies this NIC. |
| string machine = 2; |
| // The MAC address associated with this NIC. |
| string mac_address = 3; |
| // The switch this NIC is connected to. |
| string switch = 4; |
| // The switchport this NIC is connected to. |
| int32 switchport = 5; |
| // The name of this NIC on the network. |
| string hostname = 6; |
| // The IPv4 address associated with this NIC. |
| string ipv4 = 7; |
| } |
| |
| // A request to create a new NIC in the database. |
| message CreateNICRequest { |
| // The NIC to create in the database. |
| NIC nic = 1; |
| } |
| |
| // A request to delete a NIC from the database. |
| message DeleteNICRequest { |
| // The name of the NIC to delete. |
| string name = 1; |
| // The machine the NIC belongs to. |
| string machine = 2; |
| } |
| |
| // A request to list NICs in the database. |
| message ListNICsRequest { |
| // The names of NICs to filter retrieved NICs on. |
| repeated string names = 1; |
| // The machines to filter retrieved NICs on. |
| repeated string machines = 2; |
| // The MAC addresses to filter retrieved NICs on. |
| repeated string mac_addresses = 3; |
| // The switches to filter retrieved NICs on. |
| repeated string switches = 4; |
| // The hostnames of NICs to filter retrieved NICs on. |
| repeated string hostnames = 5; |
| // The IPv4 addresses of NICs to filter retrieved NICs on. |
| repeated string ipv4s = 6; |
| } |
| |
| // A response containing a list of NICs in the database. |
| message ListNICsResponse { |
| // The NICs matching this request. |
| repeated NIC nics = 1; |
| // TODO(smut): Support page tokens. |
| } |
| |
| // A request to update a NIC in the database. |
| message UpdateNICRequest { |
| // The NIC to update in the database. |
| NIC nic = 1; |
| // The fields to update in the NIC. |
| google.protobuf.FieldMask update_mask = 2; |
| } |