def unregister_container(cmd, client, vault_name, resource_group_name, container_name, backup_management_type=None): containrs_client = backup_protection_containers_cf(cmd.cli_ctx) container = show_container(cmd, containrs_client, container_name, resource_group_name, vault_name, backup_management_type) if container.properties.backup_management_type.lower() == "azurestorage": custom_afs.unregister_afs_container(cmd, client, vault_name, resource_group_name, container.name)
def unregister_container(cmd, client, vault_name, resource_group_name, container_name, backup_management_type=None): container = None container_type = custom_help.validate_and_extract_container_type( container_name, backup_management_type) if not custom_help.is_native_name(container_name): containrs_client = backup_protection_containers_cf(cmd.cli_ctx) container = show_container(cmd, containrs_client, container_name, resource_group_name, vault_name, backup_management_type) container_name = container.name if container_type.lower() == "azurestorage": return custom_afs.unregister_afs_container(cmd, client, vault_name, resource_group_name, container_name) if container_type.lower() == "azureworkload": return custom_wl.unregister_wl_container(cmd, client, vault_name, resource_group_name, container_name) return None
def unregister_container(cmd, client, vault_name, resource_group_name, container_name, backup_management_type=None): container = None container_friendly_name = None container_type = custom_help.validate_and_extract_container_type( container_name, backup_management_type) containrs_client = backup_protection_containers_cf(cmd.cli_ctx) container = show_container(cmd, containrs_client, container_name, resource_group_name, vault_name, backup_management_type) container_name = container.name container_friendly_name = container.properties.friendly_name if container_type.lower() == "azurestorage": return custom_afs.unregister_afs_container(cmd, client, vault_name, resource_group_name, container_name) if container_type.lower() == "azureworkload": return custom_wl.unregister_wl_container(cmd, client, vault_name, resource_group_name, container_name) if container_type.lower() == "mab": mab_client = registered_identities_cf(cmd.cli_ctx) mab_client.delete(resource_group_name, vault_name, container_friendly_name) return None
def unregister_container(cmd, client, vault_name, resource_group_name, container_name, backup_management_type=None): container = None # container_friendly_name = None container_type = custom_help.validate_and_extract_container_type( container_name, backup_management_type) if not custom_help.is_native_name(container_name): containrs_client = backup_protection_containers_cf(cmd.cli_ctx) container = show_container(cmd, containrs_client, container_name, resource_group_name, vault_name, backup_management_type) container_name = container.name # container_friendly_name = container.properties.friendly_name if container_type.lower() == "azurestorage": return custom_afs.unregister_afs_container(cmd, client, vault_name, resource_group_name, container_name) if container_type.lower() == "azureworkload": return custom_wl.unregister_wl_container(cmd, client, vault_name, resource_group_name, container_name) # if container_type.lower() == "mab": # if container_friendly_name is None: # containrs_client = backup_protection_containers_cf(cmd.cli_ctx) # container = show_container(cmd, containrs_client, container_name, resource_group_name, vault_name, # backup_management_type) # container_friendly_name = container.properties.friendly_name # mab_client = registered_identities_cf(cmd.cli_ctx) # result = mab_client.delete(resource_group_name, vault_name, container_friendly_name, # cls=custom_help.get_pipeline_response) # return custom_help.track_mab_unregister_operation(cmd.cli_ctx, result, vault_name, resource_group_name, # container_name) return None