-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{Quota}Generate quota with codegen (#4475)
* {Quota}Generate quota with codegen * Update setup.py * Update test_quota_crud.yaml * Update test_quota_crud.yaml * Update * Update * Update _help.py * Update _help.py
- Loading branch information
Showing
48 changed files
with
7,159 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,112 @@ | ||
# 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-UsagesForCompute ##### | ||
``` | ||
az quota usage list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### List-UsagesForNetwork ##### | ||
``` | ||
az quota usage list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### List-UsagesMachineLearningServices ##### | ||
``` | ||
az quota usage list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus" | ||
``` | ||
##### Show-UsagesRequestForCompute ##### | ||
``` | ||
az quota usage show --resource-name "standardNDSFamily" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Show-UsagesRequestForNetwork ##### | ||
``` | ||
az quota usage show --resource-name "MinPublicIpInterNetworkPrefixLength" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
#### quota #### | ||
##### Create-ForNetwork ##### | ||
``` | ||
az quota create --resource-name "MinPublicIpInterNetworkPrefixLength" --scope "subscriptions/00000000-00\ | ||
00-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" \ | ||
--limit-object value=10 limit-object-type=LimitValue --resource-type MinPublicIpInterNetworkPrefixLength | ||
``` | ||
##### Create-ForNetworkStandardSkuPublicIpAddressesResource ##### | ||
``` | ||
az quota create --resource-name "StandardSkuPublicIpAddresses" --scope "subscriptions/00000000-0000-0000\ | ||
-0000-000000000000/providers/Microsoft.Network/locations/eastus" \ | ||
--limit-object value=10 limit-object-type=LimitValue --resource-type PublicIpAddresses | ||
``` | ||
##### Create-ForCompute ##### | ||
``` | ||
az quota create --resource-name "standardFSv2Family" --scope "subscriptions/00000000-0000-0000-0000-0000\ | ||
00000000/providers/Microsoft.Compute/locations/eastus" \ | ||
--limit-object value=10 limit-object-type=LimitValue --resource-type dedicated | ||
``` | ||
##### Create-MachineLearningServicesLowPriorityResource ##### | ||
``` | ||
az quota create --resource-name "TotalLowPriorityCores" --scope "subscriptions/00000000-0000-0000-0000-\ | ||
000000000000/providers/Microsoft.MachineLearning/Services/locations/eastus" \ | ||
--limit-object value=10 limit-object-type=LimitValue --resource-type lowPriority | ||
``` | ||
##### Show-ForNetwork ##### | ||
``` | ||
az quota show --resource-name "MinPublicIpInterNetworkPrefixLength" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### Show-ForCompute ##### | ||
``` | ||
az quota show --resource-name "standardNDSFamily" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### List-QuotaLimitsForCompute ##### | ||
``` | ||
az quota list --scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### List-QuotaLimitsForNetwork ##### | ||
``` | ||
az quota list --scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" | ||
``` | ||
##### List-QuotaLimitsMachineLearningServices ##### | ||
``` | ||
az quota list \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus" | ||
``` | ||
##### Update-ForCompute ##### | ||
``` | ||
az quota update --resource-name "standardFSv2Family" --scope "subscriptions/00000000-0000-0000-0000-0000\ | ||
00000000/providers/Microsoft.Compute/locations/eastus" --limit-object value=10 limit-object-type=LimitValue | ||
--resource-type dedicated | ||
``` | ||
##### Update-ForNetwork ##### | ||
``` | ||
az quota update --resource-name "MinPublicIpInterNetworkPrefixLength" --scope "subscriptions/00000000-00\ | ||
00-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus" \ | ||
--limit-object value=10 limit-object-type=LimitValue --resource-type MinPublicIpInterNetworkPrefixLength | ||
``` | ||
#### quota request status #### | ||
##### List-QuotaRequestHistory ##### | ||
``` | ||
az quota request status list \ | ||
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
##### Show ##### | ||
``` | ||
az quota request status show --name "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \ | ||
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus" | ||
``` | ||
#### quota operation #### | ||
##### List ##### | ||
``` | ||
az quota operation 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.