-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[backup] az backup vault deleted-vault: Implementing List and Undelete for Deleted Backup Vaults
#32306
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
Merged
zhoxing-ms
merged 30 commits into
Azure:dev
from
zubairabid:users/zubair/RSVVaultSoftDelete
Oct 28, 2025
Merged
[backup] az backup vault deleted-vault: Implementing List and Undelete for Deleted Backup Vaults
#32306
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
da1d89a
Initial code changes
ca2ebcc
Fix list, get, and undelete
e9cdb2b
list deleted containers works
969275d
azdev style now works
2f3328a
Initial test code
e957d2f
Merge remote-tracking branch 'upstream/dev' into users/zubair/RSVVaul…
0df0bdc
Update vault create to allow for new API operation
2dd0b71
The new tests work
85f04b1
Fix test RG name length
21bf9ee
Merge remote-tracking branch 'upstream/dev' into users/zubair/RSVVaul…
916aa37
Update src/azure-cli/azure/cli/command_modules/backup/_help.py
zubairabid 2296190
Update src/azure-cli/azure/cli/command_modules/backup/_help.py
zubairabid d9310bc
Reruns of most tests. Some VM and some AFS tests pending.
8da4253
Merge branch 'users/zubair/RSVVaultSoftDelete' of https://github.com/…
e767630
More passing tests
353f959
more pass
631e27d
Run encryption test in redbox
7555845
Run encryption test
zubairabid 408cf5a
All but one AFS test
93b86b2
Merge branch 'users/zubair/RSVVaultSoftDelete' of https://github.com/…
bc6d1bc
.
4de68f6
Using VM Pattern for ARG Queries.
zubairabid c4848d6
Rerun tests live
9cb8c75
Merge branch 'users/zubair/RSVVaultSoftDelete' of https://github.com/…
zubairabid 220975e
Rerun VSD test, switch AFS to live only
ac0b611
SQL CRR now run
7e594c9
Reconfigure test run now
zubairabid 438b94a
Merge branch 'users/zubair/RSVVaultSoftDelete' of https://github.com/…
zubairabid 8acd3dc
Merge remote-tracking branch 'upstream/dev' into users/zubair/RSVVaul…
zubairabid 39569ef
Linters work
zubairabid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/azure-cli/azure/cli/command_modules/backup/_arg_client.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| import json | ||
|
|
||
| from azure.cli.core.util import send_raw_request | ||
| from azure.cli.core.azclierror import HTTPError, AzureResponseError | ||
|
|
||
|
|
||
| class ARGClient: # pylint: disable=too-few-public-methods | ||
| """A lightweight Microsoft ARG API client. | ||
|
|
||
| For what ARG is, please see https://learn.microsoft.com/en-us/azure/governance/resource-graph/overview for details. | ||
| The reason for directly using this client to request REST is that ARG API does not return "nextLink" data, | ||
| so the Python SDK "azure-mgmt-resourcegraph" cannot support paging | ||
|
|
||
| """ | ||
|
|
||
| def __init__(self, cli_ctx): | ||
| self._cli_ctx = cli_ctx | ||
|
|
||
| self._endpoint = cli_ctx.cloud.endpoints.resource_manager.rstrip('/') | ||
| self._resource_provider_uri = 'providers/Microsoft.ResourceGraph/resources' | ||
| self._api_version = '2021-03-01' | ||
| self._method = 'post' | ||
|
|
||
| def send(self, query_body): | ||
| url = f'{self._endpoint}/{self._resource_provider_uri}?api-version={self._api_version}' | ||
|
|
||
| if isinstance(query_body, QueryBody): | ||
| # Serialize QueryBody object and ignore the None value | ||
| query_body = json.dumps(query_body, | ||
| default=lambda o: dict((key, value) for key, value in o.__dict__.items() if value)) | ||
|
|
||
| try: | ||
| response = send_raw_request(self._cli_ctx, self._method, url, body=query_body) | ||
| except HTTPError as ex: | ||
| raise AzureResponseError(ex.response.json()['error']['message'], ex.response) from ex | ||
| # Other exceptions like AuthenticationError should not be handled here, so we don't catch CLIError | ||
|
|
||
| if response.text: | ||
| return response.json() | ||
|
|
||
| return response | ||
|
|
||
|
|
||
| class QueryBody: # pylint: disable=too-few-public-methods | ||
|
|
||
| def __init__(self, query, options=None): | ||
| self.query = query | ||
| self.options = options |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.