]> git.proxmox.com Git - proxmox-backup.git/blame - src/api2/ping.rs
remove wrong calls to systemd_notify
[proxmox-backup.git] / src / api2 / ping.rs
CommitLineData
bf78f708
DM
1//! Cheap check if the API daemon is online.
2
eed1bae5
TL
3use anyhow::{Error};
4use serde_json::{json, Value};
5
6use proxmox::api::{api, Router, Permission};
7
8#[api(
9 returns: {
10 description: "Dummy ping",
11 type: Object,
12 properties: {
13 pong: {
14 description: "Always true",
15 type: bool,
16 }
17 }
18 },
19 access: {
20 description: "Anyone can access this, because it's used for a cheap check if the API daemon is online.",
21 permission: &Permission::World,
22 }
23)]
24/// Dummy method which replies with `{ "pong": True }`
bf78f708 25pub fn ping() -> Result<Value, Error> {
eed1bae5
TL
26 Ok(json!({
27 "pong": true,
28 }))
29}
30pub const ROUTER: Router = Router::new()
31 .get(&API_METHOD_PING);