mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
68 lines
1.3 KiB
Protocol Buffer
68 lines
1.3 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 Machine {
|
|
rpc InitCluster(InitClusterRequest) returns (InitClusterResponse);
|
|
rpc JoinCluster(JoinClusterRequest) returns (google.protobuf.Empty);
|
|
rpc Token(google.protobuf.Empty) returns (TokenResponse);
|
|
rpc Inspect(google.protobuf.Empty) returns (MachineInfo);
|
|
rpc InspectService(InspectServiceRequest) returns (InspectServiceResponse);
|
|
}
|
|
|
|
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 InitClusterRequest {
|
|
string machineName = 1;
|
|
IPPrefix network = 2;
|
|
}
|
|
|
|
message InitClusterResponse {
|
|
MachineInfo machine = 1;
|
|
}
|
|
|
|
message JoinClusterRequest {
|
|
MachineInfo machine = 1;
|
|
repeated MachineInfo other_machines = 3;
|
|
}
|
|
|
|
message TokenResponse {
|
|
string token = 1;
|
|
}
|
|
|
|
message Service {
|
|
string id = 1;
|
|
string name = 2;
|
|
|
|
message Container {
|
|
string machine_id = 1;
|
|
bytes container = 2;
|
|
}
|
|
|
|
repeated Container containers = 3;
|
|
}
|
|
|
|
message InspectServiceRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message InspectServiceResponse {
|
|
Service service = 1;
|
|
}
|