summaryrefslogtreecommitdiffstats
path: root/aclk/aclk-schemas/proto/agent/v1
diff options
context:
space:
mode:
Diffstat (limited to 'aclk/aclk-schemas/proto/agent/v1')
-rw-r--r--aclk/aclk-schemas/proto/agent/v1/cmds.proto79
-rw-r--r--aclk/aclk-schemas/proto/agent/v1/connection.proto59
-rw-r--r--aclk/aclk-schemas/proto/agent/v1/disconnect.proto16
3 files changed, 154 insertions, 0 deletions
diff --git a/aclk/aclk-schemas/proto/agent/v1/cmds.proto b/aclk/aclk-schemas/proto/agent/v1/cmds.proto
new file mode 100644
index 000000000..c37c00c3a
--- /dev/null
+++ b/aclk/aclk-schemas/proto/agent/v1/cmds.proto
@@ -0,0 +1,79 @@
+syntax = "proto3";
+option go_package = "agent/v1;agent";
+
+package agent.v1;
+
+import "google/protobuf/timestamp.proto";
+import "proto/aclk/v1/lib.proto";
+
+message CancelPendingRequest {
+ // must match the ID sent with the request originally made
+ // other than this agent will not put conditions on it
+ // and will treat it as opaque string (it simply has to match)
+ // However this doesn't mean there are no conditions on the id
+ // made on the request side
+ string request_id = 1;
+
+ // time when the cancellation request was generated
+ google.protobuf.Timestamp timestamp = 2;
+
+ // optional might be useful for debugging purposes
+ string trace_id = 3;
+}
+
+// AgentCommand is sent from the Cloud to the Agent at `/agent/{claim_id}/inbound/v1/cmd/AgentCommand`
+// the message includes the resource that the Cloud needs to GET from the Agent HTTP API along with related metadata
+message AgentCommand {
+ // the topic to which the Cloud awaits for the AgentCommandResponse.
+ // example: `/svc/agent-data-ctrl/2d7b7edd-561e-4aec-8ac1-466a585520f5/resp`
+ string callback_topic = 1;
+ // the topic to which the Cloud awaits for the AgentCommandAck.
+ // example: `/svc/agent-data-ctrl/2d7b7edd-561e-4aec-8ac1-466a585520f5/resp`
+ string ack_topic = 2;
+ // unique identifier for the AgentCommand
+ // example: `617038b3-7c2a-4617-a78f-ab37bd820198`
+ string message_id = 3;
+ // defined in milliseconds, the time the Agent has to respond before Cloud
+ // considering the request as timed-out
+ // example: `60000`
+ uint64 timeout = 4;
+ // defined in milliseconds, the time the Agent has to send back to the Cloud
+ // an AgentCommandAck message signaling that is still working on the request
+ // example: `3000`
+ uint64 ack_timeout = 5;
+ // the requested Agent resource
+ // example: `/api/v2/data?query_params_go_here`
+ string resource = 6;
+}
+
+// AgentCommandAck is sent from the Agent to the Cloud at predefined intervals (`AgentCommand.ack_timeout`) to predefined topic (`AgentCommand.ack_topic`)
+// signaling that the Agent is still working to serve an AgentCommand (referenced by the message_id) that the Cloud sent
+message AgentCommandAck {
+ // unique identifier to reference AgentCommand on which the Agent is still working on serving
+ // example: `617038b3-7c2a-4617-a78f-ab37bd820198`
+ string message_id = 1;
+ // the timestamp when the Agent created this AgentCommandAck message
+ google.protobuf.Timestamp created_at = 2;
+ // integer revealing the progress of completion to serve the AgentCommand with the given message_id
+ // example: `25`
+ uint32 progress_percent = 3;
+}
+
+// AgentCommandResponse is sent from the Agent to the Cloud at `/agent/{claim_id}/inbound/v1/cmd/AgentCommand`
+// the message includes the resource that the Cloud needs to GET from the Agent HTTP API along with related metadata
+message AgentCommandResponse {
+ // unique identifier for the AgentCommand
+ // example: `617038b3-7c2a-4617-a78f-ab37bd820198`
+ string message_id = 1;
+ // the (http) status code of the Agent's API response
+ // example: `200`
+ uint32 status_code = 2;
+ // the dumped raw (http) response the Agent's API returned
+ bytes response = 3;
+ // the Agent's timestamp (aka legacy `timestamp`)
+ google.protobuf.Timestamp timestamp = 4;
+ // the timestamp when the Agent received the AgentCommand for execution (aka legacy `t-rx`)
+ google.protobuf.Timestamp received_at = 5;
+ // the amount of microseconds the Agent needed to execute the HTTP request of the AgentCommand (aka legacy`t-exec`)
+ uint64 exec_time = 6;
+}
diff --git a/aclk/aclk-schemas/proto/agent/v1/connection.proto b/aclk/aclk-schemas/proto/agent/v1/connection.proto
new file mode 100644
index 000000000..4321b0b90
--- /dev/null
+++ b/aclk/aclk-schemas/proto/agent/v1/connection.proto
@@ -0,0 +1,59 @@
+syntax = "proto3";
+option go_package = "agent/v1;agent";
+
+package agent.v1;
+
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
+import "proto/aclk/v1/lib.proto";
+
+message UpdateAgentConnection {
+ string claim_id = 1;
+ bool reachable = 2;
+
+ int64 session_id = 3;
+
+ ConnectionUpdateSource update_source = 4;
+
+ // mqtt_broker_addr shard to use for reaching the agent
+ // cloud injects this information
+ string mqtt_broker_addr = 5;
+
+ google.protobuf.Timestamp updated_at = 6;
+
+ // vmq_instance_id broker shard to use for reaching the agent
+ // cloud injects this information
+ int32 vmq_instance_id = 7;
+
+ // > 15 optional fields:
+ // How long the system was running until connection (only applicable when reachable=true)
+ google.protobuf.Duration system_uptime = 15;
+
+ // How long the netdata agent was running until connection (only applicable when reachable=true)
+ google.protobuf.Duration agent_uptime = 16;
+
+ repeated aclk_lib.v1.Capability capabilities = 17;
+}
+
+message SendNodeInstances {
+ string claim_id = 1;
+ Config config = 2;
+}
+
+// ConnectionUpdateSource is to determine whether the connection update was issued
+enum ConnectionUpdateSource {
+ // CONNECTION_UPDATE_SOURCE_UNSPECIFIED acts as default value for protobuf and is never specified
+ CONNECTION_UPDATE_SOURCE_UNSPECIFIED = 0;
+ // CONNECTION_UPDATE_SOURCE_AGENT A direct message from an agent
+ CONNECTION_UPDATE_SOURCE_AGENT = 1;
+ // CONNECTION_UPDATE_SOURCE_LWT message delivered as the Last Will and Testiment from MQTT broker if an agent connection with the broker is lost
+ CONNECTION_UPDATE_SOURCE_LWT = 2;
+ // CONNECTION_UPDATE_SOURCE_HEURISTIC A cloud generated message to sanitize incorrect internal state
+ CONNECTION_UPDATE_SOURCE_HEURISTIC = 3;
+}
+
+message Config {
+ bool bearer_protection = 1;
+ bool cloud_only_notifications = 2;
+ bool universal_dashboards = 3;
+}
diff --git a/aclk/aclk-schemas/proto/agent/v1/disconnect.proto b/aclk/aclk-schemas/proto/agent/v1/disconnect.proto
new file mode 100644
index 000000000..852ef702a
--- /dev/null
+++ b/aclk/aclk-schemas/proto/agent/v1/disconnect.proto
@@ -0,0 +1,16 @@
+syntax = "proto3";
+
+package agent.v1;
+
+import "google/protobuf/timestamp.proto";
+
+option go_package = "agent/v1;agent";
+
+// Sent by Cloud to instruct Agent to disconnect ASAP
+message DisconnectReq {
+ uint64 reconnect_after_seconds = 1;
+ bool permaban = 2;
+ google.protobuf.Timestamp created_at = 3;
+ uint32 error_code = 4;
+ string error_description = 5;
+}