-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new command budget to consumption (#6024)
* Add new command budget to consumption * Fix build errors on consumption * Fix test bugs on consumption * Addressed comments of argument type, wrapper, and comments on consumption * Fixed build errors on indent * Fixed import sequence error * Fixed bugs on argument option list * Removed enum type validation
- Loading branch information
1 parent
227fb22
commit ecb1c53
Showing
13 changed files
with
264 additions
and
28 deletions.
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
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
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
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
34 changes: 34 additions & 0 deletions
34
...i/command_modules/consumption/tests/latest/recordings/test_consumption_budget_create.yaml
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,34 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"category": "cost", "amount": 100.0, "timeGrain": "monthly", | ||
"timePeriod": {"startDate": "2018-02-01T00:00:00.000Z", "endDate": "2018-10-01T00:00:00.000Z"}}}' | ||
headers: | ||
Accept: [application/json] | ||
Accept-Encoding: ['gzip, deflate'] | ||
CommandName: [consumption budget create] | ||
Connection: [keep-alive] | ||
Content-Length: ['173'] | ||
Content-Type: [application/json; charset=utf-8] | ||
User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 | ||
msrest_azure/0.4.21 azure-mgmt-consumption/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.28] | ||
accept-language: [en-US] | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/costbudget?api-version=2018-01-31 | ||
response: | ||
body: {string: '{"id":"subscriptions/0f88eb23-845d-48b9-b363-efd011b05586/providers/Microsoft.Consumption/budgets/costbudget","name":"costbudget","type":"Microsoft.Consumption/budgets","eTag":"\"1d3ab6019183d09\"","properties":{"timePeriod":{"startDate":"2018-02-01T00:00:00Z","endDate":"2018-10-01T00:00:00Z"},"timeGrain":"Monthly","amount":100.0,"currentSpend":null,"category":"Cost","notifications":{},"filters":{"resourceGroups":[],"resources":[],"meters":[]}}}'} | ||
headers: | ||
cache-control: [no-cache] | ||
content-length: ['449'] | ||
content-type: [application/json; charset=utf-8] | ||
date: ['Wed, 21 Feb 2018 22:05:32 GMT'] | ||
expires: ['-1'] | ||
location: ['https://consumption.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/costbudget?api-version=2018-01-31'] | ||
pragma: [no-cache] | ||
server: [Microsoft-IIS/8.5] | ||
session-id: [5215920e-8606-48f6-b900-5b2a5d59794a] | ||
strict-transport-security: [max-age=31536000; includeSubDomains] | ||
x-content-type-options: [nosniff] | ||
x-ms-ratelimit-remaining-subscription-writes: ['1199'] | ||
x-powered-by: [ASP.NET] | ||
status: {code: 201, message: Created} | ||
version: 1 |
31 changes: 31 additions & 0 deletions
31
...i/command_modules/consumption/tests/latest/recordings/test_consumption_budget_delete.yaml
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,31 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: [application/json] | ||
Accept-Encoding: ['gzip, deflate'] | ||
CommandName: [consumption budget delete] | ||
Connection: [keep-alive] | ||
Content-Length: ['0'] | ||
Content-Type: [application/json; charset=utf-8] | ||
User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 | ||
msrest_azure/0.4.21 azure-mgmt-consumption/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.28] | ||
accept-language: [en-US] | ||
method: DELETE | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/costbudget?api-version=2018-01-31 | ||
response: | ||
body: {string: ''} | ||
headers: | ||
cache-control: [no-cache] | ||
content-length: ['0'] | ||
date: ['Thu, 22 Feb 2018 00:11:03 GMT'] | ||
expires: ['-1'] | ||
pragma: [no-cache] | ||
server: [Microsoft-IIS/8.5] | ||
session-id: [2fb4175b-6646-45a5-8595-b324cd07818a] | ||
strict-transport-security: [max-age=31536000; includeSubDomains] | ||
x-content-type-options: [nosniff] | ||
x-ms-ratelimit-remaining-subscription-writes: ['1199'] | ||
x-powered-by: [ASP.NET] | ||
status: {code: 200, message: OK} | ||
version: 1 |
35 changes: 35 additions & 0 deletions
35
...and_modules/consumption/tests/latest/recordings/test_consumption_budget_usage_create.yaml
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,35 @@ | ||
interactions: | ||
- request: | ||
body: '{"properties": {"category": "usage", "amount": 20.0, "timeGrain": "annually", | ||
"timePeriod": {"startDate": "2018-02-01T00:00:00.000Z", "endDate": "2018-10-01T00:00:00.000Z"}, | ||
"filters": {"meters": ["0dfadad2-6e4f-4078-85e1-90c230d4d482"]}}}' | ||
headers: | ||
Accept: [application/json] | ||
Accept-Encoding: ['gzip, deflate'] | ||
CommandName: [consumption budget create] | ||
Connection: [keep-alive] | ||
Content-Length: ['239'] | ||
Content-Type: [application/json; charset=utf-8] | ||
User-Agent: [python/3.6.4 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 | ||
msrest_azure/0.4.21 azure-mgmt-consumption/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.28] | ||
accept-language: [en-US] | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/usagetypebudget1?api-version=2018-01-31 | ||
response: | ||
body: {string: '{"id":"subscriptions/0f88eb23-845d-48b9-b363-efd011b05586/providers/Microsoft.Consumption/budgets/usagetypebudget1","name":"usagetypebudget1","type":"Microsoft.Consumption/budgets","eTag":"\"1d3ab875141ad02\"","properties":{"timePeriod":{"startDate":"2018-02-01T00:00:00Z","endDate":"2018-10-01T00:00:00Z"},"timeGrain":"Annually","amount":20.0,"currentSpend":null,"category":"Usage","notifications":{},"filters":{"resourceGroups":[],"resources":[],"meters":["0dfadad2-6e4f-4078-85e1-90c230d4d482"]}}}'} | ||
headers: | ||
cache-control: [no-cache] | ||
content-length: ['500'] | ||
content-type: [application/json; charset=utf-8] | ||
date: ['Thu, 22 Feb 2018 02:46:20 GMT'] | ||
expires: ['-1'] | ||
location: ['https://consumption.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/usagetypebudget1?api-version=2018-01-31'] | ||
pragma: [no-cache] | ||
server: [Microsoft-IIS/8.5] | ||
session-id: [3268b230-5476-48b4-9e87-07f73dee71d7] | ||
strict-transport-security: [max-age=31536000; includeSubDomains] | ||
x-content-type-options: [nosniff] | ||
x-ms-ratelimit-remaining-subscription-writes: ['1199'] | ||
x-powered-by: [ASP.NET] | ||
status: {code: 201, message: Created} | ||
version: 1 |
Oops, something went wrong.