router change made one level of rpcenv mut superfluous
Created via `cargo fix`. see commit 47acc8dc8f68ed2c5db69b1678b479e05b0a3194 from proxmox-rs Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
aefbaa4dc6
commit
41c1a17999
@ -109,7 +109,7 @@ fn extract_acl_node_data(
|
|||||||
pub fn read_acl(
|
pub fn read_acl(
|
||||||
path: Option<String>,
|
path: Option<String>,
|
||||||
exact: bool,
|
exact: bool,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<AclListItem>, Error> {
|
) -> Result<Vec<AclListItem>, Error> {
|
||||||
let auth_id = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ use pbs_api_types::BasicRealmInfo;
|
|||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
/// Authentication domain/realm index.
|
/// Authentication domain/realm index.
|
||||||
fn list_domains(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<BasicRealmInfo>, Error> {
|
fn list_domains(rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<BasicRealmInfo>, Error> {
|
||||||
let mut list = Vec::new();
|
let mut list = Vec::new();
|
||||||
|
|
||||||
list.push(serde_json::from_value(json!({
|
list.push(serde_json::from_value(json!({
|
||||||
|
@ -56,7 +56,7 @@ fn new_user_with_tokens(user: User) -> UserWithTokens {
|
|||||||
pub fn list_users(
|
pub fn list_users(
|
||||||
include_tokens: bool,
|
include_tokens: bool,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<UserWithTokens>, Error> {
|
) -> Result<Vec<UserWithTokens>, Error> {
|
||||||
let (config, digest) = pbs_config::user::config()?;
|
let (config, digest) = pbs_config::user::config()?;
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ pub fn create_user(
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Read user configuration data.
|
/// Read user configuration data.
|
||||||
pub fn read_user(userid: Userid, mut rpcenv: &mut dyn RpcEnvironment) -> Result<User, Error> {
|
pub fn read_user(userid: Userid, rpcenv: &mut dyn RpcEnvironment) -> Result<User, Error> {
|
||||||
let (config, digest) = pbs_config::user::config()?;
|
let (config, digest) = pbs_config::user::config()?;
|
||||||
let user = config.lookup("user", userid.as_str())?;
|
let user = config.lookup("user", userid.as_str())?;
|
||||||
rpcenv["digest"] = hex::encode(&digest).into();
|
rpcenv["digest"] = hex::encode(&digest).into();
|
||||||
@ -417,7 +417,7 @@ pub fn read_token(
|
|||||||
userid: Userid,
|
userid: Userid,
|
||||||
token_name: Tokenname,
|
token_name: Tokenname,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<ApiToken, Error> {
|
) -> Result<ApiToken, Error> {
|
||||||
let (config, digest) = pbs_config::user::config()?;
|
let (config, digest) = pbs_config::user::config()?;
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ pub struct TokenApiEntry {
|
|||||||
pub fn list_tokens(
|
pub fn list_tokens(
|
||||||
userid: Userid,
|
userid: Userid,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<TokenApiEntry>, Error> {
|
) -> Result<Vec<TokenApiEntry>, Error> {
|
||||||
let (config, digest) = pbs_config::user::config()?;
|
let (config, digest) = pbs_config::user::config()?;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ use crate::{
|
|||||||
pub fn list_sync_jobs(
|
pub fn list_sync_jobs(
|
||||||
store: Option<String>,
|
store: Option<String>,
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<SyncJobStatus>, Error> {
|
) -> Result<Vec<SyncJobStatus>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
@ -44,7 +44,7 @@ pub struct TrafficControlCurrentRate {
|
|||||||
)]
|
)]
|
||||||
/// Show current traffic for all traffic control rules.
|
/// Show current traffic for all traffic control rules.
|
||||||
pub fn show_current_traffic(
|
pub fn show_current_traffic(
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<TrafficControlCurrentRate>, Error> {
|
) -> Result<Vec<TrafficControlCurrentRate>, Error> {
|
||||||
let (config, digest) = pbs_config::traffic_control::config()?;
|
let (config, digest) = pbs_config::traffic_control::config()?;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ use crate::server::{
|
|||||||
pub fn list_verification_jobs(
|
pub fn list_verification_jobs(
|
||||||
store: Option<String>,
|
store: Option<String>,
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<VerificationJobStatus>, Error> {
|
) -> Result<Vec<VerificationJobStatus>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
@ -30,7 +30,7 @@ use pbs_config::domains;
|
|||||||
/// List configured OpenId realms
|
/// List configured OpenId realms
|
||||||
pub fn list_openid_realms(
|
pub fn list_openid_realms(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<OpenIdRealmConfig>, Error> {
|
) -> Result<Vec<OpenIdRealmConfig>, Error> {
|
||||||
let (config, digest) = domains::config()?;
|
let (config, digest) = domains::config()?;
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ pub fn delete_openid_realm(
|
|||||||
/// Read the OpenID realm configuration
|
/// Read the OpenID realm configuration
|
||||||
pub fn read_openid_realm(
|
pub fn read_openid_realm(
|
||||||
realm: String,
|
realm: String,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<OpenIdRealmConfig, Error> {
|
) -> Result<OpenIdRealmConfig, Error> {
|
||||||
let (domains, digest) = domains::config()?;
|
let (domains, digest) = domains::config()?;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ const WEBAUTHN_ROUTER: Router = Router::new()
|
|||||||
)]
|
)]
|
||||||
/// Get the TFA configuration.
|
/// Get the TFA configuration.
|
||||||
pub fn get_webauthn_config(
|
pub fn get_webauthn_config(
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Option<WebauthnConfig>, Error> {
|
) -> Result<Option<WebauthnConfig>, Error> {
|
||||||
let (config, digest) = match tfa::webauthn_config()? {
|
let (config, digest) = match tfa::webauthn_config()? {
|
||||||
Some(c) => c,
|
Some(c) => c,
|
||||||
|
@ -519,7 +519,7 @@ fn modify_cfg_for_api(id: &str, ty: &str, data: &Value) -> PluginConfig {
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// List ACME challenge plugins.
|
/// List ACME challenge plugins.
|
||||||
pub fn list_plugins(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<PluginConfig>, Error> {
|
pub fn list_plugins(rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<PluginConfig>, Error> {
|
||||||
let (plugins, digest) = plugin::config()?;
|
let (plugins, digest) = plugin::config()?;
|
||||||
rpcenv["digest"] = hex::encode(&digest).into();
|
rpcenv["digest"] = hex::encode(&digest).into();
|
||||||
Ok(plugins
|
Ok(plugins
|
||||||
@ -541,7 +541,7 @@ pub fn list_plugins(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<PluginCon
|
|||||||
returns: { type: PluginConfig },
|
returns: { type: PluginConfig },
|
||||||
)]
|
)]
|
||||||
/// List ACME challenge plugins.
|
/// List ACME challenge plugins.
|
||||||
pub fn get_plugin(id: String, mut rpcenv: &mut dyn RpcEnvironment) -> Result<PluginConfig, Error> {
|
pub fn get_plugin(id: String, rpcenv: &mut dyn RpcEnvironment) -> Result<PluginConfig, Error> {
|
||||||
let (plugins, digest) = plugin::config()?;
|
let (plugins, digest) = plugin::config()?;
|
||||||
rpcenv["digest"] = hex::encode(&digest).into();
|
rpcenv["digest"] = hex::encode(&digest).into();
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ pub fn create_changer(config: ScsiTapeChanger) -> Result<(), Error> {
|
|||||||
pub fn get_config(
|
pub fn get_config(
|
||||||
name: String,
|
name: String,
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<ScsiTapeChanger, Error> {
|
) -> Result<ScsiTapeChanger, Error> {
|
||||||
let (config, digest) = pbs_config::drive::config()?;
|
let (config, digest) = pbs_config::drive::config()?;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ pub fn get_config(
|
|||||||
/// List changers
|
/// List changers
|
||||||
pub fn list_changers(
|
pub fn list_changers(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<ScsiTapeChanger>, Error> {
|
) -> Result<Vec<ScsiTapeChanger>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
@ -44,7 +44,7 @@ use crate::server::jobstate;
|
|||||||
/// List all datastores
|
/// List all datastores
|
||||||
pub fn list_datastores(
|
pub fn list_datastores(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<DataStoreConfig>, Error> {
|
) -> Result<Vec<DataStoreConfig>, Error> {
|
||||||
let (config, digest) = pbs_config::datastore::config()?;
|
let (config, digest) = pbs_config::datastore::config()?;
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ pub fn create_datastore(
|
|||||||
/// Read a datastore configuration.
|
/// Read a datastore configuration.
|
||||||
pub fn read_datastore(
|
pub fn read_datastore(
|
||||||
name: String,
|
name: String,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<DataStoreConfig, Error> {
|
) -> Result<DataStoreConfig, Error> {
|
||||||
let (config, digest) = pbs_config::datastore::config()?;
|
let (config, digest) = pbs_config::datastore::config()?;
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ pub fn create_drive(config: LtoTapeDrive) -> Result<(), Error> {
|
|||||||
pub fn get_config(
|
pub fn get_config(
|
||||||
name: String,
|
name: String,
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<LtoTapeDrive, Error> {
|
) -> Result<LtoTapeDrive, Error> {
|
||||||
let (config, digest) = pbs_config::drive::config()?;
|
let (config, digest) = pbs_config::drive::config()?;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ pub fn get_config(
|
|||||||
/// List drives
|
/// List drives
|
||||||
pub fn list_drives(
|
pub fn list_drives(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<LtoTapeDrive>, Error> {
|
) -> Result<Vec<LtoTapeDrive>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
@ -56,7 +56,7 @@ pub fn create_pool(config: MediaPoolConfig) -> Result<(), Error> {
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// List media pools
|
/// List media pools
|
||||||
pub fn list_pools(mut rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<MediaPoolConfig>, Error> {
|
pub fn list_pools(rpcenv: &mut dyn RpcEnvironment) -> Result<Vec<MediaPoolConfig>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ use pbs_config::CachedUserInfo;
|
|||||||
pub fn list_remotes(
|
pub fn list_remotes(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<RemoteWithoutPassword>, Error> {
|
) -> Result<Vec<RemoteWithoutPassword>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
@ -120,7 +120,7 @@ pub fn create_remote(name: String, config: RemoteConfig, password: String) -> Re
|
|||||||
pub fn read_remote(
|
pub fn read_remote(
|
||||||
name: String,
|
name: String,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<RemoteWithoutPassword, Error> {
|
) -> Result<RemoteWithoutPassword, Error> {
|
||||||
let (config, digest) = pbs_config::remote::config()?;
|
let (config, digest) = pbs_config::remote::config()?;
|
||||||
let data: RemoteWithoutPassword = config.lookup("remote", &name)?;
|
let data: RemoteWithoutPassword = config.lookup("remote", &name)?;
|
||||||
|
@ -81,7 +81,7 @@ pub fn check_sync_job_modify_access(
|
|||||||
/// List all sync jobs
|
/// List all sync jobs
|
||||||
pub fn list_sync_jobs(
|
pub fn list_sync_jobs(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<SyncJobConfig>, Error> {
|
) -> Result<Vec<SyncJobConfig>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
@ -158,10 +158,7 @@ pub fn create_sync_job(
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Read a sync job configuration.
|
/// Read a sync job configuration.
|
||||||
pub fn read_sync_job(
|
pub fn read_sync_job(id: String, rpcenv: &mut dyn RpcEnvironment) -> Result<SyncJobConfig, Error> {
|
||||||
id: String,
|
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
|
||||||
) -> Result<SyncJobConfig, Error> {
|
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ use pbs_config::CachedUserInfo;
|
|||||||
/// List all tape backup jobs
|
/// List all tape backup jobs
|
||||||
pub fn list_tape_backup_jobs(
|
pub fn list_tape_backup_jobs(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<TapeBackupJobConfig>, Error> {
|
) -> Result<Vec<TapeBackupJobConfig>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
@ -104,7 +104,7 @@ pub fn create_tape_backup_job(
|
|||||||
/// Read a tape backup job configuration.
|
/// Read a tape backup job configuration.
|
||||||
pub fn read_tape_backup_job(
|
pub fn read_tape_backup_job(
|
||||||
id: String,
|
id: String,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<TapeBackupJobConfig, Error> {
|
) -> Result<TapeBackupJobConfig, Error> {
|
||||||
let (config, digest) = pbs_config::tape_job::config()?;
|
let (config, digest) = pbs_config::tape_job::config()?;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ use pbs_config::tape_encryption_keys::{
|
|||||||
pub fn list_keys(
|
pub fn list_keys(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<KeyInfo>, Error> {
|
) -> Result<Vec<KeyInfo>, Error> {
|
||||||
let (key_map, digest) = load_key_configs()?;
|
let (key_map, digest) = load_key_configs()?;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ use pbs_api_types::{
|
|||||||
pub fn list_traffic_controls(
|
pub fn list_traffic_controls(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<TrafficControlRule>, Error> {
|
) -> Result<Vec<TrafficControlRule>, Error> {
|
||||||
let (config, digest) = pbs_config::traffic_control::config()?;
|
let (config, digest) = pbs_config::traffic_control::config()?;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ pub fn create_traffic_control(config: TrafficControlRule) -> Result<(), Error> {
|
|||||||
pub fn read_traffic_control(
|
pub fn read_traffic_control(
|
||||||
name: String,
|
name: String,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<TrafficControlRule, Error> {
|
) -> Result<TrafficControlRule, Error> {
|
||||||
let (config, digest) = pbs_config::traffic_control::config()?;
|
let (config, digest) = pbs_config::traffic_control::config()?;
|
||||||
let data: TrafficControlRule = config.lookup("rule", &name)?;
|
let data: TrafficControlRule = config.lookup("rule", &name)?;
|
||||||
|
@ -31,7 +31,7 @@ use pbs_config::CachedUserInfo;
|
|||||||
/// List all verification jobs
|
/// List all verification jobs
|
||||||
pub fn list_verification_jobs(
|
pub fn list_verification_jobs(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<VerificationJobConfig>, Error> {
|
) -> Result<Vec<VerificationJobConfig>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
@ -120,7 +120,7 @@ pub fn create_verification_job(
|
|||||||
/// Read a verification job configuration.
|
/// Read a verification job configuration.
|
||||||
pub fn read_verification_job(
|
pub fn read_verification_job(
|
||||||
id: String,
|
id: String,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<VerificationJobConfig, Error> {
|
) -> Result<VerificationJobConfig, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
@ -28,7 +28,7 @@ pub const ROUTER: Router = Router::new()
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Get the node configuration
|
/// Get the node configuration
|
||||||
pub fn get_node_config(mut rpcenv: &mut dyn RpcEnvironment) -> Result<NodeConfig, Error> {
|
pub fn get_node_config(rpcenv: &mut dyn RpcEnvironment) -> Result<NodeConfig, Error> {
|
||||||
let (config, digest) = crate::config::node::config()?;
|
let (config, digest) = crate::config::node::config()?;
|
||||||
rpcenv["digest"] = hex::encode(&digest).into();
|
rpcenv["digest"] = hex::encode(&digest).into();
|
||||||
Ok(config)
|
Ok(config)
|
||||||
|
@ -109,7 +109,7 @@ fn set_bond_slaves(iface: &mut Interface, slaves: Vec<String>) -> Result<(), Err
|
|||||||
pub fn list_network_devices(
|
pub fn list_network_devices(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Value, Error> {
|
) -> Result<Value, Error> {
|
||||||
let (config, digest) = network::config()?;
|
let (config, digest) = network::config()?;
|
||||||
let digest = hex::encode(&digest);
|
let digest = hex::encode(&digest);
|
||||||
|
@ -140,7 +140,7 @@ fn dump_journal(
|
|||||||
fn get_syslog(
|
fn get_syslog(
|
||||||
param: Value,
|
param: Value,
|
||||||
_info: &ApiMethod,
|
_info: &ApiMethod,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Value, Error> {
|
) -> Result<Value, Error> {
|
||||||
let service = param["service"]
|
let service = param["service"]
|
||||||
.as_str()
|
.as_str()
|
||||||
|
@ -293,7 +293,7 @@ fn extract_upid(param: &Value) -> Result<UPID, Error> {
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Read task log.
|
/// Read task log.
|
||||||
async fn read_task_log(param: Value, mut rpcenv: &mut dyn RpcEnvironment) -> Result<Value, Error> {
|
async fn read_task_log(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result<Value, Error> {
|
||||||
let upid = extract_upid(¶m)?;
|
let upid = extract_upid(¶m)?;
|
||||||
|
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
@ -463,7 +463,7 @@ pub fn list_tasks(
|
|||||||
typefilter: Option<String>,
|
typefilter: Option<String>,
|
||||||
statusfilter: Option<Vec<TaskStateType>>,
|
statusfilter: Option<Vec<TaskStateType>>,
|
||||||
param: Value,
|
param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<TaskListItem>, Error> {
|
) -> Result<Vec<TaskListItem>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
@ -79,7 +79,7 @@ fn check_backup_permission(
|
|||||||
/// List all tape backup jobs
|
/// List all tape backup jobs
|
||||||
pub fn list_tape_backup_jobs(
|
pub fn list_tape_backup_jobs(
|
||||||
_param: Value,
|
_param: Value,
|
||||||
mut rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Vec<TapeBackupJobStatus>, Error> {
|
) -> Result<Vec<TapeBackupJobStatus>, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
let user_info = CachedUserInfo::new()?;
|
let user_info = CachedUserInfo::new()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user