update to proxmox-router 3 and proxmox-rest-server 0.8

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-09-05 13:35:21 +02:00
parent c3b7862be5
commit bd8c677eab
3 changed files with 13 additions and 9 deletions

View File

@ -72,9 +72,9 @@ proxmox-ldap = "0.2.1"
proxmox-metrics = "0.3.1"
proxmox-notify = "0.4"
proxmox-openid = "0.10.0"
proxmox-rest-server = { version = "0.7", features = [ "templates" ] }
proxmox-rest-server = { version = "0.8", features = [ "templates" ] }
# some use "cli", some use "cli" and "server", pbs-config uses nothing
proxmox-router = { version = "2.0.0", default-features = false }
proxmox-router = { version = "3.0.0", default-features = false }
proxmox-rrd = { version = "0.3", features = [ "api-types" ]}
# everything but pbs-config and pbs-client use "api-macro"
proxmox-schema = "3"

10
debian/control vendored
View File

@ -77,11 +77,11 @@ Build-Depends: bash-completion,
librust-proxmox-notify-0.4+default-dev,
librust-proxmox-notify-0.4+pbs-context-dev,
librust-proxmox-openid-0.10+default-dev,
librust-proxmox-rest-server-0.7+default-dev,
librust-proxmox-rest-server-0.7+rate-limited-stream-dev,
librust-proxmox-rest-server-0.7+templates-dev,
librust-proxmox-router-2+cli-dev,
librust-proxmox-router-2+server-dev,
librust-proxmox-rest-server-0.8+default-dev,
librust-proxmox-rest-server-0.8+rate-limited-stream-dev,
librust-proxmox-rest-server-0.8+templates-dev,
librust-proxmox-router-3+cli-dev,
librust-proxmox-router-3+server-dev,
librust-proxmox-rrd-0.3+api-types-dev,
librust-proxmox-rrd-0.3+default-dev,
librust-proxmox-schema-3+api-macro-dev,

View File

@ -226,14 +226,18 @@ async fn call_api_code(
nix::unistd::setuid(backup_user.uid)?;
}
match method.handler {
ApiHandler::StreamingSync(handler) => {
ApiHandler::SerializingSync(handler) => {
let res = (handler)(params, method, rpcenv)?.to_value()?;
Ok(res)
}
ApiHandler::StreamingAsync(handler) => {
ApiHandler::SerializingAsync(handler) => {
let res = (handler)(params, method, rpcenv).await?.to_value()?;
Ok(res)
}
ApiHandler::StreamSync(handler) => (handler)(params, method, rpcenv)?.try_collect(),
ApiHandler::StreamAsync(handler) => {
(handler)(params, method, rpcenv).await?.try_collect().await
}
ApiHandler::AsyncHttp(_handler) => {
bail!("not implemented");
}