Skip to content
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,5 @@
/src/carbon/ @itiinani

/src/amlfs/ @Aman-Jain-14 @amajai @mawhite @brpanask @tibanyas

/src/storage-discovery/ @shanefujs @calvinhzy
5 changes: 5 additions & 0 deletions src/service_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,11 @@
"AzureServiceName": "Azure Storage Actions",
"URL": "https://learn.microsoft.com/azure/storage-actions/"
},
{
"Command": "az storage-discovery",
"AzureServiceName": "Azure Storage Discovery",
"URL": "https://learn.microsoft.com/azure/storage-discovery/"
},
{
"Command": "az baremetalinstance",
"AzureServiceName": "BareMetal Infrastructure",
Expand Down
8 changes: 8 additions & 0 deletions src/storage-discovery/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

1.0.0b1
++++++
* Initial release.
56 changes: 56 additions & 0 deletions src/storage-discovery/README.md
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
```
42 changes: 42 additions & 0 deletions src/storage-discovery/azext_storage_discovery/__init__.py
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
61 changes: 61 additions & 0 deletions src/storage-discovery/azext_storage_discovery/_help.py
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"
"""
13 changes: 13 additions & 0 deletions src/storage-discovery/azext_storage_discovery/_params.py
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
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
# --------------------------------------------------------------------------------------------
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

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"]
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 *
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"]
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 *
Loading
Loading