summaryrefslogtreecommitdiffstats
path: root/aclk/aclk-schemas/proto/agent/v1/connection.proto
blob: 4321b0b903119ea68f191dcc78543375129248db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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;
}