[pbs-devel] [PATCH proxmox-backup v2 7/8] bin/proxmox-tape: add restore-single command to proxmox-tape

Dominik Csapak d.csapak at proxmox.com
Wed May 5 14:50:06 CEST 2021


On 5/5/21 13:04, Thomas Lamprecht wrote:
> On 05.05.21 12:09, Dominik Csapak wrote:
>> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>> ---
>>   src/bin/proxmox-tape.rs | 62 +++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 62 insertions(+)
>>
>> diff --git a/src/bin/proxmox-tape.rs b/src/bin/proxmox-tape.rs
>> index e18f334c..3d5d0cf3 100644
>> --- a/src/bin/proxmox-tape.rs
>> +++ b/src/bin/proxmox-tape.rs
>> @@ -868,6 +868,61 @@ async fn backup(mut param: Value) -> Result<(), Error> {
>>       Ok(())
>>   }
>>   
>> +#[api(
>> +   input: {
>> +        properties: {
>> +            store: {
>> +                schema: DATASTORE_MAP_LIST_SCHEMA,
>> +            },
>> +            drive: {
>> +                schema: DRIVE_NAME_SCHEMA,
>> +                optional: true,
>> +            },
>> +            "media-set": {
>> +                description: "Media set UUID.",
>> +                type: String,
>> +            },
>> +            "snapshots": {
>> +                description: "Comma-separated list of snapshots.",
>> +                type: Array,
>> +                items: {
>> +                    type: String,
>> +                    description: "A single snapshot',"
>> +                },
>> +            },
> 
> same here, and if we'd really like to add a extra command for restoring not all but
> a list of snapshots I'd at least make snapshots a fixed "take all" parameter, e.g.:
> 
> proxmox-tape restore-snapshots --store bar --media-set foo vm/100/... ct/101/...
> 
> Or allow passing it multiple times for accumulation, as those can be better
> tab-completed which would be really helpful compared to typing some date in.
> (those pasting it in would not loose any benefit).

this does that already (the text is wrong) but yes have it that way
and optional makes sense, just gotta write a completion helper
(since we need the source store per snapshot too)

> 
> But as said, above is only for the case where we really want a separate command,
> IMO this would fit fine into a single restore command...
> 
yes thanks





More information about the pbs-devel mailing list