-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way of creating and executing "config switch" operations (#86)
Through this PR we expose an operation in the REST API for performing `barman config-switch` command remotely. The following changes have been applied: * Create a ``ConfigSwitchOperation`` class, which takes care of validating the arguments for a config switch operation, and also of running such operation; * Modify `servers_operations_post` Flask end point so it is able to receive POST requests both for creating a recovery operation or a config switch operation; * Create a new command ``pg-backup-api config-switch``, which is used by the API in order to run the config switch on Barman; * Create a function ``config_switch_operation``, which is used by ``pg-backup-api config-switch`` command; * Create a helper function ``_run_operation``, which is used both by ``recovery_operation`` and ``config_switch_operation`` functions. They both have a very similar logic, so that helper function executes the common code paths. The new API endpoint is able to handle both an "apply model" or a "reset model" through `barman config-switch` command. References: BAR-125.
- Loading branch information
1 parent
455f783
commit 896957b
Showing
8 changed files
with
557 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.