Skip to content
Draft
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/quota/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

0.1.0
++++++
* Initial release.
104 changes: 104 additions & 0 deletions src/quota/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 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 ####
##### Create #####
```
az quota create --properties "{\\"name\\":{\\"value\\":\\"standardFSv2Family\\"},\\"limit\\":200}" \
--resource-name "standardFSv2Family" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus"
```
##### Create #####
```
az quota create --properties "{\\"name\\":{\\"value\\":\\"standardFSv2Family\\"},\\"limit\\":200}" \
--resource-name "standardFSv2Family" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus"
```
##### Create #####
```
az quota create \
--properties "{\\"name\\":{\\"value\\":\\"TotalLowPriorityCores\\"},\\"limit\\":200,\\"resourceType\\":\\"lowPriority\\"}" \
--resource-name "TotalLowPriorityCores" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.MachineLearningServices/locations/eastus"
```
##### Create #####
```
az quota create \
--properties "{\\"name\\":{\\"value\\":\\"MinPublicIpInterNetworkPrefixLength\\"},\\"limit\\":200,\\"resourceType\\":\\"MinPublicIpInterNetworkPrefixLength\\"}" \
--resource-name "MinPublicIpInterNetworkPrefixLength" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/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\\":200}" \
--resource-name "standardFSv2Family" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus"
```
##### Update #####
```
az quota update \
--properties "{\\"name\\":{\\"value\\":\\"MinPublicIpInterNetworkPrefixLength\\"},\\"limit\\":200,\\"resourceType\\":\\"MinPublicIpInterNetworkPrefixLength\\"}" \
--resource-name "MinPublicIpInterNetworkPrefixLength" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus"
```
#### quota quota-request-status ####
##### List #####
```
az quota quota-request-status list \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus"
```
##### Show #####
```
az quota quota-request-status show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus"
```
##### Show #####
```
az quota quota-request-status show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \
--scope "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus"
```
##### Show #####
```
az quota quota-request-status show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" \
--scope "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus"
```
#### quota quota-resource-provider ####
##### List #####
```
az quota quota-resource-provider list
```
#### quota operation ####
##### List #####
```
az quota operation list
```
50 changes: 50 additions & 0 deletions src/quota/azext_quota/__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_quota.generated._help import helps # pylint: disable=unused-import
try:
from azext_quota.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


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


COMMAND_LOADER_CLS = AzureQuotaExtensionAPICommandsLoader
17 changes: 17 additions & 0 deletions src/quota/azext_quota/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/quota/azext_quota/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/quota/azext_quota/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/quota/azext_quota/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__)
33 changes: 33 additions & 0 deletions src/quota/azext_quota/generated/_client_factory.py
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_quota(cli_ctx, *_):
return cf_quota_cl(cli_ctx).quota


def cf_quota_request_status(cli_ctx, *_):
return cf_quota_cl(cli_ctx).quota_request_status


def cf_quota_resource_provider(cli_ctx, *_):
return cf_quota_cl(cli_ctx).quota_resource_providers


def cf_operation(cli_ctx, *_):
return cf_quota_cl(cli_ctx).operation
Loading