diff options
Diffstat (limited to 'src/handlers/planets.rs')
-rw-r--r-- | src/handlers/planets.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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<String>) -> NoneResult { Ok(()) } + +pub async fn reboot(Path(uuid): Path<String>) -> NoneResult { + let mut s = get_star()?; + + if let Ok(p) = s.find_planet(uuid) { + p.reboot()?; + } else { + return Err(ServiceError::NotFound); + } + + Ok(()) +} |