Initial project snapshot
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/client"
|
||||
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/state"
|
||||
)
|
||||
|
||||
const Version = "0.1.0-c3"
|
||||
|
||||
func EnrollmentPayload(clusterID, joinToken string, identity state.Identity) client.EnrollRequest {
|
||||
return client.EnrollRequest{
|
||||
ClusterID: clusterID,
|
||||
JoinToken: joinToken,
|
||||
NodeName: identity.NodeName,
|
||||
NodeFingerprint: identity.NodeFingerprint,
|
||||
PublicKey: identity.PublicKey,
|
||||
ReportedCapabilities: map[string]any{
|
||||
"can_accept_client_ingress": false,
|
||||
"can_accept_node_ingress": false,
|
||||
"can_route_mesh": false,
|
||||
"can_run_rdp_worker": true,
|
||||
"can_run_vnc_worker": false,
|
||||
"can_run_vpn_exit": false,
|
||||
"can_run_vpn_connector": false,
|
||||
"can_run_file_cache": false,
|
||||
"can_run_update_cache": false,
|
||||
"can_run_video_relay": false,
|
||||
"native_node_agent_version": Version,
|
||||
"service_supervision_enabled": false,
|
||||
},
|
||||
ReportedFacts: map[string]any{
|
||||
"os": runtime.GOOS,
|
||||
"arch": runtime.GOARCH,
|
||||
"agent": "rap-node-agent",
|
||||
"agent_ver": Version,
|
||||
},
|
||||
RequestedRoles: []string{},
|
||||
}
|
||||
}
|
||||
|
||||
func HeartbeatPayload() client.HeartbeatRequest {
|
||||
return client.HeartbeatRequest{
|
||||
HealthStatus: "healthy",
|
||||
ReportedVersion: Version,
|
||||
Capabilities: map[string]any{
|
||||
"native_node_agent": true,
|
||||
},
|
||||
ServiceStates: map[string]any{
|
||||
"workload_supervision": "not_implemented_c3",
|
||||
},
|
||||
Metadata: map[string]any{
|
||||
"stage": "c3",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func MeshSelfObservationPayload(identity state.Identity) client.MeshLinkObservationRequest {
|
||||
return client.MeshLinkObservationRequest{
|
||||
SourceNodeID: identity.NodeID,
|
||||
TargetNodeID: identity.NodeID,
|
||||
LinkStatus: "reachable",
|
||||
Metadata: map[string]any{
|
||||
"stage": "c6",
|
||||
"traffic_forwarding": false,
|
||||
"observation_type": "self",
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user