Skip to content

Commit

Permalink
Merge branch '007-revert-backup-different-big-storage' into 'master'
Browse files Browse the repository at this point in the history
Add destination big storage name to revert action

See merge request transip/restapi-cli-client!137
  • Loading branch information
Jordi Donadeu committed Nov 22, 2021
2 parents 4b524ac + 8381c43 commit cc5905c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

6.11.0
-----
* Added destination big storage name for backup restore

6.10.0
-----
* Added autodns functionality for domain
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"symfony/console": "^4.3",
"symfony/finder": "^4.3",
"symfony/filesystem": "^4.3",
"transip/transip-api-php": "^6.10.0",
"transip/transip-api-php": "^6.11.0",
"symfony/yaml": "^4.3",
"webmozart/path-util": "^2.3"
},
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/Command/BigStorage/Backup/Revert.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ protected function configure(): void
->setDescription('Restore a bigstorage backup')
->addArgument(Field::BIGSTORAGE_NAME, InputArgument::REQUIRED, Field::BIGSTORAGE_NAME__DESC)
->addArgument(Field::BIGSTORAGE_BACKUPID, InputArgument::REQUIRED, Field::BIGSTORAGE_BACKUPID__DESC)
->addArgument(Field::BIGSTORAGE_BACKUP_DESTINATION_NAME, InputArgument::OPTIONAL, Field::BIGSTORAGE_BACKUP_DESTINATION_NAME__DESC . Field::OPTIONAL)
->setHelp('This command restores a big storage backup.');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$bigStorageName = $input->getArgument(Field::BIGSTORAGE_NAME);
$bigStorageBackupId = $input->getArgument(Field::BIGSTORAGE_BACKUPID);
$destinationBigStorageName = $input->getArgument(Field::BIGSTORAGE_BACKUP_DESTINATION_NAME) ?? '';

$this->getTransipApi()->bigStorageBackups()->revertBackup($bigStorageName, $bigStorageBackupId);
$this->getTransipApi()->bigStorageBackups()->revertBackup(
$bigStorageName,
$bigStorageBackupId,
$destinationBigStorageName
);
}
}
2 changes: 2 additions & 0 deletions src/Command/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ class Field
public const BIGSTORAGE_HASOFFSITEBACKUPS__DESC = 'Whether to order offsite backups, default is true.';
public const BIGSTORAGE_BACKUPID = 'BigStorageBackupId';
public const BIGSTORAGE_BACKUPID__DESC = 'ID number of the backup';
public const BIGSTORAGE_BACKUP_DESTINATION_NAME = 'DestinationBigStorageName';
public const BIGSTORAGE_BACKUP_DESTINATION_NAME__DESC = 'Reverts the backup to this big storage.';
public const BIGSTORAGE_DESCRIPTION = 'BigStorageDescription';
public const BIGSTORAGE_DESCRIPTION__DESC = 'Description of the big storage';
public const BIGSTORAGE_STARTDATE = 'StartDate';
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Settings
private const CONFIG_FILE_NAME = 'cli-config.json';

public const TRANSIP_API_ENDPOINT = 'https://api.transip.nl/v6';
public const TRANSIP_CLI_VERSION = '6.10.0';
public const TRANSIP_CLI_VERSION = '6.11.0';

/**
* @var string
Expand Down

0 comments on commit cc5905c

Please sign in to comment.