[pbs-devel] [PATCH proxmox-backup v3 09/13] proxmox-backup-client: add 'protected' commands

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Oct 28 11:05:50 CEST 2021


just an FYI about all the explicit `Null` values we have by now...
We *can* just return `()` ;-)

On Wed, Oct 27, 2021 at 01:22:34PM +0200, Dominik Csapak wrote:
> includes 'update' and 'show' similar to the notes commands
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  proxmox-backup-client/src/snapshot.rs | 113 ++++++++++++++++++++++++++
>  1 file changed, 113 insertions(+)
> 
> diff --git a/proxmox-backup-client/src/snapshot.rs b/proxmox-backup-client/src/snapshot.rs
> index 6b563d79..46b1db09 100644
> --- a/proxmox-backup-client/src/snapshot.rs
> +++ b/proxmox-backup-client/src/snapshot.rs
> @@ -358,6 +358,118 @@ async fn update_notes(param: Value) -> Result<Value, Error> {
>      Ok(Value::Null)
>  }
>  
> +#[api(
(...)
> +)]
> +/// Show protection status of the specified snapshot
> +async fn show_protection(param: Value) -> Result<Value, Error> {
 ^ `-> Result<(), Error>`
(...)
 v `Ok(())`
> +    Ok(Value::Null)
> +}
> +
> +#[api(
(...)
> +)]
> +/// Update Protection Status of a snapshot
> +async fn update_protection(protected: bool, param: Value) -> Result<Value, Error> {
 ^ `-> Result<(), Error>`
(...)
 v `Ok(())`
> +    Ok(Value::Null)
> +}




More information about the pbs-devel mailing list