Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networker Backup Software Support as a Cloud Provider module #617

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion barman/clients/cloud_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def create_argument_parser(description, source_or_destination=UrlArgumentType.so
parser.add_argument(
"--cloud-provider",
help="The cloud provider to use as a storage backend",
choices=["aws-s3", "azure-blob-storage", "google-cloud-storage"],
choices=["aws-s3", "azure-blob-storage", "google-cloud-storage", "networker-storage"],
default="aws-s3",
)
s3_arguments = parser.add_argument_group(
Expand Down
20 changes: 19 additions & 1 deletion barman/cloud_providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,23 @@ def _make_google_cloud_interface(config, cloud_interface_kwargs):
cloud_interface_kwargs["jobs"] = 1
return GoogleCloudInterface(**cloud_interface_kwargs)

def _make_networker_interface(config, cloud_interface_kwargs):
"""
:param config: Not used yet
:param cloud_interface_kwargs: common parameters
:return: NetworkerInterface
"""
from barman.cloud_providers.networker_storage import NetworkerInterface

cloud_interface_kwargs["jobs"] = 1
_update_kwargs(
cloud_interface_kwargs,
config,
(
"server_name",
),
)
return NetworkerInterface(**cloud_interface_kwargs)

def get_cloud_interface(config):
"""
Expand All @@ -122,8 +139,9 @@ def get_cloud_interface(config):
elif config.cloud_provider == "azure-blob-storage":
return _make_azure_cloud_interface(config, cloud_interface_kwargs)
elif config.cloud_provider == "google-cloud-storage":

return _make_google_cloud_interface(config, cloud_interface_kwargs)
elif config.cloud_provider == "networker-storage":
return _make_networker_interface(config, cloud_interface_kwargs)
else:
raise CloudProviderUnsupported(
"Unsupported cloud provider: %s" % config.cloud_provider
Expand Down
Loading