syntax = "proto3";

// If you make any changes make sure you run: make regenerate-proto

// NOTE: need to keep this without agentk_ prefix due to backwards-compatibility
package gitlab.agent.agent_registrar.rpc;

import "pkg/entity/agentk/agentk.proto";

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/internal/module/agent_registrar/agentk_rpc";

message RegisterRequest {
  reserved 3, 4;

  entity.agentk.Meta meta = 1;
  // Uniquely identifies a particular agent process.
  // Randomly generated when agent process starts up.
  int64 instance_id = 2;
}

message RegisterResponse {}

message UnregisterRequest {
  reserved 3, 4;

  entity.agentk.Meta meta = 1;

  // Uniquely identifies a particular agent process.
  // Randomly generated when agent process starts up.
  int64 instance_id = 2;
}

message UnregisterResponse {}

service AgentRegistrar {
  // Register a new agent.
  rpc Register(RegisterRequest) returns (RegisterResponse) {
    option idempotency_level = IDEMPOTENT;
  }
  rpc Unregister(UnregisterRequest) returns (UnregisterResponse) {
    option idempotency_level = IDEMPOTENT;
  }
}
