mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
68 lines
1.4 KiB
Protocol Buffer
68 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
|
|
option go_package = "github.com/psviderski/uncloud/internal/machine/api/pb";
|
|
|
|
import "google/protobuf/empty.proto";
|
|
import "internal/machine/api/pb/common.proto";
|
|
|
|
service Cluster {
|
|
rpc AddMachine(AddMachineRequest) returns (AddMachineResponse);
|
|
rpc ListMachines(google.protobuf.Empty) returns (ListMachinesResponse);
|
|
rpc ListMachineEndpoints(ListMachineEndpointsRequest) returns (ListMachineEndpointsResponse);
|
|
}
|
|
|
|
message AddMachineRequest {
|
|
string name = 1;
|
|
NetworkConfig network = 2;
|
|
}
|
|
|
|
message AddMachineResponse {
|
|
MachineInfo machine = 1;
|
|
}
|
|
|
|
message ListMachinesResponse {
|
|
repeated MachineInfo machines = 1;
|
|
}
|
|
|
|
message ListMachineEndpointsRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message ListMachineEndpointsResponse {
|
|
MachineEndpoints endpoints = 1;
|
|
}
|
|
|
|
message MachineInfo {
|
|
string id = 1;
|
|
string name = 2;
|
|
NetworkConfig network = 3;
|
|
}
|
|
|
|
message NetworkConfig {
|
|
IPPrefix subnet = 1;
|
|
IP management_ip = 2;
|
|
repeated IPPort endpoints = 3;
|
|
bytes publicKey = 4;
|
|
}
|
|
|
|
message MachineEndpoints {
|
|
string id = 1;
|
|
repeated IPPort endpoints = 2;
|
|
}
|
|
|
|
message User {
|
|
NetworkConfig network = 1;
|
|
}
|
|
|
|
message State {
|
|
IPPrefix Network = 1;
|
|
// The machine configuration in the state is the source of truth set by the administrator.
|
|
// The machine itself can't update it.
|
|
map<string, MachineInfo> machines = 2;
|
|
map<string, MachineEndpoints> endpoints = 3;
|
|
repeated User users = 4;
|
|
}
|
|
|