Class: VpsAdmin::CLI::Commands::BackupVps
- Inherits:
-
BackupDataset
- Object
- HaveAPI::CLI::Command
- BaseDownload
- BackupDataset
- VpsAdmin::CLI::Commands::BackupVps
- Defined in:
- lib/vpsadmin/cli/commands/backup_vps.rb
Instance Method Summary collapse
Methods inherited from BackupDataset
Methods inherited from BaseDownload
Constructor Details
This class inherits a constructor from VpsAdmin::CLI::Commands::BaseDownload
Instance Method Details
#exec(args) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vpsadmin/cli/commands/backup_vps.rb', line 7 def exec(args) if args.size == 1 && /^\d+$/ !~ args[0] fs = args[0] ds_id = read_dataset_id(fs) if ds_id super([ds_id, fs]) else ds = dataset_chooser(vps_only: true) super([ds.id, fs]) end elsif args.size == 2 super([@api.vps.show(args[0].to_i).dataset_id, args[1]]) else super end end |