Skip to content

Commit

Permalink
Change Analysis CLI support (#4931)
Browse files Browse the repository at this point in the history
* add Change Analysis CLI

* regenerate code with the latest version of CodeGen tool

* Add code owner name

* add service name and address cr feedback
  • Loading branch information
LinglingTong authored Jun 9, 2022
1 parent e1e8a87 commit 64d0e9e
Show file tree
Hide file tree
Showing 21 changed files with 949 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,5 @@
/src/spring/ @yuwzho

/src/containerapp-compose/ @smurawski @jldeen

/src/change-analysis/ @linglingtong
8 changes: 8 additions & 0 deletions src/change-analysis/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
28 changes: 28 additions & 0 deletions src/change-analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Azure CLI ChangeAnalysis Extension #
This is an extension to Azure CLI to manage ChangeAnalysis resources.

## How to use ##
Install this extension using the below CLI command
```
az extension add --name change-analysis
```
### Included Features
#### List changes for resources:

##### List the changes of a subscription within the specific time range.

```
az change-analysis list --start-time '05/24/2022 8:43:36' --end-time '05/25/2022 9:46:36'
```

##### List the changes of a resource group within the specific time range

```
az change-analysis list -g [ResourceGroup] --start-time '05/24/2022 8:43:36' --end-time '05/25/2022 9:46:36'
```

##### List the changes of a resource within the specified time range

```
az change-analysis list-by-resource -r [ResourceId] --start-time '05/24/2022 8:43:36' --end-time '05/25/2022 9:46:36'
```
42 changes: 42 additions & 0 deletions src/change-analysis/azext_change_analysis/__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_change_analysis._help import helps # pylint: disable=unused-import


class ChangeAnalysisCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_command_type = CliCommandType(
operations_tmpl='azext_change_analysis.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)

def load_command_table(self, args):
from azext_change_analysis.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_change_analysis._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = ChangeAnalysisCommandsLoader
11 changes: 11 additions & 0 deletions src/change-analysis/azext_change_analysis/_help.py
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: disable=line-too-long
# pylint: disable=too-many-lines

from knack.help_files import helps # pylint: disable=unused-import
13 changes: 13 additions & 0 deletions src/change-analysis/azext_change_analysis/_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
6 changes: 6 additions & 0 deletions src/change-analysis/azext_change_analysis/aaz/__init__.py
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,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,23 @@
# --------------------------------------------------------------------------------------------
# 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(
"change-analysis",
)
class __CMDGroup(AAZCommandGroup):
"""List changes for resources
"""
pass


__all__ = ["__CMDGroup"]
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: skip-file
# flake8: noqa

from .__cmd_group import *
from ._list import *
from ._list_by_resource import *
Loading

0 comments on commit 64d0e9e

Please sign in to comment.