MCPcopy Create free account
hub / github.com/BigBoot/AutoKuma / get_maintenance

Method get_maintenance

kuma-client/src/client.rs:1011–1033  ·  view source on GitHub ↗
(self: &Arc<Self>, maintenance_id: i32)

Source from the content-addressed store, hash-verified

1009 }
1010
1011 pub async fn get_maintenance(self: &Arc<Self>, maintenance_id: i32) -> Result<Maintenance> {
1012 let mut maintenance: Maintenance = self
1013 .call(
1014 "getMaintenance",
1015 vec![serde_json::to_value(maintenance_id.clone()).unwrap()],
1016 "/maintenance",
1017 true,
1018 )
1019 .await
1020 .map_err(|e| match e {
1021 Error::ServerError(msg) if msg.contains("Cannot read properties of null") => {
1022 Error::IdNotFound("Maintenance".to_owned(), maintenance_id)
1023 }
1024 _ => e,
1025 })?;
1026
1027 maintenance.common_mut().monitors =
1028 Some(self.get_maintenance_monitors(maintenance_id).await?);
1029 maintenance.common_mut().status_pages =
1030 Some(self.get_maintenance_status_pages(maintenance_id).await?);
1031
1032 Ok(maintenance)
1033 }
1034
1035 pub async fn edit_maintenance(self: &Arc<Self>, maintenance: &mut Maintenance) -> Result<()> {
1036 let id = self

Callers 1

handleFunction · 0.80

Calls 4

callMethod · 0.45
common_mutMethod · 0.45

Tested by

no test coverage detected