-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Storage-Discovery] 2025-06-01-preivew initial preview #8954
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f0b4546
[storage-discovery] 06-01-preivew cli extension
shanefujs 16be50d
add azext_storage_discovery tests and recordings
shanefujs 8c2e231
Add help.py for azext_storage_discovery
shanefujs 70dd282
split test into test_<module>_<feature>
shanefujs 06ae52a
add examples for all workspace features
shanefujs 69afede
add storage-discovery to service_name.json
shanefujs a2e73c3
update README and examples
shanefujs 7f126f4
update test cases and recordings
shanefujs 6602e10
add codeowner
calvinhzy ffd3d5c
add codeowner
calvinhzy 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .. :changelog: | ||
| Release History | ||
| =============== | ||
|
|
||
| 1.0.0b1 | ||
| ++++++ | ||
| * Initial release. |
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,56 @@ | ||
| # Azure CLI StorageDiscovery Extension # | ||
| This is an extension to Azure CLI to manage StorageDiscovery resources. | ||
|
|
||
| ## How to use ## | ||
| ### az storage-discovery workspace create ### | ||
| ```commandline | ||
| az storage-discovery workspace create \ | ||
| --resource-group myRG \ | ||
| --name myWorkspace \ | ||
| --location francecentral \ | ||
| --workspace-roots "/subscriptions/mySubId/resourceGroups/myRG" \ | ||
| --scopes '[{"displayName":"basic","resourceTypes":["Microsoft.Storage/storageAccounts"]}]' | ||
| ``` | ||
|
|
||
| ### az storage-discovery workspace create (with full configuration) ### | ||
| ```commandline | ||
| az storage-discovery workspace create \ | ||
| --resource-group myRG \ | ||
| --name myWorkspace \ | ||
| --location francecentral \ | ||
| --description "My workspace for storage discovery" \ | ||
| --sku Standard \ | ||
| --workspace-roots "/subscriptions/mySubId/resourceGroups/myRG" \ | ||
| --scopes '[{"displayName":"production","resourceTypes":["Microsoft.Storage/storageAccounts"],"tagKeysOnly":["environment"],"tags":{"project":"demo","tier":"prod"}}]' | ||
| ``` | ||
|
|
||
| ### az storage-discovery workspace show ### | ||
| ```commandline | ||
| az storage-discovery workspace show --resource-group myRG --name myWorkspace | ||
| ``` | ||
|
|
||
| ### az storage-discovery workspace update ### | ||
| ```commandline | ||
| az storage-discovery workspace update \ | ||
| --resource-group myRG \ | ||
| --name myWorkspace \ | ||
| --description "Updated description" \ | ||
| --sku Free \ | ||
| --scopes '[{"displayName":"updated","resourceTypes":["Microsoft.Storage/storageAccounts"],"tags":{"environment":"test"}}]' \ | ||
| --tags environment=production team=storage | ||
| ``` | ||
|
|
||
| ### az storage-discovery workspace list ### | ||
| ```commandline | ||
| az storage-discovery workspace list --resource-group myRG | ||
| ``` | ||
|
|
||
| ### az storage-discovery workspace list (subscription level) ### | ||
| ```commandline | ||
| az storage-discovery workspace list | ||
| ``` | ||
|
|
||
| ### az storage-discovery workspace delete ### | ||
| ```commandline | ||
| az storage-discovery workspace delete --resource-group myRG --name myWorkspace | ||
| ``` |
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,42 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from azure.cli.core import AzCommandsLoader | ||
| from azext_storage_discovery._help import helps # pylint: disable=unused-import | ||
|
|
||
|
|
||
| class StorageDiscoveryCommandsLoader(AzCommandsLoader): | ||
|
|
||
| def __init__(self, cli_ctx=None): | ||
| from azure.cli.core.commands import CliCommandType | ||
| custom_command_type = CliCommandType( | ||
| operations_tmpl='azext_storage_discovery.custom#{}') | ||
| super().__init__(cli_ctx=cli_ctx, | ||
| custom_command_type=custom_command_type) | ||
|
|
||
| def load_command_table(self, args): | ||
| from azext_storage_discovery.commands import load_command_table | ||
| from azure.cli.core.aaz import load_aaz_command_table | ||
| try: | ||
| from . import aaz | ||
| except ImportError: | ||
| aaz = None | ||
| if aaz: | ||
| load_aaz_command_table( | ||
| loader=self, | ||
| aaz_pkg_name=aaz.__name__, | ||
| args=args | ||
| ) | ||
| load_command_table(self, args) | ||
| return self.command_table | ||
|
|
||
| def load_arguments(self, command): | ||
| from azext_storage_discovery._params import load_arguments | ||
| load_arguments(self, command) | ||
|
|
||
|
|
||
| COMMAND_LOADER_CLS = StorageDiscoveryCommandsLoader |
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,61 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: disable=line-too-long | ||
| # pylint: disable=too-many-lines | ||
|
|
||
| from knack.help_files import helps # pylint: disable=unused-import | ||
|
|
||
| helps['storage-discovery workspace create'] = """ | ||
| type: command | ||
| short-summary: Create a storage discovery workspace. | ||
| examples: | ||
| - name: Create a storage discovery workspace with basic settings. | ||
| text: | | ||
| az storage-discovery workspace create \\ | ||
| --resource-group myRG \\ | ||
| --name myWorkspace \\ | ||
| --location eastus2 \\ | ||
| --workspace-roots "/subscriptions/mySubId/resourceGroups/myRG" \\ | ||
| --scopes '[{"displayName":"basic","resourceTypes":["Microsoft.Storage/storageAccounts"]}]' | ||
| - name: Create a storage discovery workspace with full configuration. | ||
| text: | | ||
| az storage-discovery workspace create \\ | ||
| --resource-group myRG \\ | ||
| --name myWorkspace \\ | ||
| --location francecentral \\ | ||
| --description "My workspace for storage discovery" \\ | ||
| --sku Standard \\ | ||
| --workspace-roots "/subscriptions/mySubId/resourceGroups/myRG" \\ | ||
| --scopes '[{"displayName":"production","resourceTypes":["Microsoft.Storage/storageAccounts"],"tagKeysOnly":["environment"],"tags":{"project":"demo","tier":"prod"}}]' | ||
| """ | ||
|
|
||
| helps['storage-discovery workspace update'] = """ | ||
| type: command | ||
| short-summary: Update a storage discovery workspace. | ||
| examples: | ||
| - name: Update workspace description and SKU. | ||
| text: | | ||
| az storage-discovery workspace update \\ | ||
| --resource-group myRG \\ | ||
| --name myWorkspace \\ | ||
| --description "Updated description" \\ | ||
| --sku Free | ||
| - name: Update workspace with new scopes and tags. | ||
| text: | | ||
| az storage-discovery workspace update \\ | ||
| --resource-group myRG \\ | ||
| --name myWorkspace \\ | ||
| --scopes '[{"displayName":"updated","resourceTypes":["Microsoft.Storage/storageAccounts"],"tags":{"environment":"test"}}]' \\ | ||
| --tags environment=production team=storage | ||
| - name: Update workspace roots to subscription level. | ||
| text: | | ||
| az storage-discovery workspace update \\ | ||
| --resource-group myRG \\ | ||
| --name myWorkspace \\ | ||
| --workspace-roots "/subscriptions/mySubId" | ||
| """ |
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,13 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: disable=too-many-lines | ||
| # pylint: disable=too-many-statements | ||
|
|
||
|
|
||
| def load_arguments(self, _): # pylint: disable=unused-argument | ||
| pass | ||
6 changes: 6 additions & 0 deletions
6
src/storage-discovery/azext_storage_discovery/aaz/__init__.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,6 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- |
10 changes: 10 additions & 0 deletions
10
src/storage-discovery/azext_storage_discovery/aaz/latest/__init__.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,10 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
24 changes: 24 additions & 0 deletions
24
src/storage-discovery/azext_storage_discovery/aaz/latest/storage_discovery/__cmd_group.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,24 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| @register_command_group( | ||
| "storage-discovery", | ||
| is_preview=True, | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Storage Discovery | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
11 changes: 11 additions & 0 deletions
11
src/storage-discovery/azext_storage_discovery/aaz/latest/storage_discovery/__init__.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,11 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * |
24 changes: 24 additions & 0 deletions
24
...e-discovery/azext_storage_discovery/aaz/latest/storage_discovery/workspace/__cmd_group.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,24 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from azure.cli.core.aaz import * | ||
|
|
||
|
|
||
| @register_command_group( | ||
| "storage-discovery workspace", | ||
| is_preview=True, | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Storage Discovery Workspace | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
16 changes: 16 additions & 0 deletions
16
...rage-discovery/azext_storage_discovery/aaz/latest/storage_discovery/workspace/__init__.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,16 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 aaz-dev-tools | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: skip-file | ||
| # flake8: noqa | ||
|
|
||
| from .__cmd_group import * | ||
| from ._create import * | ||
| from ._delete import * | ||
| from ._list import * | ||
| from ._show import * | ||
| from ._update import * |
Oops, something went wrong.
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.