[pdm-devel] [PATCH datacenter-manager v2 3/4] api: add /remotes/tasks/refresh
Lukas Wagner
l.wagner at proxmox.com
Mon Dec 29 15:57:48 CET 2025
On Fri Dec 19, 2025 at 2:52 PM CET, Shannon Sterz wrote:
> some comments in-line:
>
> On Thu Dec 18, 2025 at 3:20 PM CET, Lukas Wagner wrote:
[...]
>> #[api(
>> @@ -168,3 +175,80 @@ async fn task_statistics(
>>
>> Ok(TaskStatistics { by_type, by_remote })
>> }
>> +
>> +#[api(
>> + input: {
>> + properties: {
>> + remote: {
>> + schema: REMOTE_ID_SCHEMA,
>> + optional: true,
>
> i wonder if it makes sense to allow a list of remotes here instead of
> just a single remote.
Yeah, good point. I don't see any reason why not, especially since the
refresh_taskcache function supports a list of remotes anyway.
As for permissions, I will implement it so that if `remotes` is
provided, the user requires the appropriate permissions for *all* off
them - opposed to just not showing them as we do for `remotes` is not
provided.
I will change this to a `remotes` parameter for v2.
Thanks a lot, Shannon!
>
> this api endpoint would also benefit from a short description on how
> this parameter influences the result imo.
>
Will do!
>> + },
>> + },
>> + },
>> + access: {
>> + permission: &Permission::Anybody,
>> + description: "Resource.Modify privileges are needed on /resource/{remote}",
>> + },
>> + returns: { type: UPID }
>> +)]
>> +/// Refresh the update summary of all remotes.
>> +pub fn refresh_remote_tasks(
>> + remote: Option<String>,
>> + rpcenv: &mut dyn RpcEnvironment,
>> +) -> Result<UPID, Error> {
>> + let (config, _digest) = pdm_config::remotes::config()?;
>> +
>> + let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
>> + let user_info = CachedUserInfo::new()?;
[...]
More information about the pdm-devel
mailing list