From 03989d646ee3fd74536d420860e9f5bcf58937af Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 9 Jun 2022 15:17:17 -0400 Subject: state: Reboot Issue #1 --- src/handlers/planets.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/handlers/planets.rs') diff --git a/src/handlers/planets.rs b/src/handlers/planets.rs index a57f605..ede7b2b 100644 --- a/src/handlers/planets.rs +++ b/src/handlers/planets.rs @@ -64,3 +64,15 @@ pub async fn pause(Path(uuid): Path) -> NoneResult { Ok(()) } + +pub async fn reboot(Path(uuid): Path) -> NoneResult { + let mut s = get_star()?; + + if let Ok(p) = s.find_planet(uuid) { + p.reboot()?; + } else { + return Err(ServiceError::NotFound); + } + + Ok(()) +} -- cgit v1.2.3