use proxmox::{sortable, identity, list_subdirs_api_method};
use proxmox::api::{api, Router, Permission, RpcEnvironment};
use proxmox::api::router::SubdirMap;
-use proxmox::api::schema::*;
-use crate::api2::types::*;
-use crate::config::acl::{PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
-use crate::server::WorkerTask;
+use pbs_api_types::{Authid, NODE_SCHEMA, SERVICE_ID_SCHEMA, PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
+
+use proxmox_rest_server::WorkerTask;
static SERVICE_NAME_LIST: [&str; 7] = [
"proxmox-backup",
"systemd-timesyncd",
];
-fn real_service_name(service: &str) -> &str {
+pub fn real_service_name(service: &str) -> &str {
// since postfix package 3.1.0-3.1 the postfix unit is only here
// to manage subinstances, of which the default is called "-".
let upid = WorkerTask::new_thread(
&workerid,
Some(service.clone()),
- auth_id,
+ auth_id.to_string(),
false,
move |_worker| {
run_service_command(&service, "reload", auth_id)
}
-
-const SERVICE_ID_SCHEMA: Schema = StringSchema::new("Service ID.")
- .max_length(256)
- .schema();
-
#[sortable]
const SERVICE_SUBDIRS: SubdirMap = &sorted!([
(