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

[Dataprotection] Onboard new OSS Workload to dataprotection extension #3834

Merged
merged 9 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dataprotection/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

0.2.0
++++++
* onboard OSS workload to dataprotection extension.
* [BREAKING CHANGE] `az dataprotection restorable-time-range find`: `--backup-instances` renamed to `--backup-instance-name`.

0.1.0
++++++
* Initial release.
2 changes: 1 addition & 1 deletion src/dataprotection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ az dataprotection job show --job-id "3c60cb49-63e8-4b21-b9bd-26277b3fdfae" --res
#### dataprotection restorable-time-range ####
##### Find #####
```
az dataprotection restorable-time-range find --backup-instances "zblobbackuptestsa58" \
az dataprotection restorable-time-range find --backup-instance-name "zblobbackuptestsa58" \
--end-time "2021-02-24T00:35:17.6829685Z" --source-data-store-type "OperationalStore" \
--start-time "2020-10-17T23:28:17.6829685Z" --resource-group "Blob-Backup" --vault-name "ZBlobBackupVaultBVTD3"
```
118 changes: 59 additions & 59 deletions src/dataprotection/azext_dataprotection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_dataprotection.generated._help import helps # pylint: disable=unused-import
try:
from azext_dataprotection.manual._help import helps # pylint: disable=reimported
except ImportError as e:
if e.name.endswith('manual._help'):
pass
else:
raise e


class DataProtectionClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_dataprotection.generated._client_factory import cf_dataprotection_cl
dataprotection_custom = CliCommandType(
operations_tmpl='azext_dataprotection.custom#{}',
client_factory=cf_dataprotection_cl)
parent = super(DataProtectionClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=dataprotection_custom)

def load_command_table(self, args):
from azext_dataprotection.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_dataprotection.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError as e:
if e.name.endswith('manual.commands'):
pass
else:
raise e
return self.command_table

def load_arguments(self, command):
from azext_dataprotection.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_dataprotection.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError as e:
if e.name.endswith('manual._params'):
pass
else:
raise e


COMMAND_LOADER_CLS = DataProtectionClientCommandsLoader
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from azure.cli.core import AzCommandsLoader
from azext_dataprotection.generated._help import helps # pylint: disable=unused-import
try:
from azext_dataprotection.manual._help import helps # pylint: disable=reimported
except ImportError as e:
if e.name.endswith('manual._help'):
pass
else:
raise e
class DataProtectionClientCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_dataprotection.generated._client_factory import cf_dataprotection_cl
dataprotection_custom = CliCommandType(
operations_tmpl='azext_dataprotection.custom#{}',
client_factory=cf_dataprotection_cl)
parent = super(DataProtectionClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=dataprotection_custom)
def load_command_table(self, args):
from azext_dataprotection.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_dataprotection.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError as e:
if e.name.endswith('manual.commands'):
pass
else:
raise e
return self.command_table
def load_arguments(self, command):
from azext_dataprotection.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_dataprotection.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError as e:
if e.name.endswith('manual._params'):
pass
else:
raise e
COMMAND_LOADER_CLS = DataProtectionClientCommandsLoader
40 changes: 20 additions & 20 deletions src/dataprotection/azext_dataprotection/action.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError as e:
if e.name.endswith('manual.action'):
pass
else:
raise e
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError as e:
if e.name.endswith('manual.action'):
pass
else:
raise e
40 changes: 20 additions & 20 deletions src/dataprotection/azext_dataprotection/custom.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError as e:
if e.name.endswith('manual.custom'):
pass
else:
raise e
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError as e:
if e.name.endswith('manual.custom'):
pass
else:
raise e
24 changes: 12 additions & 12 deletions src/dataprotection/azext_dataprotection/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_dataprotection_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_dataprotection.vendored_sdks.dataprotection import DataProtectionClient
return get_mgmt_service_client(cli_ctx,
DataProtectionClient)


def cf_backup_vault(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).backup_vaults


def cf_backup_policy(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).backup_policies


def cf_backup_instance(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).backup_instances


def cf_recovery_point(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).recovery_points


def cf_job(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).jobs


def cf_restorable_time_range(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).restorable_time_ranges
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
def cf_dataprotection_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_dataprotection.vendored_sdks.dataprotection import DataProtectionClient
return get_mgmt_service_client(cli_ctx,
DataProtectionClient)
def cf_backup_vault(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).backup_vaults
def cf_backup_policy(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).backup_policies
def cf_backup_instance(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).backup_instances
def cf_recovery_point(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).recovery_points
def cf_job(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).jobs
def cf_restorable_time_range(cli_ctx, *_):
return cf_dataprotection_cl(cli_ctx).restorable_time_ranges
Loading