Hello community, here is the log from the commit of package azure-cli-backup for openSUSE:Factory checked in at 2018-05-13 16:01:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-backup (Old) and /work/SRC/openSUSE:Factory/.azure-cli-backup.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-backup" Sun May 13 16:01:12 2018 rev:3 rq:600033 version:1.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-backup/azure-cli-backup.changes 2018-02-14 09:29:52.123291967 +0100 +++ /work/SRC/openSUSE:Factory/.azure-cli-backup.new/azure-cli-backup.changes 2018-05-13 16:01:12.994756254 +0200 @@ -1,0 +2,8 @@ +Tue Apr 17 14:02:07 UTC 2018 - [email protected] + +- New upstream release + + Version 1.1.1 +- Move LICENSE.txt from %doc to %license section +- Update Requires from setup.py + +------------------------------------------------------------------- Old: ---- azure-cli-backup-1.0.6.tar.gz New: ---- azure-cli-backup-1.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-backup.spec ++++++ --- /var/tmp/diff_new_pack.yTJTLB/_old 2018-05-13 16:01:13.730729402 +0200 +++ /var/tmp/diff_new_pack.yTJTLB/_new 2018-05-13 16:01:13.734729256 +0200 @@ -17,7 +17,7 @@ Name: azure-cli-backup -Version: 1.0.6 +Version: 1.1.1 Release: 0 Summary: Microsoft Azure CLI 'backup' Command Module License: MIT @@ -32,6 +32,7 @@ BuildRequires: python3-setuptools BuildRequires: unzip Requires: azure-cli-command-modules-nspkg +Requires: azure-cli-core Requires: azure-cli-nspkg Requires: python3-azure-mgmt-recoveryservices >= 0.1.0 Requires: python3-azure-mgmt-recoveryservicesbackup >= 0.1.1 @@ -64,7 +65,8 @@ %files %defattr(-,root,root,-) -%doc HISTORY.rst LICENSE.txt README.rst +%doc HISTORY.rst README.rst +%license LICENSE.txt %{python3_sitelib}/azure/cli/command_modules/backup %{python3_sitelib}/azure_cli_backup-*.egg-info ++++++ azure-cli-backup-1.0.6.tar.gz -> azure-cli-backup-1.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/HISTORY.rst new/azure-cli-backup-1.1.1/HISTORY.rst --- old/azure-cli-backup-1.0.6/HISTORY.rst 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/HISTORY.rst 2018-04-06 19:33:13.000000000 +0200 @@ -3,6 +3,41 @@ Release History =============== +1.1.1 ++++++ + +* `sdist` is now compatible with wheel 0.31.0 + +1.1.0 ++++++ +* Added new command 'az backup protection isenabled-for-vm'. This command can be used to check if a VM is backed up by any vault in the subscription. +* Enabled --ids for vault_name and resource_group parameters for the following commands: + az backup container show + az backup item set-policy + az backup item show + az backup job show + az backup job stop + az backup job wait + az backup policy delete + az backup policy get-default-for-vm + az backup policy list-associated-items + az backup policy set + az backup policy show + az backup protection backup-now + az backup protection disable + az backup protection enable-for-vm + az backup recoverypoint show + az backup restore files mount-rp + az backup restore files unmount-rp + az backup restore restore-disks + az backup vault delete + az backup vault show +* 'name' parameters now accept the name format as output from the show commands. + +1.0.7 ++++++ +* Support Autorest 3.0 based SDKs + 1.0.6 +++++ * New feature: 'az backup item list' command now has '--container-name' parameter as optional instead of mandatory and output contains item health details. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/PKG-INFO new/azure-cli-backup-1.1.1/PKG-INFO --- old/azure-cli-backup-1.0.6/PKG-INFO 2018-01-12 18:26:09.000000000 +0100 +++ new/azure-cli-backup-1.1.1/PKG-INFO 2018-04-06 19:33:41.000000000 +0200 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: azure-cli-backup -Version: 1.0.6 +Version: 1.1.1 Summary: Microsoft Azure Command-Line Tools Recovery Services Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT +Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'backup' Command Module =========================================== @@ -20,6 +21,41 @@ Release History =============== + 1.1.1 + +++++ + + * `sdist` is now compatible with wheel 0.31.0 + + 1.1.0 + +++++ + * Added new command 'az backup protection isenabled-for-vm'. This command can be used to check if a VM is backed up by any vault in the subscription. + * Enabled --ids for vault_name and resource_group parameters for the following commands: + az backup container show + az backup item set-policy + az backup item show + az backup job show + az backup job stop + az backup job wait + az backup policy delete + az backup policy get-default-for-vm + az backup policy list-associated-items + az backup policy set + az backup policy show + az backup protection backup-now + az backup protection disable + az backup protection enable-for-vm + az backup recoverypoint show + az backup restore files mount-rp + az backup restore files unmount-rp + az backup restore restore-disks + az backup vault delete + az backup vault show + * 'name' parameters now accept the name format as output from the show commands. + + 1.0.7 + +++++ + * Support Autorest 3.0 based SDKs + 1.0.6 +++++ * New feature: 'az backup item list' command now has '--container-name' parameter as optional instead of mandatory and output contains item health details. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_client_factory.py new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_client_factory.py --- old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_client_factory.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_client_factory.py 2018-04-06 19:33:13.000000000 +0200 @@ -41,6 +41,10 @@ return _resource_client_factory(cli_ctx).resources +def resource_groups_cf(cli_ctx, *_): + return _resource_client_factory(cli_ctx).resource_groups + + # Internal Deps Client Factories def vaults_cf(cli_ctx, *_): return _common_client_factory(cli_ctx).vaults diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_format.py new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_format.py --- old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_format.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_format.py 2018-04-06 19:33:13.000000000 +0200 @@ -33,12 +33,19 @@ def transform_job(result): - return OrderedDict([('Name', result['name']), - ('Operation', result['properties']['operation']), - ('Status', result['properties']['status']), - ('Item Name', result['properties']['entityFriendlyName']), - ('Start Time UTC', result['properties']['startTime']), - ('Duration', result['properties']['duration'])]) + columns = [] + columns.append(('Name', result['name'])) + columns.append(('Operation', result['properties']['operation'])) + columns.append(('Status', result['properties']['status'])) + columns.append(('Item Name', result['properties']['entityFriendlyName'])) + columns.append(('Start Time UTC', result['properties']['startTime'])) + + if result['properties']['backupManagementType'] == 'AzureIaasVM': + columns.append(('Duration', result['properties']['duration'])) + elif result['properties']['backupManagementType'] == 'AzureStorage': + columns.append(('Duration', result['properties']['additionalProperties']['duration'])) + + return OrderedDict(columns) def transform_policy(result): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_help.py new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_help.py --- old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_help.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_help.py 2018-04-06 19:33:13.000000000 +0200 @@ -140,6 +140,11 @@ short-summary: Manage protection of your items, enable protection or disable it, or take on-demand backups. """ +helps['backup protection check-vm'] = """ + type: command + short-summary: Find out whether the virtual machine is protected or not. If protected, it returns the recovery services vault ID, otherwise it returns empty. + """ + helps['backup protection enable-for-vm'] = """ type: command short-summary: Start protecting a previously unprotected Azure VM as per the specified policy to a Recovery services vault. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_params.py new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_params.py --- old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/_params.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/_params.py 2018-04-06 19:33:13.000000000 +0200 @@ -9,9 +9,11 @@ from knack.arguments import CLIArgumentType +import azure.cli.core.commands.arm # pylint: disable=unused-import from azure.cli.core.commands.parameters import \ - (get_resource_name_completion_list, file_type, get_location_type, get_three_state_flag, + (get_resource_name_completion_list, file_type, get_three_state_flag, get_enum_type) +from azure.cli.core.commands.validators import get_default_location_from_resource_group from azure.cli.command_modules.backup._validators import \ (datetime_type) @@ -38,35 +40,42 @@ # Vault with self.argument_context('backup vault') as c: - c.argument('vault_name', vault_name_type, options_list=['--name', '-n']) - c.argument('region', get_location_type(self.cli_ctx)) + c.argument('vault_name', vault_name_type, options_list=['--name', '-n'], id_part='name') + c.argument('location', validator=get_default_location_from_resource_group) with self.argument_context('backup vault backup-properties set') as c: c.argument('backup_storage_redundancy', arg_type=get_enum_type(['GeoRedundant', 'LocallyRedundant']), help='Sets backup storage properties for a Recovery Services vault.') # Container with self.argument_context('backup container') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') c.ignore('status') with self.argument_context('backup container show') as c: c.argument('name', container_name_type, options_list=['--name', '-n'], help='Name of the container. You can use the backup container list command to get the name of a container.') + with self.argument_context('backup container list') as c: + c.argument('vault_name', vault_name_type, id_part=None) + # Item with self.argument_context('backup item') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') c.argument('container_name', container_name_type) with self.argument_context('backup item show') as c: c.argument('name', item_name_type, options_list=['--name', '-n'], help='Name of the backed up item. You can use the backup item list command to get the name of a backed up item.') + # TODO: Need to use item.id once https://github.com/Azure/msrestazure-for-python/issues/80 is fixed. with self.argument_context('backup item set-policy') as c: - c.argument('item_name', item_name_type, options_list=['--name', '-n'], help='Name of the backed up item. You can use the backup item list command to get the name of a backed up item.') + c.argument('item_name', item_name_type, options_list=['--name', '-n'], id_part='name', help='Name of the backed up item. You can use the backup item list command to get the name of a backed up item.') c.argument('policy_name', policy_name_type, help='Name of the Backup policy. You can use the backup policy list command to get the name of a backup policy.') + with self.argument_context('backup item list') as c: + c.argument('vault_name', vault_name_type, id_part=None) + # Policy with self.argument_context('backup policy') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') for command in ['show', 'delete', 'list-associated-items']: with self.argument_context('backup policy ' + command) as c: @@ -75,13 +84,18 @@ with self.argument_context('backup policy set') as c: c.argument('policy', type=file_type, help='JSON encoded policy definition. Use the show command with JSON output to obtain a policy object. Modify the values using a file editor and pass the object.', completer=FilesCompleter()) + with self.argument_context('backup policy list') as c: + c.argument('vault_name', vault_name_type, id_part=None) + # Recovery Point + # TODO: Need to use item.id once https://github.com/Azure/msrestazure-for-python/issues/80 is fixed. with self.argument_context('backup recoverypoint') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') c.argument('container_name', container_name_type) c.argument('item_name', item_name_type) with self.argument_context('backup recoverypoint list') as c: + c.argument('vault_name', vault_name_type, id_part=None) c.argument('start_date', type=datetime_type, help='The start date of the range in UTC (d-m-Y).') c.argument('end_date', type=datetime_type, help='The end date of the range in UTC (d-m-Y).') @@ -90,10 +104,11 @@ # Protection with self.argument_context('backup protection') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') c.argument('vm', help='Name or ID of the Virtual Machine to be protected.') c.argument('policy_name', policy_name_type) + # TODO: Need to use item.id once https://github.com/Azure/msrestazure-for-python/issues/80 is fixed. for command in ['backup-now', 'disable']: with self.argument_context('backup protection ' + command) as c: c.argument('container_name', container_name_type) @@ -104,9 +119,14 @@ with self.argument_context('backup protection disable') as c: c.argument('delete_backup_data', arg_type=get_three_state_flag(), help='Option to delete existing backed up data in the Recovery services vault.') + + with self.argument_context('backup protection check-vm') as c: + c.argument('vm_id', help='ID of the virtual machine to be checked for protection.') + # Restore + # TODO: Need to use recovery_point.id once https://github.com/Azure/msrestazure-for-python/issues/80 is fixed. with self.argument_context('backup restore') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') c.argument('container_name', container_name_type) c.argument('item_name', item_name_type) c.argument('rp_name', rp_name_type) @@ -117,13 +137,15 @@ # Job with self.argument_context('backup job') as c: - c.argument('vault_name', vault_name_type) + c.argument('vault_name', vault_name_type, id_part='name') + # TODO: Need to use job.id once https://github.com/Azure/msrestazure-for-python/issues/80 is fixed. for command in ['show', 'stop', 'wait']: with self.argument_context('backup job ' + command) as c: c.argument('name', job_name_type, help='Name of the job. You can use the backup job list command to get the name of a job.') with self.argument_context('backup job list') as c: + c.argument('vault_name', vault_name_type, id_part=None) c.argument('status', arg_type=get_enum_type(['Cancelled', 'Completed', 'CompletedWithWarnings', 'Failed', 'InProgress']), help='Status of the Job.') c.argument('operation', arg_type=get_enum_type(['Backup', 'ConfigureBackup', 'DeleteBackupData', 'DisableBackup', 'Restore']), help='User initiated operation.') c.argument('start_date', type=datetime_type, help='The start date of the range in UTC (d-m-Y).') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/commands.py new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/commands.py --- old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/commands.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/commands.py 2018-04-06 19:33:13.000000000 +0200 @@ -47,6 +47,7 @@ g.command('delete', 'delete_policy') with self.command_group('backup protection', backup_custom, client_factory=protected_items_cf) as g: + g.command('check-vm', 'check_protection_enabled_for_vm') g.command('enable-for-vm', 'enable_protection_for_vm') g.command('backup-now', 'backup_now', client_factory=backups_cf) g.command('disable', 'disable_protection', confirmation=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/custom.py new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/custom.py --- old/azure-cli-backup-1.0.6/azure/cli/command_modules/backup/custom.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure/cli/command_modules/backup/custom.py 2018-04-06 19:33:13.000000000 +0200 @@ -21,7 +21,7 @@ IaasVMRestoreRequest, RestoreRequestResource, BackupManagementType, WorkloadType, OperationStatusValues, \ JobStatus, ILRRequestResource, IaasVMILRRegistrationRequest -from azure.cli.core.util import CLIError +from azure.cli.core.util import CLIError, sdk_no_wait from azure.cli.command_modules.backup._client_factory import ( vaults_cf, backup_protected_items_cf, protection_policies_cf, virtual_machines_cf, recovery_points_cf, protection_containers_cf, backup_protectable_items_cf, resources_cf, backup_operation_statuses_cf, @@ -38,10 +38,11 @@ password_length = 15 -def create_vault(client, vault_name, region, resource_group_name): +def create_vault(client, vault_name, resource_group_name, location): vault_sku = Sku(SkuName.standard) vault_properties = VaultProperties() - vault = Vault(region, sku=vault_sku, properties=vault_properties) + + vault = Vault(location, sku=vault_sku, properties=vault_properties) return client.create_or_update(resource_group_name, vault_name, vault) @@ -63,7 +64,7 @@ logger.warning("Deleting backup item '%s' in container '%s'", item_name, container_name) disable_protection(cmd, item_client, resource_group_name, vault_name, - container.name, item_name, delete_backup_data=True) + container_name, item_name, delete_backup_data=True) # now delete the vault vault_client.delete(resource_group_name, vault_name) @@ -127,6 +128,16 @@ return _get_containers(client, container_type, status, resource_group_name, vault_name) +def check_protection_enabled_for_vm(cmd, vm_id): + vaults = list_vaults(vaults_cf(cmd.cli_ctx)) + for vault in vaults: + vault_rg = _get_resource_group_from_id(vault.id) + items = list_items(cmd, backup_protected_items_cf(cmd.cli_ctx), vault_rg, vault.name) + if any(vm_id.lower() == item.properties.virtual_machine_id.lower() for item in items): + return vault.id + return None + + def enable_protection_for_vm(cmd, client, resource_group_name, vault_name, vm, policy_name): vm_name, vm_rg = _get_resource_name_and_rg(resource_group_name, vm) vm = virtual_machines_cf(cmd.cli_ctx).get(vm_rg, vm_name) @@ -169,8 +180,8 @@ vm_item = ProtectedItemResource(properties=vm_item_properties) # Trigger enable protection and wait for completion - result = client.create_or_update(vault_name, resource_group_name, fabric_name, container_uri, item_uri, vm_item, - raw=True) + result = sdk_no_wait(True, client.create_or_update, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, vm_item) return _track_backup_job(cmd.cli_ctx, result, vault_name, resource_group_name) @@ -178,7 +189,12 @@ item_type="VM"): items = list_items(cmd, client, resource_group_name, vault_name, container_name, container_type, item_type) - return _get_none_one_or_many([item for item in items if item.properties.friendly_name == name]) + if _is_native_name(name): + filtered_items = [item for item in items if item.name == name] + else: + filtered_items = [item for item in items if item.properties.friendly_name == name] + + return _get_none_one_or_many(filtered_items) def list_items(cmd, client, resource_group_name, vault_name, container_name=None, container_type="AzureIaasVM", @@ -189,12 +205,18 @@ items = client.list(vault_name, resource_group_name, filter_string) paged_items = _get_list_from_paged_response(items) - if container_name is not None: - container = show_container(backup_protection_containers_cf(cmd.cli_ctx), container_name, resource_group_name, - vault_name, container_type) - _validate_container(container) + if container_name: + if _is_native_name(container_name): + container_uri = container_name + else: + container = show_container(backup_protection_containers_cf(cmd.cli_ctx), + container_name, resource_group_name, vault_name, + container_type) + _validate_container(container) + container_uri = container.name - return [item for item in paged_items if item.properties.container_name.lower() in container.name.lower()] + return [item for item in paged_items if + _get_protection_container_uri_from_id(item.id).lower() == container_uri.lower()] return paged_items @@ -227,8 +249,8 @@ vm_item = ProtectedItemResource(properties=vm_item_properties) # Update policy - result = client.create_or_update(vault_name, resource_group_name, fabric_name, container_uri, item_uri, vm_item, - raw=True) + result = sdk_no_wait(True, client.create_or_update, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, vm_item) return _track_backup_job(cmd.cli_ctx, result, vault_name, resource_group_name) @@ -244,8 +266,9 @@ trigger_backup_request = _get_backup_request(item.properties.workload_type, retain_until) # Trigger backup - result = client.trigger(vault_name, resource_group_name, fabric_name, container_uri, item_uri, - trigger_backup_request, raw=True) + result = sdk_no_wait(True, client.trigger, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, + trigger_backup_request) return _track_backup_job(cmd.cli_ctx, result, vault_name, resource_group_name) @@ -353,8 +376,9 @@ trigger_restore_request = RestoreRequestResource(properties=trigger_restore_properties) # Trigger restore - result = client.trigger(vault_name, resource_group_name, fabric_name, container_uri, item_uri, rp_name, - trigger_restore_request, raw=True) + result = sdk_no_wait(True, client.trigger, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, rp_name, + trigger_restore_request) return _track_backup_job(cmd.cli_ctx, result, vault_name, resource_group_name) @@ -379,8 +403,9 @@ if recovery_point.properties.is_instant_ilr_session_active: recovery_point.properties.renew_existing_registration = True - result = client.provision(vault_name, resource_group_name, fabric_name, container_uri, item_uri, rp_name, - file_restore_request, raw=True) + result = sdk_no_wait(True, client.provision, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, rp_name, + file_restore_request) client_scripts = _track_backup_ilr(cmd.cli_ctx, result, vault_name, resource_group_name) @@ -403,8 +428,8 @@ container_uri, item_uri, rp_name) if recovery_point.properties.is_instant_ilr_session_active: - result = client.revoke(vault_name, resource_group_name, fabric_name, container_uri, item_uri, rp_name, - raw=True) + result = sdk_no_wait(True, client.revoke, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, rp_name) _track_backup_operation(cmd.cli_ctx, resource_group_name, result, vault_name) @@ -420,13 +445,14 @@ # Trigger disable protection and wait for completion if delete_backup_data: - result = client.delete(vault_name, resource_group_name, fabric_name, container_uri, item_uri, raw=True) + result = sdk_no_wait(True, client.delete, + vault_name, resource_group_name, fabric_name, container_uri, item_uri) return _track_backup_job(cmd.cli_ctx, result, vault_name, resource_group_name) vm_item = _get_disable_protection_request(item) - result = client.create_or_update(vault_name, resource_group_name, fabric_name, container_uri, item_uri, vm_item, - raw=True) + result = sdk_no_wait(True, client.create_or_update, + vault_name, resource_group_name, fabric_name, container_uri, item_uri, vm_item) return _track_backup_job(cmd.cli_ctx, result, vault_name, resource_group_name) @@ -467,17 +493,27 @@ # Client Utilities +def _is_native_name(name): + return ";" in name + + def _get_containers(client, container_type, status, resource_group_name, vault_name, container_name=None): filter_dict = { 'backupManagementType': container_type, 'status': status } - if container_name: + + if container_name and not _is_native_name(container_name): filter_dict['friendlyName'] = container_name filter_string = _get_filter_string(filter_dict) - containers = client.list(vault_name, resource_group_name, filter_string) - return _get_list_from_paged_response(containers) + paged_containers = client.list(vault_name, resource_group_name, filter_string) + containers = _get_list_from_paged_response(paged_containers) + + if container_name and _is_native_name(container_name): + return [container for container in containers if container.name == container_name] + + return containers def _get_protectable_item_for_vm(cli_ctx, vault_name, vault_rg, vm_name, vm_rg): @@ -486,7 +522,8 @@ protectable_item = _try_get_protectable_item_for_vm(cli_ctx, vault_name, vault_rg, vm_name, vm_rg) if protectable_item is None: # Protectable item not found. Trigger discovery. - refresh_result = protection_containers_client.refresh(vault_name, vault_rg, fabric_name, raw=True) + refresh_result = sdk_no_wait(True, protection_containers_client.refresh, + vault_name, vault_rg, fabric_name) _track_refresh_operation(cli_ctx, refresh_result, vault_name, vault_rg) protectable_item = _try_get_protectable_item_for_vm(cli_ctx, vault_name, vault_rg, vm_name, vm_rg) return protectable_item @@ -704,12 +741,12 @@ protection_container_refresh_operation_results_client = protection_container_refresh_operation_results_cf(cli_ctx) operation_id = _get_operation_id_from_header(result.response.headers['Location']) - result = protection_container_refresh_operation_results_client.get(vault_name, resource_group, fabric_name, - operation_id, raw=True) + result = sdk_no_wait(True, protection_container_refresh_operation_results_client.get, + vault_name, resource_group, fabric_name, operation_id) while result.response.status_code == 202: time.sleep(1) - result = protection_container_refresh_operation_results_client.get(vault_name, resource_group, fabric_name, - operation_id, raw=True) + result = sdk_no_wait(True, protection_container_refresh_operation_results_client.get, + vault_name, resource_group, fabric_name, operation_id) def _job_in_progress(job_status): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/azure_cli_backup.egg-info/PKG-INFO new/azure-cli-backup-1.1.1/azure_cli_backup.egg-info/PKG-INFO --- old/azure-cli-backup-1.0.6/azure_cli_backup.egg-info/PKG-INFO 2018-01-12 18:26:09.000000000 +0100 +++ new/azure-cli-backup-1.1.1/azure_cli_backup.egg-info/PKG-INFO 2018-04-06 19:33:41.000000000 +0200 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: azure-cli-backup -Version: 1.0.6 +Version: 1.1.1 Summary: Microsoft Azure Command-Line Tools Recovery Services Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT +Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'backup' Command Module =========================================== @@ -20,6 +21,41 @@ Release History =============== + 1.1.1 + +++++ + + * `sdist` is now compatible with wheel 0.31.0 + + 1.1.0 + +++++ + * Added new command 'az backup protection isenabled-for-vm'. This command can be used to check if a VM is backed up by any vault in the subscription. + * Enabled --ids for vault_name and resource_group parameters for the following commands: + az backup container show + az backup item set-policy + az backup item show + az backup job show + az backup job stop + az backup job wait + az backup policy delete + az backup policy get-default-for-vm + az backup policy list-associated-items + az backup policy set + az backup policy show + az backup protection backup-now + az backup protection disable + az backup protection enable-for-vm + az backup recoverypoint show + az backup restore files mount-rp + az backup restore files unmount-rp + az backup restore restore-disks + az backup vault delete + az backup vault show + * 'name' parameters now accept the name format as output from the show commands. + + 1.0.7 + +++++ + * Support Autorest 3.0 based SDKs + 1.0.6 +++++ * New feature: 'az backup item list' command now has '--container-name' parameter as optional instead of mandatory and output contains item health details. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-backup-1.0.6/setup.py new/azure-cli-backup-1.1.1/setup.py --- old/azure-cli-backup-1.0.6/setup.py 2018-01-12 18:25:22.000000000 +0100 +++ new/azure-cli-backup-1.1.1/setup.py 2018-04-06 19:33:13.000000000 +0200 @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "1.0.6" +VERSION = "1.1.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers
