Skip to content

Commit 2f373ac

Browse files
author
SDKAuto
committed
CodeGen from PR 14849 in Azure/azure-rest-api-specs
Merge 3c8a67c2bea1b0a9bd03fd7976e2f9a1922b38fa into a331a45
1 parent e5f28e2 commit 2f373ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+15019
-0
lines changed

src/reservations/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0
7+
++++++
8+
* Initial release.

src/reservations/README.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Azure CLI quota Extension #
2+
This is the extension for quota
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name quota
8+
```
9+
10+
### Included Features ###
11+
#### quota reservation ####
12+
##### List #####
13+
```
14+
az quota reservation list --reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
15+
```
16+
##### Show #####
17+
```
18+
az quota reservation show --expand "renewProperties" --reservation-id "6ef59113-3482-40da-8d79-787f823e34bc" \
19+
--reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
20+
```
21+
##### Update #####
22+
```
23+
az quota reservation update --applied-scope-type "Shared" --instance-flexibility "Off" \
24+
--reservation-id "6ef59113-3482-40da-8d79-787f823e34bc" \
25+
--reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
26+
```
27+
##### Available-scope #####
28+
```
29+
az quota reservation available-scope --properties scopes="/subscriptions/efc7c997-7700-4a74-b731-55aec16c15e9" \
30+
--reservation-id "356e7ae4-84d0-4da6-ab4b-d6b94f3557da" \
31+
--reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
32+
```
33+
##### List-all #####
34+
```
35+
az quota reservation list-all --filter "(properties%2farchived+eq+false)" --orderby "properties/displayName asc" \
36+
--skiptoken "50" --refresh-summary "true" --take "1"
37+
```
38+
##### List-revision #####
39+
```
40+
az quota reservation list-revision --reservation-id "6ef59113-3482-40da-8d79-787f823e34bc" \
41+
--reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
42+
```
43+
##### Merge #####
44+
```
45+
az quota reservation merge \
46+
--sources "/providers/Microsoft.Capacity/reservationOrders/c0565a8a-4491-4e77-b07b-5e6d66718e1c/reservations/cea04232-932e-47db-acb5-e29a945ecc73" "/providers/Microsoft.Capacity/reservationOrders/c0565a8a-4491-4e77-b07b-5e6d66718e1c/reservations/5bf54dc7-dacd-4f46-a16b-7b78f4a59799" \
47+
--reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
48+
```
49+
##### Split #####
50+
```
51+
az quota reservation split --quantities 1 2 \
52+
--reservation-id "/providers/Microsoft.Capacity/reservationOrders/276e7ae4-84d0-4da6-ab4b-d6b94f3557da/reservations/bcae77cd-3119-4766-919f-b50d36c75c7a" \
53+
--reservation-order-id "276e7ae4-84d0-4da6-ab4b-d6b94f3557da"
54+
```
55+
#### quota ####
56+
##### Show-applied-reservation-list #####
57+
```
58+
az quota show-applied-reservation-list --subscription-id "23bc208b-083f-4901-ae85-4f98c0c3b4b6"
59+
```
60+
##### Show-catalog #####
61+
```
62+
az quota show-catalog --location "eastus" --reserved-resource-type "VirtualMachines" \
63+
--subscription-id "23bc208b-083f-4901-ae85-4f98c0c3b4b6"
64+
```
65+
#### quota reservation-order ####
66+
##### Purchase #####
67+
```
68+
az quota reservation-order purchase --location "westus" --applied-scope-type "Shared" --billing-plan "Monthly" \
69+
--billing-scope-id "/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83" --display-name "TestReservationOrder" \
70+
--quantity 1 --renew false --instance-flexibility "On" --reserved-resource-type "VirtualMachines" --term "P1Y" \
71+
--name "standard_D1" --reservation-order-id "a075419f-44cc-497f-b68a-14ee811d48b9"
72+
```
73+
##### Show #####
74+
```
75+
az quota reservation-order show --reservation-order-id "a075419f-44cc-497f-b68a-14ee811d48b9"
76+
```
77+
##### Show #####
78+
```
79+
az quota reservation-order show --expand "schedule" --reservation-order-id "a075419f-44cc-497f-b68a-14ee811d48b9"
80+
```
81+
##### Calculate #####
82+
```
83+
az quota reservation-order calculate --location "westus" --applied-scope-type "Shared" --billing-plan "Monthly" \
84+
--billing-scope-id "/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83" --display-name "TestReservationOrder" \
85+
--quantity 1 --instance-flexibility "On" --reserved-resource-type "VirtualMachines" --term "P1Y" \
86+
--name "standard_D1"
87+
```
88+
##### Change-directory #####
89+
```
90+
az quota reservation-order change-directory --destination-tenant-id "906655ea-30be-4587-9d12-b50e077b0f32" \
91+
--reservation-order-id "a075419f-44cc-497f-b68a-14ee811d48b9"
92+
```
93+
##### List #####
94+
```
95+
az quota reservation-order list
96+
```
97+
#### quota operation ####
98+
##### List #####
99+
```
100+
az quota operation list
101+
```
102+
#### quota calculate-exchange ####
103+
##### Post #####
104+
```
105+
az quota calculate-exchange post \
106+
--reservations-to-exchange quantity=1 reservation-id="/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6" \
107+
--reservations-to-purchase location="westus" reserved-resource-type="VirtualMachines" billing-scope-id="/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83" term="P1Y" billing-plan="Upfront" quantity=1 display-name="testDisplayName" applied-scope-type="Shared" applied-scopes=null renew=false instance-flexibility="On" name="Standard_B1ls"
108+
```
109+
#### quota exchange ####
110+
##### Post #####
111+
```
112+
az quota exchange post --session-id "66e2ac8f-439e-4345-8235-6fef07608081"
113+
```
114+
#### quota ####
115+
##### Create #####
116+
```
117+
az quota create \
118+
--properties "{\\"name\\":{\\"value\\":\\"standardFSv2Family\\"},\\"limit\\":200,\\"unit\\":\\"Count\\"}" \
119+
--location "eastus" --provider-id "Microsoft.Compute" --resource-name "standardFSv2Family" \
120+
--subscription-id "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3"
121+
```
122+
##### Create #####
123+
```
124+
az quota create \
125+
--properties "{\\"name\\":{\\"value\\":\\"StandardDv2Family\\"},\\"limit\\":200,\\"resourceType\\":\\"dedicated\\",\\"unit\\":\\"Count\\"}" \
126+
--location "eastus" --provider-id "Microsoft.MachineLearningServices" --resource-name "StandardDv2Family" \
127+
--subscription-id "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3"
128+
```
129+
##### Create #####
130+
```
131+
az quota create \
132+
--properties "{\\"name\\":{\\"value\\":\\"TotalLowPriorityCores\\"},\\"limit\\":200,\\"resourceType\\":\\"lowPriority\\",\\"unit\\":\\"Count\\"}" \
133+
--location "eastus" --provider-id "Microsoft.MachineLearningServices" --resource-name "TotalLowPriorityCores" \
134+
--subscription-id "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3"
135+
```
136+
##### List #####
137+
```
138+
az quota list --location "eastus" --provider-id "Microsoft.Compute" \
139+
--subscription-id "00000000-0000-0000-0000-000000000000"
140+
```
141+
##### List #####
142+
```
143+
az quota list --location "eastus" --provider-id "Microsoft.MachineLearningServices" \
144+
--subscription-id "00000000-0000-0000-0000-000000000000"
145+
```
146+
##### Show #####
147+
```
148+
az quota show --location "eastus" --provider-id "Microsoft.Compute" --resource-name "standardNDSFamily" \
149+
--subscription-id "00000000-0000-0000-0000-000000000000"
150+
```
151+
##### Update #####
152+
```
153+
az quota update \
154+
--properties "{\\"name\\":{\\"value\\":\\"standardFSv2Family\\"},\\"limit\\":200,\\"unit\\":\\"Count\\"}" \
155+
--location "eastus" --provider-id "Microsoft.Compute" --resource-name "standardFSv2Family" \
156+
--subscription-id "D7EC67B3-7657-4966-BFFC-41EFD36BAAB3"
157+
```
158+
#### quota quota-request-status ####
159+
##### List #####
160+
```
161+
az quota quota-request-status list --location "eastus" --provider-id "Microsoft.Compute" \
162+
--subscription-id "3f75fdf7-977e-44ad-990d-99f14f0f299f"
163+
```
164+
##### Show #####
165+
```
166+
az quota quota-request-status show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" --location "eastus" \
167+
--provider-id "Microsoft.Compute" --subscription-id "00000000-0000-0000-0000-000000000000"
168+
```
169+
##### Show #####
170+
```
171+
az quota quota-request-status show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" --location "eastus" \
172+
--provider-id "Microsoft.Compute" --subscription-id "00000000-0000-0000-0000-000000000000"
173+
```
174+
##### Show #####
175+
```
176+
az quota quota-request-status show --id "2B5C8515-37D8-4B6A-879B-CD641A2CF605" --location "eastus" \
177+
--provider-id "Microsoft.Compute" --subscription-id "00000000-0000-0000-0000-000000000000"
178+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
from azure.cli.core import AzCommandsLoader
12+
from azext_reservations.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_reservations.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
17+
18+
19+
class AzureReservationAPICommandsLoader(AzCommandsLoader):
20+
21+
def __init__(self, cli_ctx=None):
22+
from azure.cli.core.commands import CliCommandType
23+
from azext_reservations.generated._client_factory import cf_quota_cl
24+
quota_custom = CliCommandType(
25+
operations_tmpl='azext_reservations.custom#{}',
26+
client_factory=cf_quota_cl)
27+
parent = super(AzureReservationAPICommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=quota_custom)
29+
30+
def load_command_table(self, args):
31+
from azext_reservations.generated.commands import load_command_table
32+
load_command_table(self, args)
33+
try:
34+
from azext_reservations.manual.commands import load_command_table as load_command_table_manual
35+
load_command_table_manual(self, args)
36+
except ImportError:
37+
pass
38+
return self.command_table
39+
40+
def load_arguments(self, command):
41+
from azext_reservations.generated._params import load_arguments
42+
load_arguments(self, command)
43+
try:
44+
from azext_reservations.manual._params import load_arguments as load_arguments_manual
45+
load_arguments_manual(self, command)
46+
except ImportError:
47+
pass
48+
49+
50+
COMMAND_LOADER_CLS = AzureReservationAPICommandsLoader
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.action import * # noqa: F403
14+
try:
15+
from .manual.action import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"azext.isExperimental": true,
3+
"azext.minCliCoreVersion": "2.15.0"
4+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.custom import * # noqa: F403
14+
try:
15+
from .manual.custom import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
12+
def cf_quota_cl(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from azext_reservations.vendored_sdks.quota import AzureReservationAPI
15+
return get_mgmt_service_client(cli_ctx,
16+
AzureReservationAPI,
17+
subscription_bound=False)
18+
19+
20+
def cf_reservation(cli_ctx, *_):
21+
return cf_quota_cl(cli_ctx).reservation
22+
23+
24+
def cf_reservation_order(cli_ctx, *_):
25+
return cf_quota_cl(cli_ctx).reservation_order
26+
27+
28+
def cf_operation(cli_ctx, *_):
29+
return cf_quota_cl(cli_ctx).operation
30+
31+
32+
def cf_calculate_exchange(cli_ctx, *_):
33+
return cf_quota_cl(cli_ctx).calculate_exchange
34+
35+
36+
def cf_exchange(cli_ctx, *_):
37+
return cf_quota_cl(cli_ctx).exchange
38+
39+
40+
def cf_quota(cli_ctx, *_):
41+
return cf_quota_cl(cli_ctx).quota
42+
43+
44+
def cf_quota_request_status(cli_ctx, *_):
45+
return cf_quota_cl(cli_ctx).quota_request_status

0 commit comments

Comments
 (0)