go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/gce/api/instances/v1/service.proto (about)

     1  // Copyright 2019 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  syntax = "proto3";
     6  
     7  option go_package = "go.chromium.org/luci/gce/api/instances/v1;instances";
     8  
     9  package instances;
    10  
    11  import "google/protobuf/empty.proto";
    12  import "google/protobuf/timestamp.proto";
    13  
    14  // A disk associated with a GCE instance.
    15  message Disk {
    16    // The image associated with this disk.
    17    // https://cloud.google.com/compute/docs/reference/rest/v1/images/list.
    18    string image = 1;
    19  }
    20  
    21  // A network interface associated with a GCE instance.
    22  message NetworkInterface {
    23    // The internal IP address associated with this network interface.
    24    string internal_ip = 1;
    25    // The external IP addresses associated with this network interface.
    26    repeated string external_ips = 2;
    27  }
    28  
    29  // A GCE instance configured to exist.
    30  // The instance actually exists iff the created timestamp is set.
    31  message Instance {
    32    // The ID of the VM this instance was created from.
    33    string id = 1;
    34  
    35    // The hostname associated with this instance.
    36    string hostname = 2;
    37  
    38    // The zone associated with this instance.
    39    // https://cloud.google.com/compute/docs/reference/rest/v1/zones/list.
    40    string zone = 3;
    41  
    42    // The GCP project associated with this instance.
    43    string project = 4;
    44  
    45    // The timestamp when this instance was created.
    46    google.protobuf.Timestamp created = 5;
    47  
    48    // The lifetime of this instance.
    49    // At the end of its lifetime, the instance is deleted.
    50    int64 lifetime = 6;
    51  
    52    // The hostname of the Swarming server this instance should connect to.
    53    string swarming = 7;
    54  
    55    // The timestamp when this instance connected to Swarming.
    56    google.protobuf.Timestamp connected = 8;
    57  
    58    // The timeout of this instance.
    59    // If no Swarming bot has connected by the timeout, the instance is deleted.
    60    int64 timeout = 9;
    61  
    62    // Whether this instance is drained or not.
    63    // A drained instance will be safely deleted regardless of lifetime.
    64    bool drained = 10;
    65  
    66    // The config revision associated with this instance.
    67    string config_revision = 11;
    68  
    69    // The disks associated with this instance.
    70    repeated Disk disks = 12;
    71  
    72    // The network interfaces associated with this instance.
    73    repeated NetworkInterface network_interfaces = 13;
    74  
    75    // The prefix associated with this instance.
    76    string prefix = 14;
    77  }
    78  
    79  // A request to delete an instance.
    80  message DeleteRequest {
    81    // The ID of the instance to delete.
    82    string id = 1;
    83  
    84    // The hostname of the instance to delete.
    85    string hostname = 2;
    86  }
    87  
    88  // A request to get an existing instance.
    89  message GetRequest {
    90    // The ID of the instance to get.
    91    string id = 1;
    92  
    93    // The hostname of the instance to get.
    94    string hostname = 2;
    95  }
    96  
    97  // A request to list existing instances.
    98  message ListRequest {
    99    // The prefix to list instances for.
   100    string prefix = 1;
   101  
   102    // The value of next_page_token received in a ListResponse. Used to get the
   103    // next page of instances. If empty, gets the first page.
   104    string page_token = 2;
   105  
   106    // The maximum number of results to include in the response.
   107    int32 page_size = 3;
   108  
   109    // A filter to apply when listing instances. Currently the only supported
   110    // filter is "disks.image=<image>" where <image> is the name of the image to
   111    // filter for.
   112    string filter = 4;
   113  }
   114  
   115  // A response to a request to list instances.
   116  message ListResponse {
   117    // The prefix the instances are for.
   118    string prefix = 1;
   119  
   120    // The instances matching the prefix.
   121    repeated Instance instances = 2;
   122  
   123    // The value to use as the page_token in a ListRequest to get the next page of
   124    // instances. If empty, there are no more instances.
   125    string next_page_token = 3;
   126  }
   127  
   128  // A service for manipulating GCE instances.
   129  service Instances {
   130    // Delete deletes an instance asynchronously.
   131    rpc Delete(DeleteRequest) returns (google.protobuf.Empty);
   132    // Get returns an existing instance.
   133    rpc Get(GetRequest) returns (Instance);
   134    // List returns existing instances.
   135    rpc List(ListRequest) returns (ListResponse);
   136  }