/** * Communication between the Ambassador Agent and the Director service * to populate the Central Edge Policy Console, which is a cloud service * run by Datawire. */ syntax = "proto3"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "prometheus/metrics.proto"; package agent; option go_package = "./agent"; service Director { // Report a consistent Snapshot of information to the DCP. This // method is deprecated, you should call ReportStream instead. rpc Report(Snapshot) returns (SnapshotResponse) { option deprecated = true; } // Report a consistent Snapshot of information to the DCP. rpc ReportStream(stream RawSnapshotChunk) returns (SnapshotResponse) {} // Report a consistent Diagnostics snapshot of information to the DCP. rpc StreamDiagnostics(stream RawDiagnosticsChunk) returns (DiagnosticsResponse) {} // Stream metrics to the DCP. rpc StreamMetrics(stream StreamMetricsMessage) returns (StreamMetricsResponse) {} // Retrieve Directives from the DCP rpc Retrieve(Identity) returns (stream Directive) {} // Reports the result of a command execution to the cloud rpc ReportCommandResult(CommandResult) returns (CommandResultResponse) {} } // How Ambassador's Agent identifies itself to the DCP // This is the identity of the ambassador the agent is reporting on behalf of // no user account specific information should be contained in here message Identity { // The account ID assigned by the DCP string account_id = 1 [deprecated = true]; // Ambassador version string version = 2 [deprecated = true]; // This Ambassador's hostname string hostname = 3; // License information string license = 4; // The cluster ID, as determined by Ambassador string cluster_id = 5; // Label or description for the user string label = 6 [deprecated = true]; } // Information that Ambassador's Agent can send to the Director // component of the DCP message Snapshot { Identity identity = 1; string message = 2; // no longer used. repeated Service services = 3 [deprecated = true]; bytes raw_snapshot = 4; // describes how the raw_snapshot is encoded string content_type = 5; // api version of RawSnapshot string api_version = 6; google.protobuf.Timestamp snapshot_ts = 7; } // RawSnapshotChunk is a fragment of a JSON serialization of a // Snapshot protobuf object. message RawSnapshotChunk { bytes chunk = 1; } // Diagnostic information from ambassador admin message Diagnostics { Identity identity = 1; string message = 2; bytes raw_diagnostics = 3; // describes how the raw_diagnostic is encoded string content_type = 4; // api version of Diagnostics string api_version = 5; google.protobuf.Timestamp snapshot_ts = 6; } // RawDiagnosticChunk is a fragment of a JSON serialization of a // Diagnostic protobuf object. message RawDiagnosticsChunk { bytes chunk = 1; } message Service { string name = 1; string namespace = 2; map labels = 3; map annotations = 4; } // The Director's response to a Snapshot from the Agent message SnapshotResponse { // Empty for now, as the Director only knows how to return success or // an error. In the future this may contain additional information. } // The Director's response to a Diagnostics message from the Agent message DiagnosticsResponse { // Empty for now, as the Director only knows how to return success or // an error. In the future this may contain additional information. } // Instructions that the DCP can send to Ambassador message Directive { string ID = 1; // Stop sending snapshots. The default value (false) indicates that // snapshot should be sent. bool stop_reporting = 2; // Minimum time to wait before pushing the next snapshot. The default // value (zero duration) indicates that the Agent should not modify // the existing report period. google.protobuf.Duration min_report_period = 3; // Commands to execute repeated Command commands = 4; } // An individual instruction from the DCP message Command { // Log this message if present string message = 1; RolloutCommand rolloutCommand = 2; SecretSyncCommand secretSyncCommand = 3; } message RolloutCommand { string name = 1; string namespace = 2; enum Action { PAUSE = 0; RESUME = 1; ABORT = 2; } Action action = 3; string command_id = 4; } message SecretSyncCommand { string name = 1; string namespace = 2; string command_id = 3; enum Action { SET = 0; DELETE = 1; } Action action = 4; map secret = 5; } message CommandResult { string command_id = 1; bool success = 2; string message = 3; } message CommandResultResponse { } message StreamMetricsMessage { Identity identity = 1; // A list of metric entries repeated io.prometheus.client.MetricFamily envoy_metrics = 2; } message StreamMetricsResponse { }