forked from ghe0/brain-mock
first push
This commit is contained in:
commit
22a0905a1d
93
brain.proto
Normal file
93
brain.proto
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package brain;
|
||||||
|
|
||||||
|
message Empty {
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterNodeRequest {
|
||||||
|
string node_pubkey = 1;
|
||||||
|
string country = 2;
|
||||||
|
string city = 3;
|
||||||
|
uint32 avail_ports = 4;
|
||||||
|
uint32 avail_ipv4 = 5;
|
||||||
|
uint32 avail_ipv6 = 6;
|
||||||
|
uint32 avail_vcpus = 7;
|
||||||
|
uint32 avail_memory_mb = 8;
|
||||||
|
uint32 avail_storage_gb = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NewVMRequest {
|
||||||
|
string uuid = 1; // UUID is empty when CLI sends request; brain sets UUID
|
||||||
|
string hostname = 2;
|
||||||
|
string admin_pubkey = 3;
|
||||||
|
string node_pubkey = 4;
|
||||||
|
repeated uint32 extra_ports = 5;
|
||||||
|
bool public_ipv4 = 6;
|
||||||
|
bool public_ipv6 = 7;
|
||||||
|
uint32 disk_size_gb = 8;
|
||||||
|
uint32 vcpus = 9;
|
||||||
|
uint32 memory_mb = 10;
|
||||||
|
string kernel_url = 11;
|
||||||
|
string kernel_sha = 12;
|
||||||
|
string dtrfs_url = 13;
|
||||||
|
string dtrfs_sha = 14;
|
||||||
|
}
|
||||||
|
|
||||||
|
message VMContract {
|
||||||
|
string uuid = 1;
|
||||||
|
string hostname = 2;
|
||||||
|
string admin_pubkey = 3;
|
||||||
|
string node_pubkey = 4;
|
||||||
|
repeated uint32 exposed_ports = 5;
|
||||||
|
string public_ipv4 = 6;
|
||||||
|
string public_ipv6 = 7;
|
||||||
|
uint32 disk_size_gb = 8;
|
||||||
|
uint32 vcpus = 9;
|
||||||
|
uint32 memory_mb = 10;
|
||||||
|
string kernel_sha = 11;
|
||||||
|
string dtrfs_sha = 12;
|
||||||
|
string created_at = 13;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NewVMConfirmation {
|
||||||
|
repeated uint32 exposed_ports = 1;
|
||||||
|
string public_ipv4 = 2;
|
||||||
|
string public_ipv6 = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeletedVMUpdate {
|
||||||
|
string uuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
service BrainDaemonService {
|
||||||
|
rpc RegisterNode (RegisterNodeRequest) returns (Empty);
|
||||||
|
rpc NewVMUpdates (stream NewVMConfirmation) returns (stream NewVMRequest);
|
||||||
|
rpc DeletedVMUpdates (Empty) returns (stream DeletedVMUpdate);
|
||||||
|
rpc ListVMContracts (Empty) returns (stream VMContract);
|
||||||
|
}
|
||||||
|
|
||||||
|
message NodeFilters {
|
||||||
|
uint32 free_ports = 1;
|
||||||
|
bool offers_ipv4 = 2;
|
||||||
|
bool offers_ipv6 = 3;
|
||||||
|
uint32 vcpus = 4;
|
||||||
|
uint32 memory_mb = 5;
|
||||||
|
uint32 storage_gb = 6;
|
||||||
|
string country = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NodeListResponse {
|
||||||
|
string node_pubkey = 1;
|
||||||
|
string country = 2;
|
||||||
|
string city = 3;
|
||||||
|
string ip = 4; // required for latency test
|
||||||
|
uint32 server_rating = 5;
|
||||||
|
uint32 provider_rating = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
service BrainCliService {
|
||||||
|
rpc CreateVMContract (NewVMRequest) returns (Empty);
|
||||||
|
rpc ListVMContracts (Empty) returns (stream VMContract);
|
||||||
|
rpc ListNodes (NodeFilters) returns (stream NodeListResponse);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user