src/api_schema/router.rs: add docu for RpcEnvironmentType
This commit is contained in:
parent
d21c2710da
commit
51ebd07974
@ -32,14 +32,20 @@ pub trait RpcEnvironment {
|
|||||||
fn get_user(&self) -> Option<String>;
|
fn get_user(&self) -> Option<String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Environment Type
|
||||||
|
///
|
||||||
|
/// We use this to enumerate the different environment types. Some methods
|
||||||
|
/// needs to do different things when started from the command line interface,
|
||||||
|
/// or when executed from a privileged server running as root.
|
||||||
#[derive(PartialEq, Copy, Clone)]
|
#[derive(PartialEq, Copy, Clone)]
|
||||||
pub enum RpcEnvironmentType {
|
pub enum RpcEnvironmentType {
|
||||||
/// command started from command line
|
/// Command started from command line
|
||||||
CLI,
|
CLI,
|
||||||
/// access from public acessable server
|
/// Access from public accessible server
|
||||||
PUBLIC,
|
PUBLIC,
|
||||||
/// ... access from priviledged server (run as root)
|
/// Access from privileged server (run as root)
|
||||||
PRIVILEDGED,
|
PRIVILEGED,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Fail)]
|
||||||
|
@ -50,7 +50,7 @@ fn run() -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let config = ApiConfig::new(
|
let config = ApiConfig::new(
|
||||||
env!("PROXMOX_JSDIR"), &ROUTER, RpcEnvironmentType::PRIVILEDGED);
|
env!("PROXMOX_JSDIR"), &ROUTER, RpcEnvironmentType::PRIVILEGED);
|
||||||
|
|
||||||
let rest_server = RestServer::new(config);
|
let rest_server = RestServer::new(config);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user