created update functionality?? sequel
This commit is contained in:
parent
5e916803b3
commit
c0e5acbf24
@ -97,7 +97,8 @@ service BrainDaemonService {
|
||||
rpc SendVMConfirmations (stream NewVMConfirmation) returns (Empty);
|
||||
rpc DeletedVMUpdates (NodePubkey) returns (stream DeletedVMUpdate);
|
||||
rpc ListVMContracts (ListVMContractsReq) returns (stream VMContract);
|
||||
rpc UpdateVMs (NodePubkey) returns (stream UpdateVMRequest);
|
||||
rpc GetUpdateVM (NodePubkey) returns (stream UpdateVMRequest);
|
||||
rpc SendUpdateVM (stream UpdateVMResp) returns (Empty);
|
||||
}
|
||||
|
||||
message NodeFilters {
|
||||
|
@ -138,8 +138,8 @@ async fn delete_vm(mut client: BrainCliServiceClient<Channel>, uuid: &str) -> Re
|
||||
async fn update_vm(mut client: BrainCliServiceClient<Channel>, uuid: &str) -> Result<UpdateVmResp> {
|
||||
info!("Updatind VM {uuid}");
|
||||
let req = UpdateVmRequest {
|
||||
uuid: String::new(),
|
||||
node_pubkey: String::new(),
|
||||
uuid: uuid.to_string(),
|
||||
node_pubkey: SECURE_PUBLIC_KEY.to_string(),
|
||||
vcpus: 4,
|
||||
memory_mb: 4096,
|
||||
disk_size_gb: 40,
|
||||
|
@ -97,7 +97,8 @@ service BrainDaemonService {
|
||||
rpc SendVMConfirmations (stream NewVMConfirmation) returns (Empty);
|
||||
rpc DeletedVMUpdates (NodePubkey) returns (stream DeletedVMUpdate);
|
||||
rpc ListVMContracts (ListVMContractsReq) returns (stream VMContract);
|
||||
rpc UpdateVMs (NodePubkey) returns (stream UpdateVMRequest);
|
||||
rpc GetUpdateVM (NodePubkey) returns (stream UpdateVMRequest);
|
||||
rpc SendUpdateVM (stream UpdateVMResp) returns (Empty);
|
||||
}
|
||||
|
||||
message NodeFilters {
|
||||
|
@ -123,7 +123,7 @@ async fn listen_for_update_vm_reqs(
|
||||
debug!("starting listen_for_update_vm_reqs");
|
||||
let node_pubkey = SECURE_PUBLIC_KEY.clone();
|
||||
let mut grpc_stream = client
|
||||
.update_v_ms(NodePubkey { node_pubkey })
|
||||
.get_update_vm(NodePubkey { node_pubkey })
|
||||
.await?
|
||||
.into_inner();
|
||||
while let Some(stream_update) = grpc_stream.next().await {
|
||||
@ -147,6 +147,7 @@ async fn handle_update_vm_requests(
|
||||
) {
|
||||
info!("Started to handle update vm requests.");
|
||||
while let Some(update_vm) = req.recv().await {
|
||||
info!("Updating vm: {update_vm:?}");
|
||||
let response = UpdateVmResp {
|
||||
uuid: update_vm.uuid.clone(),
|
||||
timestamp: chrono::Utc::now().to_rfc3339(),
|
||||
|
Loading…
Reference in New Issue
Block a user