go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/logdog/api/endpoints/coordinator/registration/v1/service.proto (about)

     1  // Copyright 2016 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  package logdog;
     8  
     9  option go_package = "go.chromium.org/luci/logdog/api/endpoints/coordinator/registration/v1;logdog";
    10  
    11  import "google/protobuf/duration.proto";
    12  
    13  // RegisterPrefixRequest registers a new Prefix with the Coordinator.
    14  message RegisterPrefixRequest {
    15    // The log stream's project.
    16    string project = 1;
    17  
    18    // The log stream prefix to register.
    19    string prefix = 2;
    20  
    21    // The realm name (within the project) to associate the stream prefix with.
    22    //
    23    // This realm contains ACLs defining who will be able to read logs under this
    24    // prefix.
    25    //
    26    // The caller should have "logdog.logs.create" permission in this realm.
    27    string realm = 5;
    28  
    29    // Optional information about the registering agent.
    30    repeated string source_info = 3;
    31  
    32    // Optional nonce to allow retries of this RPC. ALL CLIENTS SHOULD PROVIDE
    33    // THIS. The client should generate the nonce once while preparing the request
    34    // message, and then re-use the same nonce for retries of the request.
    35    //
    36    // The nonce should be 32 bytes of random data.
    37    // The nonce must not be reused between different requests (only for retries
    38    //   of the same request).
    39    //
    40    // NOTE: This is currently optional, but once all clients have upgraded to
    41    // this scheme, it will become mandatory. During the transition if this is
    42    // omitted, then NO RETRIES will be allowed for this request, if the server
    43    // processes it correctly but the client fails to get the response from the
    44    // server.
    45    bytes op_nonce = 4;
    46  
    47    // The prefix expiration time. If <= 0, the project's default prefix
    48    // expiration period will be applied.
    49    //
    50    // The prefix will be closed by the Coordinator after its expiration period.
    51    // Once closed, new stream registration requests will no longer be accepted.
    52    //
    53    // If supplied, this value should exceed the timeout of the local task, else
    54    // some of the task's streams may be dropped due to failing registration.
    55    google.protobuf.Duration expiration = 10;
    56  }
    57  
    58  // The response message for the RegisterPrefix RPC.
    59  message RegisterPrefixResponse {
    60    // Secret is the prefix's secret. This must be included verbatim in Butler
    61    // bundles to assert ownership of this prefix.
    62    bytes secret = 1;
    63  
    64    // The name of the Pub/Sub topic to publish butlerproto-formatted Butler log
    65    // bundles to.
    66    string log_bundle_topic = 2;
    67  }
    68  
    69  // Registration service is a LogDog Coordinator endpoint that interfaces with
    70  // LogDog Butler instances and enables stream prefix registration and Butler
    71  // streaming initialization.
    72  service Registration {
    73    // RegisterStream allows a Butler instance to register a log stream with the
    74    // Coordinator. Upon success, the Coordinator will return registration
    75    // information and streaming parameters to the Butler.
    76    //
    77    // This should be called by a Butler instance to gain the ability to publish
    78    // to a prefix space. The caller must have WRITE access to its project's
    79    // stream space. If WRITE access is not present, this will fail with the
    80    // "PermissionDenied" gRPC code.
    81    //
    82    // A stream prefix may be registered at most once. Additional registration
    83    // requests will fail with the "AlreadyExists" gRPC code.
    84    rpc RegisterPrefix(RegisterPrefixRequest) returns (RegisterPrefixResponse);
    85  }