api: pass RpcEnvirnment to api handlers

This commit is contained in:
Dietmar Maurer
2019-01-26 14:50:37 +01:00
parent d96d82736d
commit 6049b71f41
18 changed files with 252 additions and 109 deletions

View File

@ -14,7 +14,11 @@ fn read_etc_localtime() -> Result<String, Error> {
Ok(line.trim().to_owned())
}
fn get_time(_param: Value, _info: &ApiMethod) -> Result<Value, Error> {
fn get_time(
_param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
) -> Result<Value, Error> {
let datetime = Local::now();
let offset = datetime.offset();
@ -32,7 +36,11 @@ extern "C" { fn tzset(); }
// Note:: this needs root rights ??
fn set_timezone(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
fn set_timezone(
param: Value,
_info: &ApiMethod,
_rpcenv: &mut RpcEnvironment,
) -> Result<Value, Error> {
let timezone = tools::required_string_param(&param, "timezone")?;