-
Notifications
You must be signed in to change notification settings - Fork 1.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
{Quota}Generate quota with codegen #4475
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
843c279
{Quota}Generate quota with codegen
ZengTaoxu 37b4187
Update setup.py
ZengTaoxu 4cd3560
Update test_quota_crud.yaml
ZengTaoxu 6afebd5
Update test_quota_crud.yaml
ZengTaoxu 7b80f1a
Update
ZengTaoxu 96103ec
Update
ZengTaoxu 8279754
Update _help.py
ZengTaoxu f37cc68
Update _help.py
ZengTaoxu 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
0.1.0 | ||
++++++ | ||
* Initial release. |
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,128 @@ | ||
# Azure CLI quota Extension # | ||
This is the extension for quota | ||
|
||
### How to use ### | ||
Install this extension using the below CLI command | ||
``` | ||
az extension add --name quota | ||
``` | ||
|
||
### Included Features ### | ||
#### quota usage #### | ||
##### List ##### | ||
``` | ||
az quota usage list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### List ##### | ||
``` | ||
az quota usage list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### List ##### | ||
``` | ||
az quota usage list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota usage show --resource-name "standardNDSFamily" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota usage show --resource-name "MinPublicIpInterNetworkPrefixLength" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
#### quota #### | ||
##### Create ##### | ||
``` | ||
az quota create \ | ||
--properties "{\\"name\\":{\\"value\\":\\"MinPublicIpInterNetworkPrefixLength\\"},\\"limit\\":{\\"limitObjectType\\":\\"LimitValue\\",\\"value\\":10},\\"resourceType\\":\\"MinPublicIpInterNetworkPrefixLength\\"}" \ | ||
--resource-name "MinPublicIpInterNetworkPrefixLength" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### Create ##### | ||
``` | ||
az quota create \ | ||
--properties "{\\"name\\":{\\"value\\":\\"StandardSkuPublicIpAddresses\\"},\\"limit\\":{\\"limitObjectType\\":\\"LimitValue\\",\\"value\\":10},\\"resourceType\\":\\"PublicIpAddresses\\"}" \ | ||
--resource-name "StandardSkuPublicIpAddresses" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### Create ##### | ||
``` | ||
az quota create \ | ||
--properties "{\\"name\\":{\\"value\\":\\"standardFSv2Family\\"},\\"limit\\":{\\"limitObjectType\\":\\"LimitValue\\",\\"value\\":10}}" \ | ||
--resource-name "standardFSv2Family" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Create ##### | ||
``` | ||
az quota create \ | ||
--properties "{\\"name\\":{\\"value\\":\\"TotalLowPriorityCores\\"},\\"limit\\":{\\"limitObjectType\\":\\"LimitValue\\",\\"value\\":10},\\"resourceType\\":\\"lowPriority\\"}" \ | ||
--resource-name "TotalLowPriorityCores" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.MachineLearningServices/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota show --resource-name "MinPublicIpInterNetworkPrefixLength" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### List ##### | ||
``` | ||
az quota list --scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### List ##### | ||
``` | ||
az quota list --scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### List ##### | ||
``` | ||
az quota list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota show --resource-name "standardNDSFamily" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Update ##### | ||
``` | ||
az quota update \ | ||
--properties "{\\"name\\":{\\"value\\":\\"standardFSv2Family\\"},\\"limit\\":{\\"limitObjectType\\":\\"LimitValue\\",\\"value\\":10}}" \ | ||
--resource-name "standardFSv2Family" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Update ##### | ||
``` | ||
az quota update \ | ||
--properties "{\\"name\\":{\\"value\\":\\"MinPublicIpInterNetworkPrefixLength\\"},\\"limit\\":{\\"limitObjectType\\":\\"LimitValue\\",\\"value\\":10},\\"resourceType\\":\\"MinPublicIpInterNetworkPrefixLength\\"}" \ | ||
--resource-name "MinPublicIpInterNetworkPrefixLength" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
#### quota quotarequeststatus #### | ||
##### List ##### | ||
``` | ||
az quota quotarequeststatus list \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota quotarequeststatus show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota quotarequeststatus show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota quotarequeststatus show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
#### quota quotaoperation #### | ||
##### List ##### | ||
``` | ||
az quota quotaoperation list | ||
``` |
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,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_quota._help | ||
from azure.cli.core import AzCommandsLoader | ||
|
||
|
||
class AzureQuotaExtensionAPICommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azext_quota.generated._client_factory import cf_quota_cl | ||
quota_custom = CliCommandType( | ||
operations_tmpl='azext_quota.custom#{}', | ||
client_factory=cf_quota_cl) | ||
parent = super(AzureQuotaExtensionAPICommandsLoader, self) | ||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=quota_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_quota.generated.commands import load_command_table | ||
load_command_table(self, args) | ||
try: | ||
from azext_quota.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_quota.generated._params import load_arguments | ||
load_arguments(self, command) | ||
try: | ||
from azext_quota.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 = AzureQuotaExtensionAPICommandsLoader |
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,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 |
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,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 |
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,4 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.15.0" | ||
} |
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,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 |
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,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__) |
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,33 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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_quota_cl(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azext_quota.vendored_sdks.quota import AzureQuotaExtensionAPI | ||
return get_mgmt_service_client(cli_ctx, | ||
AzureQuotaExtensionAPI, | ||
subscription_bound=False) | ||
|
||
|
||
def cf_usage(cli_ctx, *_): | ||
return cf_quota_cl(cli_ctx).usages | ||
|
||
|
||
def cf_quota(cli_ctx, *_): | ||
return cf_quota_cl(cli_ctx).quota | ||
|
||
|
||
def cf_quotarequeststatus(cli_ctx, *_): | ||
return cf_quota_cl(cli_ctx).quotarequeststatus | ||
|
||
|
||
def cf_quotaoperation(cli_ctx, *_): | ||
return cf_quota_cl(cli_ctx).quotaoperation |
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.
Why the help is duplicated?
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.
It has been modified.