-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add management groups commands to azure-cli-resource #6426
Merged
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ae58bff
Add mgmt groups to resource, use latest SDK, update tests
rajshah11 42376be
Bump up version and edit history
rajshah11 89210ef
Add wheel file
rajshah11 07e1bf3
style check
rajshah11 80d08ab
Changes suggested in PR/after review
rajshah11 972a0e6
More changes suggested in the PR and rerun tests
rajshah11 6d06867
Style check
rajshah11 25e6137
Some build fixes
rajshah11 9a9566c
Minor fix
rajshah11 21ddb6b
Fix build errors, rerun tests in prod, update help
rajshah11 4266a02
Merge branch 'dev' of https://github.com/Azure/azure-cli into cli-mgm…
rajshah11 698c379
Supress extension
rajshah11 e73a0a6
Remove private whl file
rajshah11 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
Binary file added
BIN
+59.7 KB
privates/azure_mgmt_managementgroups-2018_03_01_preview-py2.py3-none-any.whl
Binary file not shown.
This file contains 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 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
19 changes: 19 additions & 0 deletions
19
...mmand_modules/azure-cli-resource/azure/cli/command_modules/resource/_exception_handler.py
This file contains 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,19 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core.util import CLIError | ||
|
||
|
||
def managementgroups_exception_handler(ex): | ||
from azure.mgmt.managementgroups.models import ErrorResponseException | ||
if isinstance(ex, ErrorResponseException): | ||
if ex.error.error: | ||
raise CLIError(ex.error.error) | ||
else: | ||
raise CLIError(ex.error) | ||
else: | ||
import sys | ||
from six import reraise | ||
reraise(*sys.exc_info()) |
This file contains 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 |
---|---|---|
|
@@ -152,6 +152,155 @@ | |
text: > | ||
az account lock update --name lockName --notes newNotesHere --lock-type CanNotDelete | ||
""" | ||
helps['account management-group'] = """ | ||
type: group | ||
short-summary: Manage Azure Management Groups. | ||
""" | ||
|
||
helps['account management-group subscription'] = """ | ||
type: group | ||
short-summary: Subscription operations for Management Groups. | ||
""" | ||
|
||
helps['account management-group list'] = """ | ||
type: command | ||
short-summary: List all management groups. | ||
long-summary: List of all management groups in the current tenant. | ||
examples: | ||
- name: List all management groups | ||
text: > | ||
az managementgroups group list | ||
""" | ||
|
||
helps['account management-group show'] = """ | ||
type: command | ||
short-summary: Get a specific management group. | ||
long-summary: Get the details of the management group. | ||
parameters: | ||
- name: --name -n | ||
type: string | ||
short-summary: Name of the management group. | ||
- name: --expand -e | ||
type: bool | ||
short-summary: If given, lists the children in the first level of hierarchy. | ||
- name: --recurse -r | ||
type: bool | ||
short-summary: If given, lists the children in all levels of hierarchy. | ||
examples: | ||
- name: Get a management group. | ||
text: > | ||
az managementgroups group show --name GroupName | ||
- name: Get a management group with children in the first level of hierarchy. | ||
text: > | ||
az managementgroups group show --name GroupName -e | ||
- name: Get a management group with children in all levels of hierarchy. | ||
text: > | ||
az managementgroups group show --name GroupName -e -r | ||
""" | ||
|
||
helps['account management-group create'] = """ | ||
type: command | ||
short-summary: Create a new management group. | ||
long-summary: Create a new management group. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
parameters: | ||
- name: --name -n | ||
type: string | ||
short-summary: Name of the management group. | ||
- name: --display-name -d | ||
type: string | ||
short-summary: Sets the display name of the management group. If null, the group name is set as the display name. | ||
- name: --parent -p | ||
type: string | ||
short-summary: Sets the parent of the management group. Can be the fully qualified id or the name of the management group. If null, the root tenant group is set as the parent. | ||
examples: | ||
- name: Create a new management group. | ||
text: > | ||
az managementgroups group create --name GroupName | ||
- name: Create a new management group with a specific display name. | ||
text: > | ||
az managementgroups group create --name GroupName --display-name DisplayName | ||
- name: Create a new management group with a specific parent id. | ||
text: > | ||
az managementgroups group create --name GroupName --parent ParentId/ParentName | ||
- name: Create a new management group with a specific display name and parent id. | ||
text: > | ||
az managementgroups group create --name GroupName --display-name DisplayName --parent ParentId/ParentName | ||
""" | ||
|
||
helps['account management-group update'] = """ | ||
type: command | ||
short-summary: Update an existing management group. | ||
long-summary: Update an existing management group. | ||
parameters: | ||
- name: --name -n | ||
type: string | ||
short-summary: Name of the management group. | ||
- name: --display-name -d | ||
type: string | ||
short-summary: Updates the display name of the management group. If null, no change is made. | ||
- name: --parent -p | ||
type: string | ||
short-summary: Update the parent of the management group. Can be the fully qualified id or the name of the management group. If null, no change is made. | ||
examples: | ||
- name: Update an existing management group with a specific display name. | ||
text: > | ||
az managementgroups group update --name GroupName --display-name DisplayName | ||
- name: Update an existing management group with a specific parent id. | ||
text: > | ||
az managementgroups group update --name GroupName --parent ParentId/ParentName | ||
- name: Update an existing management group with a specific display name and parent id. | ||
text: > | ||
az managementgroups group update --name GroupName --display-name DisplayName --parent ParentId/ParentName | ||
""" | ||
|
||
helps['account management-group delete'] = """ | ||
type: command | ||
short-summary: Delete an existing management group. | ||
long-summary: Delete an existing management group. | ||
parameters: | ||
- name: --name -n | ||
type: string | ||
short-summary: Name of the management group. | ||
examples: | ||
- name: Delete an existing management group | ||
text: > | ||
az managementgroups group delete --name GroupName | ||
""" | ||
|
||
helps['account management-group subscription add'] = """ | ||
type: command | ||
short-summary: Add a subscription to a management group. | ||
long-summary: Add a subscription to a management group. | ||
parameters: | ||
- name: --name -n | ||
type: string | ||
short-summary: Name of the management group. | ||
- name: --subscription | ||
type: string | ||
short-summary: Subscription Id or Name | ||
examples: | ||
- name: Add a subscription to a management group. | ||
text: > | ||
az managementgroups group new --name GroupName --subscription Subscription | ||
""" | ||
|
||
helps['account management-group subscription remove'] = """ | ||
type: command | ||
short-summary: Remove an existing subscription from a management group. | ||
long-summary: Remove an existing subscription from a management group. | ||
parameters: | ||
- name: --name -n | ||
type: string | ||
short-summary: Name of the management group. | ||
- name: --subscription | ||
type: string | ||
short-summary: Subscription Id or Name | ||
examples: | ||
- name: Remove an existing subscription from a management group. | ||
text: > | ||
az managementgroups group remove --name GroupName --subscription Subscription | ||
""" | ||
|
||
helps['policy'] = """ | ||
type: group | ||
short-summary: Manage resource policies. | ||
|
This file contains 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be more explicit especially since these commands live in the command tree that is predominantly in a different module.
"* add
account management-group
commands."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok will make this change. Also, just checked the travis build. Will make the changes.