From a38e9a0df071299126f93b72914f1db1bd76c80e Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 20 Aug 2020 01:53:39 +0000 Subject: [PATCH] Generated from 378268d4da7efb7214d72325784ade5692a32c3d moved forecastDataset addition to correct version --- src/costmanagement/README.md | 15 - .../azext_costmanagement/__init__.py | 93 +- .../azext_costmanagement/generated/_help.py | 1721 +++++----- .../azext_costmanagement/generated/_params.py | 898 +++--- .../generated/_validators.py | 14 - .../azext_costmanagement/generated/action.py | 82 +- .../generated/commands.py | 131 +- .../azext_costmanagement/generated/custom.py | 601 ++-- .../azext_costmanagement/tests/__init__.py | 28 +- .../tests/latest/preparers.py | 89 +- .../latest/test_costmanagement_export.py | 221 -- .../tests/latest/test_costmanagement_query.py | 139 - .../latest/test_costmanagement_scenario.py | 2802 +++++++++-------- .../vendored_sdks/costmanagement/__init__.py | 5 +- .../costmanagement/_configuration.py | 8 +- .../costmanagement/_cost_management_client.py | 17 +- .../vendored_sdks/costmanagement/_version.py | 9 - .../aio/_configuration_async.py | 10 +- .../aio/_cost_management_client_async.py | 21 +- .../_alert_operations_async.py | 264 +- .../_dimension_operations_async.py | 88 +- .../_export_operations_async.py | 158 +- .../_forecast_operations_async.py | 88 +- .../_operation_operations_async.py | 29 +- .../_query_operations_async.py | 70 +- .../_view_operations_async.py | 180 +- .../costmanagement/models/__init__.py | 26 +- .../models/_cost_management_client_enums.py | 85 +- .../costmanagement/models/_models.py | 712 +++-- .../costmanagement/models/_models_py3.py | 819 +++-- .../operations/_alert_operations.py | 266 +- .../operations/_dimension_operations.py | 88 +- .../operations/_export_operations.py | 158 +- .../operations/_forecast_operations.py | 88 +- .../operations/_operation_operations.py | 29 +- .../operations/_query_operations.py | 70 +- .../operations/_view_operations.py | 180 +- .../vendored_sdks/costmanagement/setup.py | 37 - src/costmanagement/report.md | 269 ++ src/costmanagement/setup.py | 14 +- 40 files changed, 5962 insertions(+), 4660 deletions(-) delete mode 100644 src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_export.py delete mode 100644 src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_query.py delete mode 100644 src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_version.py delete mode 100644 src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/setup.py create mode 100644 src/costmanagement/report.md diff --git a/src/costmanagement/README.md b/src/costmanagement/README.md index 5a29ad5a7e4..cb4eea58d74 100644 --- a/src/costmanagement/README.md +++ b/src/costmanagement/README.md @@ -3,18 +3,3 @@ Microsoft Azure CLI 'costmanagement' Extension This package is for the 'costmanagement' extension. i.e. 'az costmanagement' - -# Installation -Firstly, azure-cli must be installed. then `az extension add -n costmanagement` - - -# Commands - -## Query -- az costmanagement query - Query the usage data for scope defined. - -## Export - Manage cost export -- az costmanagement export create - Operation to create an export -- az costmanagement export update - Operation to update an export configuration -- az costmanagement export show/list - Operations to display export(s) information -- az costmanagement export delete - Operations to delete an existing export diff --git a/src/costmanagement/azext_costmanagement/__init__.py b/src/costmanagement/azext_costmanagement/__init__.py index 8870243ca42..c502c01141c 100644 --- a/src/costmanagement/azext_costmanagement/__init__.py +++ b/src/costmanagement/azext_costmanagement/__init__.py @@ -1,47 +1,46 @@ -# -------------------------------------------------------------------------- -# 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_costmanagement.generated._help import helps # pylint: disable=unused-import -from azext_costmanagement.manual._help import helps # pylint: disable=unused-import - - -class CostManagementClientCommandsLoader(AzCommandsLoader): - - def __init__(self, cli_ctx=None): - from azure.cli.core.commands import CliCommandType - from azext_costmanagement.generated._client_factory import cf_costmanagement - costmanagement_custom = CliCommandType( - operations_tmpl='azext_costmanagement.custom#{}', - client_factory=cf_costmanagement) - super(CostManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=costmanagement_custom) - - def load_command_table(self, args): - from azext_costmanagement.generated.commands import load_command_table - load_command_table(self, args) - try: - from azext_costmanagement.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_costmanagement.generated._params import load_arguments - load_arguments(self, command) - try: - from azext_costmanagement.manual._params import load_arguments as load_arguments_manual - load_arguments_manual(self, command) - except ImportError: - pass - - -COMMAND_LOADER_CLS = CostManagementClientCommandsLoader +# -------------------------------------------------------------------------- +# 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_costmanagement.generated._help import helps # pylint: disable=unused-import + + +class CostManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_costmanagement.generated._client_factory import cf_costmanagement + costmanagement_custom = CliCommandType( + operations_tmpl='azext_costmanagement.custom#{}', + client_factory=cf_costmanagement) + parent = super(CostManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=costmanagement_custom) + + def load_command_table(self, args): + from azext_costmanagement.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_costmanagement.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_costmanagement.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_costmanagement.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = CostManagementClientCommandsLoader diff --git a/src/costmanagement/azext_costmanagement/generated/_help.py b/src/costmanagement/azext_costmanagement/generated/_help.py index 13440845a57..548b1f0cd2b 100644 --- a/src/costmanagement/azext_costmanagement/generated/_help.py +++ b/src/costmanagement/azext_costmanagement/generated/_help.py @@ -9,774 +9,953 @@ # -------------------------------------------------------------------------- # pylint: disable=too-many-lines -# from knack.help_files import helps - - -# helps['costmanagement view'] = """ -# type: group -# short-summary: costmanagement view -# """ - -# helps['costmanagement view list'] = """ -# type: command -# short-summary: Lists all views by tenant and object. -# examples: -# - name: ResourceGroupViewList -# text: |- -# az costmanagement view list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/M\ -# YDEVTESTRG" -# """ - -# helps['costmanagement view show'] = """ -# type: command -# short-summary: Gets the view by view name. -# examples: -# - name: ResourceGroupView -# text: |- -# az costmanagement view show --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/M\ -# YDEVTESTRG" --view-name "swaggerExample" -# """ - -# helps['costmanagement view create'] = """ -# type: command -# short-summary: The operation to create or update a view. Update operation requires latest eTag to be set in the req\ -# uest. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -# examples: -# - name: ResourceGroupCreateOrUpdateView -# text: |- -# az costmanagement view create --e-tag "\\"1d4ff9fe66f1d10\\"" --accumulated "true" --chart "Table" --dis\ -# play-name "swagger Example" --kpis type="Forecast" enabled=true id=null --kpis type="Budget" enabled=true id="/subscrip\ -# tions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDe\ -# mo" --metric "ActualCost" --pivots name="ServiceName" type="Dimension" --pivots name="MeterCategory" type="Dimension" -\ -# -pivots name="swaggerTagKey" type="TagKey" --query-dataset "{\\"aggregation\\":{\\"totalCost\\":{\\"name\\":\\"PreTaxCo\ -# st\\",\\"function\\":\\"Sum\\"}},\\"granularity\\":\\"Daily\\",\\"grouping\\":[],\\"sorting\\":[{\\"name\\":\\"UsageDat\ -# e\\",\\"direction\\":\\"Ascending\\"}]}" --query-timeframe "MonthToDate" --properties-scope "subscriptions/00000000-000\ -# 0-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" --view-name "swaggerExample" -# """ - -# helps['costmanagement view delete'] = """ -# type: command -# short-summary: The operation to delete a view. -# examples: -# - name: ResourceGroupDeleteView -# text: |- -# az costmanagement view delete --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups\ -# /MYDEVTESTRG" --view-name "TestView" -# """ - -# helps['costmanagement alert'] = """ -# type: group -# short-summary: costmanagement alert -# """ - -# helps['costmanagement alert list'] = """ -# type: command -# short-summary: Lists the alerts for scope defined. -# examples: -# - name: BillingAccountAlerts -# text: |- -# az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" -# - name: BillingProfileAlerts -# text: |- -# az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProf\ -# iles/13579" -# - name: DepartmentAlerts -# text: |- -# az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments\ -# /123" -# - name: EnrollmentAccountAlerts -# text: |- -# az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentA\ -# ccounts/456" -# - name: InvoiceSectionAlerts -# text: |- -# az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProf\ -# iles/13579/invoiceSections/9876" -# - name: ResourceGroupAlerts -# text: |- -# az costmanagement alert list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/\ -# ScreenSharingTest-peer" -# - name: SubscriptionAlerts -# text: |- -# az costmanagement alert list --scope "subscriptions/00000000-0000-0000-0000-000000000000" -# """ - -# helps['costmanagement alert list-external'] = """ -# type: command -# short-summary: Lists the Alerts for external cloud provider type defined. -# examples: -# - name: ExternalBillingAccountAlerts -# text: |- -# az costmanagement alert list-external --external-cloud-provider-id "100" --external-cloud-provider-type \ -# "externalBillingAccounts" -# - name: ExternalSubscriptionAlerts -# text: |- -# az costmanagement alert list-external --external-cloud-provider-id "100" --external-cloud-provider-type \ -# "externalSubscriptions" -# """ - -# helps['costmanagement forecast'] = """ -# type: group -# short-summary: costmanagement forecast -# """ - -# helps['costmanagement forecast external-cloud-provider-usage'] = """ -# type: command -# short-summary: Lists the forecast charges for external cloud provider type defined. -# examples: -# - name: ExternalBillingAccountForecast -# text: |- -# az costmanagement forecast external-cloud-provider-usage --external-cloud-provider-id "100" --external-c\ -# loud-provider-type "externalBillingAccounts" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" -# - name: ExternalSubscriptionForecast -# text: |- -# az costmanagement forecast external-cloud-provider-usage --external-cloud-provider-id "100" --external-c\ -# loud-provider-type "externalSubscriptions" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\\ -# "name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\\ -# "name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\"\ -# :\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" -# """ - -# helps['costmanagement forecast usage'] = """ -# type: command -# short-summary: Lists the forecast charges for scope defined. -# examples: -# - name: BillingAccountForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" -# - name: BillingProfileForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billi\ -# ngProfiles/13579" -# - name: DepartmentForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/depar\ -# tments/123" -# - name: EnrollmentAccountForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrol\ -# lmentAccounts/456" -# - name: InvoiceSectionForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billi\ -# ngProfiles/13579/invoiceSections/9876" -# - name: ResourceGroupForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceG\ -# roups/ScreenSharingTest-peer" -# - name: SubscriptionForecast -# text: |- -# az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ -# resh-partial-cost false --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-000000000000" -# """ - -# helps['costmanagement dimension'] = """ -# type: group -# short-summary: costmanagement dimension -# """ - -# helps['costmanagement dimension list'] = """ -# type: command -# short-summary: Lists the dimensions by the defined scope. -# examples: -# - name: BillingAccountDimensionsList-Legacy -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100" -# - name: BillingAccountDimensionsList-Modern -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" -# - name: BillingAccountDimensionsListExpandAndTop-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/100" -# - name: BillingAccountDimensionsListExpandAndTop-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/12345:6789" -# - name: BillingAccountDimensionsListWithFilter-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100" -# - name: BillingAccountDimensionsListWithFilter-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" -# - name: BillingProfileDimensionsList-Modern -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billing\ -# Profiles/13579" -# - name: BillingProfileDimensionsListExpandAndTop-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/12345:6789/billingProfiles/13579" -# - name: BillingProfileDimensionsListWithFilter-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579" -# - name: CustomerDimensionsList-Modern -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/custome\ -# rs/5678" -# - name: CustomerDimensionsListExpandAndTop-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/12345:6789/customers/5678" -# - name: CustomerDimensionsListWithFilter-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678" -# - name: DepartmentDimensionsList-Legacy -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100/departments/12\ -# 3" -# - name: DepartmentDimensionsListExpandAndTop-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/100/departments/123" -# - name: DepartmentDimensionsListWithFilter-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100/departments/123" -# - name: EnrollmentAccountDimensionsList-Legacy -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAcco\ -# unts/456" -# - name: EnrollmentAccountDimensionsListExpandAndTop-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/100/enrollmentAccounts/456" -# - name: EnrollmentAccountDimensionsListWithFilter-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456" -# - name: InvoiceSectionDimensionsList-Modern -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billing\ -# Profiles/13579/invoiceSections/9876" -# - name: InvoiceSectionDimensionsListExpandAndTop-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ -# /billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876" -# - name: InvoiceSectionDimensionsListWithFilter-Modern -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876\ -# " -# - name: ManagementGroupDimensionsList-Legacy -# text: |- -# az costmanagement dimension list --scope "providers/Microsoft.Management/managementGroups/MyMgId" -# - name: ManagementGroupDimensionsListExpandAndTop-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Managem\ -# ent/managementGroups/MyMgId" -# - name: ManagementGroupDimensionsListWithFilter-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ -# d\'" --top 5 --scope "providers/Microsoft.Management/managementGroups/MyMgId" -# - name: ResourceGroupDimensionsList-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "subscriptions/00000000-0000\ -# -0000-0000-000000000000/resourceGroups/system.orlando" -# - name: SubscriptionDimensionsList-Legacy -# text: |- -# az costmanagement dimension list --expand "properties/data" --top 5 --scope "subscriptions/00000000-0000\ -# -0000-0000-000000000000" -# """ - -# helps['costmanagement dimension by-external-cloud-provider-type'] = """ -# type: command -# short-summary: Lists the dimensions by the external cloud provider type. -# examples: -# - name: ExternalBillingAccountDimensionList -# text: |- -# az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" --externa\ -# l-cloud-provider-type "externalBillingAccounts" -# - name: ExternalSubscriptionDimensionList -# text: |- -# az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" --externa\ -# l-cloud-provider-type "externalSubscriptions" -# """ - -# helps['costmanagement query'] = """ -# type: group -# short-summary: costmanagement query -# """ - -# helps['costmanagement query usage'] = """ -# type: command -# short-summary: Query the usage data for scope defined. -# examples: -# - name: BillingAccountQuery-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/70664866" -# - name: BillingAccountQuery-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/12345:6789" -# - name: BillingAccountQueryGrouping-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/70664866" -# - name: BillingAccountQueryGrouping-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" -# - name: BillingProfileQuery-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579" -# - name: BillingProfileQueryGrouping-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579" -# - name: CustomerQuery-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678" -# - name: CustomerQueryGrouping-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678" -# - name: DepartmentQuery-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/100/departments/123" -# - name: DepartmentQueryGrouping-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/100/departments/123" -# - name: EnrollmentAccountQuery-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456" -# - name: EnrollmentAccountQueryGrouping-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456" -# - name: InvoiceSectionQuery-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876" -# - name: InvoiceSectionQueryGrouping-Modern -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876" -# - name: ManagementGroupQuery-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ -# ers/Microsoft.Management/managementGroups/MyMgId" -# - name: ManagementGroupQueryGrouping-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "providers/Microsoft.Management/managementGroups/MyMgId" -# - name: ResourceGroupQuery-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "subscr\ -# iptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer" -# - name: ResourceGroupQueryGrouping-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceType" type="Dimension" --timeframe "TheLastMonth\ -# " --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer" -# - name: SubscriptionQuery-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ -# \\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ -# \\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ -# \\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "subscr\ -# iptions/00000000-0000-0000-0000-000000000000" -# - name: SubscriptionQueryGrouping-Legacy -# text: |- -# az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ -# axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ -# h" --scope "subscriptions/00000000-0000-0000-0000-000000000000" -# """ - -# helps['costmanagement query usage-by-external-cloud-provider-type'] = """ -# type: command -# short-summary: Query the usage data for external cloud provider type defined. -# examples: -# - name: ExternalBillingAccountQueryList -# text: |- -# az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" --exter\ -# nal-cloud-provider-type "externalBillingAccounts" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\ -# \\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\ -# \\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"\ -# name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" -# - name: ExternalSubscriptionsQuery -# text: |- -# az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" --exter\ -# nal-cloud-provider-type "externalSubscriptions" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ -# ":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ -# ":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ -# me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" -# """ - -# helps['costmanagement export'] = """ -# type: group -# short-summary: costmanagement export -# """ - -# helps['costmanagement export list'] = """ -# type: command -# short-summary: The operation to list all exports at the given scope. -# examples: -# - name: BillingAccountExportList -# text: |- -# az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/123456" -# - name: DepartmentExportList -# text: |- -# az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/12/departments/123" -# - name: EnrollmentAccountExportList -# text: |- -# az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccount\ -# s/456" -# - name: ManagementGroupExportList -# text: |- -# az costmanagement export list --scope "providers/Microsoft.Management/managementGroups/TestMG" -# - name: ResourceGroupExportList -# text: |- -# az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups\ -# /MYDEVTESTRG" -# - name: SubscriptionExportList -# text: |- -# az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000" -# """ - -# helps['costmanagement export show'] = """ -# type: command -# short-summary: The operation to get the execution history of an export for the defined scope by export name. -# examples: -# - name: BillingAccountExport -# text: |- -# az costmanagement export show --export-name "TestExport" --scope "providers/Microsoft.Billing/billingAcc\ -# ounts/123456" -# - name: DepartmentExport -# text: |- -# az costmanagement export show --export-name "TestExport" --scope "providers/Microsoft.Billing/billingAcc\ -# ounts/12/departments/1234" -# - name: EnrollmentAccountExport -# text: |- -# az costmanagement export show --export-name "TestExport" --scope "providers/Microsoft.Billing/billingAcc\ -# ounts/100/enrollmentAccounts/456" -# - name: ManagementGroupExport -# text: |- -# az costmanagement export show --export-name "TestExport" --scope "providers/Microsoft.Management/managem\ -# entGroups/TestMG" -# - name: ResourceGroupExport -# text: |- -# az costmanagement export show --export-name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-\ -# 000000000000/resourceGroups/MYDEVTESTRG" -# - name: SubscriptionExport -# text: |- -# az costmanagement export show --export-name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-\ -# 000000000000" -# """ - -# helps['costmanagement export create'] = """ -# type: command -# short-summary: The operation to create or update a export. Update operation requires latest eTag to be set in the r\ -# equest. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -# examples: -# - name: BillingAccountCreateOrUpdateExport -# text: |- -# az costmanagement export create --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billi\ -# ngAccounts/123456" -# - name: DepartmentCreateOrUpdateExport -# text: |- -# az costmanagement export create --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billi\ -# ngAccounts/12/departments/1234" -# - name: EnrollmentAccountCreateOrUpdateExport -# text: |- -# az costmanagement export create --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billi\ -# ngAccounts/100/enrollmentAccounts/456" -# - name: ManagementGroupCreateOrUpdateExport -# text: |- -# az costmanagement export create --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/ma\ -# nagementGroups/TestMG" -# - name: ResourceGroupCreateOrUpdateExport -# text: |- -# az costmanagement export create --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-\ -# 0000-000000000000/resourceGroups/MYDEVTESTRG" -# - name: SubscriptionCreateOrUpdateExport -# text: |- -# az costmanagement export create --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-\ -# 0000-000000000000" -# """ - -# helps['costmanagement export update'] = """ -# type: command -# short-summary: The operation to create or update a export. Update operation requires latest eTag to be set in the r\ -# equest. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -# examples: -# - name: BillingAccountCreateOrUpdateExport -# text: |- -# az costmanagement export update --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billi\ -# ngAccounts/123456" -# - name: DepartmentCreateOrUpdateExport -# text: |- -# az costmanagement export update --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billi\ -# ngAccounts/12/departments/1234" -# - name: EnrollmentAccountCreateOrUpdateExport -# text: |- -# az costmanagement export update --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billi\ -# ngAccounts/100/enrollmentAccounts/456" -# - name: ManagementGroupCreateOrUpdateExport -# text: |- -# az costmanagement export update --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/ma\ -# nagementGroups/TestMG" -# - name: ResourceGroupCreateOrUpdateExport -# text: |- -# az costmanagement export update --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-\ -# 0000-000000000000/resourceGroups/MYDEVTESTRG" -# - name: SubscriptionCreateOrUpdateExport -# text: |- -# az costmanagement export update --export-name "TestExport" --definition-type "Usage" --definition-datase\ -# t-aggregation "{\\"costSum\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}" --definition-dataset-configurati\ -# on columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --definition-d\ -# ataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"va\ -# lues\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\ -# \\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\ -# \\"API\\"]}}]}" --definition-dataset-grouping name="SubscriptionName" type="Dimension" --definition-dataset-grouping na\ -# me="Environment" type="Tag" --definition-timeframe "MonthToDate" --delivery-info-destination container="exports" resour\ -# ce-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/stora\ -# geAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from\ -# ="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-\ -# 0000-000000000000" -# """ - -# helps['costmanagement export delete'] = """ -# type: command -# short-summary: The operation to delete a export. -# examples: -# - name: BillingAccountDeleteExport -# text: |- -# az costmanagement export delete --export-name "TestExport" --scope "providers/Microsoft.Billing/billingA\ -# ccounts/123456" -# - name: DepartmentDeleteExport -# text: |- -# az costmanagement export delete --export-name "TestExport" --scope "providers/Microsoft.Billing/billingA\ -# ccounts/12/departments/1234" -# - name: EnrollmentAccountDeleteExport -# text: |- -# az costmanagement export delete --export-name "TestExport" --scope "providers/Microsoft.Billing/billingA\ -# ccounts/100/enrollmentAccounts/456" -# - name: ManagementGroupDeleteExport -# text: |- -# az costmanagement export delete --export-name "TestExport" --scope "providers/Microsoft.Management/manag\ -# ementGroups/TestMG" -# - name: ResourceGroupDeleteExport -# text: |- -# az costmanagement export delete --export-name "TestExport" --scope "subscriptions/00000000-0000-0000-000\ -# 0-000000000000/resourceGroups/MYDEVTESTRG" -# - name: SubscriptionDeleteExport -# text: |- -# az costmanagement export delete --export-name "TestExport" --scope "subscriptions/00000000-0000-0000-000\ -# 0-000000000000" -# """ - -# helps['costmanagement export execute'] = """ -# type: command -# short-summary: The operation to execute a export. -# examples: -# - name: BillingAccountExecuteExport -# text: |- -# az costmanagement export execute --export-name "TestExport" --scope "providers/Microsoft.Billing/billing\ -# Accounts/123456" -# - name: DepartmentExecuteExport -# text: |- -# az costmanagement export execute --export-name "TestExport" --scope "providers/Microsoft.Billing/billing\ -# Accounts/12/departments/1234" -# - name: EnrollmentAccountExecuteExport -# text: |- -# az costmanagement export execute --export-name "TestExport" --scope "providers/Microsoft.Billing/billing\ -# Accounts/100/enrollmentAccounts/456" -# - name: ManagementGroupExecuteExport -# text: |- -# az costmanagement export execute --export-name "TestExport" --scope "providers/Microsoft.Management/mana\ -# gementGroups/TestMG" -# - name: ResourceGroupExecuteExport -# text: |- -# az costmanagement export execute --export-name "TestExport" --scope "subscriptions/00000000-0000-0000-00\ -# 00-000000000000/resourceGroups/MYDEVTESTRG" -# - name: SubscriptionExecuteExport -# text: |- -# az costmanagement export execute --export-name "TestExport" --scope "subscriptions/00000000-0000-0000-00\ -# 00-000000000000" -# """ +from knack.help_files import helps + + +helps['costmanagement view'] = """ + type: group + short-summary: costmanagement view +""" + +helps['costmanagement view list'] = """ + type: command + short-summary: Lists all views by tenant and object. + examples: + - name: ResourceGroupViewList + text: |- + az costmanagement view list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/M\ +YDEVTESTRG" +""" + +helps['costmanagement view show'] = """ + type: command + short-summary: Gets the view by view name. + examples: + - name: PrivateView + text: |- + az costmanagement view show --name "swaggerExample" +""" + +helps['costmanagement view create'] = """ + type: command + short-summary: The operation to create or update a view. Update operation requires latest eTag to be set in the req\ +uest. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. + parameters: + - name: --kpis + short-summary: List of KPIs to show in Cost Analysis UI. + long-summary: | + Usage: --kpis type=XX id=XX enabled=XX + + type: KPI type (Forecast, Budget). + id: ID of resource related to metric (budget). + enabled: show the KPI in the UI? + + Multiple actions can be specified by using more than one --kpis argument. + - name: --pivots + short-summary: Configuration of 3 sub-views in the Cost Analysis UI. + long-summary: | + Usage: --pivots type=XX name=XX + + type: Data type to show in view. + name: Data field to show in view. + + Multiple actions can be specified by using more than one --pivots argument. + - name: --query-time-period + short-summary: Has time period for pulling data for the report. + long-summary: | + Usage: --query-time-period from=XX to=XX + + from: Required. The start date to pull data from. + to: Required. The end date to pull data to. + examples: + - name: ResourceGroupCreateOrUpdateView + text: |- + az costmanagement view create --e-tag "\\"1d4ff9fe66f1d10\\"" --accumulated "true" --chart "Table" --dis\ +play-name "swagger Example" --kpis type="Forecast" enabled=true id=null --kpis type="Budget" enabled=true id="/subscrip\ +tions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDe\ +mo" --metric "ActualCost" --pivots name="ServiceName" type="Dimension" --pivots name="MeterCategory" type="Dimension" -\ +-pivots name="swaggerTagKey" type="TagKey" --query-dataset "{\\"aggregation\\":{\\"totalCost\\":{\\"name\\":\\"PreTaxCo\ +st\\",\\"function\\":\\"Sum\\"}},\\"granularity\\":\\"Daily\\",\\"grouping\\":[],\\"sorting\\":[{\\"name\\":\\"UsageDat\ +e\\",\\"direction\\":\\"Ascending\\"}]}" --query-timeframe "MonthToDate" --properties-scope "subscriptions/00000000-000\ +0-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" --name "swaggerExample" +""" + +helps['costmanagement view delete'] = """ + type: command + short-summary: The operation to delete a view. + examples: + - name: ResourceGroupDeleteView + text: |- + az costmanagement view delete --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups\ +/MYDEVTESTRG" --name "TestView" +""" + +helps['costmanagement view get-by-scope'] = """ + type: command + short-summary: Gets the view for the defined scope by view name. + examples: + - name: ResourceGroupView + text: |- + az costmanagement view get-by-scope --scope "subscriptions/00000000-0000-0000-0000-000000000000/resource\ +Groups/MYDEVTESTRG" --name "swaggerExample" +""" + +helps['costmanagement alert'] = """ + type: group + short-summary: costmanagement alert +""" + +helps['costmanagement alert list'] = """ + type: command + short-summary: Lists the alerts for scope defined. + examples: + - name: BillingAccountAlerts + text: |- + az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" + - name: BillingProfileAlerts + text: |- + az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProf\ +iles/13579" + - name: DepartmentAlerts + text: |- + az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments\ +/123" + - name: EnrollmentAccountAlerts + text: |- + az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentA\ +ccounts/456" + - name: InvoiceSectionAlerts + text: |- + az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProf\ +iles/13579/invoiceSections/9876" + - name: ResourceGroupAlerts + text: |- + az costmanagement alert list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/\ +ScreenSharingTest-peer" + - name: SubscriptionAlerts + text: |- + az costmanagement alert list --scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement alert show'] = """ + type: command + short-summary: Gets the alert for the scope by alert ID. + examples: + - name: ResourceGroupAlerts + text: |- + az costmanagement alert show --alert-id "22222222-2222-2222-2222-222222222222" --scope "subscriptions/00\ +000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer" + - name: SubscriptionAlerts + text: |- + az costmanagement alert show --alert-id "22222222-2222-2222-2222-222222222222" --scope "subscriptions/00\ +000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement alert dismiss'] = """ + type: command + short-summary: Dismisses the specified alert + parameters: + - name: --definition + short-summary: defines the type of alert + long-summary: | + Usage: --definition type=XX category=XX criteria=XX + + type: type of alert + category: Alert category + criteria: Criteria that triggered alert + examples: + - name: ResourceGroupAlerts + text: |- + az costmanagement alert dismiss --alert-id "22222222-2222-2222-2222-222222222222" --status "Dismissed" -\ +-scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer" + - name: SubscriptionAlerts + text: |- + az costmanagement alert dismiss --alert-id "22222222-2222-2222-2222-222222222222" --status "Dismissed" -\ +-scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement alert list-external'] = """ + type: command + short-summary: Lists the Alerts for external cloud provider type defined. + examples: + - name: ExternalBillingAccountAlerts + text: |- + az costmanagement alert list-external --external-cloud-provider-id "100" --external-cloud-provider-type \ +"externalBillingAccounts" + - name: ExternalSubscriptionAlerts + text: |- + az costmanagement alert list-external --external-cloud-provider-id "100" --external-cloud-provider-type \ +"externalSubscriptions" +""" + +helps['costmanagement forecast'] = """ + type: group + short-summary: costmanagement forecast +""" + +helps['costmanagement forecast external-cloud-provider-usage'] = """ + type: command + short-summary: Lists the forecast charges for external cloud provider type defined. + parameters: + - name: --time-period + short-summary: Has time period for pulling data for the forecast. + long-summary: | + Usage: --time-period from=XX to=XX + + from: Required. The start date to pull data from. + to: Required. The end date to pull data to. + - name: --dataset-configuration + short-summary: Has configuration information for the data in the export. The configuration will be ignored if a\ +ggregation and grouping are provided. + long-summary: | + Usage: --dataset-configuration columns=XX + + columns: Array of column names to be included in the query. Any valid query column name is allowed. If not \ +provided, then query includes all columns. + examples: + - name: ExternalBillingAccountForecast + text: |- + az costmanagement forecast external-cloud-provider-usage --external-cloud-provider-id "100" --external-c\ +loud-provider-type "externalBillingAccounts" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" + - name: ExternalSubscriptionForecast + text: |- + az costmanagement forecast external-cloud-provider-usage --external-cloud-provider-id "100" --external-c\ +loud-provider-type "externalSubscriptions" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\\ +"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\\ +"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\"\ +:\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" +""" + +helps['costmanagement forecast usage'] = """ + type: command + short-summary: Lists the forecast charges for scope defined. + parameters: + - name: --time-period + short-summary: Has time period for pulling data for the forecast. + long-summary: | + Usage: --time-period from=XX to=XX + + from: Required. The start date to pull data from. + to: Required. The end date to pull data to. + - name: --dataset-configuration + short-summary: Has configuration information for the data in the export. The configuration will be ignored if a\ +ggregation and grouping are provided. + long-summary: | + Usage: --dataset-configuration columns=XX + + columns: Array of column names to be included in the query. Any valid query column name is allowed. If not \ +provided, then query includes all columns. + examples: + - name: BillingAccountForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" + - name: BillingProfileForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billi\ +ngProfiles/13579" + - name: DepartmentForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/depar\ +tments/123" + - name: EnrollmentAccountForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrol\ +lmentAccounts/456" + - name: InvoiceSectionForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billi\ +ngProfiles/13579/invoiceSections/9876" + - name: ResourceGroupForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceG\ +roups/ScreenSharingTest-peer" + - name: SubscriptionForecast + text: |- + az costmanagement forecast usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false --include-f\ +resh-partial-cost false --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement dimension'] = """ + type: group + short-summary: costmanagement dimension +""" + +helps['costmanagement dimension list'] = """ + type: command + short-summary: Lists the dimensions by the defined scope. + examples: + - name: BillingAccountDimensionsList-Legacy + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100" + - name: BillingAccountDimensionsList-Modern + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" + - name: BillingAccountDimensionsListExpandAndTop-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/100" + - name: BillingAccountDimensionsListExpandAndTop-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/12345:6789" + - name: BillingAccountDimensionsListWithFilter-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100" + - name: BillingAccountDimensionsListWithFilter-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" + - name: BillingProfileDimensionsList-Modern + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billing\ +Profiles/13579" + - name: BillingProfileDimensionsListExpandAndTop-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/12345:6789/billingProfiles/13579" + - name: BillingProfileDimensionsListWithFilter-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579" + - name: CustomerDimensionsList-Modern + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/custome\ +rs/5678" + - name: CustomerDimensionsListExpandAndTop-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/12345:6789/customers/5678" + - name: CustomerDimensionsListWithFilter-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678" + - name: DepartmentDimensionsList-Legacy + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100/departments/12\ +3" + - name: DepartmentDimensionsListExpandAndTop-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/100/departments/123" + - name: DepartmentDimensionsListWithFilter-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100/departments/123" + - name: EnrollmentAccountDimensionsList-Legacy + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAcco\ +unts/456" + - name: EnrollmentAccountDimensionsListExpandAndTop-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/100/enrollmentAccounts/456" + - name: EnrollmentAccountDimensionsListWithFilter-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456" + - name: InvoiceSectionDimensionsList-Modern + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billing\ +Profiles/13579/invoiceSections/9876" + - name: InvoiceSectionDimensionsListExpandAndTop-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing\ +/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876" + - name: InvoiceSectionDimensionsListWithFilter-Modern + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876\ +" + - name: ManagementGroupDimensionsList-Legacy + text: |- + az costmanagement dimension list --scope "providers/Microsoft.Management/managementGroups/MyMgId" + - name: ManagementGroupDimensionsListExpandAndTop-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Managem\ +ent/managementGroups/MyMgId" + - name: ManagementGroupDimensionsListWithFilter-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceI\ +d\'" --top 5 --scope "providers/Microsoft.Management/managementGroups/MyMgId" + - name: ResourceGroupDimensionsList-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "subscriptions/00000000-0000\ +-0000-0000-000000000000/resourceGroups/system.orlando" + - name: SubscriptionDimensionsList-Legacy + text: |- + az costmanagement dimension list --expand "properties/data" --top 5 --scope "subscriptions/00000000-0000\ +-0000-0000-000000000000" +""" + +helps['costmanagement dimension by-external-cloud-provider-type'] = """ + type: command + short-summary: Lists the dimensions by the external cloud provider type. + examples: + - name: ExternalBillingAccountDimensionList + text: |- + az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" --externa\ +l-cloud-provider-type "externalBillingAccounts" + - name: ExternalSubscriptionDimensionList + text: |- + az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" --externa\ +l-cloud-provider-type "externalSubscriptions" +""" + +helps['costmanagement query'] = """ + type: group + short-summary: costmanagement query +""" + +helps['costmanagement query usage'] = """ + type: command + short-summary: Query the usage data for scope defined. + parameters: + - name: --time-period + short-summary: Has time period for pulling data for the query. + long-summary: | + Usage: --time-period from=XX to=XX + + from: Required. The start date to pull data from. + to: Required. The end date to pull data to. + - name: --dataset-configuration + short-summary: Has configuration information for the data in the export. The configuration will be ignored if a\ +ggregation and grouping are provided. + long-summary: | + Usage: --dataset-configuration columns=XX + + columns: Array of column names to be included in the query. Any valid query column name is allowed. If not \ +provided, then query includes all columns. + - name: --dataset-grouping + short-summary: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + long-summary: | + Usage: --dataset-grouping type=XX name=XX + + type: Required. Has type of the column to group. + name: Required. The name of the column to group. + + Multiple actions can be specified by using more than one --dataset-grouping argument. + examples: + - name: BillingAccountQuery-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/70664866" + - name: BillingAccountQuery-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/12345:6789" + - name: BillingAccountQueryGrouping-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/70664866" + - name: BillingAccountQueryGrouping-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789" + - name: BillingProfileQuery-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579" + - name: BillingProfileQueryGrouping-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579" + - name: CustomerQuery-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678" + - name: CustomerQueryGrouping-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678" + - name: DepartmentQuery-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/100/departments/123" + - name: DepartmentQueryGrouping-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/100/departments/123" + - name: EnrollmentAccountQuery-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456" + - name: EnrollmentAccountQueryGrouping-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456" + - name: InvoiceSectionQuery-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876" + - name: InvoiceSectionQueryGrouping-Modern + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876" + - name: ManagementGroupQuery-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "provid\ +ers/Microsoft.Management/managementGroups/MyMgId" + - name: ManagementGroupQueryGrouping-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "providers/Microsoft.Management/managementGroups/MyMgId" + - name: ResourceGroupQuery-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "subscr\ +iptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer" + - name: ResourceGroupQueryGrouping-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceType" type="Dimension" --timeframe "TheLastMonth\ +" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer" + - name: SubscriptionQuery-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\ +\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\ +\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\ +\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "subscr\ +iptions/00000000-0000-0000-0000-000000000000" + - name: SubscriptionQueryGrouping-Legacy + text: |- + az costmanagement query usage --type "Usage" --dataset-aggregation "{\\"totalCost\\":{\\"name\\":\\"PreT\ +axCost\\",\\"function\\":\\"Sum\\"}}" --dataset-grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMont\ +h" --scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement query usage-by-external-cloud-provider-type'] = """ + type: command + short-summary: Query the usage data for external cloud provider type defined. + parameters: + - name: --time-period + short-summary: Has time period for pulling data for the query. + long-summary: | + Usage: --time-period from=XX to=XX + + from: Required. The start date to pull data from. + to: Required. The end date to pull data to. + - name: --dataset-configuration + short-summary: Has configuration information for the data in the export. The configuration will be ignored if a\ +ggregation and grouping are provided. + long-summary: | + Usage: --dataset-configuration columns=XX + + columns: Array of column names to be included in the query. Any valid query column name is allowed. If not \ +provided, then query includes all columns. + - name: --dataset-grouping + short-summary: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + long-summary: | + Usage: --dataset-grouping type=XX name=XX + + type: Required. Has type of the column to group. + name: Required. The name of the column to group. + + Multiple actions can be specified by using more than one --dataset-grouping argument. + examples: + - name: ExternalBillingAccountQueryList + text: |- + az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" --exter\ +nal-cloud-provider-type "externalBillingAccounts" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\ +\\":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\ +\\":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"\ +name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" + - name: ExternalSubscriptionsQuery + text: |- + az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" --exter\ +nal-cloud-provider-type "externalSubscriptions" --type "Usage" --dataset-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\\ +":{\\"name\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\\ +":{\\"name\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"na\ +me\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" +""" + +helps['costmanagement export'] = """ + type: group + short-summary: costmanagement export +""" + +helps['costmanagement export list'] = """ + type: command + short-summary: The operation to list all exports at the given scope. + examples: + - name: ExportsGetByBillingAccount + text: |- + az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/123456" + - name: ExportsGetByDepartment + text: |- + az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/12/departments/123" + - name: ExportsGetByEnrollmentAccount + text: |- + az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccount\ +s/456" + - name: ExportsGetByManagementGroup + text: |- + az costmanagement export list --scope "providers/Microsoft.Management/managementGroups/TestMG" + - name: ExportsGetByResourceGroup + text: |- + az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups\ +/MYDEVTESTRG" + - name: ExportsGetBySubscription + text: |- + az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement export show'] = """ + type: command + short-summary: The operation to get the export for the defined scope by export name. + examples: + - name: ExportGetByBillingAccount + text: |- + az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/1\ +23456" + - name: ExportGetByDepartment + text: |- + az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/1\ +2/departments/1234" + - name: ExportGetByEnrollmentAccount + text: |- + az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/1\ +00/enrollmentAccounts/456" + - name: ExportGetByManagementGroup + text: |- + az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Management/managementGrou\ +ps/TestMG" + - name: ExportGetByResourceGroup + text: |- + az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-0000000\ +00000/resourceGroups/MYDEVTESTRG" + - name: ExportGetBySubscription + text: |- + az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-0000000\ +00000" +""" + +helps['costmanagement export create'] = """ + type: command + short-summary: The operation to create or update a export. Update operation requires latest eTag to be set in the r\ +equest. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. + parameters: + - name: --definition-time-period + short-summary: Has time period for pulling data for the export. + long-summary: | + Usage: --definition-time-period from=XX to=XX + + from: Required. The start date for export data. + to: Required. The end date for export data. + - name: --definition-data-set-configuration + short-summary: The export dataset configuration. + long-summary: | + Usage: --definition-data-set-configuration columns=XX + + columns: Array of column names to be included in the export. If not provided then the export will include a\ +ll available columns. The available columns can vary by customer channel (see examples). + - name: --delivery-info-destination + short-summary: Has destination for the export being delivered. + long-summary: | + Usage: --delivery-info-destination resource-id=XX container=XX root-folder-path=XX + + resource-id: Required. The resource id of the storage account where exports will be delivered. + container: Required. The name of the container where exports will be uploaded. + root-folder-path: The name of the directory where exports will be uploaded. + - name: --schedule-recurrence-period + short-summary: Has start and end date of the recurrence. The start date must be in future. If present, the end \ +date must be greater than start date. + long-summary: | + Usage: --schedule-recurrence-period from=XX to=XX + + from: Required. The start date of recurrence. + to: The end date of recurrence. + examples: + - name: ExportCreateOrUpdateByBillingAccount + text: |- + az costmanagement export create --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billingAccounts/123456" + - name: ExportCreateOrUpdateByDepartment + text: |- + az costmanagement export create --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234" + - name: ExportCreateOrUpdateByEnrollmentAccount + text: |- + az costmanagement export create --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccount\ +s/456" + - name: ExportCreateOrUpdateByManagementGroup + text: |- + az costmanagement export create --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/managementGroups/TestMG" + - name: ExportCreateOrUpdateByResourceGroup + text: |- + az costmanagement export create --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups\ +/MYDEVTESTRG" + - name: ExportCreateOrUpdateBySubscription + text: |- + az costmanagement export create --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement export update'] = """ + type: command + short-summary: The operation to create or update a export. Update operation requires latest eTag to be set in the r\ +equest. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. + parameters: + - name: --definition-time-period + short-summary: Has time period for pulling data for the export. + long-summary: | + Usage: --definition-time-period from=XX to=XX + + from: Required. The start date for export data. + to: Required. The end date for export data. + - name: --definition-data-set-configuration + short-summary: The export dataset configuration. + long-summary: | + Usage: --definition-data-set-configuration columns=XX + + columns: Array of column names to be included in the export. If not provided then the export will include a\ +ll available columns. The available columns can vary by customer channel (see examples). + - name: --delivery-info-destination + short-summary: Has destination for the export being delivered. + long-summary: | + Usage: --delivery-info-destination resource-id=XX container=XX root-folder-path=XX + + resource-id: Required. The resource id of the storage account where exports will be delivered. + container: Required. The name of the container where exports will be uploaded. + root-folder-path: The name of the directory where exports will be uploaded. + - name: --schedule-recurrence-period + short-summary: Has start and end date of the recurrence. The start date must be in future. If present, the end \ +date must be greater than start date. + long-summary: | + Usage: --schedule-recurrence-period from=XX to=XX + + from: Required. The start date of recurrence. + to: The end date of recurrence. + examples: + - name: ExportCreateOrUpdateByBillingAccount + text: |- + az costmanagement export update --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billingAccounts/123456" + - name: ExportCreateOrUpdateByDepartment + text: |- + az costmanagement export update --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234" + - name: ExportCreateOrUpdateByEnrollmentAccount + text: |- + az costmanagement export update --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccount\ +s/456" + - name: ExportCreateOrUpdateByManagementGroup + text: |- + az costmanagement export update --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/managementGroups/TestMG" + - name: ExportCreateOrUpdateByResourceGroup + text: |- + az costmanagement export update --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups\ +/MYDEVTESTRG" + - name: ExportCreateOrUpdateBySubscription + text: |- + az costmanagement export update --name "TestExport" --definition-type "ActualCost" --definition-data-set\ +-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --de\ +finition-timeframe "MonthToDate" --delivery-info-destination container="exports" resource-id="/subscriptions/00000000-0\ +000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" roo\ +t-folder-path="ad-hoc" --schedule-recurrence "Weekly" --schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020\ +-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000" +""" + +helps['costmanagement export delete'] = """ + type: command + short-summary: The operation to delete a export. + examples: + - name: ExportDeleteByBillingAccount + text: |- + az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts\ +/123456" + - name: ExportDeleteByDepartment + text: |- + az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts\ +/12/departments/1234" + - name: ExportDeleteByEnrollmentAccount + text: |- + az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts\ +/100/enrollmentAccounts/456" + - name: ExportDeleteByManagementGroup + text: |- + az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Management/managementGr\ +oups/TestMG" + - name: ExportDeleteByResourceGroup + text: |- + az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-00000\ +0000000/resourceGroups/MYDEVTESTRG" + - name: ExportDeleteBySubscription + text: |- + az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-00000\ +0000000" +""" + +helps['costmanagement export execute'] = """ + type: command + short-summary: The operation to execute an export. + examples: + - name: ExportRunByBillingAccount + text: |- + az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Billing/billingAccount\ +s/123456" + - name: ExportRunByDepartment + text: |- + az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Billing/billingAccount\ +s/12/departments/1234" + - name: ExportRunByEnrollmentAccount + text: |- + az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Billing/billingAccount\ +s/100/enrollmentAccounts/456" + - name: ExportRunByManagementGroup + text: |- + az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Management/managementG\ +roups/TestMG" + - name: ExportRunByResourceGroup + text: |- + az costmanagement export execute --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-0000\ +00000000/resourceGroups/MYDEVTESTRG" + - name: ExportRunBySubscription + text: |- + az costmanagement export execute --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-0000\ +00000000" +""" + +helps['costmanagement export get-execution-history'] = """ + type: command + short-summary: The operation to get the execution history of an export for the defined scope and export name. + examples: + - name: ExportRunHistoryGetByBillingAccount + text: |- + az costmanagement export get-execution-history --name "TestExport" --scope "providers/Microsoft.Billing/\ +billingAccounts/123456" + - name: ExportRunHistoryGetByDepartment + text: |- + az costmanagement export get-execution-history --name "TestExport" --scope "providers/Microsoft.Billing/\ +billingAccounts/12/departments/1234" + - name: ExportRunHistoryGetByEnrollmentAccount + text: |- + az costmanagement export get-execution-history --name "TestExport" --scope "providers/Microsoft.Billing/\ +billingAccounts/100/enrollmentAccounts/456" + - name: ExportRunHistoryGetByManagementGroup + text: |- + az costmanagement export get-execution-history --name "TestExport" --scope "providers/Microsoft.Manageme\ +nt/managementGroups/TestMG" + - name: ExportRunHistoryGetByResourceGroup + text: |- + az costmanagement export get-execution-history --name "TestExport" --scope "subscriptions/00000000-0000-\ +0000-0000-000000000000/resourceGroups/MYDEVTESTRG" + - name: ExportRunHistoryGetBySubscription + text: |- + az costmanagement export get-execution-history --name "TestExport" --scope "subscriptions/00000000-0000-\ +0000-0000-000000000000" +""" diff --git a/src/costmanagement/azext_costmanagement/generated/_params.py b/src/costmanagement/azext_costmanagement/generated/_params.py index 367e16f0a57..8181b5b1fb4 100644 --- a/src/costmanagement/azext_costmanagement/generated/_params.py +++ b/src/costmanagement/azext_costmanagement/generated/_params.py @@ -19,449 +19,509 @@ AddKpis, AddPivots, AddQueryTimePeriod, + AddDefinition, AddTimePeriod, AddDatasetConfiguration, AddDatasetGrouping, + AddDefinitionTimePeriod, + AddDefinitionDataSetConfiguration, AddDeliveryInfoDestination, AddScheduleRecurrencePeriod ) def load_arguments(self, _): - pass - # with self.argument_context('costmanagement view list') as c: - # c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' - # 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - # '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' - # 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' - # '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' - # 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' - # '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' - # ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' - # 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' - # 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' - # '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' - # 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') + with self.argument_context('costmanagement view list') as c: + c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' + 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' + 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' + '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' + 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' + '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' + ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' + 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' + 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' + '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' + 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') - # with self.argument_context('costmanagement view show') as c: - # c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' - # 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - # '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' - # 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' - # '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' - # 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' - # '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' - # ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' - # 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' - # 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' - # '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' - # 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') - # c.argument('view_name', help='View name') + with self.argument_context('costmanagement view show') as c: + c.argument('view_name', options_list=['--name', '-n'], help='View name') - # with self.argument_context('costmanagement view create') as c: - # c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' - # 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - # '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' - # 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' - # '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' - # 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' - # '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' - # ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' - # 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' - # 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' - # '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' - # 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') - # c.argument('view_name', help='View name') - # c.argument('e_tag', help='eTag of the resource. To handle concurrent update scenario, this field will be used t' - # 'o determine whether the user is updating the latest version or not.') - # c.argument('display_name', help='User input name of the view. Required.') - # c.argument('properties_scope', help='Cost Management scope to save the view on. This includes \'subscriptions/{' - # 'subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resource' - # 'GroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccount' - # 'Id}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/d' - # 'epartments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{bi' - # 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers' - # '/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for Bill' - # 'ingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/' - # '{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{m' - # 'anagementGroupId}\' for Management Group scope, \'/providers/Microsoft.CostManagement/externalBilli' - # 'ngAccounts/{externalBillingAccountName}\' for ExternalBillingAccount scope, and \'/providers/Micros' - # 'oft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for ExternalSubscription scop' - # 'e.') - # c.argument('chart', arg_type=get_enum_type(['Area', 'Line', 'StackedColumn', 'GroupedColumn', 'Table']), help= - # 'Chart type of the main view in Cost Analysis. Required.') - # c.argument('accumulated', arg_type=get_enum_type(['true', 'false']), help='Show costs accumulated over time.') - # c.argument('metric', arg_type=get_enum_type(['ActualCost', 'AmortizedCost', 'AHUB']), help='Metric to use when ' - # 'displaying costs.') - # c.argument('kpis', action=AddKpis, nargs='+', help='List of KPIs to show in Cost Analysis UI. Expect value: KEY' - # '1=VALUE1 KEY2=VALUE2 ... , available KEYs are: type, id, enabled.') - # c.argument('pivots', action=AddPivots, nargs='+', help='Configuration of 3 sub-views in the Cost Analysis UI. E' - # 'xpect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: type, name.') - # c.argument('query_timeframe', arg_type=get_enum_type(['WeekToDate', 'MonthToDate', 'YearToDate', 'Custom']), - # help='The time frame for pulling data for the report. If custom, then a specific time period must be' - # ' provided.') - # c.argument('query_time_period', action=AddQueryTimePeriod, nargs='+', help='Has time period for pulling data fo' - # 'r the report. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('query_dataset', arg_type=CLIArgumentType(options_list=['--query-dataset'], help='Has definition for' - # ' data in this report config. Expected value: json-string/@json-file.')) + with self.argument_context('costmanagement view create') as c: + c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' + 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' + 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' + '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' + 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' + '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' + ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' + 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' + 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' + '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' + 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') + c.argument('view_name', options_list=['--name', '-n'], help='View name') + c.argument('e_tag', help='eTag of the resource. To handle concurrent update scenario, this field will be used t' + 'o determine whether the user is updating the latest version or not.') + c.argument('display_name', help='User input name of the view. Required.') + c.argument('properties_scope', help='Cost Management scope to save the view on. This includes \'subscriptions/{' + 'subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resource' + 'GroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccount' + 'Id}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/d' + 'epartments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{bi' + 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers' + '/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for Bill' + 'ingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/' + '{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{m' + 'anagementGroupId}\' for Management Group scope, \'/providers/Microsoft.CostManagement/externalBilli' + 'ngAccounts/{externalBillingAccountName}\' for ExternalBillingAccount scope, and \'/providers/Micros' + 'oft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for ExternalSubscription scop' + 'e.') + c.argument('chart', arg_type=get_enum_type(['Area', 'Line', 'StackedColumn', 'GroupedColumn', 'Table']), help= + 'Chart type of the main view in Cost Analysis. Required.') + c.argument('accumulated', arg_type=get_enum_type(['true', 'false']), help='Show costs accumulated over time.') + c.argument('metric', arg_type=get_enum_type(['ActualCost', 'AmortizedCost', 'AHUB']), help='Metric to use when ' + 'displaying costs.') + c.argument('kpis', action=AddKpis, nargs='+', help='List of KPIs to show in Cost Analysis UI.') + c.argument('pivots', action=AddPivots, nargs='+', + help='Configuration of 3 sub-views in the Cost Analysis UI.') + c.argument('query_timeframe', arg_type=get_enum_type(['WeekToDate', 'MonthToDate', 'YearToDate', 'Custom']), + help='The time frame for pulling data for the report. If custom, then a specific time period must be' + ' provided.') + c.argument('query_time_period', action=AddQueryTimePeriod, nargs='+', help='Has time period for pulling data fo' + 'r the report.') + c.argument('query_dataset', arg_type=CLIArgumentType(options_list=['--query-dataset'], help='Has definition for' + ' data in this report config. Expected value: json-string/@json-file.')) - # with self.argument_context('costmanagement view delete') as c: - # c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' - # 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - # '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' - # 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' - # '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' - # 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' - # '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' - # ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' - # 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' - # 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' - # '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' - # 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') - # c.argument('view_name', help='View name') + with self.argument_context('costmanagement view delete') as c: + c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' + 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' + 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' + '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' + 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' + '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' + ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' + 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' + 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' + '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' + 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') + c.argument('view_name', options_list=['--name', '-n'], help='View name') - # with self.argument_context('costmanagement alert list') as c: - # c.argument('scope', help='The scope associated with alerts operations. This includes \'/subscriptions/{subscrip' - # 'tionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupN' - # 'ame}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}\'' - # ' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/de' - # 'partments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{bi' - # 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provider' - # 's/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, \'/provider' - # 's/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for bil' - # 'lingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile' - # 's/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'/provider' - # 's/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for partne' - # 'rs.') + with self.argument_context('costmanagement view get-by-scope') as c: + c.argument('scope', help='The scope associated with view operations. This includes \'subscriptions/{subscriptio' + 'nId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + '\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}\' for ' + 'Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments' + '/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccou' + 'ntId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'providers/Microsoft' + '.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for BillingProfile' + ' scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSe' + 'ctionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/managementGroups/{managementG' + 'roupId}\' for Management Group scope, \'providers/Microsoft.CostManagement/externalBillingAccounts/' + '{externalBillingAccountName}\' for External Billing Account scope and \'providers/Microsoft.CostMan' + 'agement/externalSubscriptions/{externalSubscriptionName}\' for External Subscription scope.') + c.argument('view_name', options_list=['--name', '-n'], help='View name') - # with self.argument_context('costmanagement alert list-external') as c: - # c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' - # 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' - # 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' - # 'ed account.') - # c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' - # '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') + with self.argument_context('costmanagement alert list') as c: + c.argument('scope', help='The scope associated with alerts operations. This includes \'/subscriptions/{subscrip' + 'tionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupN' + 'ame}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}\'' + ' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/de' + 'partments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{bi' + 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provider' + 's/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, \'/provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for bil' + 'lingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile' + 's/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'/provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for partne' + 'rs.') - # with self.argument_context('costmanagement forecast external-cloud-provider-usage') as c: - # c.argument('filter', help='May be used to filter forecasts by properties/usageDate (Utc time), properties/charg' - # 'eType or properties/grain. The filter supports \'eq\', \'lt\', \'gt\', \'le\', \'ge\', and \'and\'.' - # ' It does not currently support \'ne\', \'or\', or \'not\'.') - # c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' - # 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' - # 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' - # 'ed account.') - # c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' - # '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') - # c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), - # help='The type of the forecast.') - # c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' - # 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the forecast. If c' - # 'ustom, then a specific time period must be provided.') - # c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the forec' - # 'ast. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('include_actual_cost', arg_type=get_three_state_flag(), help='a boolean determining if actualCost wi' - # 'll be included') - # c.argument('include_fresh_partial_cost', arg_type=get_three_state_flag(), help='a boolean determining if FreshP' - # 'artialCost will be included') - # c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' - # 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' - # 'rovided. Expect value: columns=xx.') - # c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' - # 'nary of aggregation expression to use in the query. The key of each item in the dictionary is the a' - # 'lias for the aggregated column. Query can have up to 2 aggregation clauses. Expected value: json-st' - # 'ring/@json-file.')) - # c.argument('dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by expression to use ' - # 'in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , ' - # 'available KEYs are: type, name.') - # c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' - # 'ssion to use in the query. Expected value: json-string/@json-file.')) + with self.argument_context('costmanagement alert show') as c: + c.argument('scope', help='The scope associated with alerts operations. This includes \'/subscriptions/{subscrip' + 'tionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupN' + 'ame}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}\'' + ' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/de' + 'partments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{bi' + 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provider' + 's/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, \'/provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for bil' + 'lingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile' + 's/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'/provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for partne' + 'rs.') + c.argument('alert_id', help='Alert ID') - # with self.argument_context('costmanagement forecast usage') as c: - # c.argument('filter', help='May be used to filter forecasts by properties/usageDate (Utc time), properties/charg' - # 'eType or properties/grain. The filter supports \'eq\', \'lt\', \'gt\', \'le\', \'ge\', and \'and\'.' - # ' It does not currently support \'ne\', \'or\', or \'not\'.') - # c.argument('scope', help='The scope associated with forecast operations. This includes \'/subscriptions/{subscr' - # 'iptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGrou' - # 'pName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' - # '\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/' - # 'departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{' - # 'billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provid' - # 'ers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, \'/provid' - # 'ers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for b' - # 'illingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfi' - # 'les/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'/provid' - # 'ers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for part' - # 'ners.') - # c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), - # help='The type of the forecast.') - # c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' - # 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the forecast. If c' - # 'ustom, then a specific time period must be provided.') - # c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the forec' - # 'ast. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('include_actual_cost', arg_type=get_three_state_flag(), help='a boolean determining if actualCost wi' - # 'll be included') - # c.argument('include_fresh_partial_cost', arg_type=get_three_state_flag(), help='a boolean determining if FreshP' - # 'artialCost will be included') - # c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' - # 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' - # 'rovided. Expect value: columns=xx.') - # c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' - # 'nary of aggregation expression to use in the query. The key of each item in the dictionary is the a' - # 'lias for the aggregated column. Query can have up to 2 aggregation clauses. Expected value: json-st' - # 'ring/@json-file.')) - # c.argument('dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by expression to use ' - # 'in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , ' - # 'available KEYs are: type, name.') - # c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' - # 'ssion to use in the query. Expected value: json-string/@json-file.')) + with self.argument_context('costmanagement alert dismiss') as c: + c.argument('scope', help='The scope associated with alerts operations. This includes \'/subscriptions/{subscrip' + 'tionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupN' + 'ame}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}\'' + ' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/de' + 'partments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{bi' + 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provider' + 's/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, \'/provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for bil' + 'lingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile' + 's/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'/provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for partne' + 'rs.') + c.argument('alert_id', help='Alert ID') + c.argument('definition', action=AddDefinition, nargs='+', help='defines the type of alert') + c.argument('description', help='Alert description') + c.argument('source', arg_type=get_enum_type(['Preset', 'User']), help='Source of alert') + c.argument('cost_entity_id', help='related budget') + c.argument('status', arg_type=get_enum_type(['None', 'Active', 'Overridden', 'Resolved', 'Dismissed']), help='a' + 'lert status') + c.argument('creation_time', help='dateTime in which alert was created') + c.argument('close_time', help='dateTime in which alert was closed') + c.argument('modification_time', help='dateTime in which alert was last modified') + c.argument('status_modification_user_name', help='') + c.argument('status_modification_time', help='dateTime in which the alert status was last modified') + c.argument('details_time_grain_type', arg_type=get_enum_type(['None', 'Monthly', 'Quarterly', 'Annually', 'Bill' + 'ingMonth', 'BillingQuarter', 'BillingAnnual']), help='Type of timegrain cadence') + c.argument('details_period_start_date', help='datetime of periodStartDate') + c.argument('details_triggered_by', help='notificationId that triggered this alert') + c.argument('details_resource_group_filter', arg_type=CLIArgumentType(options_list=['--details-resource-group-fi' + 'lter'], help='array of resourceGroups to filter by Expected value: json-string/@json-file.')) + c.argument('details_resource_filter', arg_type=CLIArgumentType(options_list=['--details-resource-filter'], + help='array of resources to filter by Expected value: json-string/@json-file.')) + c.argument('details_meter_filter', arg_type=CLIArgumentType(options_list=['--details-meter-filter'], help='arra' + 'y of meters to filter by Expected value: json-string/@json-file.')) + c.argument('details_tag_filter', arg_type=CLIArgumentType(options_list=['--details-tag-filter'], help='tags to ' + 'filter by Expected value: json-string/@json-file.')) + c.argument('details_threshold', help='notification threshold percentage as a decimal which activated this alert' + '') + c.argument('details_operator', arg_type=get_enum_type(['None', 'EqualTo', 'GreaterThan', + 'GreaterThanOrEqualTo', 'LessThan', 'LessThanOrEqualTo']), help='operator used to compare currentSpe' + 'nd with amount') + c.argument('details_amount', help='budget threshold amount') + c.argument('details_unit', help='unit of currency being used') + c.argument('details_current_spend', help='current spend') + c.argument('details_contact_emails', nargs='+', help='list of emails to contact') + c.argument('details_contact_groups', nargs='+', help='list of action groups to broadcast to') + c.argument('details_contact_roles', nargs='+', help='list of contact roles') + c.argument('details_overriding_alert', help='overriding alert') - # with self.argument_context('costmanagement dimension list') as c: - # c.argument('scope', help='The scope associated with dimension operations. This includes \'/subscriptions/{subsc' - # 'riptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGro' - # 'upName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId' - # '}\' for Billing Account scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/de' - # 'partments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{bi' - # 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provider' - # 's/Microsoft.Management/managementGroups/{managementGroupId}\' for Management Group scope, \'/provid' - # 'ers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for b' - # 'illingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfil' - # 'es/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'provider' - # 's/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for partne' - # 'rs.') - # c.argument('filter', help='May be used to filter dimensions by properties/category, properties/usageStart, prop' - # 'erties/usageEnd. Supported operators are \'eq\',\'lt\', \'gt\', \'le\', \'ge\'.') - # c.argument('expand', help='May be used to expand the properties/data within a dimension category. By default, d' - # 'ata is not included when listing dimensions.') - # c.argument('skiptoken', help='Skiptoken is only used if a previous operation returned a partial result. If a pr' - # 'evious response contains a nextLink element, the value of the nextLink element will include a skipt' - # 'oken parameter that specifies a starting point to use for subsequent calls.') - # c.argument('top', help='May be used to limit the number of results to the most recent N dimension data.') + with self.argument_context('costmanagement alert list-external') as c: + c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' + 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' + 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' + 'ed account.') + c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' + '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') - # with self.argument_context('costmanagement dimension by-external-cloud-provider-type') as c: - # c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' - # 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' - # 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' - # 'ed account.') - # c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' - # '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') - # c.argument('filter', help='May be used to filter dimensions by properties/category, properties/usageStart, prop' - # 'erties/usageEnd. Supported operators are \'eq\',\'lt\', \'gt\', \'le\', \'ge\'.') - # c.argument('expand', help='May be used to expand the properties/data within a dimension category. By default, d' - # 'ata is not included when listing dimensions.') - # c.argument('skiptoken', help='Skiptoken is only used if a previous operation returned a partial result. If a pr' - # 'evious response contains a nextLink element, the value of the nextLink element will include a skipt' - # 'oken parameter that specifies a starting point to use for subsequent calls.') - # c.argument('top', help='May be used to limit the number of results to the most recent N dimension data.') + with self.argument_context('costmanagement forecast external-cloud-provider-usage') as c: + c.argument('filter', help='May be used to filter forecasts by properties/usageDate (Utc time), properties/charg' + 'eType or properties/grain. The filter supports \'eq\', \'lt\', \'gt\', \'le\', \'ge\', and \'and\'.' + ' It does not currently support \'ne\', \'or\', or \'not\'.') + c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' + 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' + 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' + 'ed account.') + c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' + '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), + help='The type of the forecast.') + c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' + 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the forecast. If c' + 'ustom, then a specific time period must be provided.') + c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the forec' + 'ast.') + c.argument('include_actual_cost', arg_type=get_three_state_flag(), help='a boolean determining if actualCost wi' + 'll be included') + c.argument('include_fresh_partial_cost', arg_type=get_three_state_flag(), help='a boolean determining if FreshP' + 'artialCost will be included') + c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' + 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' + 'rovided.') + c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' + 'nary of aggregation expression to use in the forecast. The key of each item in the dictionary is th' + 'e alias for the aggregated column. forecast can have up to 2 aggregation clauses. Expected value: j' + 'son-string/@json-file.')) + c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' + 'ssion to use in the forecast. Expected value: json-string/@json-file.')) - # with self.argument_context('costmanagement query usage') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') - # c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), - # help='The type of the query.') - # c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' - # 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the query. If cust' - # 'om, then a specific time period must be provided.') - # c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the query' - # '. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' - # 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' - # 'rovided. Expect value: columns=xx.') - # c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' - # 'nary of aggregation expression to use in the query. The key of each item in the dictionary is the a' - # 'lias for the aggregated column. Query can have up to 2 aggregation clauses. Expected value: json-st' - # 'ring/@json-file.')) - # c.argument('dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by expression to use ' - # 'in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , ' - # 'available KEYs are: type, name.') - # c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' - # 'ssion to use in the query. Expected value: json-string/@json-file.')) + with self.argument_context('costmanagement forecast usage') as c: + c.argument('filter', help='May be used to filter forecasts by properties/usageDate (Utc time), properties/charg' + 'eType or properties/grain. The filter supports \'eq\', \'lt\', \'gt\', \'le\', \'ge\', and \'and\'.' + ' It does not currently support \'ne\', \'or\', or \'not\'.') + c.argument('scope', help='The scope associated with forecast operations. This includes \'/subscriptions/{subscr' + 'iptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGrou' + 'pName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + '\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/' + 'departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{' + 'billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provid' + 'ers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, \'/provid' + 'ers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for b' + 'illingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfi' + 'les/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'/provid' + 'ers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for part' + 'ners.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), + help='The type of the forecast.') + c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' + 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the forecast. If c' + 'ustom, then a specific time period must be provided.') + c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the forec' + 'ast.') + c.argument('include_actual_cost', arg_type=get_three_state_flag(), help='a boolean determining if actualCost wi' + 'll be included') + c.argument('include_fresh_partial_cost', arg_type=get_three_state_flag(), help='a boolean determining if FreshP' + 'artialCost will be included') + c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' + 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' + 'rovided.') + c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' + 'nary of aggregation expression to use in the forecast. The key of each item in the dictionary is th' + 'e alias for the aggregated column. forecast can have up to 2 aggregation clauses. Expected value: j' + 'son-string/@json-file.')) + c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' + 'ssion to use in the forecast. Expected value: json-string/@json-file.')) - # with self.argument_context('costmanagement query usage-by-external-cloud-provider-type') as c: - # c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' - # 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' - # 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' - # 'ed account.') - # c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' - # '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') - # c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), - # help='The type of the query.') - # c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' - # 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the query. If cust' - # 'om, then a specific time period must be provided.') - # c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the query' - # '. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' - # 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' - # 'rovided. Expect value: columns=xx.') - # c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' - # 'nary of aggregation expression to use in the query. The key of each item in the dictionary is the a' - # 'lias for the aggregated column. Query can have up to 2 aggregation clauses. Expected value: json-st' - # 'ring/@json-file.')) - # c.argument('dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by expression to use ' - # 'in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , ' - # 'available KEYs are: type, name.') - # c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' - # 'ssion to use in the query. Expected value: json-string/@json-file.')) + with self.argument_context('costmanagement dimension list') as c: + c.argument('scope', help='The scope associated with dimension operations. This includes \'/subscriptions/{subsc' + 'riptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGro' + 'upName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId' + '}\' for Billing Account scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/de' + 'partments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAccounts/{bi' + 'llingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, \'/provider' + 's/Microsoft.Management/managementGroups/{managementGroupId}\' for Management Group scope, \'/provid' + 'ers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}\' for b' + 'illingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfil' + 'es/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'provider' + 's/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific for partne' + 'rs.') + c.argument('filter', help='May be used to filter dimensions by properties/category, properties/usageStart, prop' + 'erties/usageEnd. Supported operators are \'eq\',\'lt\', \'gt\', \'le\', \'ge\'.') + c.argument('expand', help='May be used to expand the properties/data within a dimension category. By default, d' + 'ata is not included when listing dimensions.') + c.argument('skiptoken', help='Skiptoken is only used if a previous operation returned a partial result. If a pr' + 'evious response contains a nextLink element, the value of the nextLink element will include a skipt' + 'oken parameter that specifies a starting point to use for subsequent calls.') + c.argument('top', help='May be used to limit the number of results to the most recent N dimension data.') - # with self.argument_context('costmanagement export list') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') + with self.argument_context('costmanagement dimension by-external-cloud-provider-type') as c: + c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' + 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' + 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' + 'ed account.') + c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' + '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') + c.argument('filter', help='May be used to filter dimensions by properties/category, properties/usageStart, prop' + 'erties/usageEnd. Supported operators are \'eq\',\'lt\', \'gt\', \'le\', \'ge\'.') + c.argument('expand', help='May be used to expand the properties/data within a dimension category. By default, d' + 'ata is not included when listing dimensions.') + c.argument('skiptoken', help='Skiptoken is only used if a previous operation returned a partial result. If a pr' + 'evious response contains a nextLink element, the value of the nextLink element will include a skipt' + 'oken parameter that specifies a starting point to use for subsequent calls.') + c.argument('top', help='May be used to limit the number of results to the most recent N dimension data.') - # with self.argument_context('costmanagement export show') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') - # c.argument('export_name', help='Export Name.') + with self.argument_context('costmanagement query usage') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), + help='The type of the query.') + c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' + 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the query. If cust' + 'om, then a specific time period must be provided.') + c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the query' + '.') + c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' + 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' + 'rovided.') + c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' + 'nary of aggregation expression to use in the query. The key of each item in the dictionary is the a' + 'lias for the aggregated column. Query can have up to 2 aggregation clauses. Expected value: json-st' + 'ring/@json-file.')) + c.argument('dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by expression to use ' + 'in the query. Query can have up to 2 group by clauses.') + c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' + 'ssion to use in the query. Expected value: json-string/@json-file.')) - # with self.argument_context('costmanagement export create') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') - # c.argument('export_name', help='Export Name.') - # c.argument('e_tag', help='eTag of the resource. To handle concurrent update scenario, this field will be used t' - # 'o determine whether the user is updating the latest version or not.') - # c.argument('definition_type', arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), help='The type ' - # 'of the query.') - # c.argument('definition_timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', - # 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the quer' - # 'y. If custom, then a specific time period must be provided.') - # c.argument('definition_time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data fo' - # 'r the query. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('definition_dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configurati' - # 'on information for the data in the export. The configuration will be ignored if aggregation and gro' - # 'uping are provided. Expect value: columns=xx.') - # c.argument('definition_dataset_aggregation', arg_type=CLIArgumentType(options_list=['--definition-dataset-aggre' - # 'gation'], help='Dictionary of aggregation expression to use in the query. The key of each item in t' - # 'he dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. E' - # 'xpected value: json-string/@json-file.')) - # c.argument('definition_dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by express' - # 'ion to use in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VA' - # 'LUE2 ... , available KEYs are: type, name.') - # c.argument('definition_dataset_filter', arg_type=CLIArgumentType(options_list=['--definition-dataset-filter'], - # help='Has filter expression to use in the query. Expected value: json-string/@json-file.')) - # c.argument('delivery_info_destination', action=AddDeliveryInfoDestination, nargs='+', help='Has destination for' - # ' the export being delivered. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: resour' - # 'ce-id, container, root-folder-path.') - # c.argument('schedule_status', arg_type=get_enum_type(['Active', 'Inactive']), help='The status of the schedule.' - # ' Whether active or not. If inactive, the export\'s scheduled execution is paused.') - # c.argument('schedule_recurrence', arg_type=get_enum_type(['Daily', 'Weekly', 'Monthly', 'Annually']), help='The' - # ' schedule recurrence.') - # c.argument('schedule_recurrence_period', action=AddScheduleRecurrencePeriod, nargs='+', help='Has start and end' - # ' date of the recurrence. The start date must be in future. If present, the end date must be greater' - # ' than start date. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') + with self.argument_context('costmanagement query usage-by-external-cloud-provider-type') as c: + c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions', 'externalBillingAcc' + 'ounts']), help='The external cloud provider type associated with dimension/query operations. This i' + 'ncludes \'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidat' + 'ed account.') + c.argument('external_cloud_provider_id', help='This can be \'{externalSubscriptionId}\' for linked account or ' + '\'{externalBillingAccountId}\' for consolidated account used with dimension/query operations.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), + help='The type of the query.') + c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', 'TheLastBi' + 'llingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the query. If cust' + 'om, then a specific time period must be provided.') + c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the query' + '.') + c.argument('dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configuration informat' + 'ion for the data in the export. The configuration will be ignored if aggregation and grouping are p' + 'rovided.') + c.argument('dataset_aggregation', arg_type=CLIArgumentType(options_list=['--dataset-aggregation'], help='Dictio' + 'nary of aggregation expression to use in the query. The key of each item in the dictionary is the a' + 'lias for the aggregated column. Query can have up to 2 aggregation clauses. Expected value: json-st' + 'ring/@json-file.')) + c.argument('dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by expression to use ' + 'in the query. Query can have up to 2 group by clauses.') + c.argument('dataset_filter', arg_type=CLIArgumentType(options_list=['--dataset-filter'], help='Has filter expre' + 'ssion to use in the query. Expected value: json-string/@json-file.')) - # with self.argument_context('costmanagement export update') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') - # c.argument('export_name', help='Export Name.') - # c.argument('e_tag', help='eTag of the resource. To handle concurrent update scenario, this field will be used t' - # 'o determine whether the user is updating the latest version or not.') - # c.argument('definition_type', arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), help='The type ' - # 'of the query.') - # c.argument('definition_timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', - # 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the quer' - # 'y. If custom, then a specific time period must be provided.') - # c.argument('definition_time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data fo' - # 'r the query. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') - # c.argument('definition_dataset_configuration', action=AddDatasetConfiguration, nargs='+', help='Has configurati' - # 'on information for the data in the export. The configuration will be ignored if aggregation and gro' - # 'uping are provided. Expect value: columns=xx.') - # c.argument('definition_dataset_aggregation', arg_type=CLIArgumentType(options_list=['--definition-dataset-aggre' - # 'gation'], help='Dictionary of aggregation expression to use in the query. The key of each item in t' - # 'he dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. E' - # 'xpected value: json-string/@json-file.')) - # c.argument('definition_dataset_grouping', action=AddDatasetGrouping, nargs='+', help='Array of group by express' - # 'ion to use in the query. Query can have up to 2 group by clauses. Expect value: KEY1=VALUE1 KEY2=VA' - # 'LUE2 ... , available KEYs are: type, name.') - # c.argument('definition_dataset_filter', arg_type=CLIArgumentType(options_list=['--definition-dataset-filter'], - # help='Has filter expression to use in the query. Expected value: json-string/@json-file.')) - # c.argument('delivery_info_destination', action=AddDeliveryInfoDestination, nargs='+', help='Has destination for' - # ' the export being delivered. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: resour' - # 'ce-id, container, root-folder-path.') - # c.argument('schedule_status', arg_type=get_enum_type(['Active', 'Inactive']), help='The status of the schedule.' - # ' Whether active or not. If inactive, the export\'s scheduled execution is paused.') - # c.argument('schedule_recurrence', arg_type=get_enum_type(['Daily', 'Weekly', 'Monthly', 'Annually']), help='The' - # ' schedule recurrence.') - # c.argument('schedule_recurrence_period', action=AddScheduleRecurrencePeriod, nargs='+', help='Has start and end' - # ' date of the recurrence. The start date must be in future. If present, the end date must be greater' - # ' than start date. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: from, to.') + with self.argument_context('costmanagement export list') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('expand', help='May be used to expand the properties within an export. Currently only \'runHistory\'' + ' is supported and will return information for the last execution of each export.') - # with self.argument_context('costmanagement export delete') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') - # c.argument('export_name', help='Export Name.') + with self.argument_context('costmanagement export show') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('export_name', options_list=['--name', '-n'], help='Export Name.') + c.argument('expand', help='May be used to expand the properties within an export. Currently only \'runHistory\'' + ' is supported and will return information for the last 10 executions of the export.') - # with self.argument_context('costmanagement export execute') as c: - # c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' - # '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' - # 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' - # 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' - # 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' - # 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' - # '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' - # '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' - # 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' - # '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' - # ' for partners.') - # c.argument('export_name', help='Export Name.') + with self.argument_context('costmanagement export create') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('export_name', options_list=['--name', '-n'], help='Export Name.') + c.argument('e_tag', help='eTag of the resource. To handle concurrent update scenario, this field will be used t' + 'o determine whether the user is updating the latest version or not.') + c.argument('definition_type', arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), help='The type ' + 'of the export. Note that \'Usage\' is equivalent to \'ActualCost\' and is applicable to exports tha' + 't do not yet provide data for charges or amortization for service reservations.') + c.argument('definition_timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', + 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the expo' + 'rt. If custom, then a specific time period must be provided.') + c.argument('definition_time_period', action=AddDefinitionTimePeriod, nargs='+', help='Has time period for pulli' + 'ng data for the export.') + c.argument('definition_data_set_configuration', action=AddDefinitionDataSetConfiguration, nargs='+', help='The ' + 'export dataset configuration.') + c.argument('delivery_info_destination', action=AddDeliveryInfoDestination, nargs='+', help='Has destination for' + ' the export being delivered.') + c.argument('schedule_status', arg_type=get_enum_type(['Active', 'Inactive']), help='The status of the export\'s' + ' schedule. If \'Inactive\', the export\'s schedule is paused.') + c.argument('schedule_recurrence', arg_type=get_enum_type(['Daily', 'Weekly', 'Monthly', 'Annually']), help='The' + ' schedule recurrence.') + c.argument('schedule_recurrence_period', action=AddScheduleRecurrencePeriod, nargs='+', help='Has start and end' + ' date of the recurrence. The start date must be in future. If present, the end date must be greater' + ' than start date.') + + with self.argument_context('costmanagement export update') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('export_name', options_list=['--name', '-n'], help='Export Name.') + c.argument('e_tag', help='eTag of the resource. To handle concurrent update scenario, this field will be used t' + 'o determine whether the user is updating the latest version or not.') + c.argument('definition_type', arg_type=get_enum_type(['Usage', 'ActualCost', 'AmortizedCost']), help='The type ' + 'of the export. Note that \'Usage\' is equivalent to \'ActualCost\' and is applicable to exports tha' + 't do not yet provide data for charges or amortization for service reservations.') + c.argument('definition_timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth', + 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The time frame for pulling data for the expo' + 'rt. If custom, then a specific time period must be provided.') + c.argument('definition_time_period', action=AddDefinitionTimePeriod, nargs='+', help='Has time period for pulli' + 'ng data for the export.') + c.argument('definition_data_set_configuration', action=AddDefinitionDataSetConfiguration, nargs='+', help='The ' + 'export dataset configuration.') + c.argument('delivery_info_destination', action=AddDeliveryInfoDestination, nargs='+', help='Has destination for' + ' the export being delivered.') + c.argument('schedule_status', arg_type=get_enum_type(['Active', 'Inactive']), help='The status of the export\'s' + ' schedule. If \'Inactive\', the export\'s schedule is paused.') + c.argument('schedule_recurrence', arg_type=get_enum_type(['Daily', 'Weekly', 'Monthly', 'Annually']), help='The' + ' schedule recurrence.') + c.argument('schedule_recurrence_period', action=AddScheduleRecurrencePeriod, nargs='+', help='Has start and end' + ' date of the recurrence. The start date must be in future. If present, the end date must be greater' + ' than start date.') + + with self.argument_context('costmanagement export delete') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('export_name', options_list=['--name', '-n'], help='Export Name.') + + with self.argument_context('costmanagement export execute') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('export_name', options_list=['--name', '-n'], help='Export Name.') + + with self.argument_context('costmanagement export get-execution-history') as c: + c.argument('scope', help='The scope associated with query and export operations. This includes \'/subscriptions' + '/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/resourceGroups/{reso' + 'urceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAc' + 'countId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAccounts/{billingAcc' + 'ountId}/departments/{departmentId}\' for Department scope, \'/providers/Microsoft.Billing/billingAc' + 'counts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount scope, ' + '\'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId' + '}\' for billingProfile scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/bil' + 'lingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and ' + '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}\' specific' + ' for partners.') + c.argument('export_name', options_list=['--name', '-n'], help='Export Name.') diff --git a/src/costmanagement/azext_costmanagement/generated/_validators.py b/src/costmanagement/azext_costmanagement/generated/_validators.py index 7536d0531ea..e5ac7838677 100644 --- a/src/costmanagement/azext_costmanagement/generated/_validators.py +++ b/src/costmanagement/azext_costmanagement/generated/_validators.py @@ -7,17 +7,3 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- - - -def example_name_or_id_validator(cmd, namespace): - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id - if namespace.storage_account: - if not is_valid_resource_id(namespace.RESOURCE): - namespace.storage_account = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account - ) diff --git a/src/costmanagement/azext_costmanagement/generated/action.py b/src/costmanagement/azext_costmanagement/generated/action.py index e56edb2b2fb..7b6ba27444b 100644 --- a/src/costmanagement/azext_costmanagement/generated/action.py +++ b/src/costmanagement/azext_costmanagement/generated/action.py @@ -88,13 +88,36 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use return d +class AddDefinition(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.definition = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'type': + d['type'] = v[0] + elif kl == 'category': + d['category'] = v[0] + elif kl == 'criteria': + d['criteria'] = v[0] + return d + + class AddTimePeriod(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - if hasattr(namespace, 'definition_time_period'): - namespace.definition_time_period = action - if hasattr(namespace, 'time_period'): - namespace.time_period = action + namespace.time_period = action def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -118,10 +141,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AddDatasetConfiguration(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - if hasattr(namespace, 'dataset_configuration'): - namespace.dataset_configuration = action - if hasattr(namespace, 'definition_dataset_configuration'): - namespace.definition_dataset_configuration = action + namespace.dataset_configuration = action def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -164,6 +184,52 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use return d +class AddDefinitionTimePeriod(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.definition_time_period = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'from': + d['from_property'] = v[0] + elif kl == 'to': + d['to'] = v[0] + return d + + +class AddDefinitionDataSetConfiguration(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.definition_data_set_configuration = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'columns': + d['columns'] = v + return d + + class AddDeliveryInfoDestination(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) diff --git a/src/costmanagement/azext_costmanagement/generated/commands.py b/src/costmanagement/azext_costmanagement/generated/commands.py index 8a61dbaec20..da8275a8731 100644 --- a/src/costmanagement/azext_costmanagement/generated/commands.py +++ b/src/costmanagement/azext_costmanagement/generated/commands.py @@ -8,76 +8,79 @@ # regenerated. # -------------------------------------------------------------------------- -# from azure.cli.core.commands import CliCommandType +from azure.cli.core.commands import CliCommandType def load_command_table(self, _): - pass -# from azext_costmanagement.generated._client_factory import cf_view -# costmanagement_view = CliCommandType( -# operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._view_operations#ViewOperations.{' -# '}', -# client_factory=cf_view) -# with self.command_group('costmanagement view', costmanagement_view, client_factory=cf_view, -# is_experimental=True) as g: -# g.custom_command('list', 'costmanagement_view_list') -# g.custom_show_command('show', 'costmanagement_view_show') -# g.custom_command('create', 'costmanagement_view_create') -# g.custom_command('delete', 'costmanagement_view_delete') + from azext_costmanagement.generated._client_factory import cf_view + costmanagement_view = CliCommandType( + operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._view_operations#ViewOperations.{' + '}', + client_factory=cf_view) + with self.command_group('costmanagement view', costmanagement_view, client_factory=cf_view, + is_experimental=True) as g: + g.custom_command('list', 'costmanagement_view_list') + g.custom_show_command('show', 'costmanagement_view_show') + g.custom_command('create', 'costmanagement_view_create') + g.custom_command('delete', 'costmanagement_view_delete') + g.custom_command('get-by-scope', 'costmanagement_view_get_by_scope') -# from azext_costmanagement.generated._client_factory import cf_alert -# costmanagement_alert = CliCommandType( -# operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._alert_operations#AlertOperations' -# '.{}', -# client_factory=cf_alert) -# with self.command_group('costmanagement alert', costmanagement_alert, client_factory=cf_alert, -# is_experimental=True) as g: -# g.custom_command('list', 'costmanagement_alert_list') -# g.custom_command('list-external', 'costmanagement_alert_list_external') + from azext_costmanagement.generated._client_factory import cf_alert + costmanagement_alert = CliCommandType( + operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._alert_operations#AlertOperations' + '.{}', + client_factory=cf_alert) + with self.command_group('costmanagement alert', costmanagement_alert, client_factory=cf_alert, + is_experimental=True) as g: + g.custom_command('list', 'costmanagement_alert_list') + g.custom_show_command('show', 'costmanagement_alert_show') + g.custom_command('dismiss', 'costmanagement_alert_dismiss') + g.custom_command('list-external', 'costmanagement_alert_list_external') -# from azext_costmanagement.generated._client_factory import cf_forecast -# costmanagement_forecast = CliCommandType( -# operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._forecast_operations#ForecastOper' -# 'ations.{}', -# client_factory=cf_forecast) -# with self.command_group('costmanagement forecast', costmanagement_forecast, client_factory=cf_forecast, -# is_experimental=True) as g: -# g.custom_command('external-cloud-provider-usage', 'costmanagement_forecast_external_cloud_provider_usage') -# g.custom_command('usage', 'costmanagement_forecast_usage') + from azext_costmanagement.generated._client_factory import cf_forecast + costmanagement_forecast = CliCommandType( + operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._forecast_operations#ForecastOper' + 'ations.{}', + client_factory=cf_forecast) + with self.command_group('costmanagement forecast', costmanagement_forecast, client_factory=cf_forecast, + is_experimental=True) as g: + g.custom_command('external-cloud-provider-usage', 'costmanagement_forecast_external_cloud_provider_usage') + g.custom_command('usage', 'costmanagement_forecast_usage') -# from azext_costmanagement.generated._client_factory import cf_dimension -# costmanagement_dimension = CliCommandType( -# operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._dimension_operations#DimensionOp' -# 'erations.{}', -# client_factory=cf_dimension) -# with self.command_group('costmanagement dimension', costmanagement_dimension, client_factory=cf_dimension, -# is_experimental=True) as g: -# g.custom_command('list', 'costmanagement_dimension_list') -# g.custom_command('by-external-cloud-provider-type', -# 'costmanagement_dimension_by_external_cloud_provider_type') + from azext_costmanagement.generated._client_factory import cf_dimension + costmanagement_dimension = CliCommandType( + operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._dimension_operations#DimensionOp' + 'erations.{}', + client_factory=cf_dimension) + with self.command_group('costmanagement dimension', costmanagement_dimension, client_factory=cf_dimension, + is_experimental=True) as g: + g.custom_command('list', 'costmanagement_dimension_list') + g.custom_command('by-external-cloud-provider-type', + 'costmanagement_dimension_by_external_cloud_provider_type') -# from azext_costmanagement.generated._client_factory import cf_query -# costmanagement_query = CliCommandType( -# operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._query_operations#QueryOperations' -# '.{}', -# client_factory=cf_query) -# with self.command_group('costmanagement query', costmanagement_query, client_factory=cf_query, -# is_experimental=True) as g: -# g.custom_command('usage', 'costmanagement_query_usage') -# g.custom_command('usage-by-external-cloud-provider-type', 'costmanagement_query_usage_by_external_cloud_provide' -# 'r_type') + from azext_costmanagement.generated._client_factory import cf_query + costmanagement_query = CliCommandType( + operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._query_operations#QueryOperations' + '.{}', + client_factory=cf_query) + with self.command_group('costmanagement query', costmanagement_query, client_factory=cf_query, + is_experimental=True) as g: + g.custom_command('usage', 'costmanagement_query_usage') + g.custom_command('usage-by-external-cloud-provider-type', 'costmanagement_query_usage_by_external_cloud_provide' + 'r_type') - # from azext_costmanagement.generated._client_factory import cf_export - # costmanagement_export = CliCommandType( - # operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._export_operations#ExportOperatio' - # 'ns.{}', - # client_factory=cf_export) - # with self.command_group('costmanagement export', costmanagement_export, client_factory=cf_export, - # is_experimental=True) as g: - # g.custom_command('list', 'costmanagement_export_list') - # g.custom_show_command('show', 'costmanagement_export_show') - # g.custom_command('create', 'costmanagement_export_create') - # g.custom_command('update', 'costmanagement_export_update') - # g.custom_command('delete', 'costmanagement_export_delete') - # g.custom_command('execute', 'costmanagement_export_execute') + from azext_costmanagement.generated._client_factory import cf_export + costmanagement_export = CliCommandType( + operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._export_operations#ExportOperatio' + 'ns.{}', + client_factory=cf_export) + with self.command_group('costmanagement export', costmanagement_export, client_factory=cf_export, + is_experimental=True) as g: + g.custom_command('list', 'costmanagement_export_list') + g.custom_show_command('show', 'costmanagement_export_show') + g.custom_command('create', 'costmanagement_export_create') + g.custom_command('update', 'costmanagement_export_update') + g.custom_command('delete', 'costmanagement_export_delete') + g.custom_command('execute', 'costmanagement_export_execute') + g.custom_command('get-execution-history', 'costmanagement_export_get_execution_history') diff --git a/src/costmanagement/azext_costmanagement/generated/custom.py b/src/costmanagement/azext_costmanagement/generated/custom.py index 2c3fce143c8..5f558c2accf 100644 --- a/src/costmanagement/azext_costmanagement/generated/custom.py +++ b/src/costmanagement/azext_costmanagement/generated/custom.py @@ -12,176 +12,251 @@ import json -# def costmanagement_view_list(cmd, client, -# scope=None): -# if scope is not None: -# return client.list_by_scope(scope=scope) -# return client.list() - - -# def costmanagement_view_show(cmd, client, -# view_name, -# scope=None): -# if scope is not None and view_name is not None: -# return client.get_by_scope(scope=scope, -# view_name=view_name) -# return client.get(view_name=view_name) - - -# def costmanagement_view_create(cmd, client, -# view_name, -# scope=None, -# e_tag=None, -# display_name=None, -# properties_scope=None, -# chart=None, -# accumulated=None, -# metric=None, -# kpis=None, -# pivots=None, -# query_timeframe=None, -# query_time_period=None, -# query_dataset=None): -# if isinstance(query_dataset, str): -# query_dataset = json.loads(query_dataset) -# if scope is not None and view_name is not None and _parameters is not None: -# return client.create_or_update_by_scope(scope=scope, -# view_name=view_name, -# e_tag=e_tag, -# display_name=display_name, -# view_properties_scope=properties_scope, -# chart=chart, -# accumulated=accumulated, -# metric=metric, -# kpis=kpis, -# pivots=pivots, -# timeframe=query_timeframe, -# time_period=query_time_period, -# dataset=query_dataset) -# return client.create_or_update(view_name=view_name, -# e_tag=e_tag, -# display_name=display_name, -# scope=scope, -# chart=chart, -# accumulated=accumulated, -# metric=metric, -# kpis=kpis, -# pivots=pivots, -# timeframe=query_timeframe, -# time_period=query_time_period, -# dataset=query_dataset) - - -# def costmanagement_view_delete(cmd, client, -# view_name, -# scope=None): -# if scope is not None and view_name is not None: -# return client.delete_by_scope(scope=scope, -# view_name=view_name) -# return client.delete(view_name=view_name) - - -# def costmanagement_alert_list(cmd, client, -# scope): -# return client.list(scope=scope) - - -# def costmanagement_alert_list_external(cmd, client, -# external_cloud_provider_type, -# external_cloud_provider_id): -# return client.list_external(external_cloud_provider_type=external_cloud_provider_type, -# external_cloud_provider_id=external_cloud_provider_id) - - -# def costmanagement_forecast_external_cloud_provider_usage(cmd, client, -# external_cloud_provider_type, -# external_cloud_provider_id, -# type_, -# timeframe, -# filter=None, -# time_period=None, -# include_actual_cost=None, -# include_fresh_partial_cost=None, -# dataset_configuration=None, -# dataset_aggregation=None, -# dataset_grouping=None, -# dataset_filter=None): -# if isinstance(dataset_aggregation, str): -# dataset_aggregation = json.loads(dataset_aggregation) -# if isinstance(dataset_filter, str): -# dataset_filter = json.loads(dataset_filter) -# return client.external_cloud_provider_usage(filter=filter, -# external_cloud_provider_type=external_cloud_provider_type, -# external_cloud_provider_id=external_cloud_provider_id, -# type=type_, -# timeframe=timeframe, -# time_period=time_period, -# include_actual_cost=include_actual_cost, -# include_fresh_partial_cost=include_fresh_partial_cost, -# configuration=dataset_configuration, -# aggregation=dataset_aggregation, -# grouping=dataset_grouping, -# query_filter=dataset_filter) - - -# def costmanagement_forecast_usage(cmd, client, -# scope, -# type_, -# timeframe, -# filter=None, -# time_period=None, -# include_actual_cost=None, -# include_fresh_partial_cost=None, -# dataset_configuration=None, -# dataset_aggregation=None, -# dataset_grouping=None, -# dataset_filter=None): -# if isinstance(dataset_aggregation, str): -# dataset_aggregation = json.loads(dataset_aggregation) -# if isinstance(dataset_filter, str): -# dataset_filter = json.loads(dataset_filter) -# return client.usage(filter=filter, -# scope=scope, -# type=type_, -# timeframe=timeframe, -# time_period=time_period, -# include_actual_cost=include_actual_cost, -# include_fresh_partial_cost=include_fresh_partial_cost, -# configuration=dataset_configuration, -# aggregation=dataset_aggregation, -# grouping=dataset_grouping, -# query_filter=dataset_filter) - - -# def costmanagement_dimension_list(cmd, client, -# scope, -# filter=None, -# expand=None, -# skiptoken=None, -# top=None): -# return client.list(scope=scope, -# filter=filter, -# expand=expand, -# skiptoken=skiptoken, -# top=top) - - -# def costmanagement_dimension_by_external_cloud_provider_type(cmd, client, -# external_cloud_provider_type, -# external_cloud_provider_id, -# filter=None, -# expand=None, -# skiptoken=None, -# top=None): -# return client.by_external_cloud_provider_type(external_cloud_provider_type=external_cloud_provider_type, -# external_cloud_provider_id=external_cloud_provider_id, -# filter=filter, -# expand=expand, -# skiptoken=skiptoken, -# top=top) - - -def costmanagement_query_usage(cmd, client, +def costmanagement_view_list(client, + scope=None): + if scope is not None: + return client.list_by_scope(scope=scope) + return client.list() + + +def costmanagement_view_show(client, + view_name): + return client.get(view_name=view_name) + + +def costmanagement_view_create(client, + view_name, + scope=None, + e_tag=None, + display_name=None, + properties_scope=None, + chart=None, + accumulated=None, + metric=None, + kpis=None, + pivots=None, + query_timeframe=None, + query_time_period=None, + query_dataset=None): + if isinstance(query_dataset, str): + query_dataset = json.loads(query_dataset) + if isinstance(query_dataset, str): + query_dataset = json.loads(query_dataset) + if scope is not None and view_name is not None: + return client.create_or_update_by_scope(scope=scope, + view_name=view_name, + e_tag=e_tag, + display_name=display_name, + view_properties_scope=properties_scope, + chart=chart, + accumulated=accumulated, + metric=metric, + kpis=kpis, + pivots=pivots, + timeframe=query_timeframe, + time_period=query_time_period, + dataset=query_dataset) + return client.create_or_update(view_name=view_name, + e_tag=e_tag, + display_name=display_name, + scope=scope, + chart=chart, + accumulated=accumulated, + metric=metric, + kpis=kpis, + pivots=pivots, + timeframe=query_timeframe, + time_period=query_time_period, + dataset=query_dataset) + + +def costmanagement_view_delete(client, + view_name, + scope=None): + if scope is not None and view_name is not None: + return client.delete_by_scope(scope=scope, + view_name=view_name) + return client.delete(view_name=view_name) + + +def costmanagement_view_get_by_scope(client, + scope, + view_name): + return client.get_by_scope(scope=scope, + view_name=view_name) + + +def costmanagement_alert_list(client, + scope): + return client.list(scope=scope) + + +def costmanagement_alert_show(client, + scope, + alert_id): + return client.get(scope=scope, + alert_id=alert_id) + + +def costmanagement_alert_dismiss(client, + scope, + alert_id, + definition=None, + description=None, + source=None, + cost_entity_id=None, + status=None, + creation_time=None, + close_time=None, + modification_time=None, + status_modification_user_name=None, + status_modification_time=None, + details_time_grain_type=None, + details_period_start_date=None, + details_triggered_by=None, + details_resource_group_filter=None, + details_resource_filter=None, + details_meter_filter=None, + details_tag_filter=None, + details_threshold=None, + details_operator=None, + details_amount=None, + details_unit=None, + details_current_spend=None, + details_contact_emails=None, + details_contact_groups=None, + details_contact_roles=None, + details_overriding_alert=None): + if isinstance(details_resource_group_filter, str): + details_resource_group_filter = json.loads(details_resource_group_filter) + if isinstance(details_resource_filter, str): + details_resource_filter = json.loads(details_resource_filter) + if isinstance(details_meter_filter, str): + details_meter_filter = json.loads(details_meter_filter) + if isinstance(details_tag_filter, str): + details_tag_filter = json.loads(details_tag_filter) + return client.dismiss(scope=scope, + alert_id=alert_id, + definition=definition, + description=description, + source=source, + cost_entity_id=cost_entity_id, + status=status, + creation_time=creation_time, + close_time=close_time, + modification_time=modification_time, + status_modification_user_name=status_modification_user_name, + status_modification_time=status_modification_time, + time_grain_type=details_time_grain_type, + period_start_date=details_period_start_date, + triggered_by=details_triggered_by, + resource_group_filter=details_resource_group_filter, + resource_filter=details_resource_filter, + meter_filter=details_meter_filter, + tag_filter=details_tag_filter, + threshold=details_threshold, + operator=details_operator, + amount=details_amount, + unit=details_unit, + current_spend=details_current_spend, + contact_emails=details_contact_emails, + contact_groups=details_contact_groups, + contact_roles=details_contact_roles, + overriding_alert=details_overriding_alert) + + +def costmanagement_alert_list_external(client, + external_cloud_provider_type, + external_cloud_provider_id): + return client.list_external(external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id) + + +def costmanagement_forecast_external_cloud_provider_usage(client, + external_cloud_provider_type, + external_cloud_provider_id, + type_, + timeframe, + filter=None, + time_period=None, + include_actual_cost=None, + include_fresh_partial_cost=None, + dataset_configuration=None, + dataset_aggregation=None, + dataset_filter=None): + if isinstance(dataset_aggregation, str): + dataset_aggregation = json.loads(dataset_aggregation) + if isinstance(dataset_filter, str): + dataset_filter = json.loads(dataset_filter) + return client.external_cloud_provider_usage(filter=filter, + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + type=type_, + timeframe=timeframe, + time_period=time_period, + include_actual_cost=include_actual_cost, + include_fresh_partial_cost=include_fresh_partial_cost, + configuration=dataset_configuration, + aggregation=dataset_aggregation, + query_filter=dataset_filter) + + +def costmanagement_forecast_usage(client, + scope, + type_, + timeframe, + filter=None, + time_period=None, + include_actual_cost=None, + include_fresh_partial_cost=None, + dataset_configuration=None, + dataset_aggregation=None, + dataset_filter=None): + if isinstance(dataset_aggregation, str): + dataset_aggregation = json.loads(dataset_aggregation) + if isinstance(dataset_filter, str): + dataset_filter = json.loads(dataset_filter) + return client.usage(filter=filter, + scope=scope, + type=type_, + timeframe=timeframe, + time_period=time_period, + include_actual_cost=include_actual_cost, + include_fresh_partial_cost=include_fresh_partial_cost, + configuration=dataset_configuration, + aggregation=dataset_aggregation, + query_filter=dataset_filter) + + +def costmanagement_dimension_list(client, + scope, + filter=None, + expand=None, + skiptoken=None, + top=None): + return client.list(scope=scope, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top) + + +def costmanagement_dimension_by_external_cloud_provider_type(client, + external_cloud_provider_type, + external_cloud_provider_id, + filter=None, + expand=None, + skiptoken=None, + top=None): + return client.by_external_cloud_provider_type(external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top) + + +def costmanagement_query_usage(client, scope, type_, timeframe, @@ -204,7 +279,7 @@ def costmanagement_query_usage(cmd, client, filter=dataset_filter) -def costmanagement_query_usage_by_external_cloud_provider_type(cmd, client, +def costmanagement_query_usage_by_external_cloud_provider_type(client, external_cloud_provider_type, external_cloud_provider_id, type_, @@ -229,100 +304,90 @@ def costmanagement_query_usage_by_external_cloud_provider_type(cmd, client, filter=dataset_filter) -# def costmanagement_export_list(cmd, client, -# scope): -# return client.list(scope=scope) - - -# def costmanagement_export_show(cmd, client, -# scope, -# export_name): -# if scope is not None and export_name is not None: -# return client.get(scope=scope, -# export_name=export_name) -# return client.get_execution_history(scope=scope, -# export_name=export_name) - - -# def costmanagement_export_create(cmd, client, -# scope, -# export_name, -# e_tag=None, -# definition_type=None, -# definition_timeframe=None, -# definition_time_period=None, -# definition_dataset_configuration=None, -# definition_dataset_aggregation=None, -# definition_dataset_grouping=None, -# definition_dataset_filter=None, -# delivery_info_destination=None, -# schedule_status=None, -# schedule_recurrence=None, -# schedule_recurrence_period=None): -# if isinstance(definition_dataset_aggregation, str): -# definition_dataset_aggregation = json.loads(definition_dataset_aggregation) -# if isinstance(definition_dataset_filter, str): -# definition_dataset_filter = json.loads(definition_dataset_filter) -# return client.create_or_update(scope=scope, -# export_name=export_name, -# e_tag=e_tag, -# type=definition_type, -# timeframe=definition_timeframe, -# time_period=definition_time_period, -# configuration=definition_dataset_configuration, -# aggregation=definition_dataset_aggregation, -# grouping=definition_dataset_grouping, -# filter=definition_dataset_filter, -# destination=delivery_info_destination, -# status=schedule_status, -# recurrence=schedule_recurrence, -# recurrence_period=schedule_recurrence_period) - - -# def costmanagement_export_update(cmd, client, -# scope, -# export_name, -# e_tag=None, -# definition_type=None, -# definition_timeframe=None, -# definition_time_period=None, -# definition_dataset_configuration=None, -# definition_dataset_aggregation=None, -# definition_dataset_grouping=None, -# definition_dataset_filter=None, -# delivery_info_destination=None, -# schedule_status=None, -# schedule_recurrence=None, -# schedule_recurrence_period=None): -# if isinstance(definition_dataset_aggregation, str): -# definition_dataset_aggregation = json.loads(definition_dataset_aggregation) -# if isinstance(definition_dataset_filter, str): -# definition_dataset_filter = json.loads(definition_dataset_filter) -# return client.create_or_update(scope=scope, -# export_name=export_name, -# e_tag=e_tag, -# type=definition_type, -# timeframe=definition_timeframe, -# time_period=definition_time_period, -# configuration=definition_dataset_configuration, -# aggregation=definition_dataset_aggregation, -# grouping=definition_dataset_grouping, -# filter=definition_dataset_filter, -# destination=delivery_info_destination, -# status=schedule_status, -# recurrence=schedule_recurrence, -# recurrence_period=schedule_recurrence_period) - - -# def costmanagement_export_delete(cmd, client, -# scope, -# export_name): -# return client.delete(scope=scope, -# export_name=export_name) - - -# def costmanagement_export_execute(cmd, client, -# scope, -# export_name): -# return client.execute(scope=scope, -# export_name=export_name) +def costmanagement_export_list(client, + scope, + expand=None): + return client.list(scope=scope, + expand=expand) + + +def costmanagement_export_show(client, + scope, + export_name, + expand=None): + return client.get(scope=scope, + export_name=export_name, + expand=expand) + + +def costmanagement_export_create(client, + scope, + export_name, + e_tag=None, + definition_type=None, + definition_timeframe=None, + definition_time_period=None, + definition_data_set_configuration=None, + delivery_info_destination=None, + schedule_status=None, + schedule_recurrence=None, + schedule_recurrence_period=None): + return client.create_or_update(scope=scope, + export_name=export_name, + e_tag=e_tag, + run_history=json.loads("{}"), + type=definition_type, + timeframe=definition_timeframe, + time_period=definition_time_period, + configuration=definition_data_set_configuration, + destination=delivery_info_destination, + status=schedule_status, + recurrence=schedule_recurrence, + recurrence_period=schedule_recurrence_period) + + +def costmanagement_export_update(client, + scope, + export_name, + e_tag=None, + definition_type=None, + definition_timeframe=None, + definition_time_period=None, + definition_data_set_configuration=None, + delivery_info_destination=None, + schedule_status=None, + schedule_recurrence=None, + schedule_recurrence_period=None): + return client.create_or_update(scope=scope, + export_name=export_name, + e_tag=e_tag, + run_history=json.loads("{}"), + type=definition_type, + timeframe=definition_timeframe, + time_period=definition_time_period, + configuration=definition_data_set_configuration, + destination=delivery_info_destination, + status=schedule_status, + recurrence=schedule_recurrence, + recurrence_period=schedule_recurrence_period) + + +def costmanagement_export_delete(client, + scope, + export_name): + return client.delete(scope=scope, + export_name=export_name) + + +def costmanagement_export_execute(client, + scope, + export_name): + return client.execute(scope=scope, + export_name=export_name) + + +def costmanagement_export_get_execution_history(client, + scope, + export_name): + return client.get_execution_history(scope=scope, + export_name=export_name) diff --git a/src/costmanagement/azext_costmanagement/tests/__init__.py b/src/costmanagement/azext_costmanagement/tests/__init__.py index fe1bd438b46..5f8f1fd97ad 100644 --- a/src/costmanagement/azext_costmanagement/tests/__init__.py +++ b/src/costmanagement/azext_costmanagement/tests/__init__.py @@ -10,9 +10,14 @@ # -------------------------------------------------------------------------- import inspect import os +import sys +import traceback +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError __path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] def try_manual(func): @@ -34,6 +39,7 @@ def get_func_to_call(): func_to_call = func try: func_to_call = import_manual_function(func) + print("Found manual override for {}(...)".format(func.__name__)) except (ImportError, AttributeError): pass return func_to_call @@ -41,9 +47,25 @@ def get_func_to_call(): def wrapper(*args, **kwargs): func_to_call = get_func_to_call() print("running {}()...".format(func.__name__)) - return func_to_call(*args, **kwargs) + try: + return func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, JMESPathCheckAssertionError) as e: + print("--------------------------------------") + print("step exception: ", e) + print("--------------------------------------", file=sys.stderr) + print("step exception in {}: {}".format(func.__name__, e), file=sys.stderr) + traceback.print_exc() + exceptions.append((func.__name__, sys.exc_info())) if inspect.isclass(func): return get_func_to_call() - else: - return wrapper + return wrapper + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/costmanagement/azext_costmanagement/tests/latest/preparers.py b/src/costmanagement/azext_costmanagement/tests/latest/preparers.py index 3d6672de64f..4702355b2bd 100644 --- a/src/costmanagement/azext_costmanagement/tests/latest/preparers.py +++ b/src/costmanagement/azext_costmanagement/tests/latest/preparers.py @@ -10,8 +10,8 @@ import os from datetime import datetime -from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer from azure.cli.testsdk.exceptions import CliTestError from azure.cli.testsdk.reverse_dependency import get_dummy_cli @@ -19,6 +19,7 @@ KEY_RESOURCE_GROUP = 'rg' KEY_VIRTUAL_NETWORK = 'vnet' KEY_VNET_SUBNET = 'subnet' +KEY_VNET_NIC = 'nic' class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): @@ -40,7 +41,7 @@ def __init__(self, name_prefix='clitest.vn', self.resource_group_key = resource_group_key self.dev_setting_name = os.environ.get(dev_setting_name, None) - def create_resource(self, name, **kwargs): + def create_resource(self, name, **_): if self.dev_setting_name: return {self.parameter_name: self.dev_setting_name, } @@ -56,61 +57,103 @@ def create_resource(self, name, **kwargs): tags['job'] = os.environ['ENV_JOB_NAME'] tags = ' '.join(['{}={}'.format(key, value) for key, value in tags.items()]) - template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + template = 'az network vnet create --resource-group {} --name {} --subnet-name default --tag ' + tags self.live_only_execute(self.cli_ctx, template.format( self.resource_group_name, name)) self.test_class_instance.kwargs[self.key] = name return {self.parameter_name: name} - def remove_resource(self, name, **kwargs): + def remove_resource(self, name, **_): # delete vnet if test is being recorded and if the vnet is not a dev rg if not self.dev_setting_name: self.live_only_execute( - self.cli_ctx, 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) + self.cli_ctx, + 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest.vn', parameter_name='subnet', - resource_group_name=None, resource_group_key=KEY_RESOURCE_GROUP, - vnet_name=None, vnet_key=KEY_VIRTUAL_NETWORK, address_prefixes="11.0.0.0/24", dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', - random_name_length=24, key=KEY_VNET_SUBNET): + key=KEY_VNET_SUBNET): if ' ' in name_prefix: raise CliTestError( 'Error: Space character in name prefix \'%s\'' % name_prefix) - super(VnetSubnetPreparer, self).__init__( - name_prefix, random_name_length) + super(VnetSubnetPreparer, self).__init__(name_prefix, 15) self.cli_ctx = get_dummy_cli() self.parameter_name = parameter_name self.key = key - self.resource_group_name = resource_group_name - self.resource_group_key = resource_group_key - self.vnet_name = vnet_name - self.vnet_key = vnet_key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] self.address_prefixes = address_prefixes self.dev_setting_name = os.environ.get(dev_setting_name, None) - def create_resource(self, name, **kwargs): + def create_resource(self, name, **_): if self.dev_setting_name: return {self.parameter_name: self.dev_setting_name, } - if not self.resource_group_name: - self.resource_group_name = self.test_class_instance.kwargs.get( - self.resource_group_key) - if not self.resource_group_name: + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: raise CliTestError("Error: No resource group configured!") - if not self.vnet_name: - self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) - if not self.vnet_name: + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: raise CliTestError("Error: No vnet configured!") self.test_class_instance.kwargs[self.key] = 'default' return {self.parameter_name: name} - def remove_resource(self, name, **kwargs): + def remove_resource(self, name, **_): pass + + +class VnetNicPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.nic', + parameter_name='subnet', + resource_group_key=KEY_RESOURCE_GROUP, + vnet_key=KEY_VIRTUAL_NETWORK, + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_NIC_NAME', + key=KEY_VNET_NIC): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetNicPreparer, self).__init__(name_prefix, 15) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group = [resource_group_key, None] + self.vnet = [vnet_key, None] + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **_): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group[1]: + self.resource_group[1] = self.test_class_instance.kwargs.get( + self.resource_group[0]) + if not self.resource_group[1]: + raise CliTestError("Error: No resource group configured!") + if not self.vnet[1]: + self.vnet[1] = self.test_class_instance.kwargs.get(self.vnet[0]) + if not self.vnet[1]: + raise CliTestError("Error: No vnet configured!") + + template = 'az network nic create --resource-group {} --name {} --vnet-name {} --subnet default ' + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group[1], name, self.vnet[1])) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **_): + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, + 'az network nic delete --name {} --resource-group {}'.format(name, self.resource_group[1])) diff --git a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_export.py b/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_export.py deleted file mode 100644 index 65614e4cb2f..00000000000 --- a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_export.py +++ /dev/null @@ -1,221 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -from azure.cli.testsdk import ScenarioTest -from azure.cli.testsdk import ResourceGroupPreparer, StorageAccountPreparer - - -class CostManagementExportTest(ScenarioTest): - """ - Those command results may be different every time after you run if running in live mode, - because of the cost is changing as we are creating and deleting resources under this subscription. - """ - - @ResourceGroupPreparer(name_prefix='test_export_create') - @StorageAccountPreparer(name_prefix='test_export_create'.replace('_', '')) - def test_export_create_in_subscription_scope(self, resource_group, storage_account): - self.kwargs.update({ - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()), - }) - - export_name = 'ep-01' - storage_container = 'export' - timeframe = 'TheLastMonth' - storage_account_id = '/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account_name}'.format( - sub=self.get_subscription_id(), - rg=resource_group, - account_name=storage_account - ) - - self.kwargs.update({ - 'export_name': export_name, - 'storage_account_id': storage_account_id, - 'storage_container': storage_container, - 'timeframe': timeframe - }) - - creation_data = self.cmd('costmanagement export create ' - '--scope {scope} ' - '--name {export_name} ' - '--storage-account-id {storage_account_id} ' - '--storage-container {storage_container} ' - '--timeframe {timeframe} ').get_output_in_json() - self._test_export_create_in_subscription_scope_assertions(creation_data, - export_name, - storage_container, - storage_account_id, - timeframe) - - # show an export - show_data = self.cmd('costmanagement export show --scope {scope} --name {export_name}').get_output_in_json() - self._test_export_create_in_subscription_scope_assertions(show_data, - export_name, - storage_container, - storage_account_id, - timeframe) - - # list exports - list_data = self.cmd('costmanagement export list --scope {scope}').get_output_in_json() - self.assertEqual(len(list_data), 1) - self._test_export_create_in_subscription_scope_assertions(list_data[0], - export_name, - storage_container, - storage_account_id, - timeframe) - - self.cmd('costmanagement export delete -y --scope {scope} --name {export_name}') - - with self.assertRaisesRegex(SystemExit, '3'): - self.cmd('costmanagement export show --scope {scope} --name {export_name}') - - def _test_export_create_in_subscription_scope_assertions(self, data, export_name, storage_container, storage_account_id, timeframe): - self.assertEqual(data['name'], export_name) - self.assertIsNone(data['aggregation'], None) - self.assertIsNone(data['configuration'], None) - self.assertDictEqual(data['destination'], { - 'container': storage_container, - 'resourceId': storage_account_id, - 'rootFolderPath': None - }) - self.assertEqual(data['typePropertiesDefinitionType'], 'Usage') - self.assertIsNone(data['recurrence']) - self.assertIsNone(data['recurrencePeriod']) - self.assertEqual(data['status'], 'Inactive') - self.assertIsNone(data['timePeriod']) - self.assertEqual(data['timeframe'], timeframe) - - @ResourceGroupPreparer(name_prefix='test_export_schedule') - @StorageAccountPreparer(name_prefix='test_export_schedule'.replace('_', '')) - def test_export_create_with_schedule_in_subscription_scope(self, resource_group, storage_account): - self.kwargs.update({ - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()), - }) - - export_name = 'ep-02' - storage_container = 'export' - timeframe = 'TheLastMonth' - storage_account_id = '/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account_name}'.format( - sub=self.get_subscription_id(), - rg=resource_group, - account_name=storage_account - ) - - self.kwargs.update({ - 'export_name': export_name, - 'storage_account_id': storage_account_id, - 'storage_container': storage_container, - 'timeframe': timeframe - }) - - creation_data = self.cmd('costmanagement export create ' - '--scope {scope} ' - '--name {export_name} ' - '--storage-account-id {storage_account_id} ' - '--storage-container {storage_container} ' - '--timeframe {timeframe} ' - '--recurrence "Weekly" ' - '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' - '--schedule-status Active').get_output_in_json() - self._test_export_create_with_schedule_in_subscription_scope_assertions(creation_data, - export_name, - storage_container, - storage_account_id, - timeframe) - - # show an export - show_data = self.cmd('costmanagement export show --scope {scope} --name {export_name}').get_output_in_json() - self._test_export_create_with_schedule_in_subscription_scope_assertions(show_data, - export_name, - storage_container, - storage_account_id, - timeframe) - - # list exports - list_data = self.cmd('costmanagement export list --scope {scope}').get_output_in_json() - self.assertEqual(len(list_data), 1) - self._test_export_create_with_schedule_in_subscription_scope_assertions(list_data[0], - export_name, - storage_container, - storage_account_id, - timeframe) - - self.cmd('costmanagement export delete -y --scope {scope} --name {export_name}') - - with self.assertRaisesRegex(SystemExit, '3'): - self.cmd('costmanagement export show --scope {scope} --name {export_name}') - - def _test_export_create_with_schedule_in_subscription_scope_assertions(self, data, export_name, storage_container, storage_account_id, timeframe): - self.assertEqual(data['name'], export_name) - self.assertIsNone(data['aggregation'], None) - self.assertIsNone(data['configuration'], None) - self.assertDictEqual(data['destination'], { - 'container': storage_container, - 'resourceId': storage_account_id, - 'rootFolderPath': None - }) - self.assertEqual(data['typePropertiesDefinitionType'], 'Usage') # default is Usage - self.assertEqual(data['recurrence'], 'Weekly') - self.assertDictEqual(data['recurrencePeriod'], { - "fromProperty": "2020-06-01T00:00:00+00:00", - "to": "2020-10-31T00:00:00+00:00" - }) - self.assertEqual(data['status'], 'Active') - self.assertIsNone(data['timePeriod']) - self.assertEqual(data['timeframe'], timeframe) - - @ResourceGroupPreparer(name_prefix='test_update_schedule') - @StorageAccountPreparer(name_prefix='test_update_schedule'.replace('_', '')) - def test_update_with_timeperiod_in_subscription_scope(self, resource_group, storage_account): - self.kwargs.update({ - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()), - }) - - export_name = 'ep-03' - storage_container = 'export' - timeframe = 'TheLastMonth' - storage_account_id = '/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account_name}'.format( - sub=self.get_subscription_id(), - rg=resource_group, - account_name=storage_account - ) - - self.kwargs.update({ - 'export_name': export_name, - 'storage_account_id': storage_account_id, - 'storage_container': storage_container, - 'timeframe': timeframe, - 'time_period': 'from="2020-08-01T00:00:00Z" to="2020-10-31T00:00:00Z"' - }) - - creation_data = self.cmd('costmanagement export create ' - '--scope {scope} ' - '--name {export_name} ' - '--storage-account-id {storage_account_id} ' - '--storage-container {storage_container} ' - '--timeframe {timeframe} ').get_output_in_json() - self._test_export_create_in_subscription_scope_assertions(creation_data, - export_name, - storage_container, - storage_account_id, - timeframe) - - timeframe = 'TheLastBillingMonth' - self.kwargs.update({ - 'timeframe': timeframe, - }) - - update_data = self.cmd('costmanagement export update ' - '--scope {scope} ' - '--name {export_name} ' - '--recurrence-period {time_period} ' - '--timeframe {timeframe} ').get_output_in_json() - self.assertEqual(update_data['timeframe'], timeframe) - self.assertDictEqual(update_data['recurrencePeriod'], { - "fromProperty": "2020-08-01T00:00:00+00:00", - "to": "2020-10-31T00:00:00+00:00" - }) - - self.cmd('costmanagement export delete -y --scope {scope} --name {export_name}') diff --git a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_query.py b/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_query.py deleted file mode 100644 index c123331f3fb..00000000000 --- a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_query.py +++ /dev/null @@ -1,139 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -from azure.cli.testsdk import ScenarioTest -from azure.cli.testsdk import ResourceGroupPreparer - - -class CostManagementQueryTest(ScenarioTest): - """ - Those command results may be different every time after you run if running in live mode, - because of the billing is changing as we are creating and deleting resources under this subscription. - """ - - @ResourceGroupPreparer(name_prefix='test_query_without_dataset_') - def test_cm_query_in_subscription_scope(self, resource_group): - - usage_types = ['ActualCost', 'AmortizedCost', 'Usage'] - timeframes = ['BillingMonthToDate', 'MonthToDate', 'TheLastBillingMonth', - 'TheLastMonth', 'WeekToDate'] - - for usage_type in usage_types: - for timeframe in timeframes: - self.kwargs.update({ - 'usgae_type': usage_type, - 'timeframe': timeframe, - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()) - }) - - cost_data = self.cmd('costmanagement query --type {usgae_type} --timeframe {timeframe} --scope {scope}').get_output_in_json() - - self.assertEqual(cost_data['type'], 'Microsoft.CostManagement/query') - - # assert data columns, by default, there is no actual cost data but 2 columns "UsageDate" and "Currency" - self.assertEqual(len(cost_data['columns']), 2) - self.assertEqual(cost_data['columns'][0]['name'], 'UsageDate') - self.assertEqual(cost_data['columns'][0]['type'], 'Number') - self.assertEqual(cost_data['columns'][1]['name'], "Currency") - self.assertEqual(cost_data['columns'][1]['type'], 'String') - - @ResourceGroupPreparer(name_prefix='test_data_aggregation_in_subscription_scope') - def test_data_aggregation_in_subscription_scope(self, resource_group): - self.kwargs.update({ - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()), - }) - - usage_type = 'ActualCost' - timeframe = 'TheLastMonth' - aggregation_expression = '\'{"totalCost": {"name": "PreTaxCost", "function": "Sum"}}\'' - - self.kwargs.update({ - 'usage_type': usage_type, - 'timeframe': timeframe, - 'aggregation_expression': aggregation_expression - }) - - cost_data = self.cmd('costmanagement query ' - '--type {usage_type} ' - '--timeframe {timeframe} ' - '--scope {scope} ' - '--dataset-aggregation {aggregation_expression}').get_output_in_json() - - self.assertEqual(cost_data['type'], 'Microsoft.CostManagement/query') - - self.assertEqual(len(cost_data['columns']), 3) - self.assertEqual(cost_data['columns'][0]['name'], 'PreTaxCost') - self.assertEqual(cost_data['columns'][0]['type'], 'Number') - - self.assertEqual(len(cost_data['rows']), 30) - - @ResourceGroupPreparer(name_prefix='test_cm_query_in_subscription_scope_custome_timeframe') - def test_data_aggregation_in_subscription_scope_custome_timeframe(self, resource_group): - self.kwargs.update({ - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()), - }) - - timeframe = 'Custom' - aggregation_expression = '\'{"totalCost": {"name": "PreTaxCost", "function": "Sum"}}\'' - time_period = 'from=2020-03-01T00:00:00 to=2020-05-09T00:00:00 ' - - self.kwargs.update({ - 'usgae_type': 'ActualCost', - 'timeframe': timeframe, - 'time_period': time_period, - 'aggregation_expression': aggregation_expression - }) - - cost_data = self.cmd('costmanagement query ' - '--type {usgae_type} ' - '--timeframe {timeframe} ' - '--time-period {time_period} ' - '--scope {scope} ' - '--dataset-aggregation {aggregation_expression}').get_output_in_json() - - self.assertEqual(cost_data['type'], 'Microsoft.CostManagement/query') - - self.assertEqual(len(cost_data['columns']), 3) - self.assertEqual(cost_data['columns'][0]['name'], 'PreTaxCost') - self.assertEqual(cost_data['columns'][0]['type'], 'Number') - - self.assertEqual(len(cost_data['rows']), 70) - self.assertEqual(cost_data['rows'][0], [186.758302, 20200301, 'USD']) - - @ResourceGroupPreparer(name_prefix='test_data_filter_in_subscription_scopde') - def test_data_grouping_in_subscription_scopde(self, resource_group): - self.kwargs.update({ - 'scope': '/subscriptions/{}'.format(self.get_subscription_id()), - }) - - usage_type = 'ActualCost' - timeframe = 'TheLastMonth' - aggregation_expression = '\'{"totalCost": {"name": "PreTaxCost", "function": "Sum"}}\'' - dataset_grouping = 'name="ResourceGroup" type="Dimension"' - - self.kwargs.update({ - 'usage_type': usage_type, - 'timeframe': timeframe, - 'aggregation_expression': aggregation_expression, - 'dataset_grouping': dataset_grouping - }) - - cost_data = self.cmd('costmanagement query ' - '--type {usage_type} ' - '--timeframe {timeframe} ' - '--scope {scope} ' - '--dataset-aggregation {aggregation_expression} ' - '--dataset-grouping {dataset_grouping}').get_output_in_json() - - self.assertEqual(cost_data['type'], 'Microsoft.CostManagement/query') - - self.assertEqual(len(cost_data['columns']), 4) - self.assertEqual(cost_data['columns'][0]['name'], 'PreTaxCost') - self.assertEqual(cost_data['columns'][0]['type'], 'Number') - self.assertEqual(cost_data['columns'][2]['name'], 'ResourceGroup') - self.assertEqual(cost_data['columns'][2]['type'], 'String') - - self.assertEqual(len(cost_data['rows']), 1000) diff --git a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_scenario.py b/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_scenario.py index cb6650d6d38..13c647943ec 100644 --- a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_scenario.py +++ b/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_scenario.py @@ -8,1356 +8,1452 @@ # regenerated. # -------------------------------------------------------------------------- -# import os -# import unittest - -# from azure_devtools.scenario_tests import AllowLargeResponse -# from azure.cli.testsdk import ScenarioTest -# from .. import try_manual -# from azure.cli.testsdk import ResourceGroupPreparer -# from azure.cli.testsdk import StorageAccountPreparer - - -# TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - - -# @try_manual -# def setup(test, rg): -# pass - - -# # EXAMPLE: /Exports/put/BillingAccountCreateOrUpdateExport -# @try_manual -# def step__exports_put_billingaccountcreateorupdateexport(test, rg): -# test.cmd('az costmanagement export create ' -# '--export-name "{TestExport}" ' -# '--definition-type "Usage" ' -# '--definition-dataset-aggregation "{{\\"costSum\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}' -# '}}}" ' -# '--definition-dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="Resourc' -# 'eLocation" columns="PreTaxCost" ' -# '--definition-dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation' -# '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":' -# '\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{' -# '\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--definition-dataset-grouping name="SubscriptionName" type="Dimension" ' -# '--definition-dataset-grouping name="Environment" type="Tag" ' -# '--definition-timeframe "MonthToDate" ' -# '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' -# 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' -# '--schedule-recurrence "Weekly" ' -# '--schedule-recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" ' -# '--schedule-status "Active" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/123456"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/BillingAccountAlerts -# @try_manual -# def step__alerts_get_billingaccountalerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/DepartmentAlerts -# @try_manual -# def step__alerts_get_departmentalerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/EnrollmentAccountAlerts -# @try_manual -# def step__alerts_get_enrollmentaccountalerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/ExternalBillingAccountAlerts -# @try_manual -# def step__alerts_get_externalbillingaccountalerts(test, rg): -# test.cmd('az costmanagement alert list-external ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalBillingAccounts"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/ExternalSubscriptionAlerts -# @try_manual -# def step__alerts_get_externalsubscriptionalerts(test, rg): -# test.cmd('az costmanagement alert list-external ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalSubscriptions"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/InvoiceSectionAlerts -# @try_manual -# def step__alerts_get_invoicesectionalerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/ResourceGroupAlerts -# @try_manual -# def step__alerts_get_resourcegroupalerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/SubscriptionAlerts -# @try_manual -# def step__alerts_get_subscriptionalerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingAccountDimensionsList-Legacy -# @try_manual -# def step__dimensions_get_billingaccountdimensionslist_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingAccountDimensionsList-Modern -# @try_manual -# def step__dimensions_get_billingaccountdimensionslist_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingAccountDimensionsListExpandAndTop-Legacy -# @try_manual -# def step__dimensions_get_billingaccountdimensionslistexpandandtop_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingAccountDimensionsListExpandAndTop-Modern -# @try_manual -# def step__dimensions_get_billingaccountdimensionslistexpandandtop_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingAccountDimensionsListWithFilter-Legacy -# @try_manual -# def step__dimensions_get_billingaccountdimensionslistwithfilter_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingAccountDimensionsListWithFilter-Modern -# @try_manual -# def step__dimensions_get_billingaccountdimensionslistwithfilter_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingProfileDimensionsList-Modern -# @try_manual -# def step__dimensions_get_billingprofiledimensionslist_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingProfileDimensionsListExpandAndTop-Modern -# @try_manual -# def step__dimensions_get_billingprofiledimensionslistexpandandtop_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/BillingProfileDimensionsListWithFilter-Modern -# @try_manual -# def step__dimensions_get_billingprofiledimensionslistwithfilter_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/CustomerDimensionsList-Modern -# @try_manual -# def step__dimensions_get_customerdimensionslist_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/CustomerDimensionsListExpandAndTop-Modern -# @try_manual -# def step__dimensions_get_customerdimensionslistexpandandtop_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/CustomerDimensionsListWithFilter-Modern -# @try_manual -# def step__dimensions_get_customerdimensionslistwithfilter_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/DepartmentDimensionsList-Legacy -# @try_manual -# def step__dimensions_get_departmentdimensionslist_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/DepartmentDimensionsListExpandAndTop-Legacy -# @try_manual -# def step__dimensions_get_departmentdimensionslistexpandandtop_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/DepartmentDimensionsListWithFilter-Legacy -# @try_manual -# def step__dimensions_get_departmentdimensionslistwithfilter_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsList-Legacy -# @try_manual -# def step__dimensions_get_enrollmentaccountdimensionslist_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsListExpandAndTop-Legacy -# @try_manual -# def step__dimensions_get_enrollmentaccountdimensionslistexpandandtop_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsListWithFilter-Legacy -# @try_manual -# def step__dimensions_get_enrollmentaccountdimensionslistwithfilter_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/ExternalBillingAccountDimensionList -# @try_manual -# def step__dimensions_get_externalbillingaccountdimensionlist(test, rg): -# test.cmd('az costmanagement dimension by-external-cloud-provider-type ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalBillingAccounts"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/ExternalSubscriptionDimensionList -# @try_manual -# def step__dimensions_get_externalsubscriptiondimensionlist(test, rg): -# test.cmd('az costmanagement dimension by-external-cloud-provider-type ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalSubscriptions"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsList-Modern -# @try_manual -# def step__dimensions_get_invoicesectiondimensionslist_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsListExpandAndTop-Modern -# @try_manual -# def step__dimensions_get_invoicesectiondimensionslistexpandandtop_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsListWithFilter-Modern -# @try_manual -# def step__dimensions_get_invoicesectiondimensionslistwithfilter_modern(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/ManagementGroupDimensionsList-Legacy -# @try_manual -# def step__dimensions_get_managementgroupdimensionslist_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/ManagementGroupDimensionsListExpandAndTop-Legacy -# @try_manual -# def step__dimensions_get_managementgroupdimensionslistexpandandtop_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/ManagementGroupDimensionsListWithFilter-Legacy -# @try_manual -# def step__dimensions_get_managementgroupdimensionslistwithfilter_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--filter "properties/category eq \'resourceId\'" ' -# '--top 5 ' -# '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/ResourceGroupDimensionsList-Legacy -# @try_manual -# def step__dimensions_get_resourcegroupdimensionslist_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando"', -# checks=[]) - - -# # EXAMPLE: /Dimensions/get/SubscriptionDimensionsList-Legacy -# @try_manual -# def step__dimensions_get_subscriptiondimensionslist_legacy(test, rg): -# test.cmd('az costmanagement dimension list ' -# '--expand "properties/data" ' -# '--top 5 ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/put/DepartmentCreateOrUpdateExport -# @try_manual -# def step__exports_put_departmentcreateorupdateexport(test, rg): -# test.cmd('az costmanagement export create ' -# '--export-name "{TestExport}" ' -# '--definition-type "Usage" ' -# '--definition-dataset-aggregation "{{\\"costSum\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}' -# '}}}" ' -# '--definition-dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="Resourc' -# 'eLocation" columns="PreTaxCost" ' -# '--definition-dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation' -# '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":' -# '\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{' -# '\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--definition-dataset-grouping name="SubscriptionName" type="Dimension" ' -# '--definition-dataset-grouping name="Environment" type="Tag" ' -# '--definition-timeframe "MonthToDate" ' -# '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' -# 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' -# '--schedule-recurrence "Weekly" ' -# '--schedule-recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" ' -# '--schedule-status "Active" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', -# checks=[]) - - -# # EXAMPLE: /Exports/put/EnrollmentAccountCreateOrUpdateExport -# @try_manual -# def step__exports_put_enrollmentaccountcreateorupdateexport(test, rg): -# test.cmd('az costmanagement export create ' -# '--export-name "{TestExport}" ' -# '--definition-type "Usage" ' -# '--definition-dataset-aggregation "{{\\"costSum\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}' -# '}}}" ' -# '--definition-dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="Resourc' -# 'eLocation" columns="PreTaxCost" ' -# '--definition-dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation' -# '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":' -# '\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{' -# '\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--definition-dataset-grouping name="SubscriptionName" type="Dimension" ' -# '--definition-dataset-grouping name="Environment" type="Tag" ' -# '--definition-timeframe "MonthToDate" ' -# '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' -# 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' -# '--schedule-recurrence "Weekly" ' -# '--schedule-recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" ' -# '--schedule-status "Active" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Exports/put/ManagementGroupCreateOrUpdateExport -# @try_manual -# def step__exports_put_managementgroupcreateorupdateexport(test, rg): -# test.cmd('az costmanagement export create ' -# '--export-name "{TestExport}" ' -# '--definition-type "Usage" ' -# '--definition-dataset-aggregation "{{\\"costSum\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}' -# '}}}" ' -# '--definition-dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="Resourc' -# 'eLocation" columns="PreTaxCost" ' -# '--definition-dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation' -# '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":' -# '\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{' -# '\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--definition-dataset-grouping name="SubscriptionName" type="Dimension" ' -# '--definition-dataset-grouping name="Environment" type="Tag" ' -# '--definition-timeframe "MonthToDate" ' -# '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' -# 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' -# '--schedule-recurrence "Weekly" ' -# '--schedule-recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" ' -# '--schedule-status "Active" ' -# '--scope "providers/Microsoft.Management/managementGroups/TestMG"', -# checks=[]) - - -# # EXAMPLE: /Exports/put/ResourceGroupCreateOrUpdateExport -# @try_manual -# def step__exports_put_resourcegroupcreateorupdateexport(test, rg): -# test.cmd('az costmanagement export create ' -# '--export-name "{TestExport}" ' -# '--definition-type "Usage" ' -# '--definition-dataset-aggregation "{{\\"costSum\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}' -# '}}}" ' -# '--definition-dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="Resourc' -# 'eLocation" columns="PreTaxCost" ' -# '--definition-dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation' -# '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":' -# '\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{' -# '\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--definition-dataset-grouping name="SubscriptionName" type="Dimension" ' -# '--definition-dataset-grouping name="Environment" type="Tag" ' -# '--definition-timeframe "MonthToDate" ' -# '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' -# 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' -# '--schedule-recurrence "Weekly" ' -# '--schedule-recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" ' -# '--schedule-status "Active" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', -# checks=[]) - - -# # EXAMPLE: /Exports/put/SubscriptionCreateOrUpdateExport -# @try_manual -# def step__exports_put_subscriptioncreateorupdateexport(test, rg): -# test.cmd('az costmanagement export create ' -# '--export-name "{TestExport}" ' -# '--definition-type "Usage" ' -# '--definition-dataset-aggregation "{{\\"costSum\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}' -# '}}}" ' -# '--definition-dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="Resourc' -# 'eLocation" columns="PreTaxCost" ' -# '--definition-dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation' -# '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":' -# '\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{' -# '\\"name\\":\\"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--definition-dataset-grouping name="SubscriptionName" type="Dimension" ' -# '--definition-dataset-grouping name="Environment" type="Tag" ' -# '--definition-timeframe "MonthToDate" ' -# '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' -# 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' -# '--schedule-recurrence "Weekly" ' -# '--schedule-recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" ' -# '--schedule-status "Active" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/ManagementGroupExecutionHistoryExport -# @try_manual -# def step__exports_get_managementgroupexecutionhistoryexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Management/managementGroups/TestMG"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/BillingAccountExecutionHistoryExport -# @try_manual -# def step__exports_get_billingaccountexecutionhistoryexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/123456"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/BillingAccountExport -# @try_manual -# def step__exports_get_billingaccountexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/123456"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/BillingAccountExportList -# @try_manual -# def step__exports_get_billingaccountexportlist(test, rg): -# test.cmd('az costmanagement export list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/123456"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/DepartmentExecutionHistoryExport -# @try_manual -# def step__exports_get_departmentexecutionhistoryexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/DepartmentExport -# @try_manual -# def step__exports_get_departmentexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/DepartmentExportList -# @try_manual -# def step__exports_get_departmentexportlist(test, rg): -# test.cmd('az costmanagement export list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/EnrollmentAccountExecutionHistoryExport -# @try_manual -# def step__exports_get_enrollmentaccountexecutionhistoryexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/EnrollmentAccountExport -# @try_manual -# def step__exports_get_enrollmentaccountexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/EnrollmentAccountExportList -# @try_manual -# def step__exports_get_enrollmentaccountexportlist(test, rg): -# test.cmd('az costmanagement export list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Alerts/get/BillingProfileAlerts -# @try_manual -# def step__alerts_get_billingprofilealerts(test, rg): -# test.cmd('az costmanagement alert list ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/ManagementGroupExport -# @try_manual -# def step__exports_get_managementgroupexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Management/managementGroups/TestMG"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/ManagementGroupExportList -# @try_manual -# def step__exports_get_managementgroupexportlist(test, rg): -# test.cmd('az costmanagement export list ' -# '--scope "providers/Microsoft.Management/managementGroups/TestMG"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/ResourceGroupExecutionHistoryExport -# @try_manual -# def step__exports_get_resourcegroupexecutionhistoryexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/ResourceGroupExport -# @try_manual -# def step__exports_get_resourcegroupexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/ResourceGroupExportList -# @try_manual -# def step__exports_get_resourcegroupexportlist(test, rg): -# test.cmd('az costmanagement export list ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/SubscriptionExecutionHistoryExport -# @try_manual -# def step__exports_get_subscriptionexecutionhistoryexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/SubscriptionExport -# @try_manual -# def step__exports_get_subscriptionexport(test, rg): -# test.cmd('az costmanagement export show ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/get/SubscriptionExportList -# @try_manual -# def step__exports_get_subscriptionexportlist(test, rg): -# test.cmd('az costmanagement export list ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/post/BillingAccountExecuteExport -# @try_manual -# def step__exports_post_billingaccountexecuteexport(test, rg): -# test.cmd('az costmanagement export execute ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/123456"', -# checks=[]) - - -# # EXAMPLE: /Exports/post/DepartmentExecuteExport -# @try_manual -# def step__exports_post_departmentexecuteexport(test, rg): -# test.cmd('az costmanagement export execute ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', -# checks=[]) - - -# # EXAMPLE: /Exports/post/EnrollmentAccountExecuteExport -# @try_manual -# def step__exports_post_enrollmentaccountexecuteexport(test, rg): -# test.cmd('az costmanagement export execute ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Exports/post/ManagementGroupExecuteExport -# @try_manual -# def step__exports_post_managementgroupexecuteexport(test, rg): -# test.cmd('az costmanagement export execute ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Management/managementGroups/TestMG"', -# checks=[]) - - -# # EXAMPLE: /Exports/post/ResourceGroupExecuteExport -# @try_manual -# def step__exports_post_resourcegroupexecuteexport(test, rg): -# test.cmd('az costmanagement export execute ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', -# checks=[]) - - -# # EXAMPLE: /Exports/post/SubscriptionExecuteExport -# @try_manual -# def step__exports_post_subscriptionexecuteexport(test, rg): -# test.cmd('az costmanagement export execute ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/BillingAccountForecast -# @try_manual -# def step__forecast_post_billingaccountforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/BillingProfileForecast -# @try_manual -# def step__forecast_post_billingprofileforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/DepartmentForecast -# @try_manual -# def step__forecast_post_departmentforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/EnrollmentAccountForecast -# @try_manual -# def step__forecast_post_enrollmentaccountforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/ExternalBillingAccountForecast -# @try_manual -# def step__forecast_post_externalbillingaccountforecast(test, rg): -# test.cmd('az costmanagement forecast external-cloud-provider-usage ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalBillingAccounts" ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/ExternalSubscriptionForecast -# @try_manual -# def step__forecast_post_externalsubscriptionforecast(test, rg): -# test.cmd('az costmanagement forecast external-cloud-provider-usage ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalSubscriptions" ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/InvoiceSectionForecast -# @try_manual -# def step__forecast_post_invoicesectionforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/ResourceGroupForecast -# @try_manual -# def step__forecast_post_resourcegroupforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', -# checks=[]) - - -# # EXAMPLE: /Forecast/post/SubscriptionForecast -# @try_manual -# def step__forecast_post_subscriptionforecast(test, rg): -# test.cmd('az costmanagement forecast usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--include-actual-cost false ' -# '--include-fresh-partial-cost false ' -# '--timeframe "MonthToDate" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Query/post/BillingAccountQuery-Legacy -# @try_manual -# def step__query_post_billingaccountquery_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/70664866"', -# checks=[]) - - -# # EXAMPLE: /Query/post/BillingAccountQuery-Modern -# @try_manual -# def step__query_post_billingaccountquery_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Query/post/BillingAccountQueryGrouping-Legacy -# @try_manual -# def step__query_post_billingaccountquerygrouping_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/70664866"', -# checks=[]) - - -# # EXAMPLE: /Query/post/BillingAccountQueryGrouping-Modern -# @try_manual -# def step__query_post_billingaccountquerygrouping_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', -# checks=[]) - - -# # EXAMPLE: /Query/post/BillingProfileQuery-Modern -# @try_manual -# def step__query_post_billingprofilequery_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Query/post/BillingProfileQueryGrouping-Modern -# @try_manual -# def step__query_post_billingprofilequerygrouping_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', -# checks=[]) - - -# # EXAMPLE: /Query/post/CustomerQuery-Modern -# @try_manual -# def step__query_post_customerquery_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', -# checks=[]) - - -# # EXAMPLE: /Query/post/CustomerQueryGrouping-Modern -# @try_manual -# def step__query_post_customerquerygrouping_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', -# checks=[]) - - -# # EXAMPLE: /Query/post/DepartmentQuery-Legacy -# @try_manual -# def step__query_post_departmentquery_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Query/post/DepartmentQueryGrouping-Legacy -# @try_manual -# def step__query_post_departmentquerygrouping_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', -# checks=[]) - - -# # EXAMPLE: /Query/post/EnrollmentAccountQuery-Legacy -# @try_manual -# def step__query_post_enrollmentaccountquery_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Query/post/EnrollmentAccountQueryGrouping-Legacy -# @try_manual -# def step__query_post_enrollmentaccountquerygrouping_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Query/post/ExternalBillingAccountQueryList -# @try_manual -# def step__query_post_externalbillingaccountquerylist(test, rg): -# test.cmd('az costmanagement query usage-by-external-cloud-provider-type ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalBillingAccounts" ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate"', -# checks=[]) - - -# # EXAMPLE: /Query/post/ExternalSubscriptionsQuery -# @try_manual -# def step__query_post_externalsubscriptionsquery(test, rg): -# test.cmd('az costmanagement query usage-by-external-cloud-provider-type ' -# '--external-cloud-provider-id "100" ' -# '--external-cloud-provider-type "externalSubscriptions" ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate"', -# checks=[]) - - -# # EXAMPLE: /Query/post/InvoiceSectionQuery-Modern -# @try_manual -# def step__query_post_invoicesectionquery_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Query/post/InvoiceSectionQueryGrouping-Modern -# @try_manual -# def step__query_post_invoicesectionquerygrouping_modern(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' -# '6"', -# checks=[]) - - -# # EXAMPLE: /Query/post/ManagementGroupQuery-Legacy -# @try_manual -# def step__query_post_managementgroupquery_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', -# checks=[]) - - -# # EXAMPLE: /Query/post/ManagementGroupQueryGrouping-Legacy -# @try_manual -# def step__query_post_managementgroupquerygrouping_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', -# checks=[]) - - -# # EXAMPLE: /Query/post/ResourceGroupQuery-Legacy -# @try_manual -# def step__query_post_resourcegroupquery_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', -# checks=[]) - - -# # EXAMPLE: /Query/post/ResourceGroupQueryGrouping-Legacy -# @try_manual -# def step__query_post_resourcegroupquerygrouping_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceType" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', -# checks=[]) - - -# # EXAMPLE: /Query/post/SubscriptionQuery-Legacy -# @try_manual -# def step__query_post_subscriptionquery_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' -# 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' -# 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' -# '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' -# '--timeframe "MonthToDate" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Query/post/SubscriptionQueryGrouping-Legacy -# @try_manual -# def step__query_post_subscriptionquerygrouping_legacy(test, rg): -# test.cmd('az costmanagement query usage ' -# '--type "Usage" ' -# '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' -# '--dataset-grouping name="ResourceGroup" type="Dimension" ' -# '--timeframe "TheLastMonth" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/delete/DepartmentDeleteExport -# @try_manual -# def step__exports_delete_departmentdeleteexport(test, rg): -# test.cmd('az costmanagement export delete ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', -# checks=[]) - - -# # EXAMPLE: /Exports/delete/SubscriptionDeleteExport -# @try_manual -# def step__exports_delete_subscriptiondeleteexport(test, rg): -# test.cmd('az costmanagement export delete ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', -# checks=[]) - - -# # EXAMPLE: /Exports/delete/ResourceGroupDeleteExport -# @try_manual -# def step__exports_delete_resourcegroupdeleteexport(test, rg): -# test.cmd('az costmanagement export delete ' -# '--export-name "{TestExport}" ' -# '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', -# checks=[]) - - -# # EXAMPLE: /Exports/delete/ManagementGroupDeleteExport -# @try_manual -# def step__exports_delete_managementgroupdeleteexport(test, rg): -# test.cmd('az costmanagement export delete ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Management/managementGroups/TestMG"', -# checks=[]) - - -# # EXAMPLE: /Exports/delete/EnrollmentAccountDeleteExport -# @try_manual -# def step__exports_delete_enrollmentaccountdeleteexport(test, rg): -# test.cmd('az costmanagement export delete ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', -# checks=[]) - - -# # EXAMPLE: /Exports/delete/BillingAccountDeleteExport -# @try_manual -# def step__exports_delete_billingaccountdeleteexport(test, rg): -# test.cmd('az costmanagement export delete ' -# '--export-name "{TestExport}" ' -# '--scope "providers/Microsoft.Billing/billingAccounts/123456"', -# checks=[]) - - -# @try_manual -# def cleanup(test, rg): -# pass - - -# @try_manual -# def call_scenario(test, rg): -# setup(test, rg) -# step__exports_put_billingaccountcreateorupdateexport(test, rg) -# step__alerts_get_billingaccountalerts(test, rg) -# step__alerts_get_departmentalerts(test, rg) -# step__alerts_get_enrollmentaccountalerts(test, rg) -# step__alerts_get_externalbillingaccountalerts(test, rg) -# step__alerts_get_externalsubscriptionalerts(test, rg) -# step__alerts_get_invoicesectionalerts(test, rg) -# step__alerts_get_resourcegroupalerts(test, rg) -# step__alerts_get_subscriptionalerts(test, rg) -# step__dimensions_get_billingaccountdimensionslist_legacy(test, rg) -# step__dimensions_get_billingaccountdimensionslist_modern(test, rg) -# step__dimensions_get_billingaccountdimensionslistexpandandtop_legacy(test, rg) -# step__dimensions_get_billingaccountdimensionslistexpandandtop_modern(test, rg) -# step__dimensions_get_billingaccountdimensionslistwithfilter_legacy(test, rg) -# step__dimensions_get_billingaccountdimensionslistwithfilter_modern(test, rg) -# step__dimensions_get_billingprofiledimensionslist_modern(test, rg) -# step__dimensions_get_billingprofiledimensionslistexpandandtop_modern(test, rg) -# step__dimensions_get_billingprofiledimensionslistwithfilter_modern(test, rg) -# step__dimensions_get_customerdimensionslist_modern(test, rg) -# step__dimensions_get_customerdimensionslistexpandandtop_modern(test, rg) -# step__dimensions_get_customerdimensionslistwithfilter_modern(test, rg) -# step__dimensions_get_departmentdimensionslist_legacy(test, rg) -# step__dimensions_get_departmentdimensionslistexpandandtop_legacy(test, rg) -# step__dimensions_get_departmentdimensionslistwithfilter_legacy(test, rg) -# step__dimensions_get_enrollmentaccountdimensionslist_legacy(test, rg) -# step__dimensions_get_enrollmentaccountdimensionslistexpandandtop_legacy(test, rg) -# step__dimensions_get_enrollmentaccountdimensionslistwithfilter_legacy(test, rg) -# step__dimensions_get_externalbillingaccountdimensionlist(test, rg) -# step__dimensions_get_externalsubscriptiondimensionlist(test, rg) -# step__dimensions_get_invoicesectiondimensionslist_modern(test, rg) -# step__dimensions_get_invoicesectiondimensionslistexpandandtop_modern(test, rg) -# step__dimensions_get_invoicesectiondimensionslistwithfilter_modern(test, rg) -# step__dimensions_get_managementgroupdimensionslist_legacy(test, rg) -# step__dimensions_get_managementgroupdimensionslistexpandandtop_legacy(test, rg) -# step__dimensions_get_managementgroupdimensionslistwithfilter_legacy(test, rg) -# step__dimensions_get_resourcegroupdimensionslist_legacy(test, rg) -# step__dimensions_get_subscriptiondimensionslist_legacy(test, rg) -# step__exports_put_departmentcreateorupdateexport(test, rg) -# step__exports_put_enrollmentaccountcreateorupdateexport(test, rg) -# step__exports_put_managementgroupcreateorupdateexport(test, rg) -# step__exports_put_resourcegroupcreateorupdateexport(test, rg) -# step__exports_put_subscriptioncreateorupdateexport(test, rg) -# step__exports_get_managementgroupexecutionhistoryexport(test, rg) -# step__exports_get_billingaccountexecutionhistoryexport(test, rg) -# step__exports_get_billingaccountexport(test, rg) -# step__exports_get_billingaccountexportlist(test, rg) -# step__exports_get_departmentexecutionhistoryexport(test, rg) -# step__exports_get_departmentexport(test, rg) -# step__exports_get_departmentexportlist(test, rg) -# step__exports_get_enrollmentaccountexecutionhistoryexport(test, rg) -# step__exports_get_enrollmentaccountexport(test, rg) -# step__exports_get_enrollmentaccountexportlist(test, rg) -# step__alerts_get_billingprofilealerts(test, rg) -# step__exports_get_managementgroupexport(test, rg) -# step__exports_get_managementgroupexportlist(test, rg) -# step__exports_get_resourcegroupexecutionhistoryexport(test, rg) -# step__exports_get_resourcegroupexport(test, rg) -# step__exports_get_resourcegroupexportlist(test, rg) -# step__exports_get_subscriptionexecutionhistoryexport(test, rg) -# step__exports_get_subscriptionexport(test, rg) -# step__exports_get_subscriptionexportlist(test, rg) -# step__exports_post_billingaccountexecuteexport(test, rg) -# step__exports_post_departmentexecuteexport(test, rg) -# step__exports_post_enrollmentaccountexecuteexport(test, rg) -# step__exports_post_managementgroupexecuteexport(test, rg) -# step__exports_post_resourcegroupexecuteexport(test, rg) -# step__exports_post_subscriptionexecuteexport(test, rg) -# step__forecast_post_billingaccountforecast(test, rg) -# step__forecast_post_billingprofileforecast(test, rg) -# step__forecast_post_departmentforecast(test, rg) -# step__forecast_post_enrollmentaccountforecast(test, rg) -# step__forecast_post_externalbillingaccountforecast(test, rg) -# step__forecast_post_externalsubscriptionforecast(test, rg) -# step__forecast_post_invoicesectionforecast(test, rg) -# step__forecast_post_resourcegroupforecast(test, rg) -# step__forecast_post_subscriptionforecast(test, rg) -# step__query_post_billingaccountquery_legacy(test, rg) -# step__query_post_billingaccountquery_modern(test, rg) -# step__query_post_billingaccountquerygrouping_legacy(test, rg) -# step__query_post_billingaccountquerygrouping_modern(test, rg) -# step__query_post_billingprofilequery_modern(test, rg) -# step__query_post_billingprofilequerygrouping_modern(test, rg) -# step__query_post_customerquery_modern(test, rg) -# step__query_post_customerquerygrouping_modern(test, rg) -# step__query_post_departmentquery_legacy(test, rg) -# step__query_post_departmentquerygrouping_legacy(test, rg) -# step__query_post_enrollmentaccountquery_legacy(test, rg) -# step__query_post_enrollmentaccountquerygrouping_legacy(test, rg) -# step__query_post_externalbillingaccountquerylist(test, rg) -# step__query_post_externalsubscriptionsquery(test, rg) -# step__query_post_invoicesectionquery_modern(test, rg) -# step__query_post_invoicesectionquerygrouping_modern(test, rg) -# step__query_post_managementgroupquery_legacy(test, rg) -# step__query_post_managementgroupquerygrouping_legacy(test, rg) -# step__query_post_resourcegroupquery_legacy(test, rg) -# step__query_post_resourcegroupquerygrouping_legacy(test, rg) -# step__query_post_subscriptionquery_legacy(test, rg) -# step__query_post_subscriptionquerygrouping_legacy(test, rg) -# step__exports_delete_departmentdeleteexport(test, rg) -# step__exports_delete_subscriptiondeleteexport(test, rg) -# step__exports_delete_resourcegroupdeleteexport(test, rg) -# step__exports_delete_managementgroupdeleteexport(test, rg) -# step__exports_delete_enrollmentaccountdeleteexport(test, rg) -# step__exports_delete_billingaccountdeleteexport(test, rg) -# cleanup(test, rg) - - -# @try_manual -# class CostManagementClientScenarioTest(ScenarioTest): - -# @ResourceGroupPreparer(name_prefix='clitestcostmanagement_MYDEVTESTRG'[:7], key='rg', parameter_name='rg') -# @StorageAccountPreparer(name_prefix='clitestcostmanagement_ccmeastusdiag182'[:7], key='sa', -# resource_group_parameter_name='rg') -# def test_costmanagement(self, rg): - -# self.kwargs.update({ -# 'subscription_id': self.get_subscription_id() -# }) - -# self.kwargs.update({ -# 'TestExport': 'TestExport', -# }) - -# call_scenario(self, rg) +import os +from azure.cli.testsdk import ScenarioTest +from .. import try_manual, raise_if +from azure.cli.testsdk import ResourceGroupPreparer +from azure.cli.testsdk import StorageAccountPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test, rg): + pass + + +# EXAMPLE: /Alerts/get/BillingAccountAlerts +@try_manual +def step__alerts_get_billingaccountalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Alerts/get/BillingProfileAlerts +@try_manual +def step__alerts_get_billingprofilealerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Alerts/get/DepartmentAlerts +@try_manual +def step__alerts_get_departmentalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"', + checks=[]) + + +# EXAMPLE: /Alerts/get/EnrollmentAccountAlerts +@try_manual +def step__alerts_get_enrollmentaccountalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Alerts/get/ExternalBillingAccountAlerts +@try_manual +def step__alerts_get_externalbillingaccountalerts(test, rg): + test.cmd('az costmanagement alert list-external ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalBillingAccounts"', + checks=[]) + + +# EXAMPLE: /Alerts/get/ExternalSubscriptionAlerts +@try_manual +def step__alerts_get_externalsubscriptionalerts(test, rg): + test.cmd('az costmanagement alert list-external ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalSubscriptions"', + checks=[]) + + +# EXAMPLE: /Alerts/get/InvoiceSectionAlerts +@try_manual +def step__alerts_get_invoicesectionalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Alerts/get/ResourceGroupAlerts +@try_manual +def step__alerts_get_resourcegroupalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', + checks=[]) + + +# EXAMPLE: /Alerts/get/ResourceGroupAlerts +@try_manual +def step__alerts_get_resourcegroupalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', + checks=[]) + + +# EXAMPLE: /Alerts/get/SubscriptionAlerts +@try_manual +def step__alerts_get_subscriptionalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Alerts/get/SubscriptionAlerts +@try_manual +def step__alerts_get_subscriptionalerts(test, rg): + test.cmd('az costmanagement alert list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Alerts/patch/ResourceGroupAlerts +@try_manual +def step__alerts_patch_resourcegroupalerts(test, rg): + test.cmd('az costmanagement alert dismiss ' + '--alert-id "22222222-2222-2222-2222-222222222222" ' + '--status "Dismissed" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', + checks=[]) + + +# EXAMPLE: /Alerts/patch/SubscriptionAlerts +@try_manual +def step__alerts_patch_subscriptionalerts(test, rg): + test.cmd('az costmanagement alert dismiss ' + '--alert-id "22222222-2222-2222-2222-222222222222" ' + '--status "Dismissed" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingAccountDimensionsList-Legacy +@try_manual +def step__dimensions_get_billingaccountdimensionslist_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/100"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingAccountDimensionsList-Modern +@try_manual +def step__dimensions_get_billingaccountdimensionslist_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListExpandAndTop-Legacy +@try_manual +def step__dimensions_get_billingaccountdimensionslistexpandandtop_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/100"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListExpandAndTop-Modern +@try_manual +def step__dimensions_get_billingaccountdimensionslistexpandandtop_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListWithFilter-Legacy +@try_manual +def step__dimensions_get_billingaccountdimensionslistwithfilter_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/100"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListWithFilter-Modern +@try_manual +def step__dimensions_get_billingaccountdimensionslistwithfilter_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingProfileDimensionsList-Modern +@try_manual +def step__dimensions_get_billingprofiledimensionslist_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingProfileDimensionsListExpandAndTop-Modern +@try_manual +def step__dimensions_get_billingprofiledimensionslistexpandandtop_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/BillingProfileDimensionsListWithFilter-Modern +@try_manual +def step__dimensions_get_billingprofiledimensionslistwithfilter_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/CustomerDimensionsList-Modern +@try_manual +def step__dimensions_get_customerdimensionslist_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/CustomerDimensionsListExpandAndTop-Modern +@try_manual +def step__dimensions_get_customerdimensionslistexpandandtop_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/CustomerDimensionsListWithFilter-Modern +@try_manual +def step__dimensions_get_customerdimensionslistwithfilter_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/DepartmentDimensionsList-Legacy +@try_manual +def step__dimensions_get_departmentdimensionslist_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/DepartmentDimensionsListExpandAndTop-Legacy +@try_manual +def step__dimensions_get_departmentdimensionslistexpandandtop_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/DepartmentDimensionsListWithFilter-Legacy +@try_manual +def step__dimensions_get_departmentdimensionslistwithfilter_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsList-Legacy +@try_manual +def step__dimensions_get_enrollmentaccountdimensionslist_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsListExpandAndTop-Legacy +@try_manual +def step__dimensions_get_enrollmentaccountdimensionslistexpandandtop_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsListWithFilter-Legacy +@try_manual +def step__dimensions_get_enrollmentaccountdimensionslistwithfilter_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/ExternalBillingAccountDimensionList +@try_manual +def step__dimensions_get_externalbillingaccountdimensionlist(test, rg): + test.cmd('az costmanagement dimension by-external-cloud-provider-type ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalBillingAccounts"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/ExternalSubscriptionDimensionList +@try_manual +def step__dimensions_get_externalsubscriptiondimensionlist(test, rg): + test.cmd('az costmanagement dimension by-external-cloud-provider-type ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalSubscriptions"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsList-Modern +@try_manual +def step__dimensions_get_invoicesectiondimensionslist_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsListExpandAndTop-Modern +@try_manual +def step__dimensions_get_invoicesectiondimensionslistexpandandtop_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsListWithFilter-Modern +@try_manual +def step__dimensions_get_invoicesectiondimensionslistwithfilter_modern(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/ManagementGroupDimensionsList-Legacy +@try_manual +def step__dimensions_get_managementgroupdimensionslist_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/ManagementGroupDimensionsListExpandAndTop-Legacy +@try_manual +def step__dimensions_get_managementgroupdimensionslistexpandandtop_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/ManagementGroupDimensionsListWithFilter-Legacy +@try_manual +def step__dimensions_get_managementgroupdimensionslistwithfilter_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--filter "properties/category eq \'resourceId\'" ' + '--top 5 ' + '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/ResourceGroupDimensionsList-Legacy +@try_manual +def step__dimensions_get_resourcegroupdimensionslist_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando"', + checks=[]) + + +# EXAMPLE: /Dimensions/get/SubscriptionDimensionsList-Legacy +@try_manual +def step__dimensions_get_subscriptiondimensionslist_legacy(test, rg): + test.cmd('az costmanagement dimension list ' + '--expand "properties/data" ' + '--top 5 ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Exports/put/ExportCreateOrUpdateByBillingAccount +@try_manual +def step__exports_put_exportcreateorupdatebybillingaccount(test, rg): + test.cmd('az costmanagement export create ' + '--name "{TestExport}" ' + '--definition-type "ActualCost" ' + '--definition-data-set-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="Resour' + 'ceLocation" columns="Quantity" ' + '--definition-timeframe "MonthToDate" ' + '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' + 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' + '--schedule-recurrence "Weekly" ' + '--schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' + '--schedule-status "Active" ' + '--scope "providers/Microsoft.Billing/billingAccounts/123456"', + checks=[]) + + +# EXAMPLE: /Exports/put/ExportCreateOrUpdateByDepartment +@try_manual +def step__exports_put_exportcreateorupdatebydepartment(test, rg): + test.cmd('az costmanagement export create ' + '--name "{TestExport}" ' + '--definition-type "ActualCost" ' + '--definition-data-set-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="Resour' + 'ceLocation" columns="Quantity" ' + '--definition-timeframe "MonthToDate" ' + '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' + 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' + '--schedule-recurrence "Weekly" ' + '--schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' + '--schedule-status "Active" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', + checks=[]) + + +# EXAMPLE: /Exports/put/ExportCreateOrUpdateByEnrollmentAccount +@try_manual +def step__exports_put_exportcreateorupdatebyenrollmentaccount(test, rg): + test.cmd('az costmanagement export create ' + '--name "{TestExport}" ' + '--definition-type "ActualCost" ' + '--definition-data-set-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="Resour' + 'ceLocation" columns="Quantity" ' + '--definition-timeframe "MonthToDate" ' + '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' + 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' + '--schedule-recurrence "Weekly" ' + '--schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' + '--schedule-status "Active" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Exports/put/ExportCreateOrUpdateByManagementGroup +@try_manual +def step__exports_put_exportcreateorupdatebymanagementgroup(test, rg): + test.cmd('az costmanagement export create ' + '--name "{TestExport}" ' + '--definition-type "ActualCost" ' + '--definition-data-set-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="Resour' + 'ceLocation" columns="Quantity" ' + '--definition-timeframe "MonthToDate" ' + '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' + 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' + '--schedule-recurrence "Weekly" ' + '--schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' + '--schedule-status "Active" ' + '--scope "providers/Microsoft.Management/managementGroups/TestMG"', + checks=[]) + + +# EXAMPLE: /Exports/put/ExportCreateOrUpdateByResourceGroup +@try_manual +def step__exports_put_exportcreateorupdatebyresourcegroup(test, rg): + test.cmd('az costmanagement export create ' + '--name "{TestExport}" ' + '--definition-type "ActualCost" ' + '--definition-data-set-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="Resour' + 'ceLocation" columns="Quantity" ' + '--definition-timeframe "MonthToDate" ' + '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' + 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' + '--schedule-recurrence "Weekly" ' + '--schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' + '--schedule-status "Active" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/put/ExportCreateOrUpdateBySubscription +@try_manual +def step__exports_put_exportcreateorupdatebysubscription(test, rg): + test.cmd('az costmanagement export create ' + '--name "{TestExport}" ' + '--definition-type "ActualCost" ' + '--definition-data-set-configuration columns="Date" columns="MeterId" columns="ResourceId" columns="Resour' + 'ceLocation" columns="Quantity" ' + '--definition-timeframe "MonthToDate" ' + '--delivery-info-destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGro' + 'ups/{rg}/providers/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" ' + '--schedule-recurrence "Weekly" ' + '--schedule-recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" ' + '--schedule-status "Active" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportGetByBillingAccount +@try_manual +def step__exports_get_exportgetbybillingaccount(test, rg): + test.cmd('az costmanagement export show ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/123456"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportGetByDepartment +@try_manual +def step__exports_get_exportgetbydepartment(test, rg): + test.cmd('az costmanagement export show ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportGetByEnrollmentAccount +@try_manual +def step__exports_get_exportgetbyenrollmentaccount(test, rg): + test.cmd('az costmanagement export show ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportGetByManagementGroup +@try_manual +def step__exports_get_exportgetbymanagementgroup(test, rg): + test.cmd('az costmanagement export show ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Management/managementGroups/TestMG"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportGetByResourceGroup +@try_manual +def step__exports_get_exportgetbyresourcegroup(test, rg): + test.cmd('az costmanagement export show ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportGetBySubscription +@try_manual +def step__exports_get_exportgetbysubscription(test, rg): + test.cmd('az costmanagement export show ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportRunHistoryGetByBillingAccount +@try_manual +def step__exports_get_exportrunhistorygetbybillingaccount(test, rg): + test.cmd('az costmanagement export get-execution-history ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/123456"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportRunHistoryGetByDepartment +@try_manual +def step__exports_get_exportrunhistorygetbydepartment(test, rg): + test.cmd('az costmanagement export get-execution-history ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportRunHistoryGetByEnrollmentAccount +@try_manual +def step__exports_get_exportrunhistorygetbyenrollmentaccount(test, rg): + test.cmd('az costmanagement export get-execution-history ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportRunHistoryGetByManagementGroup +@try_manual +def step__exports_get_exportrunhistorygetbymanagementgroup(test, rg): + test.cmd('az costmanagement export get-execution-history ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Management/managementGroups/TestMG"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportRunHistoryGetByResourceGroup +@try_manual +def step__exports_get_exportrunhistorygetbyresourcegroup(test, rg): + test.cmd('az costmanagement export get-execution-history ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportRunHistoryGetBySubscription +@try_manual +def step__exports_get_exportrunhistorygetbysubscription(test, rg): + test.cmd('az costmanagement export get-execution-history ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportsGetByBillingAccount +@try_manual +def step__exports_get_exportsgetbybillingaccount(test, rg): + test.cmd('az costmanagement export list ' + '--scope "providers/Microsoft.Billing/billingAccounts/123456"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportsGetByDepartment +@try_manual +def step__exports_get_exportsgetbydepartment(test, rg): + test.cmd('az costmanagement export list ' + '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/123"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportsGetByEnrollmentAccount +@try_manual +def step__exports_get_exportsgetbyenrollmentaccount(test, rg): + test.cmd('az costmanagement export list ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportsGetByManagementGroup +@try_manual +def step__exports_get_exportsgetbymanagementgroup(test, rg): + test.cmd('az costmanagement export list ' + '--scope "providers/Microsoft.Management/managementGroups/TestMG"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportsGetByResourceGroup +@try_manual +def step__exports_get_exportsgetbyresourcegroup(test, rg): + test.cmd('az costmanagement export list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/get/ExportsGetBySubscription +@try_manual +def step__exports_get_exportsgetbysubscription(test, rg): + test.cmd('az costmanagement export list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Exports/post/ExportRunByBillingAccount +@try_manual +def step__exports_post_exportrunbybillingaccount(test, rg): + test.cmd('az costmanagement export execute ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/123456"', + checks=[]) + + +# EXAMPLE: /Exports/post/ExportRunByDepartment +@try_manual +def step__exports_post_exportrunbydepartment(test, rg): + test.cmd('az costmanagement export execute ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', + checks=[]) + + +# EXAMPLE: /Exports/post/ExportRunByEnrollmentAccount +@try_manual +def step__exports_post_exportrunbyenrollmentaccount(test, rg): + test.cmd('az costmanagement export execute ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Exports/post/ExportRunByManagementGroup +@try_manual +def step__exports_post_exportrunbymanagementgroup(test, rg): + test.cmd('az costmanagement export execute ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Management/managementGroups/TestMG"', + checks=[]) + + +# EXAMPLE: /Exports/post/ExportRunByResourceGroup +@try_manual +def step__exports_post_exportrunbyresourcegroup(test, rg): + test.cmd('az costmanagement export execute ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/post/ExportRunBySubscription +@try_manual +def step__exports_post_exportrunbysubscription(test, rg): + test.cmd('az costmanagement export execute ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Forecast/post/BillingAccountForecast +@try_manual +def step__forecast_post_billingaccountforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Forecast/post/BillingProfileForecast +@try_manual +def step__forecast_post_billingprofileforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Forecast/post/DepartmentForecast +@try_manual +def step__forecast_post_departmentforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"', + checks=[]) + + +# EXAMPLE: /Forecast/post/EnrollmentAccountForecast +@try_manual +def step__forecast_post_enrollmentaccountforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Forecast/post/ExternalBillingAccountForecast +@try_manual +def step__forecast_post_externalbillingaccountforecast(test, rg): + test.cmd('az costmanagement forecast external-cloud-provider-usage ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalBillingAccounts" ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate"', + checks=[]) + + +# EXAMPLE: /Forecast/post/ExternalSubscriptionForecast +@try_manual +def step__forecast_post_externalsubscriptionforecast(test, rg): + test.cmd('az costmanagement forecast external-cloud-provider-usage ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalSubscriptions" ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate"', + checks=[]) + + +# EXAMPLE: /Forecast/post/InvoiceSectionForecast +@try_manual +def step__forecast_post_invoicesectionforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Forecast/post/ResourceGroupForecast +@try_manual +def step__forecast_post_resourcegroupforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', + checks=[]) + + +# EXAMPLE: /Forecast/post/SubscriptionForecast +@try_manual +def step__forecast_post_subscriptionforecast(test, rg): + test.cmd('az costmanagement forecast usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--include-actual-cost false ' + '--include-fresh-partial-cost false ' + '--timeframe "MonthToDate" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Query/post/BillingAccountQuery-Legacy +@try_manual +def step__query_post_billingaccountquery_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/70664866"', + checks=[]) + + +# EXAMPLE: /Query/post/BillingAccountQuery-Modern +@try_manual +def step__query_post_billingaccountquery_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Query/post/BillingAccountQueryGrouping-Legacy +@try_manual +def step__query_post_billingaccountquerygrouping_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/70664866"', + checks=[]) + + +# EXAMPLE: /Query/post/BillingAccountQueryGrouping-Modern +@try_manual +def step__query_post_billingaccountquerygrouping_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"', + checks=[]) + + +# EXAMPLE: /Query/post/BillingProfileQuery-Modern +@try_manual +def step__query_post_billingprofilequery_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Query/post/BillingProfileQueryGrouping-Modern +@try_manual +def step__query_post_billingprofilequerygrouping_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"', + checks=[]) + + +# EXAMPLE: /Query/post/CustomerQuery-Modern +@try_manual +def step__query_post_customerquery_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', + checks=[]) + + +# EXAMPLE: /Query/post/CustomerQueryGrouping-Modern +@try_manual +def step__query_post_customerquerygrouping_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"', + checks=[]) + + +# EXAMPLE: /Query/post/DepartmentQuery-Legacy +@try_manual +def step__query_post_departmentquery_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', + checks=[]) + + +# EXAMPLE: /Query/post/DepartmentQueryGrouping-Legacy +@try_manual +def step__query_post_departmentquerygrouping_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"', + checks=[]) + + +# EXAMPLE: /Query/post/EnrollmentAccountQuery-Legacy +@try_manual +def step__query_post_enrollmentaccountquery_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Query/post/EnrollmentAccountQueryGrouping-Legacy +@try_manual +def step__query_post_enrollmentaccountquerygrouping_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Query/post/ExternalBillingAccountQueryList +@try_manual +def step__query_post_externalbillingaccountquerylist(test, rg): + test.cmd('az costmanagement query usage-by-external-cloud-provider-type ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalBillingAccounts" ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate"', + checks=[]) + + +# EXAMPLE: /Query/post/ExternalSubscriptionsQuery +@try_manual +def step__query_post_externalsubscriptionsquery(test, rg): + test.cmd('az costmanagement query usage-by-external-cloud-provider-type ' + '--external-cloud-provider-id "100" ' + '--external-cloud-provider-type "externalSubscriptions" ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate"', + checks=[]) + + +# EXAMPLE: /Query/post/InvoiceSectionQuery-Modern +@try_manual +def step__query_post_invoicesectionquery_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Query/post/InvoiceSectionQueryGrouping-Modern +@try_manual +def step__query_post_invoicesectionquerygrouping_modern(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987' + '6"', + checks=[]) + + +# EXAMPLE: /Query/post/ManagementGroupQuery-Legacy +@try_manual +def step__query_post_managementgroupquery_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', + checks=[]) + + +# EXAMPLE: /Query/post/ManagementGroupQueryGrouping-Legacy +@try_manual +def step__query_post_managementgroupquerygrouping_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "providers/Microsoft.Management/managementGroups/MyMgId"', + checks=[]) + + +# EXAMPLE: /Query/post/ResourceGroupQuery-Legacy +@try_manual +def step__query_post_resourcegroupquery_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', + checks=[]) + + +# EXAMPLE: /Query/post/ResourceGroupQueryGrouping-Legacy +@try_manual +def step__query_post_resourcegroupquerygrouping_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceType" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"', + checks=[]) + + +# EXAMPLE: /Query/post/SubscriptionQuery-Legacy +@try_manual +def step__query_post_subscriptionquery_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"opera' + 'tor\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environmen' + 't\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\' + '"ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" ' + '--timeframe "MonthToDate" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Query/post/SubscriptionQueryGrouping-Legacy +@try_manual +def step__query_post_subscriptionquerygrouping_legacy(test, rg): + test.cmd('az costmanagement query usage ' + '--type "Usage" ' + '--dataset-aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" ' + '--dataset-grouping name="ResourceGroup" type="Dimension" ' + '--timeframe "TheLastMonth" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Views/put/CreateOrUpdatePrivateView +@try_manual +def step__views_put_createorupdateprivateview(test, rg): + test.cmd('az costmanagement view create ' + '--e-tag "\\"1d4ff9fe66f1d10\\"" ' + '--accumulated "true" ' + '--chart "Table" ' + '--display-name "swagger Example" ' + '--kpis type="Forecast" enabled=true id=null ' + '--kpis type="Budget" enabled=true id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Micr' + 'osoft.Consumption/budgets/swaggerDemo" ' + '--metric "ActualCost" ' + '--pivots name="ServiceName" type="Dimension" ' + '--pivots name="MeterCategory" type="Dimension" ' + '--pivots name="swaggerTagKey" type="TagKey" ' + '--query-dataset "{{\\"aggregation\\":{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Su' + 'm\\"}}}},\\"granularity\\":\\"Daily\\",\\"grouping\\":[],\\"sorting\\":[{{\\"name\\":\\"UsageDate\\",\\"d' + 'irection\\":\\"Ascending\\"}}]}}" ' + '--query-timeframe "MonthToDate" ' + '--view-name "{swaggerExample}"', + checks=[]) + + +# EXAMPLE: /Views/put/ResourceGroupCreateOrUpdateView +@try_manual +def step__views_put_resourcegroupcreateorupdateview(test, rg): + test.cmd('az costmanagement view create ' + '--e-tag "\\"1d4ff9fe66f1d10\\"" ' + '--accumulated "true" ' + '--chart "Table" ' + '--display-name "swagger Example" ' + '--kpis type="Forecast" enabled=true id=null ' + '--kpis type="Budget" enabled=true id="/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Micr' + 'osoft.Consumption/budgets/swaggerDemo" ' + '--metric "ActualCost" ' + '--pivots name="ServiceName" type="Dimension" ' + '--pivots name="MeterCategory" type="Dimension" ' + '--pivots name="swaggerTagKey" type="TagKey" ' + '--query-dataset "{{\\"aggregation\\":{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Su' + 'm\\"}}}},\\"granularity\\":\\"Daily\\",\\"grouping\\":[],\\"sorting\\":[{{\\"name\\":\\"UsageDate\\",\\"d' + 'irection\\":\\"Ascending\\"}}]}}" ' + '--query-timeframe "MonthToDate" ' + '--properties-scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" ' + '--name "{swaggerExample}"', + checks=[]) + + +# EXAMPLE: /Views/get/PrivateView +@try_manual +def step__views_get_privateview(test, rg): + test.cmd('az costmanagement view show ' + '--name "{swaggerExample}"', + checks=[]) + + +# EXAMPLE: /Views/get/PrivateViewList +@try_manual +def step__views_get_privateviewlist(test, rg): + test.cmd('az costmanagement view list', + checks=[]) + + +# EXAMPLE: /Views/get/ResourceGroupView +@try_manual +def step__views_get_resourcegroupview(test, rg): + test.cmd('az costmanagement view get-by-scope ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" ' + '--name "{swaggerExample}"', + checks=[]) + + +# EXAMPLE: /Views/get/ResourceGroupViewList +@try_manual +def step__views_get_resourcegroupviewlist(test, rg): + test.cmd('az costmanagement view list ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/delete/ExportDeleteBySubscription +@try_manual +def step__exports_delete_exportdeletebysubscription(test, rg): + test.cmd('az costmanagement export delete ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000"', + checks=[]) + + +# EXAMPLE: /Exports/delete/ExportDeleteByResourceGroup +@try_manual +def step__exports_delete_exportdeletebyresourcegroup(test, rg): + test.cmd('az costmanagement export delete ' + '--name "{TestExport}" ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"', + checks=[]) + + +# EXAMPLE: /Exports/delete/ExportDeleteByManagementGroup +@try_manual +def step__exports_delete_exportdeletebymanagementgroup(test, rg): + test.cmd('az costmanagement export delete ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Management/managementGroups/TestMG"', + checks=[]) + + +# EXAMPLE: /Exports/delete/ExportDeleteByEnrollmentAccount +@try_manual +def step__exports_delete_exportdeletebyenrollmentaccount(test, rg): + test.cmd('az costmanagement export delete ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"', + checks=[]) + + +# EXAMPLE: /Exports/delete/ExportDeleteByDepartment +@try_manual +def step__exports_delete_exportdeletebydepartment(test, rg): + test.cmd('az costmanagement export delete ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"', + checks=[]) + + +# EXAMPLE: /Exports/delete/ExportDeleteByBillingAccount +@try_manual +def step__exports_delete_exportdeletebybillingaccount(test, rg): + test.cmd('az costmanagement export delete ' + '--name "{TestExport}" ' + '--scope "providers/Microsoft.Billing/billingAccounts/123456"', + checks=[]) + + +# EXAMPLE: /Views/delete/ResourceGroupDeleteView +@try_manual +def step__views_delete_resourcegroupdeleteview(test, rg): + test.cmd('az costmanagement view delete ' + '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" ' + '--name "{Views_2}"', + checks=[]) + + +# EXAMPLE: /Views/delete/DeletePrivateView +@try_manual +def step__views_delete_deleteprivateview(test, rg): + test.cmd('az costmanagement view delete ' + '--view-name "{Views_2}"', + checks=[]) + + +@try_manual +def cleanup(test, rg): + pass + + +@try_manual +def call_scenario(test, rg): + setup(test, rg) + step__alerts_get_billingaccountalerts(test, rg) + step__alerts_get_billingprofilealerts(test, rg) + step__alerts_get_departmentalerts(test, rg) + step__alerts_get_enrollmentaccountalerts(test, rg) + step__alerts_get_externalbillingaccountalerts(test, rg) + step__alerts_get_externalsubscriptionalerts(test, rg) + step__alerts_get_invoicesectionalerts(test, rg) + step__alerts_get_resourcegroupalerts(test, rg) + step__alerts_get_resourcegroupalerts(test, rg) + step__alerts_get_subscriptionalerts(test, rg) + step__alerts_get_subscriptionalerts(test, rg) + step__alerts_patch_resourcegroupalerts(test, rg) + step__alerts_patch_subscriptionalerts(test, rg) + step__dimensions_get_billingaccountdimensionslist_legacy(test, rg) + step__dimensions_get_billingaccountdimensionslist_modern(test, rg) + step__dimensions_get_billingaccountdimensionslistexpandandtop_legacy(test, rg) + step__dimensions_get_billingaccountdimensionslistexpandandtop_modern(test, rg) + step__dimensions_get_billingaccountdimensionslistwithfilter_legacy(test, rg) + step__dimensions_get_billingaccountdimensionslistwithfilter_modern(test, rg) + step__dimensions_get_billingprofiledimensionslist_modern(test, rg) + step__dimensions_get_billingprofiledimensionslistexpandandtop_modern(test, rg) + step__dimensions_get_billingprofiledimensionslistwithfilter_modern(test, rg) + step__dimensions_get_customerdimensionslist_modern(test, rg) + step__dimensions_get_customerdimensionslistexpandandtop_modern(test, rg) + step__dimensions_get_customerdimensionslistwithfilter_modern(test, rg) + step__dimensions_get_departmentdimensionslist_legacy(test, rg) + step__dimensions_get_departmentdimensionslistexpandandtop_legacy(test, rg) + step__dimensions_get_departmentdimensionslistwithfilter_legacy(test, rg) + step__dimensions_get_enrollmentaccountdimensionslist_legacy(test, rg) + step__dimensions_get_enrollmentaccountdimensionslistexpandandtop_legacy(test, rg) + step__dimensions_get_enrollmentaccountdimensionslistwithfilter_legacy(test, rg) + step__dimensions_get_externalbillingaccountdimensionlist(test, rg) + step__dimensions_get_externalsubscriptiondimensionlist(test, rg) + step__dimensions_get_invoicesectiondimensionslist_modern(test, rg) + step__dimensions_get_invoicesectiondimensionslistexpandandtop_modern(test, rg) + step__dimensions_get_invoicesectiondimensionslistwithfilter_modern(test, rg) + step__dimensions_get_managementgroupdimensionslist_legacy(test, rg) + step__dimensions_get_managementgroupdimensionslistexpandandtop_legacy(test, rg) + step__dimensions_get_managementgroupdimensionslistwithfilter_legacy(test, rg) + step__dimensions_get_resourcegroupdimensionslist_legacy(test, rg) + step__dimensions_get_subscriptiondimensionslist_legacy(test, rg) + step__exports_put_exportcreateorupdatebybillingaccount(test, rg) + step__exports_put_exportcreateorupdatebydepartment(test, rg) + step__exports_put_exportcreateorupdatebyenrollmentaccount(test, rg) + step__exports_put_exportcreateorupdatebymanagementgroup(test, rg) + step__exports_put_exportcreateorupdatebyresourcegroup(test, rg) + step__exports_put_exportcreateorupdatebysubscription(test, rg) + step__exports_get_exportgetbybillingaccount(test, rg) + step__exports_get_exportgetbydepartment(test, rg) + step__exports_get_exportgetbyenrollmentaccount(test, rg) + step__exports_get_exportgetbymanagementgroup(test, rg) + step__exports_get_exportgetbyresourcegroup(test, rg) + step__exports_get_exportgetbysubscription(test, rg) + step__exports_get_exportrunhistorygetbybillingaccount(test, rg) + step__exports_get_exportrunhistorygetbydepartment(test, rg) + step__exports_get_exportrunhistorygetbyenrollmentaccount(test, rg) + step__exports_get_exportrunhistorygetbymanagementgroup(test, rg) + step__exports_get_exportrunhistorygetbyresourcegroup(test, rg) + step__exports_get_exportrunhistorygetbysubscription(test, rg) + step__exports_get_exportsgetbybillingaccount(test, rg) + step__exports_get_exportsgetbydepartment(test, rg) + step__exports_get_exportsgetbyenrollmentaccount(test, rg) + step__exports_get_exportsgetbymanagementgroup(test, rg) + step__exports_get_exportsgetbyresourcegroup(test, rg) + step__exports_get_exportsgetbysubscription(test, rg) + step__exports_post_exportrunbybillingaccount(test, rg) + step__exports_post_exportrunbydepartment(test, rg) + step__exports_post_exportrunbyenrollmentaccount(test, rg) + step__exports_post_exportrunbymanagementgroup(test, rg) + step__exports_post_exportrunbyresourcegroup(test, rg) + step__exports_post_exportrunbysubscription(test, rg) + step__forecast_post_billingaccountforecast(test, rg) + step__forecast_post_billingprofileforecast(test, rg) + step__forecast_post_departmentforecast(test, rg) + step__forecast_post_enrollmentaccountforecast(test, rg) + step__forecast_post_externalbillingaccountforecast(test, rg) + step__forecast_post_externalsubscriptionforecast(test, rg) + step__forecast_post_invoicesectionforecast(test, rg) + step__forecast_post_resourcegroupforecast(test, rg) + step__forecast_post_subscriptionforecast(test, rg) + step__query_post_billingaccountquery_legacy(test, rg) + step__query_post_billingaccountquery_modern(test, rg) + step__query_post_billingaccountquerygrouping_legacy(test, rg) + step__query_post_billingaccountquerygrouping_modern(test, rg) + step__query_post_billingprofilequery_modern(test, rg) + step__query_post_billingprofilequerygrouping_modern(test, rg) + step__query_post_customerquery_modern(test, rg) + step__query_post_customerquerygrouping_modern(test, rg) + step__query_post_departmentquery_legacy(test, rg) + step__query_post_departmentquerygrouping_legacy(test, rg) + step__query_post_enrollmentaccountquery_legacy(test, rg) + step__query_post_enrollmentaccountquerygrouping_legacy(test, rg) + step__query_post_externalbillingaccountquerylist(test, rg) + step__query_post_externalsubscriptionsquery(test, rg) + step__query_post_invoicesectionquery_modern(test, rg) + step__query_post_invoicesectionquerygrouping_modern(test, rg) + step__query_post_managementgroupquery_legacy(test, rg) + step__query_post_managementgroupquerygrouping_legacy(test, rg) + step__query_post_resourcegroupquery_legacy(test, rg) + step__query_post_resourcegroupquerygrouping_legacy(test, rg) + step__query_post_subscriptionquery_legacy(test, rg) + step__query_post_subscriptionquerygrouping_legacy(test, rg) + step__views_put_createorupdateprivateview(test, rg) + step__views_put_resourcegroupcreateorupdateview(test, rg) + step__views_get_privateview(test, rg) + step__views_get_privateviewlist(test, rg) + step__views_get_resourcegroupview(test, rg) + step__views_get_resourcegroupviewlist(test, rg) + step__exports_delete_exportdeletebysubscription(test, rg) + step__exports_delete_exportdeletebyresourcegroup(test, rg) + step__exports_delete_exportdeletebymanagementgroup(test, rg) + step__exports_delete_exportdeletebyenrollmentaccount(test, rg) + step__exports_delete_exportdeletebydepartment(test, rg) + step__exports_delete_exportdeletebybillingaccount(test, rg) + step__views_delete_resourcegroupdeleteview(test, rg) + step__views_delete_deleteprivateview(test, rg) + cleanup(test, rg) + + +@try_manual +class CostManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestcostmanagement_MYDEVTESTRG'[:7], key='rg', parameter_name='rg') + @StorageAccountPreparer(name_prefix='clitestcostmanagement_ccmeastusdiag182'[:7], key='sa', + resource_group_parameter_name='rg') + def test_costmanagement(self, rg): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'swaggerExample': 'swaggerExample', + 'Views_2': 'TestView', + 'TestExport': 'TestExport', + }) + + call_scenario(self, rg) + raise_if() diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/__init__.py index 80154bae521..d22aaa8f169 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/__init__.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/__init__.py @@ -7,13 +7,10 @@ # -------------------------------------------------------------------------- from ._cost_management_client import CostManagementClient -from ._version import VERSION - -__version__ = VERSION __all__ = ['CostManagementClient'] try: - from .patch import patch_sdk + from ._patch import patch_sdk patch_sdk() except ImportError: pass diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_configuration.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_configuration.py index 8625677aaa9..c3474c95221 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_configuration.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_configuration.py @@ -11,14 +11,13 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential +VERSION = "unknown" class CostManagementClientConfiguration(Configuration): """Configuration for CostManagementClient. @@ -41,9 +40,10 @@ def __init__( super(CostManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential - self.api_version = "2019-11-01" + self.api_version = "2020-06-01" self.credential_scopes = ['https://management.azure.com/.default'] - kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION)) + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'costmanagementclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_cost_management_client.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_cost_management_client.py index 0cdba0c257e..b137f5955fd 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_cost_management_client.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_cost_management_client.py @@ -15,6 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any, Optional + from azure.core.credentials import TokenCredential + from ._configuration import CostManagementClientConfiguration from .operations import ViewOperations from .operations import AlertOperations @@ -30,22 +32,23 @@ class CostManagementClient(object): """CostManagementClient. :ivar view: ViewOperations operations - :vartype view: azure.mgmt.costmanagement.operations.ViewOperations + :vartype view: cost_management_client.operations.ViewOperations :ivar alert: AlertOperations operations - :vartype alert: azure.mgmt.costmanagement.operations.AlertOperations + :vartype alert: cost_management_client.operations.AlertOperations :ivar forecast: ForecastOperations operations - :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations + :vartype forecast: cost_management_client.operations.ForecastOperations :ivar dimension: DimensionOperations operations - :vartype dimension: azure.mgmt.costmanagement.operations.DimensionOperations + :vartype dimension: cost_management_client.operations.DimensionOperations :ivar query: QueryOperations operations - :vartype query: azure.mgmt.costmanagement.operations.QueryOperations + :vartype query: cost_management_client.operations.QueryOperations :ivar export: ExportOperations operations - :vartype export: azure.mgmt.costmanagement.operations.ExportOperations + :vartype export: cost_management_client.operations.ExportOperations :ivar operation: OperationOperations operations - :vartype operation: azure.mgmt.costmanagement.operations.OperationOperations + :vartype operation: cost_management_client.operations.OperationOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_version.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_version.py deleted file mode 100644 index dbf4c577231..00000000000 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -VERSION = "1.2.0" diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py index 15d87f41cbf..50d6218f26a 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py @@ -11,12 +11,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential + from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" class CostManagementClientConfiguration(Configuration): """Configuration for CostManagementClient. @@ -38,9 +37,10 @@ def __init__( super(CostManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential - self.api_version = "2019-11-01" + self.api_version = "2020-06-01" self.credential_scopes = ['https://management.azure.com/.default'] - kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION)) + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'costmanagementclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_cost_management_client_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_cost_management_client_async.py index 0f81334bb70..f0e45241588 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_cost_management_client_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_cost_management_client_async.py @@ -6,11 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import Any, Optional, TYPE_CHECKING from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + from ._configuration_async import CostManagementClientConfiguration from .operations_async import ViewOperations from .operations_async import AlertOperations @@ -26,22 +30,23 @@ class CostManagementClient(object): """CostManagementClient. :ivar view: ViewOperations operations - :vartype view: azure.mgmt.costmanagement.aio.operations_async.ViewOperations + :vartype view: cost_management_client.aio.operations_async.ViewOperations :ivar alert: AlertOperations operations - :vartype alert: azure.mgmt.costmanagement.aio.operations_async.AlertOperations + :vartype alert: cost_management_client.aio.operations_async.AlertOperations :ivar forecast: ForecastOperations operations - :vartype forecast: azure.mgmt.costmanagement.aio.operations_async.ForecastOperations + :vartype forecast: cost_management_client.aio.operations_async.ForecastOperations :ivar dimension: DimensionOperations operations - :vartype dimension: azure.mgmt.costmanagement.aio.operations_async.DimensionOperations + :vartype dimension: cost_management_client.aio.operations_async.DimensionOperations :ivar query: QueryOperations operations - :vartype query: azure.mgmt.costmanagement.aio.operations_async.QueryOperations + :vartype query: cost_management_client.aio.operations_async.QueryOperations :ivar export: ExportOperations operations - :vartype export: azure.mgmt.costmanagement.aio.operations_async.ExportOperations + :vartype export: cost_management_client.aio.operations_async.ExportOperations :ivar operation: OperationOperations operations - :vartype operation: azure.mgmt.costmanagement.aio.operations_async.OperationOperations + :vartype operation: cost_management_client.aio.operations_async.OperationOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_alert_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_alert_operations_async.py index db9ca7b4425..50398b0ce3e 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_alert_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_alert_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -25,7 +25,7 @@ class AlertOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,16 +65,17 @@ async def list( specific for partners. :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AlertsResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.AlertsResult + :return: AlertsResult, or the result of cls(response) + :rtype: ~cost_management_client.models.AlertsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertsResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -101,10 +102,238 @@ async def list( deserialized = self._deserialize('AlertsResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} # type: ignore + + async def get( + self, + scope: str, + alert_id: str, + **kwargs + ) -> "models.Alert": + """Gets the alert for the scope by alert ID. + + :param scope: The scope associated with alerts operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param alert_id: Alert ID. + :type alert_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Alert, or the result of cls(response) + :rtype: ~cost_management_client.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Alert"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Alert', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore + + async def dismiss( + self, + scope: str, + alert_id: str, + definition: Optional["models.AlertPropertiesDefinition"] = None, + description: Optional[str] = None, + source: Optional[Union[str, "models.AlertSource"]] = None, + cost_entity_id: Optional[str] = None, + status: Optional[Union[str, "models.AlertStatus"]] = None, + creation_time: Optional[str] = None, + close_time: Optional[str] = None, + modification_time: Optional[str] = None, + status_modification_user_name: Optional[str] = None, + status_modification_time: Optional[str] = None, + time_grain_type: Optional[Union[str, "models.AlertTimeGrainType"]] = None, + period_start_date: Optional[str] = None, + triggered_by: Optional[str] = None, + resource_group_filter: Optional[List[object]] = None, + resource_filter: Optional[List[object]] = None, + meter_filter: Optional[List[object]] = None, + tag_filter: Optional[object] = None, + threshold: Optional[float] = None, + operator: Optional[Union[str, "models.AlertOperator"]] = None, + amount: Optional[float] = None, + unit: Optional[str] = None, + current_spend: Optional[float] = None, + contact_emails: Optional[List[str]] = None, + contact_groups: Optional[List[str]] = None, + contact_roles: Optional[List[str]] = None, + overriding_alert: Optional[str] = None, + **kwargs + ) -> "models.Alert": + """Dismisses the specified alert. + + :param scope: The scope associated with alerts operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param alert_id: Alert ID. + :type alert_id: str + :param definition: defines the type of alert. + :type definition: ~cost_management_client.models.AlertPropertiesDefinition + :param description: Alert description. + :type description: str + :param source: Source of alert. + :type source: str or ~cost_management_client.models.AlertSource + :param cost_entity_id: related budget. + :type cost_entity_id: str + :param status: alert status. + :type status: str or ~cost_management_client.models.AlertStatus + :param creation_time: dateTime in which alert was created. + :type creation_time: str + :param close_time: dateTime in which alert was closed. + :type close_time: str + :param modification_time: dateTime in which alert was last modified. + :type modification_time: str + :param status_modification_user_name: + :type status_modification_user_name: str + :param status_modification_time: dateTime in which the alert status was last modified. + :type status_modification_time: str + :param time_grain_type: Type of timegrain cadence. + :type time_grain_type: str or ~cost_management_client.models.AlertTimeGrainType + :param period_start_date: datetime of periodStartDate. + :type period_start_date: str + :param triggered_by: notificationId that triggered this alert. + :type triggered_by: str + :param resource_group_filter: array of resourceGroups to filter by. + :type resource_group_filter: list[object] + :param resource_filter: array of resources to filter by. + :type resource_filter: list[object] + :param meter_filter: array of meters to filter by. + :type meter_filter: list[object] + :param tag_filter: tags to filter by. + :type tag_filter: object + :param threshold: notification threshold percentage as a decimal which activated this alert. + :type threshold: float + :param operator: operator used to compare currentSpend with amount. + :type operator: str or ~cost_management_client.models.AlertOperator + :param amount: budget threshold amount. + :type amount: float + :param unit: unit of currency being used. + :type unit: str + :param current_spend: current spend. + :type current_spend: float + :param contact_emails: list of emails to contact. + :type contact_emails: list[str] + :param contact_groups: list of action groups to broadcast to. + :type contact_groups: list[str] + :param contact_roles: list of contact roles. + :type contact_roles: list[str] + :param overriding_alert: overriding alert. + :type overriding_alert: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Alert, or the result of cls(response) + :rtype: ~cost_management_client.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Alert"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _parameters = models.DismissAlertPayload(definition=definition, description=description, source=source, cost_entity_id=cost_entity_id, status=status, creation_time=creation_time, close_time=close_time, modification_time=modification_time, status_modification_user_name=status_modification_user_name, status_modification_time=status_modification_time, time_grain_type=time_grain_type, period_start_date=period_start_date, triggered_by=triggered_by, resource_group_filter=resource_group_filter, resource_filter=resource_filter, meter_filter=meter_filter, tag_filter=tag_filter, threshold=threshold, operator=operator, amount=amount, unit=unit, current_spend=current_spend, contact_emails=contact_emails, contact_groups=contact_groups, contact_roles=contact_roles, overriding_alert=overriding_alert) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.dismiss.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DismissAlertPayload') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Alert', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + dismiss.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore async def list_external( self, @@ -117,21 +346,22 @@ async def list_external( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AlertsResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.AlertsResult + :return: AlertsResult, or the result of cls(response) + :rtype: ~cost_management_client.models.AlertsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertsResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.list_external.metadata['url'] + url = self.list_external.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), @@ -159,7 +389,7 @@ async def list_external( deserialized = self._deserialize('AlertsResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'} + list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_dimension_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_dimension_operations_async.py index 9e7580d0894..e177b21072e 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_dimension_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_dimension_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class DimensionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,7 +49,7 @@ def list( skiptoken: Optional[str] = None, top: Optional[int] = None, **kwargs - ) -> "models.DimensionsListResult": + ) -> AsyncIterable["models.DimensionsListResult"]: """Lists the dimensions by the defined scope. :param scope: The scope associated with dimension operations. This includes @@ -82,37 +82,38 @@ def list( :param top: May be used to limit the number of results to the most recent N dimension data. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: DimensionsListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.DimensionsListResult + :return: An iterator like instance of either DimensionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~cost_management_client.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DimensionsListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -144,7 +145,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} # type: ignore def by_external_cloud_provider_type( self, @@ -155,13 +156,13 @@ def by_external_cloud_provider_type( skiptoken: Optional[str] = None, top: Optional[int] = None, **kwargs - ) -> "models.DimensionsListResult": + ) -> AsyncIterable["models.DimensionsListResult"]: """Lists the dimensions by the external cloud provider type. :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -178,38 +179,39 @@ def by_external_cloud_provider_type( :param top: May be used to limit the number of results to the most recent N dimension data. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: DimensionsListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.DimensionsListResult + :return: An iterator like instance of either DimensionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~cost_management_client.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DimensionsListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.by_external_cloud_provider_type.metadata['url'] + url = self.by_external_cloud_provider_type.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -241,4 +243,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'} + by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_export_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_export_operations_async.py index 4d14c7ab9a2..5a9a2463bc2 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_export_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_export_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -25,7 +25,7 @@ class ExportOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, scope: str, + expand: Optional[str] = None, **kwargs ) -> "models.ExportListResult": """The operation to list all exports at the given scope. @@ -64,17 +65,21 @@ async def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. :type scope: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last execution of each export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExportListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ExportListResult + :return: ExportListResult, or the result of cls(response) + :rtype: ~cost_management_client.models.ExportListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ExportListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -83,6 +88,8 @@ async def list( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -101,15 +108,16 @@ async def list( deserialized = self._deserialize('ExportListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} # type: ignore async def get( self, scope: str, export_name: str, + expand: Optional[str] = None, **kwargs ) -> "models.Export": """The operation to get the export for the defined scope by export name. @@ -133,17 +141,21 @@ async def get( :type scope: str :param export_name: Export Name. :type export_name: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last 10 executions of the export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Export or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Export + :return: Export, or the result of cls(response) + :rtype: ~cost_management_client.models.Export :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Export"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -153,6 +165,8 @@ async def get( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -171,23 +185,21 @@ async def get( deserialized = self._deserialize('Export', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore async def create_or_update( self, scope: str, export_name: str, e_tag: Optional[str] = None, + run_history: Optional["models.ExportExecutionListResult"] = None, type: Optional[Union[str, "models.ExportType"]] = None, timeframe: Optional[Union[str, "models.TimeframeType"]] = None, - time_period: Optional["models.QueryTimePeriod"] = None, - configuration: Optional["models.QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, - filter: Optional["models.QueryFilter"] = None, + time_period: Optional["models.ExportTimePeriod"] = None, + configuration: Optional["models.ExportDatasetConfiguration"] = None, destination: Optional["models.ExportDeliveryDestination"] = None, status: Optional[Union[str, "models.StatusType"]] = None, recurrence: Optional[Union[str, "models.RecurrenceType"]] = None, @@ -218,49 +230,44 @@ async def create_or_update( :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. :type e_tag: str - :param type: The type of the query. - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: The time frame for pulling data for the query. If custom, then a specific + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :param type: The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is + applicable to exports that do not yet provide data for charges or amortization for service + reservations. + :type type: str or ~cost_management_client.models.ExportType + :param timeframe: The time frame for pulling data for the export. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. - :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :type destination: ~cost_management_client.models.ExportDeliveryDestination + :param status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. + :type status: str or ~cost_management_client.models.StatusType :param recurrence: The schedule recurrence. - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :type recurrence: str or ~cost_management_client.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :type recurrence_period: ~cost_management_client.models.ExportRecurrencePeriod :keyword callable cls: A custom type or function that will be passed the direct response - :return: Export or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Export or ~azure.mgmt.costmanagement.models.Export + :return: Export, or the result of cls(response) + :rtype: ~cost_management_client.models.Export :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Export"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.Export(e_tag=e_tag, type_properties_definition_type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter, destination=destination, status=status, recurrence=recurrence, recurrence_period=recurrence_period) - api_version = "2019-11-01" + _parameters = models.Export(e_tag=e_tag, run_history=run_history, type_properties_definition_type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, destination=destination, status=status, recurrence=recurrence, recurrence_period=recurrence_period) + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -298,10 +305,10 @@ async def create_or_update( deserialized = self._deserialize('Export', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore async def delete( self, @@ -331,16 +338,17 @@ async def delete( :param export_name: Export Name. :type export_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -365,9 +373,9 @@ async def delete( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore async def execute( self, @@ -375,7 +383,7 @@ async def execute( export_name: str, **kwargs ) -> None: - """The operation to execute a export. + """The operation to execute an export. :param scope: The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, @@ -397,16 +405,17 @@ async def execute( :param export_name: Export Name. :type export_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.execute.metadata['url'] + url = self.execute.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -431,9 +440,9 @@ async def execute( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} + execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} # type: ignore async def get_execution_history( self, @@ -441,7 +450,7 @@ async def get_execution_history( export_name: str, **kwargs ) -> "models.ExportExecutionListResult": - """The operation to get the execution history of an export for the defined scope by export name. + """The operation to get the execution history of an export for the defined scope and export name. :param scope: The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, @@ -463,16 +472,17 @@ async def get_execution_history( :param export_name: Export Name. :type export_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExportExecutionListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :return: ExportExecutionListResult, or the result of cls(response) + :rtype: ~cost_management_client.models.ExportExecutionListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ExportExecutionListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get_execution_history.metadata['url'] + url = self.get_execution_history.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -500,7 +510,7 @@ async def get_execution_history( deserialized = self._deserialize('ExportExecutionListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} + get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_forecast_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_forecast_operations_async.py index 50b4a7cf64c..826412f20d3 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_forecast_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_forecast_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -25,7 +25,7 @@ class ForecastOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -50,8 +50,7 @@ async def usage( include_actual_cost: Optional[bool] = None, include_fresh_partial_cost: Optional[bool] = None, configuration: Optional["models.QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, + aggregation: Optional[Dict[str, "models.QueryAggregation"]] = None, query_filter: Optional["models.QueryFilter"] = None, **kwargs ) -> "models.QueryResult": @@ -75,46 +74,44 @@ async def usage( specific for partners. :type scope: str :param type: The type of the forecast. - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType + :type type: str or ~cost_management_client.models.ForecastType :param timeframe: The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :type timeframe: str or ~cost_management_client.models.ForecastTimeframeType :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. :type filter: str :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. :type include_fresh_partial_cost: bool :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param query_filter: Has filter expression to use in the query. - :type query_filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] + :param query_filter: Has filter expression to use in the forecast. + :type query_filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=query_filter) - api_version = "2019-11-01" + _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, filter=query_filter) + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.usage.metadata['url'] + url = self.usage.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -148,10 +145,10 @@ async def usage( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} + usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} # type: ignore async def external_cloud_provider_usage( self, @@ -164,8 +161,7 @@ async def external_cloud_provider_usage( include_actual_cost: Optional[bool] = None, include_fresh_partial_cost: Optional[bool] = None, configuration: Optional["models.QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, + aggregation: Optional[Dict[str, "models.QueryAggregation"]] = None, query_filter: Optional["models.QueryFilter"] = None, **kwargs ) -> "models.QueryResult": @@ -174,51 +170,49 @@ async def external_cloud_provider_usage( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :param type: The type of the forecast. - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType + :type type: str or ~cost_management_client.models.ForecastType :param timeframe: The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :type timeframe: str or ~cost_management_client.models.ForecastTimeframeType :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. :type filter: str :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. :type include_fresh_partial_cost: bool :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param query_filter: Has filter expression to use in the query. - :type query_filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] + :param query_filter: Has filter expression to use in the forecast. + :type query_filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=query_filter) - api_version = "2019-11-01" + _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, filter=query_filter) + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.external_cloud_provider_usage.metadata['url'] + url = self.external_cloud_provider_usage.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), @@ -253,7 +247,7 @@ async def external_cloud_provider_usage( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'} + external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_operation_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_operation_operations_async.py index 3100d06cf5b..02e82ad276c 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_operation_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_operation_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class OperationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -44,29 +44,30 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> "models.OperationListResult": + ) -> AsyncIterable["models.OperationListResult"]: """Lists all of the available cost management REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.OperationListResult + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~cost_management_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -98,4 +99,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} + list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_query_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_query_operations_async.py index 994fc5fa69f..35c8225cd72 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_query_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_query_operations_async.py @@ -25,7 +25,7 @@ class QueryOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,8 +47,8 @@ async def usage( timeframe: Union[str, "models.TimeframeType"], time_period: Optional["models.QueryTimePeriod"] = None, configuration: Optional["models.QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, + aggregation: Optional[Dict[str, "models.QueryAggregation"]] = None, + grouping: Optional[List["models.QueryGrouping"]] = None, filter: Optional["models.QueryFilter"] = None, **kwargs ) -> "models.QueryResult": @@ -72,38 +72,39 @@ async def usage( specific for partners. :type scope: str :param type: The type of the query. - :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :type type: str or ~cost_management_client.models.ExportType :param timeframe: The time frame for pulling data for the query. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :type timeframe: str or ~cost_management_client.models.TimeframeType :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :type grouping: list[~cost_management_client.models.QueryGrouping] :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.usage.metadata['url'] + url = self.usage.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -135,10 +136,10 @@ async def usage( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} + usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore async def usage_by_external_cloud_provider_type( self, @@ -148,8 +149,8 @@ async def usage_by_external_cloud_provider_type( timeframe: Union[str, "models.TimeframeType"], time_period: Optional["models.QueryTimePeriod"] = None, configuration: Optional["models.QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, + aggregation: Optional[Dict[str, "models.QueryAggregation"]] = None, + grouping: Optional[List["models.QueryGrouping"]] = None, filter: Optional["models.QueryFilter"] = None, **kwargs ) -> "models.QueryResult": @@ -158,43 +159,44 @@ async def usage_by_external_cloud_provider_type( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :param type: The type of the query. - :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :type type: str or ~cost_management_client.models.ExportType :param timeframe: The time frame for pulling data for the query. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :type timeframe: str or ~cost_management_client.models.TimeframeType :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :type grouping: list[~cost_management_client.models.QueryGrouping] :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.usage_by_external_cloud_provider_type.metadata['url'] + url = self.usage_by_external_cloud_provider_type.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), @@ -227,7 +229,7 @@ async def usage_by_external_cloud_provider_type( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'} + usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_view_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_view_operations_async.py index c606c6c32da..25a38c4fdf5 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_view_operations_async.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_view_operations_async.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -26,7 +26,7 @@ class ViewOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -44,29 +44,30 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> "models.ViewListResult": + ) -> AsyncIterable["models.ViewListResult"]: """Lists all views by tenant and object. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ViewListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ViewListResult + :return: An iterator like instance of either ViewListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~cost_management_client.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ViewListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -98,13 +99,13 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} + list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} # type: ignore def list_by_scope( self, scope: str, **kwargs - ) -> "models.ViewListResult": + ) -> AsyncIterable["models.ViewListResult"]: """Lists all views at the given scope. :param scope: The scope associated with view operations. This includes @@ -126,29 +127,30 @@ def list_by_scope( External Subscription scope. :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ViewListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ViewListResult + :return: An iterator like instance of either ViewListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~cost_management_client.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ViewListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_scope.metadata['url'] + url = self.list_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -180,7 +182,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} + list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} # type: ignore async def get( self, @@ -192,16 +194,17 @@ async def get( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'viewName': self._serialize.url("view_name", view_name, 'str'), } @@ -228,10 +231,10 @@ async def get( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} + get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore async def create_or_update( self, @@ -242,8 +245,8 @@ async def create_or_update( chart: Optional[Union[str, "models.ChartType"]] = None, accumulated: Optional[Union[str, "models.AccumulatedType"]] = None, metric: Optional[Union[str, "models.MetricType"]] = None, - kpis: Optional[List["KpiProperties"]] = None, - pivots: Optional[List["PivotProperties"]] = None, + kpis: Optional[List["models.KpiProperties"]] = None, + pivots: Optional[List["models.PivotProperties"]] = None, timeframe: Optional[Union[str, "models.ReportTimeframeType"]] = None, time_period: Optional["models.ReportConfigTimePeriod"] = None, dataset: Optional["models.ReportConfigDataset"] = None, @@ -277,36 +280,37 @@ async def create_or_update( ExternalSubscription scope. :type scope: str :param chart: Chart type of the main view in Cost Analysis. Required. - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType + :type chart: str or ~cost_management_client.models.ChartType :param accumulated: Show costs accumulated over time. - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :type accumulated: str or ~cost_management_client.models.AccumulatedType :param metric: Metric to use when displaying costs. - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType + :type metric: str or ~cost_management_client.models.MetricType :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :type kpis: list[~cost_management_client.models.KpiProperties] :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :type pivots: list[~cost_management_client.models.PivotProperties] :param timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :type timeframe: str or ~cost_management_client.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :type time_period: ~cost_management_client.models.ReportConfigTimePeriod :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :type dataset: ~cost_management_client.models.ReportConfigDataset :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View or ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.View(e_tag=e_tag, display_name=display_name, scope=scope, chart=chart, accumulated=accumulated, metric=metric, kpis=kpis, pivots=pivots, timeframe=timeframe, time_period=time_period, dataset=dataset) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'viewName': self._serialize.url("view_name", view_name, 'str'), } @@ -343,10 +347,10 @@ async def create_or_update( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} + create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore async def delete( self, @@ -358,16 +362,17 @@ async def delete( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'viewName': self._serialize.url("view_name", view_name, 'str'), } @@ -391,9 +396,9 @@ async def delete( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} + delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore async def get_by_scope( self, @@ -424,16 +429,17 @@ async def get_by_scope( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get_by_scope.metadata['url'] + url = self.get_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), 'viewName': self._serialize.url("view_name", view_name, 'str'), @@ -461,10 +467,10 @@ async def get_by_scope( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} + get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore async def create_or_update_by_scope( self, @@ -476,8 +482,8 @@ async def create_or_update_by_scope( chart: Optional[Union[str, "models.ChartType"]] = None, accumulated: Optional[Union[str, "models.AccumulatedType"]] = None, metric: Optional[Union[str, "models.MetricType"]] = None, - kpis: Optional[List["KpiProperties"]] = None, - pivots: Optional[List["PivotProperties"]] = None, + kpis: Optional[List["models.KpiProperties"]] = None, + pivots: Optional[List["models.PivotProperties"]] = None, timeframe: Optional[Union[str, "models.ReportTimeframeType"]] = None, time_period: Optional["models.ReportConfigTimePeriod"] = None, dataset: Optional["models.ReportConfigDataset"] = None, @@ -529,36 +535,37 @@ async def create_or_update_by_scope( ExternalSubscription scope. :type view_properties_scope: str :param chart: Chart type of the main view in Cost Analysis. Required. - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType + :type chart: str or ~cost_management_client.models.ChartType :param accumulated: Show costs accumulated over time. - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :type accumulated: str or ~cost_management_client.models.AccumulatedType :param metric: Metric to use when displaying costs. - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType + :type metric: str or ~cost_management_client.models.MetricType :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :type kpis: list[~cost_management_client.models.KpiProperties] :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :type pivots: list[~cost_management_client.models.PivotProperties] :param timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :type timeframe: str or ~cost_management_client.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :type time_period: ~cost_management_client.models.ReportConfigTimePeriod :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :type dataset: ~cost_management_client.models.ReportConfigDataset :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View or ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.View(e_tag=e_tag, display_name=display_name, scope=view_properties_scope, chart=chart, accumulated=accumulated, metric=metric, kpis=kpis, pivots=pivots, timeframe=timeframe, time_period=time_period, dataset=dataset) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create_or_update_by_scope.metadata['url'] + url = self.create_or_update_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), 'viewName': self._serialize.url("view_name", view_name, 'str'), @@ -596,10 +603,10 @@ async def create_or_update_by_scope( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} + create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore async def delete_by_scope( self, @@ -630,16 +637,17 @@ async def delete_by_scope( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.delete_by_scope.metadata['url'] + url = self.delete_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), 'viewName': self._serialize.url("view_name", view_name, 'str'), @@ -664,6 +672,6 @@ async def delete_by_scope( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} + delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/__init__.py index 86b6667b5a5..9a36cdcb947 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/__init__.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/__init__.py @@ -9,20 +9,22 @@ try: from ._models_py3 import Alert from ._models_py3 import AlertPropertiesDefinition - from ._models_py3 import AlertPropertiesDetails from ._models_py3 import AlertsResult from ._models_py3 import CommonExportProperties from ._models_py3 import Dimension from ._models_py3 import DimensionsListResult + from ._models_py3 import DismissAlertPayload from ._models_py3 import ErrorDetails from ._models_py3 import ErrorResponse from ._models_py3 import Export + from ._models_py3 import ExportDatasetConfiguration from ._models_py3 import ExportDeliveryDestination from ._models_py3 import ExportExecution from ._models_py3 import ExportExecutionListResult from ._models_py3 import ExportListResult from ._models_py3 import ExportProperties from ._models_py3 import ExportRecurrencePeriod + from ._models_py3 import ExportTimePeriod from ._models_py3 import ForecastDefinition from ._models_py3 import KpiProperties from ._models_py3 import Operation @@ -53,20 +55,22 @@ except (SyntaxError, ImportError): from ._models import Alert # type: ignore from ._models import AlertPropertiesDefinition # type: ignore - from ._models import AlertPropertiesDetails # type: ignore from ._models import AlertsResult # type: ignore from ._models import CommonExportProperties # type: ignore from ._models import Dimension # type: ignore from ._models import DimensionsListResult # type: ignore + from ._models import DismissAlertPayload # type: ignore from ._models import ErrorDetails # type: ignore from ._models import ErrorResponse # type: ignore from ._models import Export # type: ignore + from ._models import ExportDatasetConfiguration # type: ignore from ._models import ExportDeliveryDestination # type: ignore from ._models import ExportExecution # type: ignore from ._models import ExportExecutionListResult # type: ignore from ._models import ExportListResult # type: ignore from ._models import ExportProperties # type: ignore from ._models import ExportRecurrencePeriod # type: ignore + from ._models import ExportTimePeriod # type: ignore from ._models import ForecastDefinition # type: ignore from ._models import KpiProperties # type: ignore from ._models import Operation # type: ignore @@ -97,6 +101,13 @@ from ._cost_management_client_enums import ( AccumulatedType, + AlertCategory, + AlertCriteria, + AlertOperator, + AlertSource, + AlertStatus, + AlertTimeGrainType, + AlertType, ChartType, ExecutionStatus, ExecutionType, @@ -121,20 +132,22 @@ __all__ = [ 'Alert', 'AlertPropertiesDefinition', - 'AlertPropertiesDetails', 'AlertsResult', 'CommonExportProperties', 'Dimension', 'DimensionsListResult', + 'DismissAlertPayload', 'ErrorDetails', 'ErrorResponse', 'Export', + 'ExportDatasetConfiguration', 'ExportDeliveryDestination', 'ExportExecution', 'ExportExecutionListResult', 'ExportListResult', 'ExportProperties', 'ExportRecurrencePeriod', + 'ExportTimePeriod', 'ForecastDefinition', 'KpiProperties', 'Operation', @@ -163,6 +176,13 @@ 'View', 'ViewListResult', 'AccumulatedType', + 'AlertCategory', + 'AlertCriteria', + 'AlertOperator', + 'AlertSource', + 'AlertStatus', + 'AlertTimeGrainType', + 'AlertType', 'ChartType', 'ExecutionStatus', 'ExecutionType', diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py index 833645db5a5..421bd72afd3 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_cost_management_client_enums.py @@ -15,6 +15,86 @@ class AccumulatedType(str, Enum): true = "true" false = "false" +class AlertCategory(str, Enum): + """Alert category + """ + + cost = "Cost" + usage = "Usage" + billing = "Billing" + system = "System" + +class AlertCriteria(str, Enum): + """Criteria that triggered alert + """ + + cost_threshold_exceeded = "CostThresholdExceeded" + usage_threshold_exceeded = "UsageThresholdExceeded" + credit_threshold_approaching = "CreditThresholdApproaching" + credit_threshold_reached = "CreditThresholdReached" + quota_threshold_approaching = "QuotaThresholdApproaching" + quota_threshold_reached = "QuotaThresholdReached" + multi_currency = "MultiCurrency" + forecast_cost_threshold_exceeded = "ForecastCostThresholdExceeded" + forecast_usage_threshold_exceeded = "ForecastUsageThresholdExceeded" + invoice_due_date_approaching = "InvoiceDueDateApproaching" + invoice_due_date_reached = "InvoiceDueDateReached" + cross_cloud_new_data_available = "CrossCloudNewDataAvailable" + cross_cloud_collection_error = "CrossCloudCollectionError" + general_threshold_error = "GeneralThresholdError" + +class AlertOperator(str, Enum): + """operator used to compare currentSpend with amount + """ + + none = "None" + equal_to = "EqualTo" + greater_than = "GreaterThan" + greater_than_or_equal_to = "GreaterThanOrEqualTo" + less_than = "LessThan" + less_than_or_equal_to = "LessThanOrEqualTo" + +class AlertSource(str, Enum): + """Source of alert + """ + + preset = "Preset" + user = "User" + +class AlertStatus(str, Enum): + """alert status + """ + + none = "None" + active = "Active" + overridden = "Overridden" + resolved = "Resolved" + dismissed = "Dismissed" + +class AlertTimeGrainType(str, Enum): + """Type of timegrain cadence + """ + + none = "None" + monthly = "Monthly" + quarterly = "Quarterly" + annually = "Annually" + billing_month = "BillingMonth" + billing_quarter = "BillingQuarter" + billing_annual = "BillingAnnual" + +class AlertType(str, Enum): + """type of alert + """ + + budget = "Budget" + invoice = "Invoice" + credit = "Credit" + quota = "Quota" + general = "General" + x_cloud = "xCloud" + budget_forecast = "BudgetForecast" + class ChartType(str, Enum): """Chart type of the main view in Cost Analysis. Required. """ @@ -26,7 +106,7 @@ class ChartType(str, Enum): table = "Table" class ExecutionStatus(str, Enum): - """The status of the export execution. + """The last known status of the export execution. """ queued = "Queued" @@ -154,8 +234,7 @@ class ReportTimeframeType(str, Enum): custom = "Custom" class StatusType(str, Enum): - """The status of the schedule. Whether active or not. If inactive, the export's scheduled - execution is paused. + """The status of the export's schedule. If 'Inactive', the export's schedule is paused. """ active = "Active" diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models.py index b1fa942dab2..f5afd130f9a 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models.py @@ -64,17 +64,16 @@ class Alert(Resource): :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param definition: defines the type of alert. - :type definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition + :type definition: ~cost_management_client.models.AlertPropertiesDefinition :param description: Alert description. :type description: str - :param source: Source of alert. - :type source: str - :param details: Alert details. - :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails + :param source: Source of alert. Possible values include: "Preset", "User". + :type source: str or ~cost_management_client.models.AlertSource :param cost_entity_id: related budget. :type cost_entity_id: str - :param status: alert status. - :type status: str + :param status: alert status. Possible values include: "None", "Active", "Overridden", + "Resolved", "Dismissed". + :type status: str or ~cost_management_client.models.AlertStatus :param creation_time: dateTime in which alert was created. :type creation_time: str :param close_time: dateTime in which alert was closed. @@ -85,6 +84,40 @@ class Alert(Resource): :type status_modification_user_name: str :param status_modification_time: dateTime in which the alert status was last modified. :type status_modification_time: str + :param time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", + "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". + :type time_grain_type: str or ~cost_management_client.models.AlertTimeGrainType + :param period_start_date: datetime of periodStartDate. + :type period_start_date: str + :param triggered_by: notificationId that triggered this alert. + :type triggered_by: str + :param resource_group_filter: array of resourceGroups to filter by. + :type resource_group_filter: list[object] + :param resource_filter: array of resources to filter by. + :type resource_filter: list[object] + :param meter_filter: array of meters to filter by. + :type meter_filter: list[object] + :param tag_filter: tags to filter by. + :type tag_filter: object + :param threshold: notification threshold percentage as a decimal which activated this alert. + :type threshold: float + :param operator: operator used to compare currentSpend with amount. Possible values include: + "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". + :type operator: str or ~cost_management_client.models.AlertOperator + :param amount: budget threshold amount. + :type amount: float + :param unit: unit of currency being used. + :type unit: str + :param current_spend: current spend. + :type current_spend: float + :param contact_emails: list of emails to contact. + :type contact_emails: list[str] + :param contact_groups: list of action groups to broadcast to. + :type contact_groups: list[str] + :param contact_roles: list of contact roles. + :type contact_roles: list[str] + :param overriding_alert: overriding alert. + :type overriding_alert: str """ _validation = { @@ -102,7 +135,6 @@ class Alert(Resource): 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'source': {'key': 'properties.source', 'type': 'str'}, - 'details': {'key': 'properties.details', 'type': 'AlertPropertiesDetails'}, 'cost_entity_id': {'key': 'properties.costEntityId', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, @@ -110,6 +142,22 @@ class Alert(Resource): 'modification_time': {'key': 'properties.modificationTime', 'type': 'str'}, 'status_modification_user_name': {'key': 'properties.statusModificationUserName', 'type': 'str'}, 'status_modification_time': {'key': 'properties.statusModificationTime', 'type': 'str'}, + 'time_grain_type': {'key': 'properties.details.timeGrainType', 'type': 'str'}, + 'period_start_date': {'key': 'properties.details.periodStartDate', 'type': 'str'}, + 'triggered_by': {'key': 'properties.details.triggeredBy', 'type': 'str'}, + 'resource_group_filter': {'key': 'properties.details.resourceGroupFilter', 'type': '[object]'}, + 'resource_filter': {'key': 'properties.details.resourceFilter', 'type': '[object]'}, + 'meter_filter': {'key': 'properties.details.meterFilter', 'type': '[object]'}, + 'tag_filter': {'key': 'properties.details.tagFilter', 'type': 'object'}, + 'threshold': {'key': 'properties.details.threshold', 'type': 'float'}, + 'operator': {'key': 'properties.details.operator', 'type': 'str'}, + 'amount': {'key': 'properties.details.amount', 'type': 'float'}, + 'unit': {'key': 'properties.details.unit', 'type': 'str'}, + 'current_spend': {'key': 'properties.details.currentSpend', 'type': 'float'}, + 'contact_emails': {'key': 'properties.details.contactEmails', 'type': '[str]'}, + 'contact_groups': {'key': 'properties.details.contactGroups', 'type': '[str]'}, + 'contact_roles': {'key': 'properties.details.contactRoles', 'type': '[str]'}, + 'overriding_alert': {'key': 'properties.details.overridingAlert', 'type': 'str'}, } def __init__( @@ -120,7 +168,6 @@ def __init__( self.definition = kwargs.get('definition', None) self.description = kwargs.get('description', None) self.source = kwargs.get('source', None) - self.details = kwargs.get('details', None) self.cost_entity_id = kwargs.get('cost_entity_id', None) self.status = kwargs.get('status', None) self.creation_time = kwargs.get('creation_time', None) @@ -128,17 +175,39 @@ def __init__( self.modification_time = kwargs.get('modification_time', None) self.status_modification_user_name = kwargs.get('status_modification_user_name', None) self.status_modification_time = kwargs.get('status_modification_time', None) + self.time_grain_type = kwargs.get('time_grain_type', None) + self.period_start_date = kwargs.get('period_start_date', None) + self.triggered_by = kwargs.get('triggered_by', None) + self.resource_group_filter = kwargs.get('resource_group_filter', None) + self.resource_filter = kwargs.get('resource_filter', None) + self.meter_filter = kwargs.get('meter_filter', None) + self.tag_filter = kwargs.get('tag_filter', None) + self.threshold = kwargs.get('threshold', None) + self.operator = kwargs.get('operator', None) + self.amount = kwargs.get('amount', None) + self.unit = kwargs.get('unit', None) + self.current_spend = kwargs.get('current_spend', None) + self.contact_emails = kwargs.get('contact_emails', None) + self.contact_groups = kwargs.get('contact_groups', None) + self.contact_roles = kwargs.get('contact_roles', None) + self.overriding_alert = kwargs.get('overriding_alert', None) class AlertPropertiesDefinition(msrest.serialization.Model): """defines the type of alert. - :param type: type of alert. - :type type: str - :param category: Alert category. - :type category: str - :param criteria: Criteria that triggered alert. - :type criteria: str + :param type: type of alert. Possible values include: "Budget", "Invoice", "Credit", "Quota", + "General", "xCloud", "BudgetForecast". + :type type: str or ~cost_management_client.models.AlertType + :param category: Alert category. Possible values include: "Cost", "Usage", "Billing", "System". + :type category: str or ~cost_management_client.models.AlertCategory + :param criteria: Criteria that triggered alert. Possible values include: + "CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", + "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", + "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", + "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", + "CrossCloudCollectionError", "GeneralThresholdError". + :type criteria: str or ~cost_management_client.models.AlertCriteria """ _attribute_map = { @@ -157,92 +226,13 @@ def __init__( self.criteria = kwargs.get('criteria', None) -class AlertPropertiesDetails(msrest.serialization.Model): - """Alert details. - - :param time_grain_type: Type of timegrain cadence. - :type time_grain_type: str - :param period_start_date: datetime of periodStartDate. - :type period_start_date: str - :param triggered_by: notificationId that triggered this alert. - :type triggered_by: str - :param resource_group_filter: array of resourceGroups to filter by. - :type resource_group_filter: list[object] - :param resource_filter: array of resources to filter by. - :type resource_filter: list[object] - :param meter_filter: array of meters to filter by. - :type meter_filter: list[object] - :param tag_filter: tags to filter by. - :type tag_filter: object - :param threshold: notification threshold percentage as a decimal which activated this alert. - :type threshold: float - :param operator: operator used to compare currentSpend with amount. - :type operator: str - :param amount: budget threshold amount. - :type amount: float - :param unit: unit of currency being used. - :type unit: str - :param current_spend: current spend. - :type current_spend: float - :param contact_emails: list of emails to contact. - :type contact_emails: list[str] - :param contact_groups: list of action groups to broadcast to. - :type contact_groups: list[str] - :param contact_roles: list of contact roles. - :type contact_roles: list[str] - :param overriding_alert: overriding alert. - :type overriding_alert: str - """ - - _attribute_map = { - 'time_grain_type': {'key': 'timeGrainType', 'type': 'str'}, - 'period_start_date': {'key': 'periodStartDate', 'type': 'str'}, - 'triggered_by': {'key': 'triggeredBy', 'type': 'str'}, - 'resource_group_filter': {'key': 'resourceGroupFilter', 'type': '[object]'}, - 'resource_filter': {'key': 'resourceFilter', 'type': '[object]'}, - 'meter_filter': {'key': 'meterFilter', 'type': '[object]'}, - 'tag_filter': {'key': 'tagFilter', 'type': 'object'}, - 'threshold': {'key': 'threshold', 'type': 'float'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'amount': {'key': 'amount', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_spend': {'key': 'currentSpend', 'type': 'float'}, - 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, - 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, - 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, - 'overriding_alert': {'key': 'overridingAlert', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AlertPropertiesDetails, self).__init__(**kwargs) - self.time_grain_type = kwargs.get('time_grain_type', None) - self.period_start_date = kwargs.get('period_start_date', None) - self.triggered_by = kwargs.get('triggered_by', None) - self.resource_group_filter = kwargs.get('resource_group_filter', None) - self.resource_filter = kwargs.get('resource_filter', None) - self.meter_filter = kwargs.get('meter_filter', None) - self.tag_filter = kwargs.get('tag_filter', None) - self.threshold = kwargs.get('threshold', None) - self.operator = kwargs.get('operator', None) - self.amount = kwargs.get('amount', None) - self.unit = kwargs.get('unit', None) - self.current_spend = kwargs.get('current_spend', None) - self.contact_emails = kwargs.get('contact_emails', None) - self.contact_groups = kwargs.get('contact_groups', None) - self.contact_roles = kwargs.get('contact_roles', None) - self.overriding_alert = kwargs.get('overriding_alert', None) - - class AlertsResult(msrest.serialization.Model): """Result of alerts. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of alerts. - :vartype value: list[~azure.mgmt.costmanagement.models.Alert] + :vartype value: list[~cost_management_client.models.Alert] :ivar next_link: URL to get the next set of alerts results if there are any. :vartype next_link: str """ @@ -273,54 +263,51 @@ class CommonExportProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar format: The format of the export being delivered. Default value: "Csv". + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Default value: "Csv". :vartype format: str - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". + :type type: str or ~cost_management_client.models.ExportType + :param timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Default value: "Daily". :vartype granularity: str - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Required. Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + :type destination: ~cost_management_client.models.ExportDeliveryDestination """ _validation = { 'format': {'constant': True}, + 'next_run_time_estimate': {'readonly': True}, 'type': {'required': True}, 'timeframe': {'required': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, 'destination': {'required': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'type': {'key': 'definition.type', 'type': 'str'}, 'timeframe': {'key': 'definition.timeframe', 'type': 'str'}, - 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'}, + 'time_period': {'key': 'definition.timePeriod', 'type': 'ExportTimePeriod'}, 'granularity': {'key': 'definition.dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'definition.dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'definition.dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'definition.dataSet.filter', 'type': 'QueryFilter'}, + 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'ExportDatasetConfiguration'}, 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'}, } @@ -332,13 +319,12 @@ def __init__( **kwargs ): super(CommonExportProperties, self).__init__(**kwargs) + self.run_history = kwargs.get('run_history', None) + self.next_run_time_estimate = None self.type = kwargs['type'] self.timeframe = kwargs['timeframe'] self.time_period = kwargs.get('time_period', None) self.configuration = kwargs.get('configuration', None) - self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) - self.filter = kwargs.get('filter', None) self.destination = kwargs['destination'] @@ -428,7 +414,7 @@ class DimensionsListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of dimensions. - :vartype value: list[~azure.mgmt.costmanagement.models.Dimension] + :vartype value: list[~cost_management_client.models.Dimension] """ _validation = { @@ -447,6 +433,128 @@ def __init__( self.value = None +class DismissAlertPayload(msrest.serialization.Model): + """The request payload to update an alert. + + :param definition: defines the type of alert. + :type definition: ~cost_management_client.models.AlertPropertiesDefinition + :param description: Alert description. + :type description: str + :param source: Source of alert. Possible values include: "Preset", "User". + :type source: str or ~cost_management_client.models.AlertSource + :param cost_entity_id: related budget. + :type cost_entity_id: str + :param status: alert status. Possible values include: "None", "Active", "Overridden", + "Resolved", "Dismissed". + :type status: str or ~cost_management_client.models.AlertStatus + :param creation_time: dateTime in which alert was created. + :type creation_time: str + :param close_time: dateTime in which alert was closed. + :type close_time: str + :param modification_time: dateTime in which alert was last modified. + :type modification_time: str + :param status_modification_user_name: + :type status_modification_user_name: str + :param status_modification_time: dateTime in which the alert status was last modified. + :type status_modification_time: str + :param time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", + "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". + :type time_grain_type: str or ~cost_management_client.models.AlertTimeGrainType + :param period_start_date: datetime of periodStartDate. + :type period_start_date: str + :param triggered_by: notificationId that triggered this alert. + :type triggered_by: str + :param resource_group_filter: array of resourceGroups to filter by. + :type resource_group_filter: list[object] + :param resource_filter: array of resources to filter by. + :type resource_filter: list[object] + :param meter_filter: array of meters to filter by. + :type meter_filter: list[object] + :param tag_filter: tags to filter by. + :type tag_filter: object + :param threshold: notification threshold percentage as a decimal which activated this alert. + :type threshold: float + :param operator: operator used to compare currentSpend with amount. Possible values include: + "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". + :type operator: str or ~cost_management_client.models.AlertOperator + :param amount: budget threshold amount. + :type amount: float + :param unit: unit of currency being used. + :type unit: str + :param current_spend: current spend. + :type current_spend: float + :param contact_emails: list of emails to contact. + :type contact_emails: list[str] + :param contact_groups: list of action groups to broadcast to. + :type contact_groups: list[str] + :param contact_roles: list of contact roles. + :type contact_roles: list[str] + :param overriding_alert: overriding alert. + :type overriding_alert: str + """ + + _attribute_map = { + 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'cost_entity_id': {'key': 'properties.costEntityId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'close_time': {'key': 'properties.closeTime', 'type': 'str'}, + 'modification_time': {'key': 'properties.modificationTime', 'type': 'str'}, + 'status_modification_user_name': {'key': 'properties.statusModificationUserName', 'type': 'str'}, + 'status_modification_time': {'key': 'properties.statusModificationTime', 'type': 'str'}, + 'time_grain_type': {'key': 'properties.details.timeGrainType', 'type': 'str'}, + 'period_start_date': {'key': 'properties.details.periodStartDate', 'type': 'str'}, + 'triggered_by': {'key': 'properties.details.triggeredBy', 'type': 'str'}, + 'resource_group_filter': {'key': 'properties.details.resourceGroupFilter', 'type': '[object]'}, + 'resource_filter': {'key': 'properties.details.resourceFilter', 'type': '[object]'}, + 'meter_filter': {'key': 'properties.details.meterFilter', 'type': '[object]'}, + 'tag_filter': {'key': 'properties.details.tagFilter', 'type': 'object'}, + 'threshold': {'key': 'properties.details.threshold', 'type': 'float'}, + 'operator': {'key': 'properties.details.operator', 'type': 'str'}, + 'amount': {'key': 'properties.details.amount', 'type': 'float'}, + 'unit': {'key': 'properties.details.unit', 'type': 'str'}, + 'current_spend': {'key': 'properties.details.currentSpend', 'type': 'float'}, + 'contact_emails': {'key': 'properties.details.contactEmails', 'type': '[str]'}, + 'contact_groups': {'key': 'properties.details.contactGroups', 'type': '[str]'}, + 'contact_roles': {'key': 'properties.details.contactRoles', 'type': '[str]'}, + 'overriding_alert': {'key': 'properties.details.overridingAlert', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DismissAlertPayload, self).__init__(**kwargs) + self.definition = kwargs.get('definition', None) + self.description = kwargs.get('description', None) + self.source = kwargs.get('source', None) + self.cost_entity_id = kwargs.get('cost_entity_id', None) + self.status = kwargs.get('status', None) + self.creation_time = kwargs.get('creation_time', None) + self.close_time = kwargs.get('close_time', None) + self.modification_time = kwargs.get('modification_time', None) + self.status_modification_user_name = kwargs.get('status_modification_user_name', None) + self.status_modification_time = kwargs.get('status_modification_time', None) + self.time_grain_type = kwargs.get('time_grain_type', None) + self.period_start_date = kwargs.get('period_start_date', None) + self.triggered_by = kwargs.get('triggered_by', None) + self.resource_group_filter = kwargs.get('resource_group_filter', None) + self.resource_filter = kwargs.get('resource_filter', None) + self.meter_filter = kwargs.get('meter_filter', None) + self.tag_filter = kwargs.get('tag_filter', None) + self.threshold = kwargs.get('threshold', None) + self.operator = kwargs.get('operator', None) + self.amount = kwargs.get('amount', None) + self.unit = kwargs.get('unit', None) + self.current_spend = kwargs.get('current_spend', None) + self.contact_emails = kwargs.get('contact_emails', None) + self.contact_groups = kwargs.get('contact_groups', None) + self.contact_roles = kwargs.get('contact_roles', None) + self.overriding_alert = kwargs.get('overriding_alert', None) + + class ErrorDetails(msrest.serialization.Model): """The details of the error. @@ -478,19 +586,19 @@ def __init__( class ErrorResponse(msrest.serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. -Some Error responses: +Some Error responses: -* - 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. +* + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. -* +* 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. :param error: The details of the error. - :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + :type error: ~cost_management_client.models.ErrorDetails """ _attribute_map = { @@ -546,7 +654,7 @@ def __init__( class Export(ProxyResource): - """A export resource. + """An export resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -559,42 +667,41 @@ class Export(ProxyResource): :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. :type e_tag: str - :ivar format: The format of the export being delivered. Default value: "Csv". + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Default value: "Csv". :vartype format: str - :param type_properties_definition_type: The type of the query. Possible values include: - "Usage", "ActualCost", "AmortizedCost". - :type type_properties_definition_type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: The time frame for pulling data for the query. If custom, then a specific + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :param type_properties_definition_type: The type of the export. Note that 'Usage' is equivalent + to 'ActualCost' and is applicable to exports that do not yet provide data for charges or + amortization for service reservations. Possible values include: "Usage", "ActualCost", + "AmortizedCost". + :type type_properties_definition_type: str or ~cost_management_client.models.ExportType + :param timeframe: The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Default value: "Daily". :vartype granularity: str - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". - :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :type destination: ~cost_management_client.models.ExportDeliveryDestination + :param status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. Possible values include: "Active", "Inactive". + :type status: str or ~cost_management_client.models.StatusType :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", "Monthly", "Annually". - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :type recurrence: str or ~cost_management_client.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :type recurrence_period: ~cost_management_client.models.ExportRecurrencePeriod """ _validation = { @@ -602,8 +709,8 @@ class Export(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'format': {'constant': True}, + 'next_run_time_estimate': {'readonly': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, } _attribute_map = { @@ -612,14 +719,13 @@ class Export(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'format': {'key': 'properties.format', 'type': 'str'}, + 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'}, 'type_properties_definition_type': {'key': 'properties.definition.type', 'type': 'str'}, 'timeframe': {'key': 'properties.definition.timeframe', 'type': 'str'}, - 'time_period': {'key': 'properties.definition.timePeriod', 'type': 'QueryTimePeriod'}, + 'time_period': {'key': 'properties.definition.timePeriod', 'type': 'ExportTimePeriod'}, 'granularity': {'key': 'properties.definition.dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'properties.definition.dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'properties.definition.dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'properties.definition.dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'properties.definition.dataSet.filter', 'type': 'QueryFilter'}, + 'configuration': {'key': 'properties.definition.dataSet.configuration', 'type': 'ExportDatasetConfiguration'}, 'destination': {'key': 'properties.deliveryInfo.destination', 'type': 'ExportDeliveryDestination'}, 'status': {'key': 'properties.schedule.status', 'type': 'str'}, 'recurrence': {'key': 'properties.schedule.recurrence', 'type': 'str'}, @@ -634,19 +740,39 @@ def __init__( **kwargs ): super(Export, self).__init__(**kwargs) + self.run_history = kwargs.get('run_history', None) + self.next_run_time_estimate = None self.type_properties_definition_type = kwargs.get('type_properties_definition_type', None) self.timeframe = kwargs.get('timeframe', None) self.time_period = kwargs.get('time_period', None) self.configuration = kwargs.get('configuration', None) - self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) - self.filter = kwargs.get('filter', None) self.destination = kwargs.get('destination', None) self.status = kwargs.get('status', None) self.recurrence = kwargs.get('recurrence', None) self.recurrence_period = kwargs.get('recurrence_period', None) +class ExportDatasetConfiguration(msrest.serialization.Model): + """The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns. + + :param columns: Array of column names to be included in the export. If not provided then the + export will include all available columns. The available columns can vary by customer channel + (see examples). + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportDatasetConfiguration, self).__init__(**kwargs) + self.columns = kwargs.get('columns', None) + + class ExportDeliveryDestination(msrest.serialization.Model): """The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services . @@ -683,7 +809,7 @@ def __init__( class ExportExecution(Resource): - """A export execution. + """An export execution. Variables are only populated by the server, and will be ignored when sending a request. @@ -697,23 +823,26 @@ class ExportExecution(Resource): :vartype tags: dict[str, str] :param execution_type: The type of the export execution. Possible values include: "OnDemand", "Scheduled". - :type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values include: "Queued", - "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable". - :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :type execution_type: str or ~cost_management_client.models.ExecutionType + :param status: The last known status of the export execution. Possible values include: + "Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", + "DataNotAvailable". + :type status: str or ~cost_management_client.models.ExecutionStatus :param submitted_by: The identifier for the entity that executed the export. For OnDemand - executions, it is the email id. For Scheduled executions, it is the constant value - System. + executions it is the user email. For scheduled executions it is 'System'. :type submitted_by: str :param submitted_time: The time when export was queued to be executed. :type submitted_time: ~datetime.datetime :param processing_start_time: The time when export was picked up to be executed. :type processing_start_time: ~datetime.datetime - :param processing_end_time: The time when export execution finished. + :param processing_end_time: The time when the export execution finished. :type processing_end_time: ~datetime.datetime - :param file_name: The name of the file export got written to. + :param file_name: The name of the exported file. :type file_name: str - :param run_settings: The common properties of the export. - :type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :param run_settings: The export settings that were in effect for this execution. + :type run_settings: ~cost_management_client.models.CommonExportProperties + :param error: The details of any error. + :type error: ~cost_management_client.models.ErrorDetails """ _validation = { @@ -736,6 +865,7 @@ class ExportExecution(Resource): 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, 'file_name': {'key': 'properties.fileName', 'type': 'str'}, 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + 'error': {'key': 'properties.error', 'type': 'ErrorDetails'}, } def __init__( @@ -751,15 +881,16 @@ def __init__( self.processing_end_time = kwargs.get('processing_end_time', None) self.file_name = kwargs.get('file_name', None) self.run_settings = kwargs.get('run_settings', None) + self.error = kwargs.get('error', None) class ExportExecutionListResult(msrest.serialization.Model): - """Result of listing exports execution history of a export by name. + """Result of listing the execution history of an export. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of export executions. - :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + :ivar value: A list of export executions. + :vartype value: list[~cost_management_client.models.ExportExecution] """ _validation = { @@ -784,7 +915,7 @@ class ExportListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of exports. - :vartype value: list[~azure.mgmt.costmanagement.models.Export] + :vartype value: list[~cost_management_client.models.Export] """ _validation = { @@ -810,63 +941,60 @@ class ExportProperties(CommonExportProperties): All required parameters must be populated in order to send to Azure. - :ivar format: The format of the export being delivered. Default value: "Csv". + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Default value: "Csv". :vartype format: str - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". + :type type: str or ~cost_management_client.models.ExportType + :param timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Default value: "Daily". :vartype granularity: str - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Required. Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". - :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :type destination: ~cost_management_client.models.ExportDeliveryDestination + :param status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. Possible values include: "Active", "Inactive". + :type status: str or ~cost_management_client.models.StatusType :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", "Monthly", "Annually". - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :type recurrence: str or ~cost_management_client.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :type recurrence_period: ~cost_management_client.models.ExportRecurrencePeriod """ _validation = { 'format': {'constant': True}, + 'next_run_time_estimate': {'readonly': True}, 'type': {'required': True}, 'timeframe': {'required': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, 'destination': {'required': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'type': {'key': 'definition.type', 'type': 'str'}, 'timeframe': {'key': 'definition.timeframe', 'type': 'str'}, - 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'}, + 'time_period': {'key': 'definition.timePeriod', 'type': 'ExportTimePeriod'}, 'granularity': {'key': 'definition.dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'definition.dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'definition.dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'definition.dataSet.filter', 'type': 'QueryFilter'}, + 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'ExportDatasetConfiguration'}, 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'}, 'status': {'key': 'schedule.status', 'type': 'str'}, 'recurrence': {'key': 'schedule.recurrence', 'type': 'str'}, @@ -915,6 +1043,36 @@ def __init__( self.to = kwargs.get('to', None) +class ExportTimePeriod(msrest.serialization.Model): + """The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date for export data. + :type from_property: ~datetime.datetime + :param to: Required. The end date for export data. + :type to: ~datetime.datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportTimePeriod, self).__init__(**kwargs) + self.from_property = kwargs['from_property'] + self.to = kwargs['to'] + + class ForecastDefinition(msrest.serialization.Model): """The definition of a forecast. @@ -924,38 +1082,34 @@ class ForecastDefinition(msrest.serialization.Model): :param type: Required. The type of the forecast. Possible values include: "Usage", "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType + :type type: str or ~cost_management_client.models.ForecastType :param timeframe: Required. The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :type timeframe: str or ~cost_management_client.models.ForecastTimeframeType :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. :type include_fresh_partial_cost: bool - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :ivar granularity: The granularity of rows in the forecast. Default value: "Daily". :vartype granularity: str :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] + :param filter: Has filter expression to use in the forecast. + :type filter: ~cost_management_client.models.QueryFilter """ _validation = { 'type': {'required': True}, 'timeframe': {'required': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, } _attribute_map = { @@ -967,7 +1121,6 @@ class ForecastDefinition(msrest.serialization.Model): 'granularity': {'key': 'dataset.granularity', 'type': 'str'}, 'configuration': {'key': 'dataset.configuration', 'type': 'QueryDatasetConfiguration'}, 'aggregation': {'key': 'dataset.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'dataset.grouping', 'type': '[QueryGrouping]'}, 'filter': {'key': 'dataset.filter', 'type': 'QueryFilter'}, } @@ -985,7 +1138,6 @@ def __init__( self.include_fresh_partial_cost = kwargs.get('include_fresh_partial_cost', None) self.configuration = kwargs.get('configuration', None) self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) self.filter = kwargs.get('filter', None) @@ -993,7 +1145,7 @@ class KpiProperties(msrest.serialization.Model): """Each KPI must contain a 'type' and 'enabled' key. :param type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget". - :type type: str or ~azure.mgmt.costmanagement.models.KpiType + :type type: str or ~cost_management_client.models.KpiType :param id: ID of resource related to metric (budget). :type id: str :param enabled: show the KPI in the UI?. @@ -1024,7 +1176,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :param display: The object that represents the operation. - :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + :type display: ~cost_management_client.models.OperationDisplay """ _validation = { @@ -1087,7 +1239,7 @@ class OperationListResult(msrest.serialization.Model): :ivar value: List of cost management operations supported by the Microsoft.CostManagement resource provider. - :vartype value: list[~azure.mgmt.costmanagement.models.Operation] + :vartype value: list[~cost_management_client.models.Operation] :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -1115,7 +1267,7 @@ class PivotProperties(msrest.serialization.Model): """Each pivot must contain a 'type' and 'name'. :param type: Data type to show in view. Possible values include: "Dimension", "TagKey". - :type type: str or ~azure.mgmt.costmanagement.models.PivotType + :type type: str or ~cost_management_client.models.PivotType :param name: Data field to show in view. :type name: str """ @@ -1199,7 +1351,7 @@ class QueryComparisonExpression(msrest.serialization.Model): :type name: str :param operator: Required. The operator to use for comparison. Possible values include: "In", "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :type operator: str or ~cost_management_client.models.OperatorType :param values: Required. Array of values to use for comparison. :type values: list[str] """ @@ -1255,27 +1407,27 @@ class QueryDefinition(msrest.serialization.Model): :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :type type: str or ~cost_management_client.models.ExportType :param timeframe: Required. The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :type timeframe: str or ~cost_management_client.models.TimeframeType :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :ivar granularity: The granularity of rows in the query. Default value: "Daily". :vartype granularity: str :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :type grouping: list[~cost_management_client.models.QueryGrouping] :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type filter: ~cost_management_client.models.QueryFilter """ _validation = { @@ -1289,11 +1441,11 @@ class QueryDefinition(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'granularity': {'key': 'dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'dataSet.filter', 'type': 'QueryFilter'}, + 'granularity': {'key': 'dataset.granularity', 'type': 'str'}, + 'configuration': {'key': 'dataset.configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'dataset.aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'dataset.grouping', 'type': '[QueryGrouping]'}, + 'filter': {'key': 'dataset.filter', 'type': 'QueryFilter'}, } granularity = "Daily" @@ -1316,15 +1468,15 @@ class QueryFilter(msrest.serialization.Model): """The filter expression to be used in the export. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :type and_property: list[~cost_management_client.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :type or_property: list[~cost_management_client.models.QueryFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter + :type not_property: ~cost_management_client.models.QueryFilter :param dimension: Has comparison expression for a dimension. - :type dimension: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :type dimension: ~cost_management_client.models.QueryComparisonExpression :param tag: Has comparison expression for a tag. - :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :type tag: ~cost_management_client.models.QueryComparisonExpression """ _validation = { @@ -1359,7 +1511,7 @@ class QueryGrouping(msrest.serialization.Model): :param type: Required. Has type of the column to group. Possible values include: "Tag", "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :type type: str or ~cost_management_client.models.QueryColumnType :param name: Required. The name of the column to group. :type name: str """ @@ -1399,7 +1551,7 @@ class QueryResult(Resource): :param next_link: The link (url) to the next page of results. :type next_link: str :param columns: Array of columns. - :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :type columns: list[~cost_management_client.models.QueryColumn] :param rows: Array of rows. :type rows: list[list[object]] """ @@ -1503,7 +1655,7 @@ class ReportConfigComparisonExpression(msrest.serialization.Model): :type name: str :param operator: Required. The operator to use for comparison. Possible values include: "In", "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :type operator: str or ~cost_management_client.models.OperatorType :param values: Required. Array of values to use for comparison. :type values: list[str] """ @@ -1535,21 +1687,21 @@ class ReportConfigDataset(msrest.serialization.Model): :param granularity: The granularity of rows in the report. Possible values include: "Daily", "Monthly". - :type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType + :type granularity: str or ~cost_management_client.models.ReportGranularityType :param configuration: Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :type configuration: ~cost_management_client.models.ReportConfigDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :type aggregation: dict[str, ~cost_management_client.models.ReportConfigAggregation] :param grouping: Array of group by expression to use in the report. Report can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :type grouping: list[~cost_management_client.models.ReportConfigGrouping] :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] + :type sorting: list[~cost_management_client.models.ReportConfigSorting] :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type filter: ~cost_management_client.models.ReportConfigFilter """ _validation = { @@ -1602,15 +1754,15 @@ class ReportConfigFilter(msrest.serialization.Model): """The filter expression to be used in the report. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type and_property: list[~cost_management_client.models.ReportConfigFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type or_property: list[~cost_management_client.models.ReportConfigFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type not_property: ~cost_management_client.models.ReportConfigFilter :param dimension: Has comparison expression for a dimension. - :type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type dimension: ~cost_management_client.models.ReportConfigComparisonExpression :param tag: Has comparison expression for a tag. - :type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type tag: ~cost_management_client.models.ReportConfigComparisonExpression """ _validation = { @@ -1645,7 +1797,7 @@ class ReportConfigGrouping(msrest.serialization.Model): :param type: Required. Has type of the column to group. Possible values include: "Tag", "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :type type: str or ~cost_management_client.models.ReportConfigColumnType :param name: Required. The name of the column to group. This version supports subscription lowest possible grain. :type name: str @@ -1676,7 +1828,7 @@ class ReportConfigSorting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param direction: Direction of sort. Possible values include: "Ascending", "Descending". - :type direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingDirection + :type direction: str or ~cost_management_client.models.ReportConfigSortingDirection :param name: Required. The name of the column to sort. :type name: str """ @@ -1769,16 +1921,16 @@ class View(ProxyResource): :vartype modified_on: ~datetime.datetime :param chart: Chart type of the main view in Cost Analysis. Required. Possible values include: "Area", "Line", "StackedColumn", "GroupedColumn", "Table". - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType + :type chart: str or ~cost_management_client.models.ChartType :param accumulated: Show costs accumulated over time. Possible values include: "true", "false". - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :type accumulated: str or ~cost_management_client.models.AccumulatedType :param metric: Metric to use when displaying costs. Possible values include: "ActualCost", "AmortizedCost", "AHUB". - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType + :type metric: str or ~cost_management_client.models.MetricType :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :type kpis: list[~cost_management_client.models.KpiProperties] :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :type pivots: list[~cost_management_client.models.PivotProperties] :ivar type_properties_query_type: The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. Default value: @@ -1787,11 +1939,11 @@ class View(ProxyResource): :param timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate", "YearToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :type timeframe: str or ~cost_management_client.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :type time_period: ~cost_management_client.models.ReportConfigTimePeriod :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :type dataset: ~cost_management_client.models.ReportConfigDataset """ _validation = { @@ -1850,7 +2002,7 @@ class ViewListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of views. - :vartype value: list[~azure.mgmt.costmanagement.models.View] + :vartype value: list[~cost_management_client.models.View] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py index 06fca40ed98..b8a44f804bf 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/_models_py3.py @@ -12,6 +12,8 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._cost_management_client_enums import * + class Resource(msrest.serialization.Model): """The Resource model definition. @@ -67,17 +69,16 @@ class Alert(Resource): :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :param definition: defines the type of alert. - :type definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition + :type definition: ~cost_management_client.models.AlertPropertiesDefinition :param description: Alert description. :type description: str - :param source: Source of alert. - :type source: str - :param details: Alert details. - :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails + :param source: Source of alert. Possible values include: "Preset", "User". + :type source: str or ~cost_management_client.models.AlertSource :param cost_entity_id: related budget. :type cost_entity_id: str - :param status: alert status. - :type status: str + :param status: alert status. Possible values include: "None", "Active", "Overridden", + "Resolved", "Dismissed". + :type status: str or ~cost_management_client.models.AlertStatus :param creation_time: dateTime in which alert was created. :type creation_time: str :param close_time: dateTime in which alert was closed. @@ -88,6 +89,40 @@ class Alert(Resource): :type status_modification_user_name: str :param status_modification_time: dateTime in which the alert status was last modified. :type status_modification_time: str + :param time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", + "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". + :type time_grain_type: str or ~cost_management_client.models.AlertTimeGrainType + :param period_start_date: datetime of periodStartDate. + :type period_start_date: str + :param triggered_by: notificationId that triggered this alert. + :type triggered_by: str + :param resource_group_filter: array of resourceGroups to filter by. + :type resource_group_filter: list[object] + :param resource_filter: array of resources to filter by. + :type resource_filter: list[object] + :param meter_filter: array of meters to filter by. + :type meter_filter: list[object] + :param tag_filter: tags to filter by. + :type tag_filter: object + :param threshold: notification threshold percentage as a decimal which activated this alert. + :type threshold: float + :param operator: operator used to compare currentSpend with amount. Possible values include: + "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". + :type operator: str or ~cost_management_client.models.AlertOperator + :param amount: budget threshold amount. + :type amount: float + :param unit: unit of currency being used. + :type unit: str + :param current_spend: current spend. + :type current_spend: float + :param contact_emails: list of emails to contact. + :type contact_emails: list[str] + :param contact_groups: list of action groups to broadcast to. + :type contact_groups: list[str] + :param contact_roles: list of contact roles. + :type contact_roles: list[str] + :param overriding_alert: overriding alert. + :type overriding_alert: str """ _validation = { @@ -105,7 +140,6 @@ class Alert(Resource): 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'source': {'key': 'properties.source', 'type': 'str'}, - 'details': {'key': 'properties.details', 'type': 'AlertPropertiesDetails'}, 'cost_entity_id': {'key': 'properties.costEntityId', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, @@ -113,6 +147,22 @@ class Alert(Resource): 'modification_time': {'key': 'properties.modificationTime', 'type': 'str'}, 'status_modification_user_name': {'key': 'properties.statusModificationUserName', 'type': 'str'}, 'status_modification_time': {'key': 'properties.statusModificationTime', 'type': 'str'}, + 'time_grain_type': {'key': 'properties.details.timeGrainType', 'type': 'str'}, + 'period_start_date': {'key': 'properties.details.periodStartDate', 'type': 'str'}, + 'triggered_by': {'key': 'properties.details.triggeredBy', 'type': 'str'}, + 'resource_group_filter': {'key': 'properties.details.resourceGroupFilter', 'type': '[object]'}, + 'resource_filter': {'key': 'properties.details.resourceFilter', 'type': '[object]'}, + 'meter_filter': {'key': 'properties.details.meterFilter', 'type': '[object]'}, + 'tag_filter': {'key': 'properties.details.tagFilter', 'type': 'object'}, + 'threshold': {'key': 'properties.details.threshold', 'type': 'float'}, + 'operator': {'key': 'properties.details.operator', 'type': 'str'}, + 'amount': {'key': 'properties.details.amount', 'type': 'float'}, + 'unit': {'key': 'properties.details.unit', 'type': 'str'}, + 'current_spend': {'key': 'properties.details.currentSpend', 'type': 'float'}, + 'contact_emails': {'key': 'properties.details.contactEmails', 'type': '[str]'}, + 'contact_groups': {'key': 'properties.details.contactGroups', 'type': '[str]'}, + 'contact_roles': {'key': 'properties.details.contactRoles', 'type': '[str]'}, + 'overriding_alert': {'key': 'properties.details.overridingAlert', 'type': 'str'}, } def __init__( @@ -120,22 +170,36 @@ def __init__( *, definition: Optional["AlertPropertiesDefinition"] = None, description: Optional[str] = None, - source: Optional[str] = None, - details: Optional["AlertPropertiesDetails"] = None, + source: Optional[Union[str, "AlertSource"]] = None, cost_entity_id: Optional[str] = None, - status: Optional[str] = None, + status: Optional[Union[str, "AlertStatus"]] = None, creation_time: Optional[str] = None, close_time: Optional[str] = None, modification_time: Optional[str] = None, status_modification_user_name: Optional[str] = None, status_modification_time: Optional[str] = None, + time_grain_type: Optional[Union[str, "AlertTimeGrainType"]] = None, + period_start_date: Optional[str] = None, + triggered_by: Optional[str] = None, + resource_group_filter: Optional[List[object]] = None, + resource_filter: Optional[List[object]] = None, + meter_filter: Optional[List[object]] = None, + tag_filter: Optional[object] = None, + threshold: Optional[float] = None, + operator: Optional[Union[str, "AlertOperator"]] = None, + amount: Optional[float] = None, + unit: Optional[str] = None, + current_spend: Optional[float] = None, + contact_emails: Optional[List[str]] = None, + contact_groups: Optional[List[str]] = None, + contact_roles: Optional[List[str]] = None, + overriding_alert: Optional[str] = None, **kwargs ): super(Alert, self).__init__(**kwargs) self.definition = definition self.description = description self.source = source - self.details = details self.cost_entity_id = cost_entity_id self.status = status self.creation_time = creation_time @@ -143,17 +207,39 @@ def __init__( self.modification_time = modification_time self.status_modification_user_name = status_modification_user_name self.status_modification_time = status_modification_time + self.time_grain_type = time_grain_type + self.period_start_date = period_start_date + self.triggered_by = triggered_by + self.resource_group_filter = resource_group_filter + self.resource_filter = resource_filter + self.meter_filter = meter_filter + self.tag_filter = tag_filter + self.threshold = threshold + self.operator = operator + self.amount = amount + self.unit = unit + self.current_spend = current_spend + self.contact_emails = contact_emails + self.contact_groups = contact_groups + self.contact_roles = contact_roles + self.overriding_alert = overriding_alert class AlertPropertiesDefinition(msrest.serialization.Model): """defines the type of alert. - :param type: type of alert. - :type type: str - :param category: Alert category. - :type category: str - :param criteria: Criteria that triggered alert. - :type criteria: str + :param type: type of alert. Possible values include: "Budget", "Invoice", "Credit", "Quota", + "General", "xCloud", "BudgetForecast". + :type type: str or ~cost_management_client.models.AlertType + :param category: Alert category. Possible values include: "Cost", "Usage", "Billing", "System". + :type category: str or ~cost_management_client.models.AlertCategory + :param criteria: Criteria that triggered alert. Possible values include: + "CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", + "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", + "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", + "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", + "CrossCloudCollectionError", "GeneralThresholdError". + :type criteria: str or ~cost_management_client.models.AlertCriteria """ _attribute_map = { @@ -165,9 +251,9 @@ class AlertPropertiesDefinition(msrest.serialization.Model): def __init__( self, *, - type: Optional[str] = None, - category: Optional[str] = None, - criteria: Optional[str] = None, + type: Optional[Union[str, "AlertType"]] = None, + category: Optional[Union[str, "AlertCategory"]] = None, + criteria: Optional[Union[str, "AlertCriteria"]] = None, **kwargs ): super(AlertPropertiesDefinition, self).__init__(**kwargs) @@ -176,109 +262,13 @@ def __init__( self.criteria = criteria -class AlertPropertiesDetails(msrest.serialization.Model): - """Alert details. - - :param time_grain_type: Type of timegrain cadence. - :type time_grain_type: str - :param period_start_date: datetime of periodStartDate. - :type period_start_date: str - :param triggered_by: notificationId that triggered this alert. - :type triggered_by: str - :param resource_group_filter: array of resourceGroups to filter by. - :type resource_group_filter: list[object] - :param resource_filter: array of resources to filter by. - :type resource_filter: list[object] - :param meter_filter: array of meters to filter by. - :type meter_filter: list[object] - :param tag_filter: tags to filter by. - :type tag_filter: object - :param threshold: notification threshold percentage as a decimal which activated this alert. - :type threshold: float - :param operator: operator used to compare currentSpend with amount. - :type operator: str - :param amount: budget threshold amount. - :type amount: float - :param unit: unit of currency being used. - :type unit: str - :param current_spend: current spend. - :type current_spend: float - :param contact_emails: list of emails to contact. - :type contact_emails: list[str] - :param contact_groups: list of action groups to broadcast to. - :type contact_groups: list[str] - :param contact_roles: list of contact roles. - :type contact_roles: list[str] - :param overriding_alert: overriding alert. - :type overriding_alert: str - """ - - _attribute_map = { - 'time_grain_type': {'key': 'timeGrainType', 'type': 'str'}, - 'period_start_date': {'key': 'periodStartDate', 'type': 'str'}, - 'triggered_by': {'key': 'triggeredBy', 'type': 'str'}, - 'resource_group_filter': {'key': 'resourceGroupFilter', 'type': '[object]'}, - 'resource_filter': {'key': 'resourceFilter', 'type': '[object]'}, - 'meter_filter': {'key': 'meterFilter', 'type': '[object]'}, - 'tag_filter': {'key': 'tagFilter', 'type': 'object'}, - 'threshold': {'key': 'threshold', 'type': 'float'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'amount': {'key': 'amount', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_spend': {'key': 'currentSpend', 'type': 'float'}, - 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, - 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, - 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, - 'overriding_alert': {'key': 'overridingAlert', 'type': 'str'}, - } - - def __init__( - self, - *, - time_grain_type: Optional[str] = None, - period_start_date: Optional[str] = None, - triggered_by: Optional[str] = None, - resource_group_filter: Optional[List[object]] = None, - resource_filter: Optional[List[object]] = None, - meter_filter: Optional[List[object]] = None, - tag_filter: Optional[object] = None, - threshold: Optional[float] = None, - operator: Optional[str] = None, - amount: Optional[float] = None, - unit: Optional[str] = None, - current_spend: Optional[float] = None, - contact_emails: Optional[List[str]] = None, - contact_groups: Optional[List[str]] = None, - contact_roles: Optional[List[str]] = None, - overriding_alert: Optional[str] = None, - **kwargs - ): - super(AlertPropertiesDetails, self).__init__(**kwargs) - self.time_grain_type = time_grain_type - self.period_start_date = period_start_date - self.triggered_by = triggered_by - self.resource_group_filter = resource_group_filter - self.resource_filter = resource_filter - self.meter_filter = meter_filter - self.tag_filter = tag_filter - self.threshold = threshold - self.operator = operator - self.amount = amount - self.unit = unit - self.current_spend = current_spend - self.contact_emails = contact_emails - self.contact_groups = contact_groups - self.contact_roles = contact_roles - self.overriding_alert = overriding_alert - - class AlertsResult(msrest.serialization.Model): """Result of alerts. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of alerts. - :vartype value: list[~azure.mgmt.costmanagement.models.Alert] + :vartype value: list[~cost_management_client.models.Alert] :ivar next_link: URL to get the next set of alerts results if there are any. :vartype next_link: str """ @@ -309,54 +299,51 @@ class CommonExportProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar format: The format of the export being delivered. Default value: "Csv". + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Default value: "Csv". :vartype format: str - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". + :type type: str or ~cost_management_client.models.ExportType + :param timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Default value: "Daily". :vartype granularity: str - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Required. Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + :type destination: ~cost_management_client.models.ExportDeliveryDestination """ _validation = { 'format': {'constant': True}, + 'next_run_time_estimate': {'readonly': True}, 'type': {'required': True}, 'timeframe': {'required': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, 'destination': {'required': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'type': {'key': 'definition.type', 'type': 'str'}, 'timeframe': {'key': 'definition.timeframe', 'type': 'str'}, - 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'}, + 'time_period': {'key': 'definition.timePeriod', 'type': 'ExportTimePeriod'}, 'granularity': {'key': 'definition.dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'definition.dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'definition.dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'definition.dataSet.filter', 'type': 'QueryFilter'}, + 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'ExportDatasetConfiguration'}, 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'}, } @@ -369,21 +356,18 @@ def __init__( type: Union[str, "ExportType"], timeframe: Union[str, "TimeframeType"], destination: "ExportDeliveryDestination", - time_period: Optional["QueryTimePeriod"] = None, - configuration: Optional["QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, - filter: Optional["QueryFilter"] = None, + run_history: Optional["ExportExecutionListResult"] = None, + time_period: Optional["ExportTimePeriod"] = None, + configuration: Optional["ExportDatasetConfiguration"] = None, **kwargs ): super(CommonExportProperties, self).__init__(**kwargs) + self.run_history = run_history + self.next_run_time_estimate = None self.type = type self.timeframe = timeframe self.time_period = time_period self.configuration = configuration - self.aggregation = aggregation - self.grouping = grouping - self.filter = filter self.destination = destination @@ -475,7 +459,7 @@ class DimensionsListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of dimensions. - :vartype value: list[~azure.mgmt.costmanagement.models.Dimension] + :vartype value: list[~cost_management_client.models.Dimension] """ _validation = { @@ -494,6 +478,155 @@ def __init__( self.value = None +class DismissAlertPayload(msrest.serialization.Model): + """The request payload to update an alert. + + :param definition: defines the type of alert. + :type definition: ~cost_management_client.models.AlertPropertiesDefinition + :param description: Alert description. + :type description: str + :param source: Source of alert. Possible values include: "Preset", "User". + :type source: str or ~cost_management_client.models.AlertSource + :param cost_entity_id: related budget. + :type cost_entity_id: str + :param status: alert status. Possible values include: "None", "Active", "Overridden", + "Resolved", "Dismissed". + :type status: str or ~cost_management_client.models.AlertStatus + :param creation_time: dateTime in which alert was created. + :type creation_time: str + :param close_time: dateTime in which alert was closed. + :type close_time: str + :param modification_time: dateTime in which alert was last modified. + :type modification_time: str + :param status_modification_user_name: + :type status_modification_user_name: str + :param status_modification_time: dateTime in which the alert status was last modified. + :type status_modification_time: str + :param time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", + "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". + :type time_grain_type: str or ~cost_management_client.models.AlertTimeGrainType + :param period_start_date: datetime of periodStartDate. + :type period_start_date: str + :param triggered_by: notificationId that triggered this alert. + :type triggered_by: str + :param resource_group_filter: array of resourceGroups to filter by. + :type resource_group_filter: list[object] + :param resource_filter: array of resources to filter by. + :type resource_filter: list[object] + :param meter_filter: array of meters to filter by. + :type meter_filter: list[object] + :param tag_filter: tags to filter by. + :type tag_filter: object + :param threshold: notification threshold percentage as a decimal which activated this alert. + :type threshold: float + :param operator: operator used to compare currentSpend with amount. Possible values include: + "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". + :type operator: str or ~cost_management_client.models.AlertOperator + :param amount: budget threshold amount. + :type amount: float + :param unit: unit of currency being used. + :type unit: str + :param current_spend: current spend. + :type current_spend: float + :param contact_emails: list of emails to contact. + :type contact_emails: list[str] + :param contact_groups: list of action groups to broadcast to. + :type contact_groups: list[str] + :param contact_roles: list of contact roles. + :type contact_roles: list[str] + :param overriding_alert: overriding alert. + :type overriding_alert: str + """ + + _attribute_map = { + 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'cost_entity_id': {'key': 'properties.costEntityId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'close_time': {'key': 'properties.closeTime', 'type': 'str'}, + 'modification_time': {'key': 'properties.modificationTime', 'type': 'str'}, + 'status_modification_user_name': {'key': 'properties.statusModificationUserName', 'type': 'str'}, + 'status_modification_time': {'key': 'properties.statusModificationTime', 'type': 'str'}, + 'time_grain_type': {'key': 'properties.details.timeGrainType', 'type': 'str'}, + 'period_start_date': {'key': 'properties.details.periodStartDate', 'type': 'str'}, + 'triggered_by': {'key': 'properties.details.triggeredBy', 'type': 'str'}, + 'resource_group_filter': {'key': 'properties.details.resourceGroupFilter', 'type': '[object]'}, + 'resource_filter': {'key': 'properties.details.resourceFilter', 'type': '[object]'}, + 'meter_filter': {'key': 'properties.details.meterFilter', 'type': '[object]'}, + 'tag_filter': {'key': 'properties.details.tagFilter', 'type': 'object'}, + 'threshold': {'key': 'properties.details.threshold', 'type': 'float'}, + 'operator': {'key': 'properties.details.operator', 'type': 'str'}, + 'amount': {'key': 'properties.details.amount', 'type': 'float'}, + 'unit': {'key': 'properties.details.unit', 'type': 'str'}, + 'current_spend': {'key': 'properties.details.currentSpend', 'type': 'float'}, + 'contact_emails': {'key': 'properties.details.contactEmails', 'type': '[str]'}, + 'contact_groups': {'key': 'properties.details.contactGroups', 'type': '[str]'}, + 'contact_roles': {'key': 'properties.details.contactRoles', 'type': '[str]'}, + 'overriding_alert': {'key': 'properties.details.overridingAlert', 'type': 'str'}, + } + + def __init__( + self, + *, + definition: Optional["AlertPropertiesDefinition"] = None, + description: Optional[str] = None, + source: Optional[Union[str, "AlertSource"]] = None, + cost_entity_id: Optional[str] = None, + status: Optional[Union[str, "AlertStatus"]] = None, + creation_time: Optional[str] = None, + close_time: Optional[str] = None, + modification_time: Optional[str] = None, + status_modification_user_name: Optional[str] = None, + status_modification_time: Optional[str] = None, + time_grain_type: Optional[Union[str, "AlertTimeGrainType"]] = None, + period_start_date: Optional[str] = None, + triggered_by: Optional[str] = None, + resource_group_filter: Optional[List[object]] = None, + resource_filter: Optional[List[object]] = None, + meter_filter: Optional[List[object]] = None, + tag_filter: Optional[object] = None, + threshold: Optional[float] = None, + operator: Optional[Union[str, "AlertOperator"]] = None, + amount: Optional[float] = None, + unit: Optional[str] = None, + current_spend: Optional[float] = None, + contact_emails: Optional[List[str]] = None, + contact_groups: Optional[List[str]] = None, + contact_roles: Optional[List[str]] = None, + overriding_alert: Optional[str] = None, + **kwargs + ): + super(DismissAlertPayload, self).__init__(**kwargs) + self.definition = definition + self.description = description + self.source = source + self.cost_entity_id = cost_entity_id + self.status = status + self.creation_time = creation_time + self.close_time = close_time + self.modification_time = modification_time + self.status_modification_user_name = status_modification_user_name + self.status_modification_time = status_modification_time + self.time_grain_type = time_grain_type + self.period_start_date = period_start_date + self.triggered_by = triggered_by + self.resource_group_filter = resource_group_filter + self.resource_filter = resource_filter + self.meter_filter = meter_filter + self.tag_filter = tag_filter + self.threshold = threshold + self.operator = operator + self.amount = amount + self.unit = unit + self.current_spend = current_spend + self.contact_emails = contact_emails + self.contact_groups = contact_groups + self.contact_roles = contact_roles + self.overriding_alert = overriding_alert + + class ErrorDetails(msrest.serialization.Model): """The details of the error. @@ -525,18 +658,19 @@ def __init__( class ErrorResponse(msrest.serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + +Some Error responses: -Some Error responses: -* - 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. +* + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. -* +* 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. :param error: The details of the error. - :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + :type error: ~cost_management_client.models.ErrorDetails """ _attribute_map = { @@ -596,7 +730,7 @@ def __init__( class Export(ProxyResource): - """A export resource. + """An export resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -609,42 +743,41 @@ class Export(ProxyResource): :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. :type e_tag: str - :ivar format: The format of the export being delivered. Default value: "Csv". + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Default value: "Csv". :vartype format: str - :param type_properties_definition_type: The type of the query. Possible values include: - "Usage", "ActualCost", "AmortizedCost". - :type type_properties_definition_type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: The time frame for pulling data for the query. If custom, then a specific + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :param type_properties_definition_type: The type of the export. Note that 'Usage' is equivalent + to 'ActualCost' and is applicable to exports that do not yet provide data for charges or + amortization for service reservations. Possible values include: "Usage", "ActualCost", + "AmortizedCost". + :type type_properties_definition_type: str or ~cost_management_client.models.ExportType + :param timeframe: The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Default value: "Daily". :vartype granularity: str - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". - :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :type destination: ~cost_management_client.models.ExportDeliveryDestination + :param status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. Possible values include: "Active", "Inactive". + :type status: str or ~cost_management_client.models.StatusType :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", "Monthly", "Annually". - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :type recurrence: str or ~cost_management_client.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :type recurrence_period: ~cost_management_client.models.ExportRecurrencePeriod """ _validation = { @@ -652,8 +785,8 @@ class Export(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'format': {'constant': True}, + 'next_run_time_estimate': {'readonly': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, } _attribute_map = { @@ -662,14 +795,13 @@ class Export(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'format': {'key': 'properties.format', 'type': 'str'}, + 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'}, 'type_properties_definition_type': {'key': 'properties.definition.type', 'type': 'str'}, 'timeframe': {'key': 'properties.definition.timeframe', 'type': 'str'}, - 'time_period': {'key': 'properties.definition.timePeriod', 'type': 'QueryTimePeriod'}, + 'time_period': {'key': 'properties.definition.timePeriod', 'type': 'ExportTimePeriod'}, 'granularity': {'key': 'properties.definition.dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'properties.definition.dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'properties.definition.dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'properties.definition.dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'properties.definition.dataSet.filter', 'type': 'QueryFilter'}, + 'configuration': {'key': 'properties.definition.dataSet.configuration', 'type': 'ExportDatasetConfiguration'}, 'destination': {'key': 'properties.deliveryInfo.destination', 'type': 'ExportDeliveryDestination'}, 'status': {'key': 'properties.schedule.status', 'type': 'str'}, 'recurrence': {'key': 'properties.schedule.recurrence', 'type': 'str'}, @@ -683,13 +815,11 @@ def __init__( self, *, e_tag: Optional[str] = None, + run_history: Optional["ExportExecutionListResult"] = None, type_properties_definition_type: Optional[Union[str, "ExportType"]] = None, timeframe: Optional[Union[str, "TimeframeType"]] = None, - time_period: Optional["QueryTimePeriod"] = None, - configuration: Optional["QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, - filter: Optional["QueryFilter"] = None, + time_period: Optional["ExportTimePeriod"] = None, + configuration: Optional["ExportDatasetConfiguration"] = None, destination: Optional["ExportDeliveryDestination"] = None, status: Optional[Union[str, "StatusType"]] = None, recurrence: Optional[Union[str, "RecurrenceType"]] = None, @@ -697,19 +827,41 @@ def __init__( **kwargs ): super(Export, self).__init__(e_tag=e_tag, **kwargs) + self.run_history = run_history + self.next_run_time_estimate = None self.type_properties_definition_type = type_properties_definition_type self.timeframe = timeframe self.time_period = time_period self.configuration = configuration - self.aggregation = aggregation - self.grouping = grouping - self.filter = filter self.destination = destination self.status = status self.recurrence = recurrence self.recurrence_period = recurrence_period +class ExportDatasetConfiguration(msrest.serialization.Model): + """The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns. + + :param columns: Array of column names to be included in the export. If not provided then the + export will include all available columns. The available columns can vary by customer channel + (see examples). + :type columns: list[str] + """ + + _attribute_map = { + 'columns': {'key': 'columns', 'type': '[str]'}, + } + + def __init__( + self, + *, + columns: Optional[List[str]] = None, + **kwargs + ): + super(ExportDatasetConfiguration, self).__init__(**kwargs) + self.columns = columns + + class ExportDeliveryDestination(msrest.serialization.Model): """The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services . @@ -750,7 +902,7 @@ def __init__( class ExportExecution(Resource): - """A export execution. + """An export execution. Variables are only populated by the server, and will be ignored when sending a request. @@ -764,23 +916,26 @@ class ExportExecution(Resource): :vartype tags: dict[str, str] :param execution_type: The type of the export execution. Possible values include: "OnDemand", "Scheduled". - :type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values include: "Queued", - "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable". - :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :type execution_type: str or ~cost_management_client.models.ExecutionType + :param status: The last known status of the export execution. Possible values include: + "Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", + "DataNotAvailable". + :type status: str or ~cost_management_client.models.ExecutionStatus :param submitted_by: The identifier for the entity that executed the export. For OnDemand - executions, it is the email id. For Scheduled executions, it is the constant value - System. + executions it is the user email. For scheduled executions it is 'System'. :type submitted_by: str :param submitted_time: The time when export was queued to be executed. :type submitted_time: ~datetime.datetime :param processing_start_time: The time when export was picked up to be executed. :type processing_start_time: ~datetime.datetime - :param processing_end_time: The time when export execution finished. + :param processing_end_time: The time when the export execution finished. :type processing_end_time: ~datetime.datetime - :param file_name: The name of the file export got written to. + :param file_name: The name of the exported file. :type file_name: str - :param run_settings: The common properties of the export. - :type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :param run_settings: The export settings that were in effect for this execution. + :type run_settings: ~cost_management_client.models.CommonExportProperties + :param error: The details of any error. + :type error: ~cost_management_client.models.ErrorDetails """ _validation = { @@ -803,6 +958,7 @@ class ExportExecution(Resource): 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, 'file_name': {'key': 'properties.fileName', 'type': 'str'}, 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + 'error': {'key': 'properties.error', 'type': 'ErrorDetails'}, } def __init__( @@ -816,6 +972,7 @@ def __init__( processing_end_time: Optional[datetime.datetime] = None, file_name: Optional[str] = None, run_settings: Optional["CommonExportProperties"] = None, + error: Optional["ErrorDetails"] = None, **kwargs ): super(ExportExecution, self).__init__(**kwargs) @@ -827,15 +984,16 @@ def __init__( self.processing_end_time = processing_end_time self.file_name = file_name self.run_settings = run_settings + self.error = error class ExportExecutionListResult(msrest.serialization.Model): - """Result of listing exports execution history of a export by name. + """Result of listing the execution history of an export. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of export executions. - :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] + :ivar value: A list of export executions. + :vartype value: list[~cost_management_client.models.ExportExecution] """ _validation = { @@ -860,7 +1018,7 @@ class ExportListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of exports. - :vartype value: list[~azure.mgmt.costmanagement.models.Export] + :vartype value: list[~cost_management_client.models.Export] """ _validation = { @@ -886,63 +1044,60 @@ class ExportProperties(CommonExportProperties): All required parameters must be populated in order to send to Azure. - :ivar format: The format of the export being delivered. Default value: "Csv". + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Default value: "Csv". :vartype format: str - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :param type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". + :type type: str or ~cost_management_client.models.ExportType + :param timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Default value: "Daily". :vartype granularity: str - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Required. Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". - :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :type destination: ~cost_management_client.models.ExportDeliveryDestination + :param status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. Possible values include: "Active", "Inactive". + :type status: str or ~cost_management_client.models.StatusType :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", "Monthly", "Annually". - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :type recurrence: str or ~cost_management_client.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :type recurrence_period: ~cost_management_client.models.ExportRecurrencePeriod """ _validation = { 'format': {'constant': True}, + 'next_run_time_estimate': {'readonly': True}, 'type': {'required': True}, 'timeframe': {'required': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, 'destination': {'required': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'type': {'key': 'definition.type', 'type': 'str'}, 'timeframe': {'key': 'definition.timeframe', 'type': 'str'}, - 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'}, + 'time_period': {'key': 'definition.timePeriod', 'type': 'ExportTimePeriod'}, 'granularity': {'key': 'definition.dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'definition.dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'definition.dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'definition.dataSet.filter', 'type': 'QueryFilter'}, + 'configuration': {'key': 'definition.dataSet.configuration', 'type': 'ExportDatasetConfiguration'}, 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'}, 'status': {'key': 'schedule.status', 'type': 'str'}, 'recurrence': {'key': 'schedule.recurrence', 'type': 'str'}, @@ -958,17 +1113,15 @@ def __init__( type: Union[str, "ExportType"], timeframe: Union[str, "TimeframeType"], destination: "ExportDeliveryDestination", - time_period: Optional["QueryTimePeriod"] = None, - configuration: Optional["QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, - filter: Optional["QueryFilter"] = None, + run_history: Optional["ExportExecutionListResult"] = None, + time_period: Optional["ExportTimePeriod"] = None, + configuration: Optional["ExportDatasetConfiguration"] = None, status: Optional[Union[str, "StatusType"]] = None, recurrence: Optional[Union[str, "RecurrenceType"]] = None, recurrence_period: Optional["ExportRecurrencePeriod"] = None, **kwargs ): - super(ExportProperties, self).__init__(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter, destination=destination, **kwargs) + super(ExportProperties, self).__init__(run_history=run_history, type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, destination=destination, **kwargs) self.status = status self.recurrence = recurrence self.recurrence_period = recurrence_period @@ -1006,6 +1159,39 @@ def __init__( self.to = to +class ExportTimePeriod(msrest.serialization.Model): + """The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months. + + All required parameters must be populated in order to send to Azure. + + :param from_property: Required. The start date for export data. + :type from_property: ~datetime.datetime + :param to: Required. The end date for export data. + :type to: ~datetime.datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + from_property: datetime.datetime, + to: datetime.datetime, + **kwargs + ): + super(ExportTimePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to + + class ForecastDefinition(msrest.serialization.Model): """The definition of a forecast. @@ -1015,38 +1201,34 @@ class ForecastDefinition(msrest.serialization.Model): :param type: Required. The type of the forecast. Possible values include: "Usage", "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType + :type type: str or ~cost_management_client.models.ForecastType :param timeframe: Required. The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :type timeframe: str or ~cost_management_client.models.ForecastTimeframeType :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. :type include_fresh_partial_cost: bool - :ivar granularity: The granularity of rows in the query. Default value: "Daily". + :ivar granularity: The granularity of rows in the forecast. Default value: "Daily". :vartype granularity: str :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] + :param filter: Has filter expression to use in the forecast. + :type filter: ~cost_management_client.models.QueryFilter """ _validation = { 'type': {'required': True}, 'timeframe': {'required': True}, 'granularity': {'constant': True}, - 'grouping': {'max_items': 2, 'min_items': 0}, } _attribute_map = { @@ -1058,7 +1240,6 @@ class ForecastDefinition(msrest.serialization.Model): 'granularity': {'key': 'dataset.granularity', 'type': 'str'}, 'configuration': {'key': 'dataset.configuration', 'type': 'QueryDatasetConfiguration'}, 'aggregation': {'key': 'dataset.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'dataset.grouping', 'type': '[QueryGrouping]'}, 'filter': {'key': 'dataset.filter', 'type': 'QueryFilter'}, } @@ -1074,7 +1255,6 @@ def __init__( include_fresh_partial_cost: Optional[bool] = None, configuration: Optional["QueryDatasetConfiguration"] = None, aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, filter: Optional["QueryFilter"] = None, **kwargs ): @@ -1086,7 +1266,6 @@ def __init__( self.include_fresh_partial_cost = include_fresh_partial_cost self.configuration = configuration self.aggregation = aggregation - self.grouping = grouping self.filter = filter @@ -1094,7 +1273,7 @@ class KpiProperties(msrest.serialization.Model): """Each KPI must contain a 'type' and 'enabled' key. :param type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget". - :type type: str or ~azure.mgmt.costmanagement.models.KpiType + :type type: str or ~cost_management_client.models.KpiType :param id: ID of resource related to metric (budget). :type id: str :param enabled: show the KPI in the UI?. @@ -1129,7 +1308,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :param display: The object that represents the operation. - :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + :type display: ~cost_management_client.models.OperationDisplay """ _validation = { @@ -1194,7 +1373,7 @@ class OperationListResult(msrest.serialization.Model): :ivar value: List of cost management operations supported by the Microsoft.CostManagement resource provider. - :vartype value: list[~azure.mgmt.costmanagement.models.Operation] + :vartype value: list[~cost_management_client.models.Operation] :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -1222,7 +1401,7 @@ class PivotProperties(msrest.serialization.Model): """Each pivot must contain a 'type' and 'name'. :param type: Data type to show in view. Possible values include: "Dimension", "TagKey". - :type type: str or ~azure.mgmt.costmanagement.models.PivotType + :type type: str or ~cost_management_client.models.PivotType :param name: Data field to show in view. :type name: str """ @@ -1314,7 +1493,7 @@ class QueryComparisonExpression(msrest.serialization.Model): :type name: str :param operator: Required. The operator to use for comparison. Possible values include: "In", "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :type operator: str or ~cost_management_client.models.OperatorType :param values: Required. Array of values to use for comparison. :type values: list[str] """ @@ -1376,27 +1555,27 @@ class QueryDefinition(msrest.serialization.Model): :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :type type: str or ~cost_management_client.models.ExportType :param timeframe: Required. The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :type timeframe: str or ~cost_management_client.models.TimeframeType :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :ivar granularity: The granularity of rows in the query. Default value: "Daily". :vartype granularity: str :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :type grouping: list[~cost_management_client.models.QueryGrouping] :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type filter: ~cost_management_client.models.QueryFilter """ _validation = { @@ -1410,11 +1589,11 @@ class QueryDefinition(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'granularity': {'key': 'dataSet.granularity', 'type': 'str'}, - 'configuration': {'key': 'dataSet.configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'dataSet.aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'dataSet.grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'dataSet.filter', 'type': 'QueryFilter'}, + 'granularity': {'key': 'dataset.granularity', 'type': 'str'}, + 'configuration': {'key': 'dataset.configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'dataset.aggregation', 'type': '{QueryAggregation}'}, + 'grouping': {'key': 'dataset.grouping', 'type': '[QueryGrouping]'}, + 'filter': {'key': 'dataset.filter', 'type': 'QueryFilter'}, } granularity = "Daily" @@ -1445,15 +1624,15 @@ class QueryFilter(msrest.serialization.Model): """The filter expression to be used in the export. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :type and_property: list[~cost_management_client.models.QueryFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :type or_property: list[~cost_management_client.models.QueryFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.QueryFilter + :type not_property: ~cost_management_client.models.QueryFilter :param dimension: Has comparison expression for a dimension. - :type dimension: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :type dimension: ~cost_management_client.models.QueryComparisonExpression :param tag: Has comparison expression for a tag. - :type tag: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :type tag: ~cost_management_client.models.QueryComparisonExpression """ _validation = { @@ -1494,7 +1673,7 @@ class QueryGrouping(msrest.serialization.Model): :param type: Required. Has type of the column to group. Possible values include: "Tag", "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :type type: str or ~cost_management_client.models.QueryColumnType :param name: Required. The name of the column to group. :type name: str """ @@ -1537,7 +1716,7 @@ class QueryResult(Resource): :param next_link: The link (url) to the next page of results. :type next_link: str :param columns: Array of columns. - :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :type columns: list[~cost_management_client.models.QueryColumn] :param rows: Array of rows. :type rows: list[list[object]] """ @@ -1650,7 +1829,7 @@ class ReportConfigComparisonExpression(msrest.serialization.Model): :type name: str :param operator: Required. The operator to use for comparison. Possible values include: "In", "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :type operator: str or ~cost_management_client.models.OperatorType :param values: Required. Array of values to use for comparison. :type values: list[str] """ @@ -1686,21 +1865,21 @@ class ReportConfigDataset(msrest.serialization.Model): :param granularity: The granularity of rows in the report. Possible values include: "Daily", "Monthly". - :type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType + :type granularity: str or ~cost_management_client.models.ReportGranularityType :param configuration: Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :type configuration: ~cost_management_client.models.ReportConfigDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :type aggregation: dict[str, ~cost_management_client.models.ReportConfigAggregation] :param grouping: Array of group by expression to use in the report. Report can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :type grouping: list[~cost_management_client.models.ReportConfigGrouping] :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] + :type sorting: list[~cost_management_client.models.ReportConfigSorting] :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type filter: ~cost_management_client.models.ReportConfigFilter """ _validation = { @@ -1762,15 +1941,15 @@ class ReportConfigFilter(msrest.serialization.Model): """The filter expression to be used in the report. :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type and_property: list[~cost_management_client.models.ReportConfigFilter] :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :type or_property: list[~cost_management_client.models.ReportConfigFilter] :param not_property: The logical "NOT" expression. - :type not_property: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :type not_property: ~cost_management_client.models.ReportConfigFilter :param dimension: Has comparison expression for a dimension. - :type dimension: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type dimension: ~cost_management_client.models.ReportConfigComparisonExpression :param tag: Has comparison expression for a tag. - :type tag: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :type tag: ~cost_management_client.models.ReportConfigComparisonExpression """ _validation = { @@ -1811,7 +1990,7 @@ class ReportConfigGrouping(msrest.serialization.Model): :param type: Required. Has type of the column to group. Possible values include: "Tag", "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :type type: str or ~cost_management_client.models.ReportConfigColumnType :param name: Required. The name of the column to group. This version supports subscription lowest possible grain. :type name: str @@ -1845,7 +2024,7 @@ class ReportConfigSorting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param direction: Direction of sort. Possible values include: "Ascending", "Descending". - :type direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingDirection + :type direction: str or ~cost_management_client.models.ReportConfigSortingDirection :param name: Required. The name of the column to sort. :type name: str """ @@ -1944,16 +2123,16 @@ class View(ProxyResource): :vartype modified_on: ~datetime.datetime :param chart: Chart type of the main view in Cost Analysis. Required. Possible values include: "Area", "Line", "StackedColumn", "GroupedColumn", "Table". - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType + :type chart: str or ~cost_management_client.models.ChartType :param accumulated: Show costs accumulated over time. Possible values include: "true", "false". - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :type accumulated: str or ~cost_management_client.models.AccumulatedType :param metric: Metric to use when displaying costs. Possible values include: "ActualCost", "AmortizedCost", "AHUB". - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType + :type metric: str or ~cost_management_client.models.MetricType :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :type kpis: list[~cost_management_client.models.KpiProperties] :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :type pivots: list[~cost_management_client.models.PivotProperties] :ivar type_properties_query_type: The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. Default value: @@ -1962,11 +2141,11 @@ class View(ProxyResource): :param timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate", "YearToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :type timeframe: str or ~cost_management_client.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :type time_period: ~cost_management_client.models.ReportConfigTimePeriod :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :type dataset: ~cost_management_client.models.ReportConfigDataset """ _validation = { @@ -2037,7 +2216,7 @@ class ViewListResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of views. - :vartype value: list[~azure.mgmt.costmanagement.models.View] + :vartype value: list[~cost_management_client.models.View] :ivar next_link: The link (url) to the next page of results. :vartype next_link: str """ diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alert_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alert_operations.py index dc1b90de5db..2894f27a033 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alert_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alert_operations.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -29,7 +29,7 @@ class AlertOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -70,16 +70,17 @@ def list( specific for partners. :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AlertsResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.AlertsResult + :return: AlertsResult, or the result of cls(response) + :rtype: ~cost_management_client.models.AlertsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertsResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -106,10 +107,240 @@ def list( deserialized = self._deserialize('AlertsResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} # type: ignore + + def get( + self, + scope, # type: str + alert_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Alert" + """Gets the alert for the scope by alert ID. + + :param scope: The scope associated with alerts operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param alert_id: Alert ID. + :type alert_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Alert, or the result of cls(response) + :rtype: ~cost_management_client.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Alert"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Alert', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore + + def dismiss( + self, + scope, # type: str + alert_id, # type: str + definition=None, # type: Optional["models.AlertPropertiesDefinition"] + description=None, # type: Optional[str] + source=None, # type: Optional[Union[str, "models.AlertSource"]] + cost_entity_id=None, # type: Optional[str] + status=None, # type: Optional[Union[str, "models.AlertStatus"]] + creation_time=None, # type: Optional[str] + close_time=None, # type: Optional[str] + modification_time=None, # type: Optional[str] + status_modification_user_name=None, # type: Optional[str] + status_modification_time=None, # type: Optional[str] + time_grain_type=None, # type: Optional[Union[str, "models.AlertTimeGrainType"]] + period_start_date=None, # type: Optional[str] + triggered_by=None, # type: Optional[str] + resource_group_filter=None, # type: Optional[List[object]] + resource_filter=None, # type: Optional[List[object]] + meter_filter=None, # type: Optional[List[object]] + tag_filter=None, # type: Optional[object] + threshold=None, # type: Optional[float] + operator=None, # type: Optional[Union[str, "models.AlertOperator"]] + amount=None, # type: Optional[float] + unit=None, # type: Optional[str] + current_spend=None, # type: Optional[float] + contact_emails=None, # type: Optional[List[str]] + contact_groups=None, # type: Optional[List[str]] + contact_roles=None, # type: Optional[List[str]] + overriding_alert=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Alert" + """Dismisses the specified alert. + + :param scope: The scope associated with alerts operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + for Department scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param alert_id: Alert ID. + :type alert_id: str + :param definition: defines the type of alert. + :type definition: ~cost_management_client.models.AlertPropertiesDefinition + :param description: Alert description. + :type description: str + :param source: Source of alert. + :type source: str or ~cost_management_client.models.AlertSource + :param cost_entity_id: related budget. + :type cost_entity_id: str + :param status: alert status. + :type status: str or ~cost_management_client.models.AlertStatus + :param creation_time: dateTime in which alert was created. + :type creation_time: str + :param close_time: dateTime in which alert was closed. + :type close_time: str + :param modification_time: dateTime in which alert was last modified. + :type modification_time: str + :param status_modification_user_name: + :type status_modification_user_name: str + :param status_modification_time: dateTime in which the alert status was last modified. + :type status_modification_time: str + :param time_grain_type: Type of timegrain cadence. + :type time_grain_type: str or ~cost_management_client.models.AlertTimeGrainType + :param period_start_date: datetime of periodStartDate. + :type period_start_date: str + :param triggered_by: notificationId that triggered this alert. + :type triggered_by: str + :param resource_group_filter: array of resourceGroups to filter by. + :type resource_group_filter: list[object] + :param resource_filter: array of resources to filter by. + :type resource_filter: list[object] + :param meter_filter: array of meters to filter by. + :type meter_filter: list[object] + :param tag_filter: tags to filter by. + :type tag_filter: object + :param threshold: notification threshold percentage as a decimal which activated this alert. + :type threshold: float + :param operator: operator used to compare currentSpend with amount. + :type operator: str or ~cost_management_client.models.AlertOperator + :param amount: budget threshold amount. + :type amount: float + :param unit: unit of currency being used. + :type unit: str + :param current_spend: current spend. + :type current_spend: float + :param contact_emails: list of emails to contact. + :type contact_emails: list[str] + :param contact_groups: list of action groups to broadcast to. + :type contact_groups: list[str] + :param contact_roles: list of contact roles. + :type contact_roles: list[str] + :param overriding_alert: overriding alert. + :type overriding_alert: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Alert, or the result of cls(response) + :rtype: ~cost_management_client.models.Alert + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Alert"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _parameters = models.DismissAlertPayload(definition=definition, description=description, source=source, cost_entity_id=cost_entity_id, status=status, creation_time=creation_time, close_time=close_time, modification_time=modification_time, status_modification_user_name=status_modification_user_name, status_modification_time=status_modification_time, time_grain_type=time_grain_type, period_start_date=period_start_date, triggered_by=triggered_by, resource_group_filter=resource_group_filter, resource_filter=resource_filter, meter_filter=meter_filter, tag_filter=tag_filter, threshold=threshold, operator=operator, amount=amount, unit=unit, current_spend=current_spend, contact_emails=contact_emails, contact_groups=contact_groups, contact_roles=contact_roles, overriding_alert=overriding_alert) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.dismiss.metadata['url'] # type: ignore + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DismissAlertPayload') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Alert', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + dismiss.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore def list_external( self, @@ -123,21 +354,22 @@ def list_external( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AlertsResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.AlertsResult + :return: AlertsResult, or the result of cls(response) + :rtype: ~cost_management_client.models.AlertsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertsResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.list_external.metadata['url'] + url = self.list_external.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), @@ -165,7 +397,7 @@ def list_external( deserialized = self._deserialize('AlertsResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'} + list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimension_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimension_operations.py index aa72450bb03..54a63ef0395 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimension_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimension_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class DimensionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ def list( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> "models.DimensionsListResult" + # type: (...) -> Iterable["models.DimensionsListResult"] """Lists the dimensions by the defined scope. :param scope: The scope associated with dimension operations. This includes @@ -87,37 +87,38 @@ def list( :param top: May be used to limit the number of results to the most recent N dimension data. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: DimensionsListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.DimensionsListResult + :return: An iterator like instance of either DimensionsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~cost_management_client.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DimensionsListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -149,7 +150,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} # type: ignore def by_external_cloud_provider_type( self, @@ -161,13 +162,13 @@ def by_external_cloud_provider_type( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> "models.DimensionsListResult" + # type: (...) -> Iterable["models.DimensionsListResult"] """Lists the dimensions by the external cloud provider type. :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -184,38 +185,39 @@ def by_external_cloud_provider_type( :param top: May be used to limit the number of results to the most recent N dimension data. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: DimensionsListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.DimensionsListResult + :return: An iterator like instance of either DimensionsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~cost_management_client.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DimensionsListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.by_external_cloud_provider_type.metadata['url'] + url = self.by_external_cloud_provider_type.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -247,4 +249,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'} + by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_export_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_export_operations.py index b77ce24bc8a..5725a143ee1 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_export_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_export_operations.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -29,7 +29,7 @@ class ExportOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,6 +47,7 @@ def __init__(self, client, config, serializer, deserializer): def list( self, scope, # type: str + expand=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> "models.ExportListResult" @@ -69,17 +70,21 @@ def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. :type scope: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last execution of each export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExportListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ExportListResult + :return: ExportListResult, or the result of cls(response) + :rtype: ~cost_management_client.models.ExportListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ExportListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -88,6 +93,8 @@ def list( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -106,15 +113,16 @@ def list( deserialized = self._deserialize('ExportListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} + list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} # type: ignore def get( self, scope, # type: str export_name, # type: str + expand=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> "models.Export" @@ -139,17 +147,21 @@ def get( :type scope: str :param export_name: Export Name. :type export_name: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last 10 executions of the export. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Export or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Export + :return: Export, or the result of cls(response) + :rtype: ~cost_management_client.models.Export :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Export"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -159,6 +171,8 @@ def get( # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -177,23 +191,21 @@ def get( deserialized = self._deserialize('Export', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore def create_or_update( self, scope, # type: str export_name, # type: str e_tag=None, # type: Optional[str] + run_history=None, # type: Optional["models.ExportExecutionListResult"] type=None, # type: Optional[Union[str, "models.ExportType"]] timeframe=None, # type: Optional[Union[str, "models.TimeframeType"]] - time_period=None, # type: Optional["models.QueryTimePeriod"] - configuration=None, # type: Optional["models.QueryDatasetConfiguration"] - aggregation=None, # type: Optional[Dict[str, "QueryAggregation"]] - grouping=None, # type: Optional[List["QueryGrouping"]] - filter=None, # type: Optional["models.QueryFilter"] + time_period=None, # type: Optional["models.ExportTimePeriod"] + configuration=None, # type: Optional["models.ExportDatasetConfiguration"] destination=None, # type: Optional["models.ExportDeliveryDestination"] status=None, # type: Optional[Union[str, "models.StatusType"]] recurrence=None, # type: Optional[Union[str, "models.RecurrenceType"]] @@ -225,49 +237,44 @@ def create_or_update( :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. :type e_tag: str - :param type: The type of the query. - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: The time frame for pulling data for the query. If custom, then a specific + :param run_history: If requested, has the most recent execution history for the export. + :type run_history: ~cost_management_client.models.ExportExecutionListResult + :param type: The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is + applicable to exports that do not yet provide data for charges or amortization for service + reservations. + :type type: str or ~cost_management_client.models.ExportType + :param timeframe: The time frame for pulling data for the export. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type timeframe: str or ~cost_management_client.models.TimeframeType + :param time_period: Has time period for pulling data for the export. + :type time_period: ~cost_management_client.models.ExportTimePeriod + :param configuration: The export dataset configuration. + :type configuration: ~cost_management_client.models.ExportDatasetConfiguration :param destination: Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. - :type status: str or ~azure.mgmt.costmanagement.models.StatusType + :type destination: ~cost_management_client.models.ExportDeliveryDestination + :param status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. + :type status: str or ~cost_management_client.models.StatusType :param recurrence: The schedule recurrence. - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :type recurrence: str or ~cost_management_client.models.RecurrenceType :param recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :type recurrence_period: ~cost_management_client.models.ExportRecurrencePeriod :keyword callable cls: A custom type or function that will be passed the direct response - :return: Export or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Export or ~azure.mgmt.costmanagement.models.Export + :return: Export, or the result of cls(response) + :rtype: ~cost_management_client.models.Export :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Export"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.Export(e_tag=e_tag, type_properties_definition_type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter, destination=destination, status=status, recurrence=recurrence, recurrence_period=recurrence_period) - api_version = "2019-11-01" + _parameters = models.Export(e_tag=e_tag, run_history=run_history, type_properties_definition_type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, destination=destination, status=status, recurrence=recurrence, recurrence_period=recurrence_period) + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -305,10 +312,10 @@ def create_or_update( deserialized = self._deserialize('Export', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore def delete( self, @@ -339,16 +346,17 @@ def delete( :param export_name: Export Name. :type export_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -373,9 +381,9 @@ def delete( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} + delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore def execute( self, @@ -384,7 +392,7 @@ def execute( **kwargs # type: Any ): # type: (...) -> None - """The operation to execute a export. + """The operation to execute an export. :param scope: The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, @@ -406,16 +414,17 @@ def execute( :param export_name: Export Name. :type export_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.execute.metadata['url'] + url = self.execute.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -440,9 +449,9 @@ def execute( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} + execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} # type: ignore def get_execution_history( self, @@ -451,7 +460,7 @@ def get_execution_history( **kwargs # type: Any ): # type: (...) -> "models.ExportExecutionListResult" - """The operation to get the execution history of an export for the defined scope by export name. + """The operation to get the execution history of an export for the defined scope and export name. :param scope: The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, @@ -473,16 +482,17 @@ def get_execution_history( :param export_name: Export Name. :type export_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExportExecutionListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :return: ExportExecutionListResult, or the result of cls(response) + :rtype: ~cost_management_client.models.ExportExecutionListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ExportExecutionListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get_execution_history.metadata['url'] + url = self.get_execution_history.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'exportName': self._serialize.url("export_name", export_name, 'str'), @@ -510,7 +520,7 @@ def get_execution_history( deserialized = self._deserialize('ExportExecutionListResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} + get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_forecast_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_forecast_operations.py index 5b97876549e..ff105642cad 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_forecast_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_forecast_operations.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -29,7 +29,7 @@ class ForecastOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,8 +54,7 @@ def usage( include_actual_cost=None, # type: Optional[bool] include_fresh_partial_cost=None, # type: Optional[bool] configuration=None, # type: Optional["models.QueryDatasetConfiguration"] - aggregation=None, # type: Optional[Dict[str, "QueryAggregation"]] - grouping=None, # type: Optional[List["QueryGrouping"]] + aggregation=None, # type: Optional[Dict[str, "models.QueryAggregation"]] query_filter=None, # type: Optional["models.QueryFilter"] **kwargs # type: Any ): @@ -80,46 +79,44 @@ def usage( specific for partners. :type scope: str :param type: The type of the forecast. - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType + :type type: str or ~cost_management_client.models.ForecastType :param timeframe: The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :type timeframe: str or ~cost_management_client.models.ForecastTimeframeType :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. :type filter: str :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. :type include_fresh_partial_cost: bool :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param query_filter: Has filter expression to use in the query. - :type query_filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] + :param query_filter: Has filter expression to use in the forecast. + :type query_filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=query_filter) - api_version = "2019-11-01" + _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, filter=query_filter) + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.usage.metadata['url'] + url = self.usage.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -153,10 +150,10 @@ def usage( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} + usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} # type: ignore def external_cloud_provider_usage( self, @@ -169,8 +166,7 @@ def external_cloud_provider_usage( include_actual_cost=None, # type: Optional[bool] include_fresh_partial_cost=None, # type: Optional[bool] configuration=None, # type: Optional["models.QueryDatasetConfiguration"] - aggregation=None, # type: Optional[Dict[str, "QueryAggregation"]] - grouping=None, # type: Optional[List["QueryGrouping"]] + aggregation=None, # type: Optional[Dict[str, "models.QueryAggregation"]] query_filter=None, # type: Optional["models.QueryFilter"] **kwargs # type: Any ): @@ -180,51 +176,49 @@ def external_cloud_provider_usage( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :param type: The type of the forecast. - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType + :type type: str or ~cost_management_client.models.ForecastType :param timeframe: The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :type timeframe: str or ~cost_management_client.models.ForecastTimeframeType :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. :type filter: str :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param include_actual_cost: a boolean determining if actualCost will be included. :type include_actual_cost: bool :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. :type include_fresh_partial_cost: bool :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration + :param aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param query_filter: Has filter expression to use in the query. - :type query_filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] + :param query_filter: Has filter expression to use in the forecast. + :type query_filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) - _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=query_filter) - api_version = "2019-11-01" + _parameters = models.ForecastDefinition(type=type, timeframe=timeframe, time_period=time_period, include_actual_cost=include_actual_cost, include_fresh_partial_cost=include_fresh_partial_cost, configuration=configuration, aggregation=aggregation, filter=query_filter) + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.external_cloud_provider_usage.metadata['url'] + url = self.external_cloud_provider_usage.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), @@ -259,7 +253,7 @@ def external_cloud_provider_usage( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'} + external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operation_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operation_operations.py index 6d83e16b9dc..0a668f86822 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operation_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operation_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class OperationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,29 +49,30 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.OperationListResult" + # type: (...) -> Iterable["models.OperationListResult"] """Lists all of the available cost management REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.OperationListResult + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~cost_management_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -103,4 +104,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} + list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_query_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_query_operations.py index 8443fd8acae..7e985f5e0c6 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_query_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_query_operations.py @@ -29,7 +29,7 @@ class QueryOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,8 +51,8 @@ def usage( timeframe, # type: Union[str, "models.TimeframeType"] time_period=None, # type: Optional["models.QueryTimePeriod"] configuration=None, # type: Optional["models.QueryDatasetConfiguration"] - aggregation=None, # type: Optional[Dict[str, "QueryAggregation"]] - grouping=None, # type: Optional[List["QueryGrouping"]] + aggregation=None, # type: Optional[Dict[str, "models.QueryAggregation"]] + grouping=None, # type: Optional[List["models.QueryGrouping"]] filter=None, # type: Optional["models.QueryFilter"] **kwargs # type: Any ): @@ -77,38 +77,39 @@ def usage( specific for partners. :type scope: str :param type: The type of the query. - :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :type type: str or ~cost_management_client.models.ExportType :param timeframe: The time frame for pulling data for the query. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :type timeframe: str or ~cost_management_client.models.TimeframeType :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :type grouping: list[~cost_management_client.models.QueryGrouping] :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.usage.metadata['url'] + url = self.usage.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -140,10 +141,10 @@ def usage( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} + usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore def usage_by_external_cloud_provider_type( self, @@ -153,8 +154,8 @@ def usage_by_external_cloud_provider_type( timeframe, # type: Union[str, "models.TimeframeType"] time_period=None, # type: Optional["models.QueryTimePeriod"] configuration=None, # type: Optional["models.QueryDatasetConfiguration"] - aggregation=None, # type: Optional[Dict[str, "QueryAggregation"]] - grouping=None, # type: Optional[List["QueryGrouping"]] + aggregation=None, # type: Optional[Dict[str, "models.QueryAggregation"]] + grouping=None, # type: Optional[List["models.QueryGrouping"]] filter=None, # type: Optional["models.QueryFilter"] **kwargs # type: Any ): @@ -164,43 +165,44 @@ def usage_by_external_cloud_provider_type( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or ~cost_management_client.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :param type: The type of the query. - :type type: str or ~azure.mgmt.costmanagement.models.ExportType + :type type: str or ~cost_management_client.models.ExportType :param timeframe: The time frame for pulling data for the query. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :type timeframe: str or ~cost_management_client.models.TimeframeType :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :type time_period: ~cost_management_client.models.QueryTimePeriod :param configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :type configuration: ~cost_management_client.models.QueryDatasetConfiguration :param aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :type aggregation: dict[str, ~cost_management_client.models.QueryAggregation] :param grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :type grouping: list[~cost_management_client.models.QueryGrouping] :param filter: Has filter expression to use in the query. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :type filter: ~cost_management_client.models.QueryFilter :keyword callable cls: A custom type or function that will be passed the direct response - :return: QueryResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.QueryResult + :return: QueryResult, or the result of cls(response) + :rtype: ~cost_management_client.models.QueryResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.usage_by_external_cloud_provider_type.metadata['url'] + url = self.usage_by_external_cloud_provider_type.metadata['url'] # type: ignore path_format_arguments = { 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), @@ -233,7 +235,7 @@ def usage_by_external_cloud_provider_type( deserialized = self._deserialize('QueryResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'} + usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py index bf08f8e37e3..b207f702adf 100644 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py +++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -30,7 +30,7 @@ class ViewOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models + :type models: ~cost_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,29 +49,30 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.ViewListResult" + # type: (...) -> Iterable["models.ViewListResult"] """Lists all views by tenant and object. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ViewListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ViewListResult + :return: An iterator like instance of either ViewListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~cost_management_client.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ViewListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -103,14 +104,14 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} + list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} # type: ignore def list_by_scope( self, scope, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ViewListResult" + # type: (...) -> Iterable["models.ViewListResult"] """Lists all views at the given scope. :param scope: The scope associated with view operations. This includes @@ -132,29 +133,30 @@ def list_by_scope( External Subscription scope. :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: ViewListResult or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.ViewListResult + :return: An iterator like instance of either ViewListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~cost_management_client.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ViewListResult"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_scope.metadata['url'] + url = self.list_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), } url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: url = next_link - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - + query_parameters = {} # type: Dict[str, Any] # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = 'application/json' @@ -186,7 +188,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} + list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} # type: ignore def get( self, @@ -199,16 +201,17 @@ def get( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'viewName': self._serialize.url("view_name", view_name, 'str'), } @@ -235,10 +238,10 @@ def get( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} + get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore def create_or_update( self, @@ -249,8 +252,8 @@ def create_or_update( chart=None, # type: Optional[Union[str, "models.ChartType"]] accumulated=None, # type: Optional[Union[str, "models.AccumulatedType"]] metric=None, # type: Optional[Union[str, "models.MetricType"]] - kpis=None, # type: Optional[List["KpiProperties"]] - pivots=None, # type: Optional[List["PivotProperties"]] + kpis=None, # type: Optional[List["models.KpiProperties"]] + pivots=None, # type: Optional[List["models.PivotProperties"]] timeframe=None, # type: Optional[Union[str, "models.ReportTimeframeType"]] time_period=None, # type: Optional["models.ReportConfigTimePeriod"] dataset=None, # type: Optional["models.ReportConfigDataset"] @@ -285,36 +288,37 @@ def create_or_update( ExternalSubscription scope. :type scope: str :param chart: Chart type of the main view in Cost Analysis. Required. - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType + :type chart: str or ~cost_management_client.models.ChartType :param accumulated: Show costs accumulated over time. - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :type accumulated: str or ~cost_management_client.models.AccumulatedType :param metric: Metric to use when displaying costs. - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType + :type metric: str or ~cost_management_client.models.MetricType :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :type kpis: list[~cost_management_client.models.KpiProperties] :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :type pivots: list[~cost_management_client.models.PivotProperties] :param timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :type timeframe: str or ~cost_management_client.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :type time_period: ~cost_management_client.models.ReportConfigTimePeriod :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :type dataset: ~cost_management_client.models.ReportConfigDataset :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View or ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.View(e_tag=e_tag, display_name=display_name, scope=scope, chart=chart, accumulated=accumulated, metric=metric, kpis=kpis, pivots=pivots, timeframe=timeframe, time_period=time_period, dataset=dataset) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'viewName': self._serialize.url("view_name", view_name, 'str'), } @@ -351,10 +355,10 @@ def create_or_update( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} + create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore def delete( self, @@ -367,16 +371,17 @@ def delete( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.delete.metadata['url'] + url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'viewName': self._serialize.url("view_name", view_name, 'str'), } @@ -400,9 +405,9 @@ def delete( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} + delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore def get_by_scope( self, @@ -434,16 +439,17 @@ def get_by_scope( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.get_by_scope.metadata['url'] + url = self.get_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), 'viewName': self._serialize.url("view_name", view_name, 'str'), @@ -471,10 +477,10 @@ def get_by_scope( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} + get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore def create_or_update_by_scope( self, @@ -486,8 +492,8 @@ def create_or_update_by_scope( chart=None, # type: Optional[Union[str, "models.ChartType"]] accumulated=None, # type: Optional[Union[str, "models.AccumulatedType"]] metric=None, # type: Optional[Union[str, "models.MetricType"]] - kpis=None, # type: Optional[List["KpiProperties"]] - pivots=None, # type: Optional[List["PivotProperties"]] + kpis=None, # type: Optional[List["models.KpiProperties"]] + pivots=None, # type: Optional[List["models.PivotProperties"]] timeframe=None, # type: Optional[Union[str, "models.ReportTimeframeType"]] time_period=None, # type: Optional["models.ReportConfigTimePeriod"] dataset=None, # type: Optional["models.ReportConfigDataset"] @@ -540,36 +546,37 @@ def create_or_update_by_scope( ExternalSubscription scope. :type view_properties_scope: str :param chart: Chart type of the main view in Cost Analysis. Required. - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType + :type chart: str or ~cost_management_client.models.ChartType :param accumulated: Show costs accumulated over time. - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :type accumulated: str or ~cost_management_client.models.AccumulatedType :param metric: Metric to use when displaying costs. - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType + :type metric: str or ~cost_management_client.models.MetricType :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :type kpis: list[~cost_management_client.models.KpiProperties] :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :type pivots: list[~cost_management_client.models.PivotProperties] :param timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :type timeframe: str or ~cost_management_client.models.ReportTimeframeType :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :type time_period: ~cost_management_client.models.ReportConfigTimePeriod :param dataset: Has definition for data in this report config. - :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :type dataset: ~cost_management_client.models.ReportConfigDataset :keyword callable cls: A custom type or function that will be passed the direct response - :return: View or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.View or ~azure.mgmt.costmanagement.models.View + :return: View, or the result of cls(response) + :rtype: ~cost_management_client.models.View :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.View"] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) _parameters = models.View(e_tag=e_tag, display_name=display_name, scope=view_properties_scope, chart=chart, accumulated=accumulated, metric=metric, kpis=kpis, pivots=pivots, timeframe=timeframe, time_period=time_period, dataset=dataset) - api_version = "2019-11-01" + api_version = "2020-06-01" content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.create_or_update_by_scope.metadata['url'] + url = self.create_or_update_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), 'viewName': self._serialize.url("view_name", view_name, 'str'), @@ -607,10 +614,10 @@ def create_or_update_by_scope( deserialized = self._deserialize('View', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} + create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore def delete_by_scope( self, @@ -642,16 +649,17 @@ def delete_by_scope( :param view_name: View name. :type view_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) + :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) - api_version = "2019-11-01" + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" # Construct URL - url = self.delete_by_scope.metadata['url'] + url = self.delete_by_scope.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str'), 'viewName': self._serialize.url("view_name", view_name, 'str'), @@ -676,6 +684,6 @@ def delete_by_scope( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} + delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/setup.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/setup.py deleted file mode 100644 index 23e053083da..00000000000 --- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -# coding: utf-8 - -from setuptools import setup, find_packages - -NAME = "costmanagementclient" -VERSION = "1.2.0" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] - -setup( - name=NAME, - version=VERSION, - description="CostManagementClient", - author_email="", - url="", - keywords=["Swagger", "CostManagementClient"], - install_requires=REQUIRES, - packages=find_packages(), - include_package_data=True, - long_description="""\ - CostManagementClient. - """ -) diff --git a/src/costmanagement/report.md b/src/costmanagement/report.md new file mode 100644 index 00000000000..d6908742c45 --- /dev/null +++ b/src/costmanagement/report.md @@ -0,0 +1,269 @@ +# Azure CLI Module Creation Report + +### costmanagement alert dismiss + +dismiss a costmanagement alert. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--alert-id**|string|Alert ID|alert_id| +|**--definition**|object|defines the type of alert|definition| +|**--description**|string|Alert description|description| +|**--source**|choice|Source of alert|source| +|**--cost-entity-id**|string|related budget|cost_entity_id| +|**--status**|choice|alert status|status| +|**--creation-time**|string|dateTime in which alert was created|creation_time| +|**--close-time**|string|dateTime in which alert was closed|close_time| +|**--modification-time**|string|dateTime in which alert was last modified|modification_time| +|**--status-modification-user-name**|string||status_modification_user_name| +|**--status-modification-time**|string|dateTime in which the alert status was last modified|status_modification_time| +|**--details-time-grain-type**|choice|Type of timegrain cadence|time_grain_type| +|**--details-period-start-date**|string|datetime of periodStartDate|period_start_date| +|**--details-triggered-by**|string|notificationId that triggered this alert|triggered_by| +|**--details-resource-group-filter**|array|array of resourceGroups to filter by|resource_group_filter| +|**--details-resource-filter**|array|array of resources to filter by|resource_filter| +|**--details-meter-filter**|array|array of meters to filter by|meter_filter| +|**--details-tag-filter**|any|tags to filter by|tag_filter| +|**--details-threshold**|number|notification threshold percentage as a decimal which activated this alert|threshold| +|**--details-operator**|choice|operator used to compare currentSpend with amount|operator| +|**--details-amount**|number|budget threshold amount|amount| +|**--details-unit**|string|unit of currency being used|unit| +|**--details-current-spend**|number|current spend|current_spend| +|**--details-contact-emails**|array|list of emails to contact|contact_emails| +|**--details-contact-groups**|array|list of action groups to broadcast to|contact_groups| +|**--details-contact-roles**|array|list of contact roles|contact_roles| +|**--details-overriding-alert**|string|overriding alert|overriding_alert| +### costmanagement alert list + +list a costmanagement alert. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +### costmanagement alert list-external + +list-external a costmanagement alert. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--external-cloud-provider-type**|choice|The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.|external_cloud_provider_type| +|**--external-cloud-provider-id**|string|This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.|external_cloud_provider_id| +### costmanagement alert show + +show a costmanagement alert. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--alert-id**|string|Alert ID|alert_id| +### costmanagement dimension by-external-cloud-provider-type + +by-external-cloud-provider-type a costmanagement dimension. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--external-cloud-provider-type**|choice|The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.|external_cloud_provider_type| +|**--external-cloud-provider-id**|string|This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.|external_cloud_provider_id| +|**--filter**|string|May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.|filter| +|**--expand**|string|May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.|expand| +|**--skiptoken**|string|Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.|skiptoken| +|**--top**|integer|May be used to limit the number of results to the most recent N dimension data.|top| +### costmanagement dimension list + +list a costmanagement dimension. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--filter**|string|May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.|filter| +|**--expand**|string|May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.|expand| +|**--skiptoken**|string|Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.|skiptoken| +|**--top**|integer|May be used to limit the number of results to the most recent N dimension data.|top| +### costmanagement export create + +create a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--export-name**|string|Export Name.|export_name| +|**--e-tag**|string|eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.|e_tag| +|**--definition-type**|choice|The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.|type_properties_definition_type| +|**--definition-timeframe**|choice|The time frame for pulling data for the export. If custom, then a specific time period must be provided.|timeframe| +|**--definition-time-period**|object|Has time period for pulling data for the export.|time_period| +|**--definition-data-set-configuration**|object|The export dataset configuration.|configuration| +|**--delivery-info-destination**|object|Has destination for the export being delivered.|destination| +|**--schedule-status**|choice|The status of the export's schedule. If 'Inactive', the export's schedule is paused.|status| +|**--schedule-recurrence**|choice|The schedule recurrence.|recurrence| +|**--schedule-recurrence-period**|object|Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.|recurrence_period| +### costmanagement export delete + +delete a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--export-name**|string|Export Name.|export_name| +### costmanagement export execute + +execute a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--export-name**|string|Export Name.|export_name| +### costmanagement export get-execution-history + +get-execution-history a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--export-name**|string|Export Name.|export_name| +### costmanagement export list + +list a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--expand**|string|May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last execution of each export.|expand| +### costmanagement export show + +show a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--export-name**|string|Export Name.|export_name| +|**--expand**|string|May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 executions of the export.|expand| +### costmanagement export update + +create a costmanagement export. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--export-name**|string|Export Name.|export_name| +|**--e-tag**|string|eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.|e_tag| +|**--definition-type**|choice|The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.|type_properties_definition_type| +|**--definition-timeframe**|choice|The time frame for pulling data for the export. If custom, then a specific time period must be provided.|timeframe| +|**--definition-time-period**|object|Has time period for pulling data for the export.|time_period| +|**--definition-data-set-configuration**|object|The export dataset configuration.|configuration| +|**--delivery-info-destination**|object|Has destination for the export being delivered.|destination| +|**--schedule-status**|choice|The status of the export's schedule. If 'Inactive', the export's schedule is paused.|status| +|**--schedule-recurrence**|choice|The schedule recurrence.|recurrence| +|**--schedule-recurrence-period**|object|Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.|recurrence_period| +### costmanagement forecast external-cloud-provider-usage + +external-cloud-provider-usage a costmanagement forecast. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--external-cloud-provider-type**|choice|The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.|external_cloud_provider_type| +|**--external-cloud-provider-id**|string|This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.|external_cloud_provider_id| +|**--type**|choice|The type of the forecast.|type| +|**--timeframe**|choice|The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.|timeframe| +|**--filter**|string|May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.|filter| +|**--time-period**|object|Has time period for pulling data for the forecast.|time_period| +|**--include-actual-cost**|boolean|a boolean determining if actualCost will be included|include_actual_cost| +|**--include-fresh-partial-cost**|boolean|a boolean determining if FreshPartialCost will be included|include_fresh_partial_cost| +|**--dataset-configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration| +|**--dataset-aggregation**|dictionary|Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses.|aggregation| +|**--dataset-filter**|object|Has filter expression to use in the forecast.|filter| +### costmanagement forecast usage + +usage a costmanagement forecast. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--type**|choice|The type of the forecast.|type| +|**--timeframe**|choice|The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.|timeframe| +|**--filter**|string|May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.|filter| +|**--time-period**|object|Has time period for pulling data for the forecast.|time_period| +|**--include-actual-cost**|boolean|a boolean determining if actualCost will be included|include_actual_cost| +|**--include-fresh-partial-cost**|boolean|a boolean determining if FreshPartialCost will be included|include_fresh_partial_cost| +|**--dataset-configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration| +|**--dataset-aggregation**|dictionary|Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses.|aggregation| +|**--dataset-filter**|object|Has filter expression to use in the forecast.|filter| +### costmanagement query usage + +usage a costmanagement query. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.|scope| +|**--type**|choice|The type of the query.|type| +|**--timeframe**|choice|The time frame for pulling data for the query. If custom, then a specific time period must be provided.|timeframe| +|**--time-period**|object|Has time period for pulling data for the query.|time_period| +|**--dataset-configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration| +|**--dataset-aggregation**|dictionary|Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.|aggregation| +|**--dataset-grouping**|array|Array of group by expression to use in the query. Query can have up to 2 group by clauses.|grouping| +|**--dataset-filter**|object|Has filter expression to use in the query.|filter| +### costmanagement query usage-by-external-cloud-provider-type + +usage-by-external-cloud-provider-type a costmanagement query. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--external-cloud-provider-type**|choice|The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.|external_cloud_provider_type| +|**--external-cloud-provider-id**|string|This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.|external_cloud_provider_id| +|**--type**|choice|The type of the query.|type| +|**--timeframe**|choice|The time frame for pulling data for the query. If custom, then a specific time period must be provided.|timeframe| +|**--time-period**|object|Has time period for pulling data for the query.|time_period| +|**--dataset-configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration| +|**--dataset-aggregation**|dictionary|Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.|aggregation| +|**--dataset-grouping**|array|Array of group by expression to use in the query. Query can have up to 2 group by clauses.|grouping| +|**--dataset-filter**|object|Has filter expression to use in the query.|filter| +### costmanagement view create + +create a costmanagement view. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.|scope| +|**--view-name**|string|View name|view_name| +|**--e-tag**|string|eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.|e_tag| +|**--display-name**|string|User input name of the view. Required.|display_name| +|**--properties-scope**|string|Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.|scope| +|**--chart**|choice|Chart type of the main view in Cost Analysis. Required.|chart| +|**--accumulated**|choice|Show costs accumulated over time.|accumulated| +|**--metric**|choice|Metric to use when displaying costs.|metric| +|**--kpis**|array|List of KPIs to show in Cost Analysis UI.|kpis| +|**--pivots**|array|Configuration of 3 sub-views in the Cost Analysis UI.|pivots| +|**--query-timeframe**|choice|The time frame for pulling data for the report. If custom, then a specific time period must be provided.|timeframe| +|**--query-time-period**|object|Has time period for pulling data for the report.|time_period| +|**--query-dataset**|object|Has definition for data in this report config.|dataset| +|**--scope**|string|Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.|scope| +### costmanagement view delete + +delete a costmanagement view. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.|scope| +|**--view-name**|string|View name|view_name| +### costmanagement view get-by-scope + +get-by-scope a costmanagement view. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.|scope| +|**--view-name**|string|View name|view_name| +### costmanagement view list + +list a costmanagement view. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--scope**|string|The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.|scope| +### costmanagement view show + +show a costmanagement view. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--view-name**|string|View name|view_name| \ No newline at end of file diff --git a/src/costmanagement/setup.py b/src/costmanagement/setup.py index d99d8b3aa94..8d0bea50e74 100644 --- a/src/costmanagement/setup.py +++ b/src/costmanagement/setup.py @@ -9,9 +9,12 @@ from codecs import open from setuptools import setup, find_packages -# TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. VERSION = '0.1.0' +try: + from .manual.version import VERSION +except ImportError: + pass # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -27,8 +30,11 @@ 'License :: OSI Approved :: MIT License', ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = [] +try: + from .manual.dependency import DEPENDENCIES +except ImportError: + pass with open('README.md', 'r', encoding='utf-8') as f: README = f.read() @@ -39,11 +45,9 @@ name='costmanagement', version=VERSION, description='Microsoft Azure Command-Line Tools CostManagementClient Extension', - # TODO: Update author and email, if applicable author='Microsoft Corporation', author_email='azpycli@microsoft.com', - # TODO: consider pointing directly to your source code instead of the generic repo - url='https://github.com/Azure/azure-cli-extensions', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/costmanagement', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS,