Rename Machine to Node (#1553)

This commit is contained in:
Juan Font 2023-09-24 13:42:05 +02:00 committed by GitHub
parent 096ac31bb3
commit 0030af3fa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 5222 additions and 5238 deletions

View file

@ -6,7 +6,7 @@ import "google/api/annotations.proto";
import "headscale/v1/user.proto";
import "headscale/v1/preauthkey.proto";
import "headscale/v1/machine.proto";
import "headscale/v1/node.proto";
import "headscale/v1/routes.proto";
import "headscale/v1/apikey.proto";
// import "headscale/v1/device.proto";
@ -67,63 +67,63 @@ service HeadscaleService {
}
// --- PreAuthKeys end ---
// --- Machine start ---
rpc DebugCreateMachine(DebugCreateMachineRequest) returns(DebugCreateMachineResponse) {
// --- Node start ---
rpc DebugCreateNode(DebugCreateNodeRequest) returns(DebugCreateNodeResponse) {
option(google.api.http) = {
post : "/api/v1/debug/machine"
post : "/api/v1/debug/node"
body : "*"
};
}
rpc GetMachine(GetMachineRequest) returns(GetMachineResponse) {
rpc GetNode(GetNodeRequest) returns(GetNodeResponse) {
option(google.api.http) = {
get : "/api/v1/machine/{machine_id}"
get : "/api/v1/node/{node_id}"
};
}
rpc SetTags(SetTagsRequest) returns(SetTagsResponse) {
option(google.api.http) = {
post : "/api/v1/machine/{machine_id}/tags"
post : "/api/v1/node/{node_id}/tags"
body : "*"
};
}
rpc RegisterMachine(RegisterMachineRequest) returns(RegisterMachineResponse) {
rpc RegisterNode(RegisterNodeRequest) returns(RegisterNodeResponse) {
option(google.api.http) = {
post : "/api/v1/machine/register"
post : "/api/v1/node/register"
};
}
rpc DeleteMachine(DeleteMachineRequest) returns(DeleteMachineResponse) {
rpc DeleteNode(DeleteNodeRequest) returns(DeleteNodeResponse) {
option(google.api.http) = {
delete : "/api/v1/machine/{machine_id}"
delete : "/api/v1/node/{node_id}"
};
}
rpc ExpireMachine(ExpireMachineRequest) returns(ExpireMachineResponse) {
rpc ExpireNode(ExpireNodeRequest) returns(ExpireNodeResponse) {
option(google.api.http) = {
post : "/api/v1/machine/{machine_id}/expire"
post : "/api/v1/node/{node_id}/expire"
};
}
rpc RenameMachine(RenameMachineRequest) returns(RenameMachineResponse) {
rpc RenameNode(RenameNodeRequest) returns(RenameNodeResponse) {
option(google.api.http) = {
post : "/api/v1/machine/{machine_id}/rename/{new_name}"
post : "/api/v1/node/{node_id}/rename/{new_name}"
};
}
rpc ListMachines(ListMachinesRequest) returns(ListMachinesResponse) {
rpc ListNodes(ListNodesRequest) returns(ListNodesResponse) {
option(google.api.http) = {
get : "/api/v1/machine"
get : "/api/v1/node"
};
}
rpc MoveMachine(MoveMachineRequest) returns(MoveMachineResponse) {
rpc MoveNode(MoveNodeRequest) returns(MoveNodeResponse) {
option(google.api.http) = {
post : "/api/v1/machine/{machine_id}/user"
post : "/api/v1/node/{node_id}/user"
};
}
// --- Machine end ---
// --- Node end ---
// --- Route start ---
rpc GetRoutes(GetRoutesRequest) returns(GetRoutesResponse) {
@ -144,9 +144,9 @@ service HeadscaleService {
};
}
rpc GetMachineRoutes(GetMachineRoutesRequest) returns(GetMachineRoutesResponse) {
rpc GetNodeRoutes(GetNodeRoutesRequest) returns(GetNodeRoutesResponse) {
option(google.api.http) = {
get : "/api/v1/machine/{machine_id}/routes"
get : "/api/v1/node/{node_id}/routes"
};
}

View file

@ -13,7 +13,7 @@ enum RegisterMethod {
REGISTER_METHOD_OIDC = 3;
}
message Machine {
message Node {
uint64 id = 1;
string machine_key = 2;
string node_key = 3;
@ -47,80 +47,80 @@ message Machine {
bool online = 22;
}
message RegisterMachineRequest {
message RegisterNodeRequest {
string user = 1;
string key = 2;
}
message RegisterMachineResponse {
Machine machine = 1;
message RegisterNodeResponse {
Node node = 1;
}
message GetMachineRequest {
uint64 machine_id = 1;
message GetNodeRequest {
uint64 node_id = 1;
}
message GetMachineResponse {
Machine machine = 1;
message GetNodeResponse {
Node node = 1;
}
message SetTagsRequest {
uint64 machine_id = 1;
uint64 node_id = 1;
repeated string tags = 2;
}
message SetTagsResponse {
Machine machine = 1;
Node node = 1;
}
message DeleteMachineRequest {
uint64 machine_id = 1;
message DeleteNodeRequest {
uint64 node_id = 1;
}
message DeleteMachineResponse {
message DeleteNodeResponse {
}
message ExpireMachineRequest {
uint64 machine_id = 1;
message ExpireNodeRequest {
uint64 node_id = 1;
}
message ExpireMachineResponse {
Machine machine = 1;
message ExpireNodeResponse {
Node node = 1;
}
message RenameMachineRequest {
uint64 machine_id = 1;
message RenameNodeRequest {
uint64 node_id = 1;
string new_name = 2;
}
message RenameMachineResponse {
Machine machine = 1;
message RenameNodeResponse {
Node node = 1;
}
message ListMachinesRequest {
message ListNodesRequest {
string user = 1;
}
message ListMachinesResponse {
repeated Machine machines = 1;
message ListNodesResponse {
repeated Node nodes = 1;
}
message MoveMachineRequest {
uint64 machine_id = 1;
message MoveNodeRequest {
uint64 node_id = 1;
string user = 2;
}
message MoveMachineResponse {
Machine machine = 1;
message MoveNodeResponse {
Node node = 1;
}
message DebugCreateMachineRequest {
message DebugCreateNodeRequest {
string user = 1;
string key = 2;
string name = 3;
repeated string routes = 4;
}
message DebugCreateMachineResponse {
Machine machine = 1;
message DebugCreateNodeResponse {
Node node = 1;
}

View file

@ -3,11 +3,11 @@ package headscale.v1;
option go_package = "github.com/juanfont/headscale/gen/go/v1";
import "google/protobuf/timestamp.proto";
import "headscale/v1/machine.proto";
import "headscale/v1/node.proto";
message Route {
uint64 id = 1;
Machine machine = 2;
Node node = 2;
string prefix = 3;
bool advertised = 4;
bool enabled = 5;
@ -39,11 +39,11 @@ message DisableRouteRequest {
message DisableRouteResponse {
}
message GetMachineRoutesRequest {
uint64 machine_id = 1;
message GetNodeRoutesRequest {
uint64 node_id = 1;
}
message GetMachineRoutesResponse {
message GetNodeRoutesResponse {
repeated Route routes = 1;
}