aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2022-06-09 15:17:17 -0400
committerCara Salter <cara@devcara.com>2022-06-09 15:17:17 -0400
commit03989d646ee3fd74536d420860e9f5bcf58937af (patch)
tree439e8f164d2c4f1a8068b31ce77fa5d2e203b8c8 /src/handlers
parentb81eaf785286519b9e5b7725cc4d4dd66175a892 (diff)
downloadsolard-03989d646ee3fd74536d420860e9f5bcf58937af.tar.gz
solard-03989d646ee3fd74536d420860e9f5bcf58937af.zip
state: Reboot
Issue #1
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/planets.rs12
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(())
+}