b096a2e7e5
This commit adds protobuf files and tooling surrounding generating APIs and datatypes.
71 lines
1.8 KiB
Protocol Buffer
71 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
package headscale.v1;
|
|
option go_package = "github.com/juanfont/headscale/gen/go/v1";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
import "google/api/annotations.proto";
|
|
import "options/gorm.proto";
|
|
|
|
enum RegisterMethod {
|
|
AUTH_KEY = 0;
|
|
CLI = 1;
|
|
OIDC = 2;
|
|
}
|
|
|
|
message Namespace {
|
|
string Name = 1;
|
|
}
|
|
|
|
message PreAuthKey {
|
|
uint64 ID = 1;
|
|
string Key = 2;
|
|
uint32 NamespaceID = 3;
|
|
Namespace Namespace = 4;
|
|
bool Reusable = 5;
|
|
bool Ephemeral = 6;
|
|
bool Used = 7;
|
|
|
|
google.protobuf.Timestamp CreatedAt = 8;
|
|
google.protobuf.Timestamp Expiration = 9;
|
|
}
|
|
|
|
message GetMachineRequest {
|
|
uint64 machine_id = 1;
|
|
}
|
|
|
|
message Machine {
|
|
option(gorm.opts).ormable = true;
|
|
uint64 ID = 1;
|
|
string MachineKey = 2;
|
|
string NodeKey = 3;
|
|
string DiscoKey = 4;
|
|
string IPAddress = 5;
|
|
string Name = 6;
|
|
uint32 NamespaceID = 7;
|
|
|
|
bool Registered = 8;
|
|
RegisterMethod RegisterMethod = 9;
|
|
uint32 AuthKeyID = 10;
|
|
PreAuthKey AuthKey = 11;
|
|
|
|
google.protobuf.Timestamp LastSeen = 12;
|
|
google.protobuf.Timestamp LastSuccessfulUpdate = 13;
|
|
google.protobuf.Timestamp Expiry = 14;
|
|
|
|
bytes HostInfo = 15;
|
|
bytes Endpoints = 16;
|
|
bytes EnabledRoutes = 17;
|
|
|
|
google.protobuf.Timestamp CreatedAt = 18;
|
|
google.protobuf.Timestamp UpdatedAt = 19;
|
|
google.protobuf.Timestamp DeletedAt = 20;
|
|
}
|
|
|
|
// Gin Router will prefix this with /api/v1
|
|
service HeadscaleService {
|
|
rpc GetMachine(GetMachineRequest) returns(Machine) {
|
|
option(google.api.http) = {
|
|
get : "/api/v1/machine/{machine_id}"
|
|
};
|
|
}
|
|
}
|