Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
301c52c
Commiting new managementgroup cli extension in the forked az-cli repo…
git-thomasdolan Nov 30, 2021
0aecb69
Working version, ready to submit PR into Azure CLI repo
git-thomasdolan Dec 7, 2021
64a6029
Committing files that were changed that did not appear in the previou…
git-thomasdolan Dec 7, 2021
62caf25
Removing managementgroups/src/managementgroup directory that I accide…
git-thomasdolan Dec 7, 2021
4d03fb2
Re-ran recordings to show that no errors took place
git-thomasdolan Dec 8, 2021
616dab5
Ran tests again so they pass in record mode
git-thomasdolan Dec 9, 2021
b55defa
Shorted variable names so it would pass linter, fix scenario tests as…
git-thomasdolan Dec 9, 2021
ff65c0a
Added ManagementGroup to service_name.json
git-thomasdolan Dec 9, 2021
06147ef
Merge branch 'main' into thomasdolan/old_swagger_test
git-thomasdolan Dec 9, 2021
e273b3f
Passed style check
git-thomasdolan Dec 9, 2021
25015cd
Merge branch 'thomasdolan/old_swagger_test' of https://github.com/git…
git-thomasdolan Dec 9, 2021
96bb751
Removed redunant tests
git-thomasdolan Dec 9, 2021
c5418de
Update service_name.json
git-thomasdolan Dec 10, 2021
8acc274
Update CODEOWNERS
git-thomasdolan Dec 10, 2021
c867321
Update README.md
git-thomasdolan Dec 10, 2021
8456350
Merge https://github.com/Azure/azure-cli-extensions into thomasdolan/…
git-thomasdolan Dec 10, 2021
a87d723
Merge branch 'main' into thomasdolan/old_swagger_test
git-thomasdolan Jan 3, 2022
501fae8
Added unit tests for management-group-subscription and hierarchy-setting
git-thomasdolan Jan 6, 2022
c2a19cc
Updating local repo with remote
git-thomasdolan Jan 6, 2022
8e9931f
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
967ec64
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
2af1d70
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
1e5c085
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
0016c90
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
8cfc04c
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
16088c8
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
7f0e39f
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
fb9f63c
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
029b606
Update src/managementgroup/azext_managementgroup/generated/_help.py
git-thomasdolan Jan 7, 2022
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 @@ -219,3 +219,5 @@
/src/image-gallery/ @zhoxing-ms

/src/init/ @zhoxing-ms @HuangYT2000

/src/managementgroup/ @kairu-ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@git-thomasdolan Just out of curiosity, is this extension the owned by your team or Azure CLI team?
If your team is responsible for it's development and maintenance, the owner should be a member from your team

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I generated the commands, I can put myself as an owner

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

Release History
===============

0.1.0
++++++
* Initial release.
109 changes: 109 additions & 0 deletions src/managementgroup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Azure CLI managementgroup Extension #
This is the extension for managementgroup

### How to use ###
Install this extension using the below CLI command
```
az extension add --name managementgroup
```

### Included Features ###
#### managementgroup management-group ####
##### Create #####
```
az managementgroup management-group create --display-name "ChildGroup" \
--id "/providers/Microsoft.Management/managementGroups/ParentGroup" --group-id "ChildGroup"
```
##### Show #####
```
az managementgroup management-group show --group-id "20000000-0001-0000-0000-000000000000"
```
##### Show #####
```
az managementgroup management-group show --expand "ancestors" --group-id "20000000-0001-0000-0000-00000000000"
```
##### Show #####
```
az managementgroup management-group show --expand "children" --group-id "20000000-0001-0000-0000-000000000000"
```
##### Show #####
```
az managementgroup management-group show --expand "path" --group-id "20000000-0001-0000-0000-000000000000"
```
##### Show #####
```
az managementgroup management-group show --expand "children" --recurse true \
--group-id "20000000-0001-0000-0000-000000000000"
```
Comment on lines +17 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show

Could we have a more detailed description of this title, or could we put similar contents together under one title

##### List #####
```
az managementgroup management-group list
```
##### Update #####
```
az managementgroup management-group update --group-id "ChildGroup" --display-name "AlternateDisplayName" \
--parent-group-id "/providers/Microsoft.Management/managementGroups/AlternateParentGroup"
```
##### Show-descendant #####
```
az managementgroup management-group show-descendant --group-id "20000000-0000-0000-0000-000000000000"
```
##### Delete #####
```
az managementgroup management-group delete --group-id "GroupToDelete"
```
#### managementgroup management-group-subscription ####
##### Create #####
```
az managementgroup management-group-subscription create --group-id "Group" \
--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
```
##### Show-subscription #####
```
az managementgroup management-group-subscription show-subscription --group-id "Group" \
--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
```
##### Show-subscription-under-management-group #####
```
az managementgroup management-group-subscription show-subscription-under-management-group --group-id "Group"
```
##### Delete #####
```
az managementgroup management-group-subscription delete --group-id "Group" \
--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
```
#### managementgroup hierarchy-setting ####
##### Create #####
```
az managementgroup hierarchy-setting create --group-id "root"
```
##### Show #####
```
az managementgroup hierarchy-setting show --group-id "root"
```
##### List #####
```
az managementgroup hierarchy-setting list --group-id "root"
```
##### Update #####
```
az managementgroup hierarchy-setting update --group-id "root"
```
##### Delete #####
```
az managementgroup hierarchy-setting delete --group-id "root"
```
#### managementgroup ####
##### Start-tenant-backfill #####
```
az managementgroup start-tenant-backfill
```
##### Tenant-backfill-status #####
```
az managementgroup tenant-backfill-status
```
#### managementgroup entity ####
##### List #####
```
az managementgroup entity list
```
53 changes: 53 additions & 0 deletions src/managementgroup/azext_managementgroup/__init__.py
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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=unused-import

import azext_managementgroup._help
from azure.cli.core import AzCommandsLoader


class ManagementGroupsAPICommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_managementgroup.generated._client_factory import cf_managementgroup_cl
managementgroup_custom = CliCommandType(
operations_tmpl='azext_managementgroup.custom#{}',
client_factory=cf_managementgroup_cl)
parent = super(ManagementGroupsAPICommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=managementgroup_custom)

def load_command_table(self, args):
from azext_managementgroup.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_managementgroup.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError as e:
if e.name.endswith('manual.commands'):
pass
else:
raise e
return self.command_table

def load_arguments(self, command):
from azext_managementgroup.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_managementgroup.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError as e:
if e.name.endswith('manual._params'):
pass
else:
raise e


COMMAND_LOADER_CLS = ManagementGroupsAPICommandsLoader
20 changes: 20 additions & 0 deletions src/managementgroup/azext_managementgroup/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
# pylint: disable=unused-import
from .generated._help import helps # pylint: disable=reimported
try:
from .manual._help import helps # pylint: disable=reimported
except ImportError as e:
if e.name.endswith('manual._help'):
pass
else:
raise e
20 changes: 20 additions & 0 deletions src/managementgroup/azext_managementgroup/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError as e:
if e.name.endswith('manual.action'):
pass
else:
raise e
4 changes: 4 additions & 0 deletions src/managementgroup/azext_managementgroup/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
20 changes: 20 additions & 0 deletions src/managementgroup/azext_managementgroup/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError as e:
if e.name.endswith('manual.custom'):
pass
else:
raise e
12 changes: 12 additions & 0 deletions src/managementgroup/azext_managementgroup/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# --------------------------------------------------------------------------
# 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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_managementgroup_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_managementgroup.vendored_sdks.managementgroup import ManagementGroupsAPI
return get_mgmt_service_client(cli_ctx,
ManagementGroupsAPI,
subscription_bound=False,
base_url_bound=True)


def cf_management_group(cli_ctx, *_):
return cf_managementgroup_cl(cli_ctx).management_groups


def cf_management_group_subscription(cli_ctx, *_):
return cf_managementgroup_cl(cli_ctx).management_group_subscriptions


def cf_hierarchy_setting(cli_ctx, *_):
return cf_managementgroup_cl(cli_ctx).hierarchy_settings


def cf_entity(cli_ctx, *_):
return cf_managementgroup_cl(cli_ctx).entities
Loading