update to first proxmox crate split
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -2,10 +2,11 @@ use anyhow::{Error, bail, format_err};
|
||||
use serde_json::{json, Value};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use proxmox::list_subdirs_api_method;
|
||||
use proxmox::api::{api, RpcEnvironment, RpcEnvironmentType, Permission};
|
||||
use proxmox::api::router::{Router, SubdirMap};
|
||||
use proxmox::tools::fs::{replace_file, CreateOptions};
|
||||
use proxmox_router::{
|
||||
list_subdirs_api_method, RpcEnvironment, RpcEnvironmentType, Permission, Router, SubdirMap
|
||||
};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use proxmox_apt::repositories::{
|
||||
APTRepositoryFile, APTRepositoryFileError, APTRepositoryHandle, APTRepositoryInfo,
|
||||
|
@ -7,9 +7,10 @@ use openssl::pkey::PKey;
|
||||
use openssl::x509::X509;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::router::SubdirMap;
|
||||
use proxmox::api::{api, Permission, Router, RpcEnvironment};
|
||||
use proxmox::list_subdirs_api_method;
|
||||
use proxmox_router::SubdirMap;
|
||||
use proxmox_router::{Permission, Router, RpcEnvironment};
|
||||
use proxmox_router::list_subdirs_api_method;
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, PRIV_SYS_MODIFY};
|
||||
use pbs_buildcfg::configdir;
|
||||
@ -516,7 +517,7 @@ pub fn renew_acme_cert(force: bool, rpcenv: &mut dyn RpcEnvironment) -> Result<S
|
||||
/// Check whether the current certificate expires within the next 30 days.
|
||||
pub fn cert_expires_soon() -> Result<bool, Error> {
|
||||
let cert = pem_to_cert_info(get_certificate_pem()?.as_bytes())?;
|
||||
cert.is_expired_after_epoch(proxmox::tools::time::epoch_i64() + 30 * 24 * 60 * 60)
|
||||
cert.is_expired_after_epoch(proxmox_time::epoch_i64() + 30 * 24 * 60 * 60)
|
||||
.map_err(|err| format_err!("Failed to check certificate expiration date: {}", err))
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
use anyhow::Error;
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::{api, Permission, Router, RpcEnvironment};
|
||||
use proxmox_router::{Permission, Router, RpcEnvironment};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
|
||||
|
||||
|
@ -2,9 +2,9 @@ use anyhow::{bail, Error};
|
||||
use serde_json::json;
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::{api, Permission, RpcEnvironment, RpcEnvironmentType};
|
||||
use proxmox::api::section_config::SectionConfigData;
|
||||
use proxmox::api::router::Router;
|
||||
use proxmox_router::{Router, RpcEnvironment, RpcEnvironmentType, Permission};
|
||||
use proxmox_schema::api;
|
||||
use proxmox_section_config::SectionConfigData;
|
||||
|
||||
use pbs_api_types::{
|
||||
DataStoreConfig, NODE_SCHEMA, BLOCKDEVICE_NAME_SCHEMA,
|
||||
|
@ -1,10 +1,11 @@
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Permission, RpcEnvironment, RpcEnvironmentType};
|
||||
use proxmox::api::router::{Router, SubdirMap};
|
||||
use proxmox::{sortable, identity};
|
||||
use proxmox::{list_subdirs_api_method};
|
||||
use proxmox_router::{
|
||||
list_subdirs_api_method, Router, RpcEnvironment, RpcEnvironmentType, SubdirMap, Permission,
|
||||
};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{
|
||||
UPID_SCHEMA, NODE_SCHEMA, BLOCKDEVICE_NAME_SCHEMA,
|
||||
|
@ -1,11 +1,8 @@
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{
|
||||
api, Permission, RpcEnvironment, RpcEnvironmentType,
|
||||
schema::parse_property_string,
|
||||
};
|
||||
use proxmox::api::router::Router;
|
||||
use proxmox_router::{Router, RpcEnvironment, RpcEnvironmentType, Permission};
|
||||
use proxmox_schema::{api, parse_property_string};
|
||||
|
||||
use pbs_api_types::{
|
||||
ZpoolListItem, ZfsRaidLevel, ZfsCompressionType, DataStoreConfig,
|
||||
|
@ -7,7 +7,8 @@ use regex::Regex;
|
||||
use serde_json::{json, Value};
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_router::{ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::api;
|
||||
use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
|
||||
use proxmox::{IPRE, IPV4RE, IPV6RE, IPV4OCTET, IPV6H16, IPV6LS32};
|
||||
|
||||
|
@ -4,7 +4,8 @@ use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
use std::io::{BufRead,BufReader};
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_router::{ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, PRIV_SYS_AUDIT};
|
||||
|
||||
|
@ -12,12 +12,12 @@ use hyper::Request;
|
||||
use serde_json::{json, Value};
|
||||
use tokio::io::{AsyncBufReadExt, BufReader};
|
||||
|
||||
use proxmox::api::router::{Router, SubdirMap};
|
||||
use proxmox::api::{
|
||||
api, schema::*, ApiHandler, ApiMethod, ApiResponseFuture, Permission, RpcEnvironment,
|
||||
};
|
||||
use proxmox::list_subdirs_api_method;
|
||||
use proxmox::{identity, sortable};
|
||||
use proxmox_router::{
|
||||
ApiHandler, ApiMethod, ApiResponseFuture, Permission, RpcEnvironment, Router, SubdirMap,
|
||||
};
|
||||
use proxmox_schema::*;
|
||||
use proxmox_router::list_subdirs_api_method;
|
||||
use proxmox_http::websocket::WebSocket;
|
||||
|
||||
use proxmox_rest_server::WorkerTask;
|
||||
|
@ -2,8 +2,8 @@ use anyhow::{Error, bail};
|
||||
use serde_json::{Value, to_value};
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox::api::schema::parse_property_string;
|
||||
use proxmox_router::{ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::{api, parse_property_string};
|
||||
|
||||
use pbs_api_types::{
|
||||
Authid, Interface, NetworkInterfaceType, LinuxBondMode, NetworkConfigMethod, BondXmitHashPolicy,
|
||||
|
@ -1,7 +1,9 @@
|
||||
use anyhow::Error;
|
||||
use proxmox::api::{api, ApiMethod, Permission, Router, RpcEnvironment};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox_router::{ApiMethod, Permission, Router, RpcEnvironment};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, PRIV_SYS_AUDIT};
|
||||
|
||||
use crate::server::generate_report;
|
||||
|
@ -1,7 +1,8 @@
|
||||
use anyhow::Error;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use proxmox::api::{api, Permission, Router};
|
||||
use proxmox_router::{Permission, Router};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{
|
||||
NODE_SCHEMA, RRDMode, RRDTimeFrameResolution, PRIV_SYS_AUDIT,
|
||||
@ -19,7 +20,7 @@ pub fn create_value_from_rrd(
|
||||
) -> Result<Value, Error> {
|
||||
|
||||
let mut result = Vec::new();
|
||||
let now = proxmox::tools::time::epoch_f64();
|
||||
let now = proxmox_time::epoch_f64();
|
||||
|
||||
for name in list {
|
||||
let (start, reso, list) = match RRD_CACHE.extract_cached_data(basedir, name, now, timeframe, cf) {
|
||||
|
@ -3,9 +3,9 @@ use std::process::{Command, Stdio};
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::{sortable, identity, list_subdirs_api_method};
|
||||
use proxmox::api::{api, Router, Permission, RpcEnvironment};
|
||||
use proxmox::api::router::SubdirMap;
|
||||
use proxmox::{sortable, identity};
|
||||
use proxmox_router::{list_subdirs_api_method, Router, Permission, RpcEnvironment, SubdirMap};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{Authid, NODE_SCHEMA, SERVICE_ID_SCHEMA, PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
|
||||
|
||||
|
@ -6,7 +6,8 @@ use serde_json::Value;
|
||||
|
||||
use proxmox::sys::linux::procfs;
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_router::{ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, NodePowerCommand, PRIV_SYS_AUDIT, PRIV_SYS_POWER_MANAGEMENT};
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
use anyhow::{Error, format_err, bail};
|
||||
use serde_json::Value;
|
||||
|
||||
use proxmox::api::{api, Router, RpcEnvironment, Permission};
|
||||
use proxmox_router::{Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{
|
||||
NODE_SCHEMA, SUBSCRIPTION_KEY_SCHEMA, Authid,
|
||||
@ -51,7 +52,7 @@ pub fn check_subscription(
|
||||
};
|
||||
|
||||
if !force && info.status == SubscriptionStatus::ACTIVE {
|
||||
let age = proxmox::tools::time::epoch_i64() - info.checktime.unwrap_or(i64::MAX);
|
||||
let age = proxmox_time::epoch_i64() - info.checktime.unwrap_or(i64::MAX);
|
||||
if age < subscription::MAX_LOCAL_KEY_AGE {
|
||||
return Ok(());
|
||||
}
|
||||
|
@ -3,7 +3,8 @@ use std::process::{Command, Stdio};
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_router::{ApiMethod, Router, RpcEnvironment, Permission};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, SYSTEMD_DATETIME_FORMAT, PRIV_SYS_AUDIT};
|
||||
|
||||
|
@ -4,9 +4,9 @@ use std::io::{BufRead, BufReader};
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Router, RpcEnvironment, Permission};
|
||||
use proxmox::api::router::SubdirMap;
|
||||
use proxmox::{identity, list_subdirs_api_method, sortable};
|
||||
use proxmox::{identity, sortable};
|
||||
use proxmox_router::{list_subdirs_api_method, Router, RpcEnvironment, Permission, SubdirMap};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{
|
||||
Userid, Authid, Tokenname, TaskListItem, TaskStateType, UPID,
|
||||
|
@ -1,8 +1,9 @@
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Router, Permission};
|
||||
use proxmox::tools::fs::{file_read_firstline, replace_file, CreateOptions};
|
||||
use proxmox_router::{Router, Permission};
|
||||
use proxmox_schema::api;
|
||||
|
||||
use pbs_api_types::{NODE_SCHEMA, TIME_ZONE_SCHEMA, PRIV_SYS_MODIFY};
|
||||
|
||||
@ -55,8 +56,8 @@ fn read_etc_localtime() -> Result<String, Error> {
|
||||
)]
|
||||
/// Read server time and time zone settings.
|
||||
fn get_time(_param: Value) -> Result<Value, Error> {
|
||||
let time = proxmox::tools::time::epoch_i64();
|
||||
let tm = proxmox::tools::time::localtime(time)?;
|
||||
let time = proxmox_time::epoch_i64();
|
||||
let tm = proxmox_time::localtime(time)?;
|
||||
let offset = tm.tm_gmtoff;
|
||||
|
||||
let localtime = time + offset;
|
||||
|
Reference in New Issue
Block a user