Skip to content

Commit 110aee2

Browse files
merge main
2 parents ec82018 + e87031f commit 110aee2

File tree

11 files changed

+1926
-3809
lines changed

11 files changed

+1926
-3809
lines changed

clients/sled-agent-client/src/lib.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,13 @@ impl ApiVersionHeader for reqwest::RequestBuilder {
358358
pub trait TestInterfaces {
359359
async fn vmm_single_step(&self, id: PropolisUuid);
360360
async fn vmm_finish_transition(&self, id: PropolisUuid);
361+
/// Essentially like `vmm_finish_transition`, but returns an error instead
362+
/// of panicking if the request fails. Useful when the VMM may have been
363+
/// removed.
364+
async fn try_vmm_finish_transition(
365+
&self,
366+
id: PropolisUuid,
367+
) -> Result<(), reqwest::Error>;
361368
async fn vmm_simulate_migration_source(
362369
&self,
363370
id: PropolisUuid,
@@ -392,6 +399,21 @@ impl TestInterfaces for Client {
392399
.expect("instance_finish_transition() failed unexpectedly");
393400
}
394401

402+
async fn try_vmm_finish_transition(
403+
&self,
404+
id: PropolisUuid,
405+
) -> Result<(), reqwest::Error> {
406+
let baseurl = self.baseurl();
407+
let client = self.client();
408+
let url = format!("{baseurl}/vmms/{id}/poke");
409+
client
410+
.post(url)
411+
.api_version_header(self.api_version())
412+
.send()
413+
.await
414+
.map(|_| ())
415+
}
416+
395417
async fn disk_finish_transition(&self, id: Uuid) {
396418
let baseurl = self.baseurl();
397419
let client = self.client();

0 commit comments

Comments
 (0)