...

Text file src/github.com/emissary-ingress/emissary/v3/api/agent/director.proto

Documentation: github.com/emissary-ingress/emissary/v3/api/agent

     1/**
     2 * Communication between the Ambassador Agent and the Director service
     3 * to populate the Central Edge Policy Console, which is a cloud service
     4 * run by Datawire.
     5 */
     6syntax = "proto3";
     7
     8import "google/protobuf/duration.proto";
     9import "google/protobuf/timestamp.proto";
    10
    11import "prometheus/metrics.proto";
    12
    13package agent;
    14
    15option go_package = "./agent";
    16
    17service Director {
    18  // Report a consistent Snapshot of information to the DCP.  This
    19  // method is deprecated, you should call ReportStream instead.
    20  rpc Report(Snapshot) returns (SnapshotResponse) {
    21    option deprecated = true;
    22  }
    23
    24  // Report a consistent Snapshot of information to the DCP.
    25  rpc ReportStream(stream RawSnapshotChunk) returns (SnapshotResponse) {}
    26
    27  // Report a consistent Diagnostics snapshot of information to the DCP.
    28  rpc StreamDiagnostics(stream RawDiagnosticsChunk) returns (DiagnosticsResponse) {}
    29
    30  // Stream metrics to the DCP.
    31  rpc StreamMetrics(stream StreamMetricsMessage) returns (StreamMetricsResponse) {}
    32
    33  // Retrieve Directives from the DCP
    34  rpc Retrieve(Identity) returns (stream Directive) {}
    35
    36  // Reports the result of a command execution to the cloud
    37  rpc ReportCommandResult(CommandResult) returns (CommandResultResponse) {}
    38}
    39
    40// How Ambassador's Agent identifies itself to the DCP
    41// This is the identity of the ambassador the agent is reporting on behalf of
    42// no user account specific information should be contained in here
    43message Identity {
    44  // The account ID assigned by the DCP
    45  string account_id = 1 [deprecated = true];
    46
    47  // Ambassador version
    48  string version = 2 [deprecated = true];
    49
    50  // This Ambassador's hostname
    51  string hostname = 3;
    52
    53  // License information
    54  string license = 4;
    55
    56  // The cluster ID, as determined by Ambassador
    57  string cluster_id = 5;
    58
    59  // Label or description for the user
    60  string label = 6 [deprecated = true];
    61}
    62
    63// Information that Ambassador's Agent can send to the Director
    64// component of the DCP
    65message Snapshot {
    66  Identity identity = 1;
    67  string message = 2;
    68  // no longer used.
    69  repeated Service services = 3 [deprecated = true];
    70  bytes raw_snapshot = 4;
    71  // describes how the raw_snapshot is encoded
    72  string content_type = 5;
    73  // api version of RawSnapshot
    74  string api_version = 6;
    75  google.protobuf.Timestamp snapshot_ts = 7;
    76}
    77
    78// RawSnapshotChunk is a fragment of a JSON serialization of a
    79// Snapshot protobuf object.
    80message RawSnapshotChunk {
    81  bytes chunk = 1;
    82}
    83
    84// Diagnostic information from ambassador admin
    85message Diagnostics {
    86  Identity identity = 1;
    87  string message = 2;
    88
    89  bytes raw_diagnostics = 3;
    90  // describes how the raw_diagnostic is encoded
    91  string content_type = 4;
    92  // api version of Diagnostics
    93  string api_version = 5;
    94  google.protobuf.Timestamp snapshot_ts = 6;
    95}
    96
    97// RawDiagnosticChunk is a fragment of a JSON serialization of a
    98// Diagnostic protobuf object.
    99message RawDiagnosticsChunk {
   100    bytes chunk = 1;
   101}
   102
   103message Service {
   104  string name = 1;
   105  string namespace = 2;
   106  map<string, string> labels = 3;
   107  map<string, string> annotations = 4;
   108}
   109
   110// The Director's response to a Snapshot from the Agent
   111message SnapshotResponse {
   112  // Empty for now, as the Director only knows how to return success or
   113  // an error. In the future this may contain additional information.
   114}
   115
   116// The Director's response to a Diagnostics message from the Agent
   117message DiagnosticsResponse {
   118  // Empty for now, as the Director only knows how to return success or
   119  // an error. In the future this may contain additional information.
   120}
   121
   122// Instructions that the DCP can send to Ambassador
   123message Directive {
   124  string ID = 1;
   125
   126  // Stop sending snapshots. The default value (false) indicates that
   127  // snapshot should be sent.
   128  bool stop_reporting = 2;
   129
   130  // Minimum time to wait before pushing the next snapshot. The default
   131  // value (zero duration) indicates that the Agent should not modify
   132  // the existing report period.
   133  google.protobuf.Duration min_report_period = 3;
   134
   135  // Commands to execute
   136  repeated Command commands = 4;
   137}
   138
   139// An individual instruction from the DCP
   140message Command {
   141  // Log this message if present
   142  string message = 1;
   143  RolloutCommand rolloutCommand = 2;
   144  SecretSyncCommand secretSyncCommand = 3;
   145}
   146
   147message RolloutCommand {
   148  string name = 1;
   149  string namespace = 2;
   150  enum Action {
   151    PAUSE = 0;
   152    RESUME = 1;
   153    ABORT = 2;
   154  }
   155  Action action = 3;
   156  string command_id = 4;
   157}
   158
   159message SecretSyncCommand {
   160  string name = 1;
   161  string namespace = 2;
   162  string command_id = 3;
   163
   164  enum Action {
   165    SET = 0;
   166    DELETE = 1;
   167  }
   168  Action action = 4;
   169  map<string, bytes> secret = 5;
   170}
   171
   172message CommandResult {
   173  string command_id = 1;
   174  bool success = 2;
   175  string message = 3;
   176}
   177
   178message CommandResultResponse {
   179}
   180
   181message StreamMetricsMessage {
   182  Identity identity = 1;
   183
   184  // A list of metric entries
   185  repeated io.prometheus.client.MetricFamily envoy_metrics = 2;
   186}
   187
   188message StreamMetricsResponse {
   189}

View as plain text