Skip to content

Commit 738a015

Browse files
author
SDKAuto
committed
CodeGen from PR 15421 in Azure/azure-rest-api-specs
Merge 5bb3a09cf03616aae9115477969bdfc87478d69f into 1267076
1 parent 0793492 commit 738a015

File tree

80 files changed

+27368
-0
lines changed

Some content is hidden

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

80 files changed

+27368
-0
lines changed

src/billing/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/billing/README.md

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
# Azure CLI billing Extension #
2+
This is the extension for billing
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name billing
8+
```
9+
10+
### Included Features ###
11+
#### billing account ####
12+
##### List #####
13+
```
14+
az billing account list
15+
```
16+
##### List #####
17+
```
18+
az billing account list --expand "soldTo,billingProfiles,billingProfiles/invoiceSections"
19+
```
20+
##### List #####
21+
```
22+
az billing account list --expand "enrollmentDetails,departments,enrollmentAccounts"
23+
```
24+
##### Show #####
25+
```
26+
az billing account show --expand "soldTo,billingProfiles,billingProfiles/invoiceSections" --name "{billingAccountName}"
27+
```
28+
##### Show #####
29+
```
30+
az billing account show --name "{billingAccountName}"
31+
```
32+
##### Update #####
33+
```
34+
az billing account update --name "{billingAccountName}" --display-name "Test Account" \
35+
--sold-to address-line1="Test Address 1" city="Redmond" company-name="Contoso" country="US" first-name="Test" last-name="User" postal-code="12345" region="WA"
36+
```
37+
#### billing balance ####
38+
##### Show #####
39+
```
40+
az billing balance show --account-name "{billingAccountName}" --profile-name "{billingProfileName}"
41+
```
42+
#### billing instruction ####
43+
##### Create #####
44+
```
45+
az billing instruction create --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
46+
--name "{instructionName}" --amount 5000 --end-date "2020-12-30T21:26:47.997Z" \
47+
--start-date "2019-12-30T21:26:47.997Z"
48+
```
49+
##### Show #####
50+
```
51+
az billing instruction show --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
52+
--name "{instructionName}"
53+
```
54+
##### List #####
55+
```
56+
az billing instruction list --account-name "{billingAccountName}" --profile-name "{billingProfileName}"
57+
```
58+
#### billing profile ####
59+
##### Create #####
60+
```
61+
az billing profile create --account-name "{billingAccountName}" --name "{billingProfileName}" \
62+
--bill-to address-line1="Test Address 1" city="Redmond" country="US" first-name="Test" last-name="User" postal-code="12345" region="WA" \
63+
--display-name "Finance" --enabled-azure-plans sku-id="0001" --enabled-azure-plans sku-id="0002" \
64+
--invoice-email-opt-in true --po-number "ABC12345"
65+
```
66+
##### List #####
67+
```
68+
az billing profile list --expand "invoiceSections" --account-name "{billingAccountName}"
69+
```
70+
##### Show #####
71+
```
72+
az billing profile show --account-name "{billingAccountName}" --name "{billingProfileName}"
73+
```
74+
##### Show #####
75+
```
76+
az billing profile show --expand "invoiceSections" --account-name "{billingAccountName}" --name "{billingProfileName}"
77+
```
78+
##### List #####
79+
```
80+
az billing profile list --account-name "{billingAccountName}"
81+
```
82+
#### billing customer ####
83+
##### List #####
84+
```
85+
az billing customer list --account-name "{billingAccountName}" --profile-name "{billingProfileName}"
86+
```
87+
##### Show #####
88+
```
89+
az billing customer show --account-name "{billingAccountName}" --name "{customerName}"
90+
```
91+
##### Show #####
92+
```
93+
az billing customer show --expand "enabledAzurePlans,resellers" --account-name "{billingAccountName}" \
94+
--name "{customerName}"
95+
```
96+
#### billing invoice section ####
97+
##### Create #####
98+
```
99+
az billing invoice section create --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
100+
--name "{invoiceSectionName}" --display-name "invoiceSection1" --labels costCategory="Support" pcCode="A123456"
101+
```
102+
##### Show #####
103+
```
104+
az billing invoice section show --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
105+
--name "{invoiceSectionName}"
106+
```
107+
##### List #####
108+
```
109+
az billing invoice section list --account-name "{billingAccountName}" --profile-name "{billingProfileName}"
110+
```
111+
#### billing permission ####
112+
##### List #####
113+
```
114+
az billing permission list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
115+
--invoice-section-name "{invoiceSectionName}"
116+
```
117+
#### billing subscription ####
118+
##### List #####
119+
```
120+
az billing subscription list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
121+
--invoice-section-name "{invoiceSectionName}"
122+
```
123+
##### Show #####
124+
```
125+
az billing subscription show --account-name "{billingAccountName}"
126+
```
127+
##### Update #####
128+
```
129+
az billing subscription update --account-name "{billingAccountName}" --cost-center "ABC1234"
130+
```
131+
##### Move #####
132+
```
133+
az billing subscription move --account-name "{billingAccountName}" \
134+
--destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"
135+
```
136+
##### Validate-move #####
137+
```
138+
az billing subscription validate-move --account-name "{billingAccountName}" \
139+
--destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"
140+
```
141+
##### Validate-move #####
142+
```
143+
az billing subscription validate-move --account-name "{billingAccountName}" \
144+
--destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"
145+
```
146+
#### billing product ####
147+
##### List #####
148+
```
149+
az billing product list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
150+
--invoice-section-name "{invoiceSectionName}"
151+
```
152+
##### Show #####
153+
```
154+
az billing product show --account-name "{billingAccountName}" --name "{productName}"
155+
```
156+
##### Update #####
157+
```
158+
az billing product update --account-name "{billingAccountName}" --auto-renew "Off" --name "{productName}"
159+
```
160+
##### Move #####
161+
```
162+
az billing product move --account-name "{billingAccountName}" \
163+
--destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" \
164+
--name "{productName}"
165+
```
166+
##### Validate-move #####
167+
```
168+
az billing product validate-move --account-name "{billingAccountName}" \
169+
--destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" \
170+
--name "{productName}"
171+
```
172+
##### Validate-move #####
173+
```
174+
az billing product validate-move --account-name "{billingAccountName}" \
175+
--destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" \
176+
--name "{productName}"
177+
```
178+
#### billing invoice ####
179+
##### List #####
180+
```
181+
az billing invoice list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
182+
--period-end-date "2018-06-30" --period-start-date "2018-01-01"
183+
```
184+
##### List #####
185+
```
186+
az billing invoice list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
187+
--period-end-date "2018-06-30" --period-start-date "2018-01-01"
188+
```
189+
##### Show #####
190+
```
191+
az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}"
192+
```
193+
##### Show #####
194+
```
195+
az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}"
196+
```
197+
##### Show #####
198+
```
199+
az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}"
200+
```
201+
##### Show #####
202+
```
203+
az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}"
204+
```
205+
#### billing transaction ####
206+
##### List #####
207+
```
208+
az billing transaction list --account-name "{billingAccountName}" --invoice-name "{invoiceName}"
209+
```
210+
#### billing policy ####
211+
##### Update #####
212+
```
213+
az billing policy update --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
214+
--marketplace-purchases "OnlyFreeAllowed" --reservation-purchases "NotAllowed" --view-charges "Allowed"
215+
```
216+
#### billing property ####
217+
##### Show #####
218+
```
219+
az billing property show
220+
```
221+
##### Update #####
222+
```
223+
az billing property update --cost-center "1010"
224+
```
225+
#### billing role-definition ####
226+
##### List #####
227+
```
228+
az billing role-definition list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
229+
--invoice-section-name "{invoiceSectionName}"
230+
```
231+
#### billing role-assignment ####
232+
##### List #####
233+
```
234+
az billing role-assignment list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
235+
--invoice-section-name "{invoiceSectionName}"
236+
```
237+
##### Delete #####
238+
```
239+
az billing role-assignment delete --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \
240+
--name "{billingRoleAssignmentName}" --invoice-section-name "{invoiceSectionName}"
241+
```
242+
#### billing agreement ####
243+
##### List #####
244+
```
245+
az billing agreement list --account-name "{billingAccountName}"
246+
```
247+
##### Show #####
248+
```
249+
az billing agreement show --name "{agreementName}" --account-name "{billingAccountName}"
250+
```
251+
#### billing reservation ####
252+
##### List #####
253+
```
254+
az billing reservation list --filter "properties/reservedResourceType eq \'VirtualMachines\'" \
255+
--orderby "properties/userFriendlyAppliedScopeType asc" --account-name "{billingAccountName}" \
256+
--profile-name "{billingProfileName}" --refresh-summary "true" --selected-state "Succeeded"
257+
```
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_billing.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_billing.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
17+
18+
19+
class BillingManagementClientCommandsLoader(AzCommandsLoader):
20+
21+
def __init__(self, cli_ctx=None):
22+
from azure.cli.core.commands import CliCommandType
23+
from azext_billing.generated._client_factory import cf_billing_cl
24+
billing_custom = CliCommandType(
25+
operations_tmpl='azext_billing.custom#{}',
26+
client_factory=cf_billing_cl)
27+
parent = super(BillingManagementClientCommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=billing_custom)
29+
30+
def load_command_table(self, args):
31+
from azext_billing.generated.commands import load_command_table
32+
load_command_table(self, args)
33+
try:
34+
from azext_billing.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_billing.generated._params import load_arguments
42+
load_arguments(self, command)
43+
try:
44+
from azext_billing.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 = BillingManagementClientCommandsLoader
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"azext.minCliCoreVersion": "2.15.0"
3+
}
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__)

0 commit comments

Comments
 (0)