update functionality for the brain #2

Merged
ghe0 merged 11 commits from new-updater into main 2025-01-09 22:29:56 +00:00
2 changed files with 12 additions and 9 deletions
Showing only changes of commit b5943ba465 - Show all commits

@ -43,18 +43,19 @@ message NewVMReq {
message UpdateVMReq {
string uuid = 1;
uint32 disk_size_gb = 3;
uint32 vcpus = 4;
uint32 memory_mb = 5;
string kernel_url = 6;
string kernel_sha = 7;
string dtrfs_url = 8;
string dtrfs_sha = 9;
uint32 disk_size_gb = 2;
uint32 vcpus = 3;
uint32 memory_mb = 4;
string kernel_url = 5;
string kernel_sha = 6;
string dtrfs_url = 7;
string dtrfs_sha = 8;
}
message UpdateVMResp {
string uuid = 1;
string error = 3;
string error = 2;
string ovmf_hash = 3;
}
message VMContract {
@ -142,4 +143,4 @@ service BrainCliService {
rpc GetOneNode (NodeFilters) returns (NodeListResp);
rpc DeleteVM (DeleteVMReq) returns (Empty);
rpc UpdateVM (UpdateVMReq) returns (UpdateVMResp);
}
}

@ -319,6 +319,7 @@ impl BrainData {
let _ = tx.send(grpc::UpdateVmResp {
uuid,
error: "Contract does not exist.".to_string(),
ovmf_hash: "".to_string(),
});
return;
}
@ -343,6 +344,7 @@ impl BrainData {
self.submit_updatevm_resp(grpc::UpdateVmResp {
uuid,
error: "Daemon is offline.".to_string(),
ovmf_hash: "".to_string(),
})
.await;
}