Proto format

This commit is contained in:
Kristoffer Dalby 2021-11-13 08:36:56 +00:00
parent 03b7ec62ca
commit dae34ca8c5

View file

@ -12,115 +12,115 @@ import "headscale/v1/routes.proto";
service HeadscaleService { service HeadscaleService {
// --- Namespace start --- // --- Namespace start ---
rpc GetNamespace(GetNamespaceRequest) returns(GetNamespaceResponse) { rpc GetNamespace(GetNamespaceRequest) returns (GetNamespaceResponse) {
option(google.api.http) = { option (google.api.http) = {
get : "/api/v1/namespace/{name}" get: "/api/v1/namespace/{name}"
}; };
} }
rpc CreateNamespace(CreateNamespaceRequest) returns(CreateNamespaceResponse) { rpc CreateNamespace(CreateNamespaceRequest) returns (CreateNamespaceResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/namespace" post: "/api/v1/namespace"
body : "*" body: "*"
}; };
} }
rpc RenameNamespace(RenameNamespaceRequest) returns(RenameNamespaceResponse) { rpc RenameNamespace(RenameNamespaceRequest) returns (RenameNamespaceResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/namespace/{old_name}/rename/{new_name}" post: "/api/v1/namespace/{old_name}/rename/{new_name}"
}; };
} }
rpc DeleteNamespace(DeleteNamespaceRequest) returns(DeleteNamespaceResponse) { rpc DeleteNamespace(DeleteNamespaceRequest) returns (DeleteNamespaceResponse) {
option(google.api.http) = { option (google.api.http) = {
delete : "/api/v1/namespace/{name}" delete: "/api/v1/namespace/{name}"
}; };
} }
rpc ListNamespaces(ListNamespacesRequest) returns(ListNamespacesResponse) { rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) {
option(google.api.http) = { option (google.api.http) = {
get : "/api/v1/namespace" get: "/api/v1/namespace"
}; };
} }
// --- Namespace end --- // --- Namespace end ---
// --- PreAuthKeys start --- // --- PreAuthKeys start ---
rpc CreatePreAuthKey(CreatePreAuthKeyRequest) returns(CreatePreAuthKeyResponse) { rpc CreatePreAuthKey(CreatePreAuthKeyRequest) returns (CreatePreAuthKeyResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/preauthkey" post: "/api/v1/preauthkey"
body : "*" body: "*"
}; };
} }
rpc ExpirePreAuthKey(ExpirePreAuthKeyRequest) returns(ExpirePreAuthKeyResponse) { rpc ExpirePreAuthKey(ExpirePreAuthKeyRequest) returns (ExpirePreAuthKeyResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/preauthkey/expire" post: "/api/v1/preauthkey/expire"
body : "*" body: "*"
}; };
} }
rpc ListPreAuthKeys(ListPreAuthKeysRequest) returns(ListPreAuthKeysResponse) { rpc ListPreAuthKeys(ListPreAuthKeysRequest) returns (ListPreAuthKeysResponse) {
option(google.api.http) = { option (google.api.http) = {
get : "/api/v1/preauthkey" get: "/api/v1/preauthkey"
}; };
} }
// --- PreAuthKeys end --- // --- PreAuthKeys end ---
// --- Machine start --- // --- Machine start ---
rpc DebugCreateMachine(DebugCreateMachineRequest) returns(DebugCreateMachineResponse) { rpc DebugCreateMachine(DebugCreateMachineRequest) returns (DebugCreateMachineResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/debug/machine" post: "/api/v1/debug/machine"
body : "*" body: "*"
}; };
} }
rpc GetMachine(GetMachineRequest) returns(GetMachineResponse) { rpc GetMachine(GetMachineRequest) returns (GetMachineResponse) {
option(google.api.http) = { option (google.api.http) = {
get : "/api/v1/machine/{machine_id}" get: "/api/v1/machine/{machine_id}"
}; };
} }
rpc RegisterMachine(RegisterMachineRequest) returns(RegisterMachineResponse) { rpc RegisterMachine(RegisterMachineRequest) returns (RegisterMachineResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/machine/register" post: "/api/v1/machine/register"
}; };
} }
rpc DeleteMachine(DeleteMachineRequest) returns(DeleteMachineResponse) { rpc DeleteMachine(DeleteMachineRequest) returns (DeleteMachineResponse) {
option(google.api.http) = { option (google.api.http) = {
delete : "/api/v1/machine/{machine_id}" delete: "/api/v1/machine/{machine_id}"
}; };
} }
rpc ListMachines(ListMachinesRequest) returns(ListMachinesResponse) { rpc ListMachines(ListMachinesRequest) returns (ListMachinesResponse) {
option(google.api.http) = { option (google.api.http) = {
get : "/api/v1/machine" get: "/api/v1/machine"
}; };
} }
rpc ShareMachine(ShareMachineRequest) returns(ShareMachineResponse) { rpc ShareMachine(ShareMachineRequest) returns (ShareMachineResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/machine/{machine_id}/share/{namespace}" post: "/api/v1/machine/{machine_id}/share/{namespace}"
}; };
} }
rpc UnshareMachine(UnshareMachineRequest) returns(UnshareMachineResponse) { rpc UnshareMachine(UnshareMachineRequest) returns (UnshareMachineResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/machine/{machine_id}/unshare/{namespace}" post: "/api/v1/machine/{machine_id}/unshare/{namespace}"
}; };
} }
// --- Machine end --- // --- Machine end ---
// --- Route start --- // --- Route start ---
rpc GetMachineRoute(GetMachineRouteRequest) returns(GetMachineRouteResponse) { rpc GetMachineRoute(GetMachineRouteRequest) returns (GetMachineRouteResponse) {
option(google.api.http) = { option (google.api.http) = {
get : "/api/v1/machine/{machine_id}/routes" get: "/api/v1/machine/{machine_id}/routes"
}; };
} }
rpc EnableMachineRoutes(EnableMachineRoutesRequest) returns(EnableMachineRoutesResponse) { rpc EnableMachineRoutes(EnableMachineRoutesRequest) returns (EnableMachineRoutesResponse) {
option(google.api.http) = { option (google.api.http) = {
post : "/api/v1/machine/{machine_id}/routes" post: "/api/v1/machine/{machine_id}/routes"
}; };
} }
// --- Route end --- // --- Route end ---