Skip to content
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

[ReleasePR managementgroup] managementgroup wave4 #2784

Closed
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
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.
107 changes: 107 additions & 0 deletions src/managementgroup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# 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 --cache-control "no-cache" --display-name "ChildGroup" \
--group-id "ChildGroup"
```
##### Show #####
```
az managementgroup management-group show --cache-control "no-cache" --group-id "20000000-0001-0000-0000-000000000000"
```
##### Show #####
```
az managementgroup management-group show --expand "children" --cache-control "no-cache" \
--group-id "20000000-0001-0000-0000-000000000000"
```
##### Show #####
```
az managementgroup management-group show --expand "children" --recurse true --cache-control "no-cache" \
--group-id "20000000-0001-0000-0000-000000000000"
```
##### List #####
```
az managementgroup management-group list --cache-control "no-cache"
```
##### Update #####
```
az managementgroup management-group update --cache-control "no-cache" --group-id "ChildGroup" \
--display-name "AlternateDisplayName" \
--parent-group-id "/providers/Microsoft.Management/managementGroups/AlternateRootGroup"
```
##### Get-descendant #####
```
az managementgroup management-group get-descendant --group-id "20000000-0000-0000-0000-000000000000"
```
##### Delete #####
```
az managementgroup management-group delete --cache-control "no-cache" --group-id "GroupToDelete"
```
#### managementgroup management-group-subscription ####
##### Create #####
```
az managementgroup management-group-subscription create --cache-control "no-cache" --group-id "Group" \
--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
```
##### Get-subscription #####
```
az managementgroup management-group-subscription get-subscription --cache-control "no-cache" --group-id "Group" \
--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
```
##### Get-subscription-under-management-group #####
```
az managementgroup management-group-subscription get-subscription-under-management-group --group-id "Group"
```
##### Delete #####
```
az managementgroup management-group-subscription delete --cache-control "no-cache" --group-id "Group" \
--subscription-id "728bcbe4-8d56-4510-86c2-4921b8beefbc"
```
#### managementgroup hierarchy-setting ####
##### Create #####
```
az managementgroup hierarchy-setting create \
--default-management-group "/providers/Microsoft.Management/managementGroups/DefaultGroup" \
--require-authorization-for-group-creation true --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 \
--default-management-group "/providers/Microsoft.Management/managementGroups/DefaultGroup" \
--require-authorization-for-group-creation true --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
```
50 changes: 50 additions & 0 deletions src/managementgroup/azext_managementgroup/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_managementgroup.generated._help import helps # pylint: disable=unused-import
try:
from azext_managementgroup.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


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:
pass
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:
pass


COMMAND_LOADER_CLS = ManagementGroupsAPICommandsLoader
17 changes: 17 additions & 0 deletions src/managementgroup/azext_managementgroup/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# 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:
pass
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.11.0"
}
17 changes: 17 additions & 0 deletions src/managementgroup/azext_managementgroup/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# 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:
pass
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 ..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_group


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


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


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