| // 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"; |
| |
| option go_package = "go.chromium.org/luci/machine-db/api/crimson/v1;crimson"; |
| |
| package crimson; |
| |
| import "google/protobuf/field_mask.proto"; |
| import "go.chromium.org/luci/machine-db/api/common/v1/states.proto"; |
| |
| // A VM in the database. |
| message VM { |
| // The name of this VM on the network. Uniquely identifies this VM. |
| string name = 1; |
| // The VLAN this VM belongs to. |
| // When creating a VM, omit this field. It will be inferred from the IPv4 address. |
| int64 vlan = 2; |
| // The physical host this VM is running on. |
| string host = 3; |
| // The VLAN this VM's physical host belongs to. |
| // When creating a VM, omit this field. It will be inferred from the host. |
| int64 host_vlan = 4; |
| // The operating system running on this VM. |
| string os = 5; |
| // A description of this VM. |
| string description = 6; |
| // The deployment ticket associated with this VM. |
| string deployment_ticket = 7; |
| // The IPv4 address associated with this host. |
| string ipv4 = 8; |
| // The state of this VM. |
| common.State state = 9; |
| } |
| |
| // A request to create a new VM in the database. |
| message CreateVMRequest { |
| // The VM to create in the database. |
| VM vm = 1; |
| } |
| |
| // A request to list VMs in the database. |
| message ListVMsRequest { |
| // The names of VMs to get. |
| repeated string names = 1; |
| // The VLANs to filter retrieved VMs on. |
| repeated int64 vlans = 2; |
| // The IPv4 addresses to filter retrieved VMs on. |
| repeated string ipv4s = 3; |
| // The physical hosts to filter retrieved VMs on. |
| repeated string hosts = 4; |
| // The physical host VLANs to filter retrieved VMs on. |
| repeated int64 host_vlans = 5; |
| // The operating system to filter retrieved VMs on. |
| repeated string oses = 6; |
| // The states to filter retrieved VMs on. |
| repeated common.State states = 10; |
| } |
| |
| // A response containing a list of VMs in the database. |
| message ListVMsResponse { |
| // The VMs matching this request. |
| repeated VM vms = 1; |
| // TODO(smut): Support page tokens. |
| } |
| |
| // A request to update a VM in the database. |
| message UpdateVMRequest { |
| // The VM to update in the database. |
| VM vm = 1; |
| // The fields to update in the VM. |
| google.protobuf.FieldMask update_mask = 2; |
| } |