-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Az.ComputeLimit CLI extension for shared-limit and guest-subscription #9718
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
Merged
yanzhudd
merged 4 commits into
Azure:main
from
deepnandu:deep/continue-feature-computelimit
Apr 7, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a2c85d2
changes for adding computelimit extension
e23a739
Add guest-subscription commands, tests for computelimit extension
ab81d6e
Add computelimit service entry to service_name.json
52ad39e
Update README.md and service_name.json for computelimit extension
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
This file contains hidden or 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,10 @@ | ||
| .. :changelog: | ||
|
|
||
| Release History | ||
| =============== | ||
|
|
||
| 1.0.0b1 | ||
| ++++++ | ||
| * Initial release. | ||
| * Add shared-limit commands (add, remove, show, list). | ||
| * Add guest-subscription commands (add, remove, show, list). |
This file contains hidden or 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,64 @@ | ||
| # Azure CLI Computelimit Extension # | ||
| This is an extension to Azure CLI to manage Computelimit resources. | ||
|
|
||
| ## How to use ## | ||
| Install the Computelimit extension using the CLI command below | ||
|
|
||
| ``` | ||
| az extension add --name computelimit | ||
| ``` | ||
|
|
||
| ### Included features ### | ||
| There are 2 groups of compute limit operations that customers can perform on their host subscription | ||
|
|
||
| **Guest Subscription Operations:** These type of operations are to add/remove/get guest subscriptions that are added to the host subscription to shared compute limits. | ||
|
|
||
| **Shared Limit Operations:** These type of operations are to enable/disable/get compute limits that are enabled for sharing with the guest subscriptions. | ||
|
|
||
| #### Add a subscription as a guest to the host subscription. #### | ||
|
|
||
| ```bash | ||
| az computelimit guest-subscription add --location eastus --guest-subscription-id 11111111-1111-1111-1111-111111111111 | ||
| ``` | ||
|
|
||
| #### Remove a subscription as a guest to the host subscription. #### | ||
|
|
||
| ```bash | ||
| az computelimit guest-subscription remove --location eastus --guest-subscription-id 11111111-1111-1111-1111-111111111111 | ||
| ``` | ||
|
deepnandu marked this conversation as resolved.
|
||
|
|
||
| #### Get a guest subscription added to the host subscription. #### | ||
|
|
||
| ```bash | ||
| az computelimit guest-subscription show --location eastus --guest-subscription-id 11111111-1111-1111-1111-111111111111 | ||
| ``` | ||
|
deepnandu marked this conversation as resolved.
|
||
|
|
||
| #### List all guest subscriptions added to the host subscription. #### | ||
|
|
||
| ```bash | ||
| az computelimit guest-subscription list --location eastus | ||
| ``` | ||
|
|
||
| #### Enable a compute limit to be shared by the host subscription with its guest subscriptions. #### | ||
|
|
||
| ```bash | ||
| az computelimit shared-limit add --location eastus --name StandardDSv3Family | ||
| ``` | ||
|
deepnandu marked this conversation as resolved.
|
||
|
|
||
| #### Disable sharing of a compute limit by the host subscription with its guest subscriptions. #### | ||
|
|
||
| ```bash | ||
| az computelimit shared-limit remove --location eastus --name StandardDSv3Family | ||
| ``` | ||
|
|
||
| #### Get a compute limit shared by the host subscription with its guest subscriptions. #### | ||
|
|
||
| ```bash | ||
| az computelimit shared-limit show --location eastus --name StandardDSv3Family | ||
| ``` | ||
|
|
||
| #### List all compute limits shared by the host subscription with its guest subscriptions. #### | ||
|
|
||
| ```bash | ||
| az computelimit shared-limit list --location eastus | ||
| ``` | ||
|
deepnandu marked this conversation as resolved.
|
||
This file contains hidden or 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,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_computelimit._help import helps # pylint: disable=unused-import | ||
|
|
||
|
|
||
| class ComputelimitCommandsLoader(AzCommandsLoader): | ||
|
|
||
| def __init__(self, cli_ctx=None): | ||
| from azure.cli.core.commands import CliCommandType | ||
| custom_command_type = CliCommandType( | ||
| operations_tmpl='azext_computelimit.custom#{}') | ||
| super().__init__(cli_ctx=cli_ctx, | ||
| custom_command_type=custom_command_type) | ||
|
|
||
| def load_command_table(self, args): | ||
| from azext_computelimit.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_computelimit._params import load_arguments | ||
| load_arguments(self, command) | ||
|
|
||
|
|
||
| COMMAND_LOADER_CLS = ComputelimitCommandsLoader |
This file contains hidden or 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,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 |
This file contains hidden or 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,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 |
This file contains hidden or 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,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 | ||
| # -------------------------------------------------------------------------------------------- |
10 changes: 10 additions & 0 deletions
10
src/computelimit/azext_computelimit/aaz/latest/__init__.py
This file contains hidden or 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,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 | ||
|
|
24 changes: 24 additions & 0 deletions
24
src/computelimit/azext_computelimit/aaz/latest/computelimit/__cmd_group.py
This file contains hidden or 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,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( | ||
| "computelimit", | ||
| is_preview=True, | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage compute shared limit resources | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
11 changes: 11 additions & 0 deletions
11
src/computelimit/azext_computelimit/aaz/latest/computelimit/__init__.py
This file contains hidden or 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,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 * |
24 changes: 24 additions & 0 deletions
24
...computelimit/azext_computelimit/aaz/latest/computelimit/guest_subscription/__cmd_group.py
This file contains hidden or 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,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( | ||
| "computelimit guest-subscription", | ||
| is_preview=True, | ||
| ) | ||
| class __CMDGroup(AAZCommandGroup): | ||
| """Manage Guest Subscription | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| __all__ = ["__CMDGroup"] |
15 changes: 15 additions & 0 deletions
15
src/computelimit/azext_computelimit/aaz/latest/computelimit/guest_subscription/__init__.py
This file contains hidden or 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,15 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 ._add import * | ||
| from ._list import * | ||
| from ._remove import * | ||
| from ._show import * |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.