diff --git a/src/costmanagement/HISTORY.rst b/src/costmanagement/HISTORY.rst
index 596e64a6031..1c139576ba0 100644
--- a/src/costmanagement/HISTORY.rst
+++ b/src/costmanagement/HISTORY.rst
@@ -1,11 +1,8 @@
-.. :changelog:
-
-Release History
-===============
-0.1.1
-++++++
-* Command group ``az costmanagement`` GA
-
-0.1.0
-++++++
-* Initial release.
+.. :changelog:
+
+Release History
+===============
+
+0.1.0
+++++++
+* Initial release.
diff --git a/src/costmanagement/azext_costmanagement/__init__.py b/src/costmanagement/azext_costmanagement/__init__.py
index 8870243ca42..99ada46c2a7 100644
--- a/src/costmanagement/azext_costmanagement/__init__.py
+++ b/src/costmanagement/azext_costmanagement/__init__.py
@@ -9,20 +9,23 @@
# --------------------------------------------------------------------------
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
+from azext_costmanagement.generated._help import helps # pylint: disable=unused-import
+try:
+ from azext_costmanagement.manual._help import helps # pylint: disable=reimported
+except ImportError:
+ pass
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
+ from azext_costmanagement.generated._client_factory import cf_costmanagement_cl
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)
+ client_factory=cf_costmanagement_cl)
+ 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
diff --git a/src/costmanagement/azext_costmanagement/action.py b/src/costmanagement/azext_costmanagement/action.py
index a846b2766c4..d95d53bf711 100644
--- a/src/costmanagement/azext_costmanagement/action.py
+++ b/src/costmanagement/azext_costmanagement/action.py
@@ -1,17 +1,17 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-# pylint: disable=wildcard-import
-# pylint: disable=unused-wildcard-import
-
-from .generated.action import * # noqa: F403
-try:
- from .manual.action import * # noqa: F403
-except ImportError:
- pass
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wildcard-import
+# pylint: disable=unused-wildcard-import
+
+from .generated.action import * # noqa: F403
+try:
+ from .manual.action import * # noqa: F403
+except ImportError:
+ pass
diff --git a/src/costmanagement/azext_costmanagement/azext_metadata.json b/src/costmanagement/azext_costmanagement/azext_metadata.json
index 7cdaeed31ca..cfc30c747c7 100644
--- a/src/costmanagement/azext_costmanagement/azext_metadata.json
+++ b/src/costmanagement/azext_costmanagement/azext_metadata.json
@@ -1,3 +1,4 @@
-{
- "azext.minCliCoreVersion": "2.3.1"
+{
+ "azext.isExperimental": true,
+ "azext.minCliCoreVersion": "2.15.0"
}
\ No newline at end of file
diff --git a/src/costmanagement/azext_costmanagement/custom.py b/src/costmanagement/azext_costmanagement/custom.py
index 7f31674ce96..dbe9d5f9742 100644
--- a/src/costmanagement/azext_costmanagement/custom.py
+++ b/src/costmanagement/azext_costmanagement/custom.py
@@ -1,17 +1,17 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-# pylint: disable=wildcard-import
-# pylint: disable=unused-wildcard-import
-
-from .generated.custom import * # noqa: F403
-try:
- from .manual.custom import * # noqa: F403
-except ImportError:
- pass
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wildcard-import
+# pylint: disable=unused-wildcard-import
+
+from .generated.custom import * # noqa: F403
+try:
+ from .manual.custom import * # noqa: F403
+except ImportError:
+ pass
diff --git a/src/costmanagement/azext_costmanagement/generated/__init__.py b/src/costmanagement/azext_costmanagement/generated/__init__.py
index ee0c4f36bd0..c9cfdc73e77 100644
--- a/src/costmanagement/azext_costmanagement/generated/__init__.py
+++ b/src/costmanagement/azext_costmanagement/generated/__init__.py
@@ -1,12 +1,12 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/costmanagement/azext_costmanagement/generated/_client_factory.py b/src/costmanagement/azext_costmanagement/generated/_client_factory.py
index 623cc620610..0029b765d2d 100644
--- a/src/costmanagement/azext_costmanagement/generated/_client_factory.py
+++ b/src/costmanagement/azext_costmanagement/generated/_client_factory.py
@@ -1,41 +1,42 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-
-def cf_costmanagement(cli_ctx, *_):
- from azure.cli.core.commands.client_factory import get_mgmt_service_client
- from ..vendored_sdks.costmanagement import CostManagementClient
- return get_mgmt_service_client(cli_ctx, CostManagementClient,
- subscription_bound=False,
- base_url_bound=True)
-
-
-def cf_view(cli_ctx, *_):
- return cf_costmanagement(cli_ctx).view
-
-
-def cf_alert(cli_ctx, *_):
- return cf_costmanagement(cli_ctx).alert
-
-
-def cf_forecast(cli_ctx, *_):
- return cf_costmanagement(cli_ctx).forecast
-
-
-def cf_dimension(cli_ctx, *_):
- return cf_costmanagement(cli_ctx).dimension
-
-
-def cf_query(cli_ctx, *_):
- return cf_costmanagement(cli_ctx).query
-
-
-def cf_export(cli_ctx, *_):
- return cf_costmanagement(cli_ctx).export
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+
+def cf_costmanagement_cl(cli_ctx, *_):
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ from azext_costmanagement.vendored_sdks.costmanagement import CostManagementClient
+ return get_mgmt_service_client(cli_ctx,
+ CostManagementClient,
+ subscription_bound=False,
+ base_url_bound=True)
+
+
+def cf_view(cli_ctx, *_):
+ return cf_costmanagement_cl(cli_ctx).views
+
+
+def cf_alert(cli_ctx, *_):
+ return cf_costmanagement_cl(cli_ctx).alerts
+
+
+def cf_forecast(cli_ctx, *_):
+ return cf_costmanagement_cl(cli_ctx).forecast
+
+
+def cf_dimension(cli_ctx, *_):
+ return cf_costmanagement_cl(cli_ctx).dimensions
+
+
+def cf_query(cli_ctx, *_):
+ return cf_costmanagement_cl(cli_ctx).query
+
+
+def cf_export(cli_ctx, *_):
+ return cf_costmanagement_cl(cli_ctx).exports
diff --git a/src/costmanagement/azext_costmanagement/generated/_help.py b/src/costmanagement/azext_costmanagement/generated/_help.py
index 13440845a57..2b339803666 100644
--- a/src/costmanagement/azext_costmanagement/generated/_help.py
+++ b/src/costmanagement/azext_costmanagement/generated/_help.py
@@ -1,782 +1,1062 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-# pylint: disable=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"
-# """
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+
+from knack.help_files import helps
+
+
+helps['costmanagement view'] = """
+ type: group
+ short-summary: Manage view with costmanagement
+"""
+
+helps['costmanagement view list'] = """
+ type: command
+ short-summary: "Lists all views at the given scope. And 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"
+ - name: PrivateViewList
+ text: |-
+ az costmanagement view list
+"""
+
+helps['costmanagement view show'] = """
+ type: command
+ short-summary: "Gets the view for the defined scope by view name. And Gets the view by view name."
+ examples:
+ - name: ResourceGroupView
+ text: |-
+ az costmanagement view show --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/M\
+YDEVTESTRG" --name "swaggerExample"
+ - 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 \
+request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. And The \
+operation to Create a view. Update operation requires latest eTag to be set in the request. 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: --time-period
+ short-summary: "Has time period for pulling data for the report."
+ 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: --configuration
+ short-summary: "Has configuration information for the data in the report. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --configuration columns=XX
+
+ columns: Array of column names to be included in the report. Any valid report column name is allowed. If \
+not provided, then report includes all columns.
+ - name: --grouping
+ short-summary: "Array of group by expression to use in the report. Report can have up to 2 group by clauses."
+ long-summary: |
+ Usage: --grouping type=XX name=XX
+
+ type: Required. Has type of the column to group.
+ name: Required. The name of the column to group. This version supports subscription lowest possible grain.
+
+ Multiple actions can be specified by using more than one --grouping argument.
+ - name: --sorting
+ short-summary: "Array of order by expression to use in the report."
+ long-summary: |
+ Usage: --sorting direction=XX name=XX
+
+ direction: Direction of sort.
+ name: Required. The name of the column to sort.
+
+ Multiple actions can be specified by using more than one --sorting argument.
+ - 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: --time-period
+ short-summary: "Has time period for pulling data for the report."
+ 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: --configuration
+ short-summary: "Has configuration information for the data in the report. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --configuration columns=XX
+
+ columns: Array of column names to be included in the report. Any valid report column name is allowed. If \
+not provided, then report includes all columns.
+ - name: --grouping
+ short-summary: "Array of group by expression to use in the report. Report can have up to 2 group by clauses."
+ long-summary: |
+ Usage: --grouping type=XX name=XX
+
+ type: Required. Has type of the column to group.
+ name: Required. The name of the column to group. This version supports subscription lowest possible grain.
+
+ Multiple actions can be specified by using more than one --grouping argument.
+ - name: --sorting
+ short-summary: "Array of order by expression to use in the report."
+ long-summary: |
+ Usage: --sorting direction=XX name=XX
+
+ direction: Direction of sort.
+ name: Required. The name of the column to sort.
+
+ Multiple actions can be specified by using more than one --sorting argument.
+ examples:
+ - name: ResourceGroupCreateOrUpdateView
+ text: |-
+ 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/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budg\
+ets/swaggerDemo" --metric "ActualCost" --pivots name="ServiceName" type="Dimension" --pivots name="MeterCategory" \
+type="Dimension" --pivots name="swaggerTagKey" type="TagKey" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\
+\\",\\"function\\":\\"Sum\\"}}" --granularity "Daily" --sorting name="UsageDate" direction="Ascending" --timeframe \
+"MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" --name \
+"swaggerExample"
+ - name: CreateOrUpdatePrivateView
+ text: |-
+ 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/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budg\
+ets/swaggerDemo" --metric "ActualCost" --pivots name="ServiceName" type="Dimension" --pivots name="MeterCategory" \
+type="Dimension" --pivots name="swaggerTagKey" type="TagKey" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\
+\\",\\"function\\":\\"Sum\\"}}" --granularity "Daily" --sorting name="UsageDate" direction="Ascending" --timeframe \
+"MonthToDate" --name "swaggerExample"
+"""
+
+helps['costmanagement view update'] = """
+ type: command
+ short-summary: "The operation to Update a view. Update operation requires latest eTag to be set in the request. \
+You may obtain the latest eTag by performing a get operation. Update 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: --time-period
+ short-summary: "Has time period for pulling data for the report."
+ 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: --configuration
+ short-summary: "Has configuration information for the data in the report. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --configuration columns=XX
+
+ columns: Array of column names to be included in the report. Any valid report column name is allowed. If \
+not provided, then report includes all columns.
+ - name: --grouping
+ short-summary: "Array of group by expression to use in the report. Report can have up to 2 group by clauses."
+ long-summary: |
+ Usage: --grouping type=XX name=XX
+
+ type: Required. Has type of the column to group.
+ name: Required. The name of the column to group. This version supports subscription lowest possible grain.
+
+ Multiple actions can be specified by using more than one --grouping argument.
+ - name: --sorting
+ short-summary: "Array of order by expression to use in the report."
+ long-summary: |
+ Usage: --sorting direction=XX name=XX
+
+ direction: Direction of sort.
+ name: Required. The name of the column to sort.
+
+ Multiple actions can be specified by using more than one --sorting argument.
+"""
+
+helps['costmanagement view delete'] = """
+ type: command
+ short-summary: "The operation to delete a view. And 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"
+ - name: DeletePrivateView
+ text: |-
+ az costmanagement view delete --name "TestView"
+"""
+
+helps['costmanagement alert'] = """
+ type: group
+ short-summary: Manage alert with costmanagement
+"""
+
+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/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+ - name: SubscriptionAlerts
+ text: |-
+ az costmanagement alert show --alert-id "22222222-2222-2222-2222-222222222222" --scope \
+"subscriptions/00000000-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: Manage forecast with costmanagement
+"""
+
+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: --configuration
+ short-summary: "Has configuration information for the data in the export. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --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-cloud-provider-type "externalBillingAccounts" --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dime\
+nsion\\":{\\"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-cloud-provider-type "externalSubscriptions" --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimens\
+ion\\":{\\"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: --configuration
+ short-summary: "Has configuration information for the data in the export. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --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" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789"
+ - name: BillingProfileForecast
+ text: |-
+ az costmanagement forecast usage --type "Usage" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+ - name: DepartmentForecast
+ text: |-
+ az costmanagement forecast usage --type "Usage" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"
+ - name: EnrollmentAccountForecast
+ text: |-
+ az costmanagement forecast usage --type "Usage" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"
+ - name: InvoiceSectionForecast
+ text: |-
+ az costmanagement forecast usage --type "Usage" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876"
+ - name: ResourceGroupForecast
+ text: |-
+ az costmanagement forecast usage --type "Usage" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+ - name: SubscriptionForecast
+ text: |-
+ az costmanagement forecast usage --type "Usage" --query-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\\"]}}]}" \
+--include-actual-cost false --include-fresh-partial-cost false --timeframe "MonthToDate" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000"
+"""
+
+helps['costmanagement dimension'] = """
+ type: group
+ short-summary: Manage dimension with costmanagement
+"""
+
+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 \
+\'resourceId\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/100"
+ - name: BillingAccountDimensionsListWithFilter-Modern
+ text: |-
+ az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \
+\'resourceId\'" --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 \
+\'resourceId\'" --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 \
+\'resourceId\'" --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 \
+\'resourceId\'" --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 \
+\'resourceId\'" --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 \
+\'resourceId\'" --top 5 --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSe\
+ctions/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.Management/managementGroups/MyMgId"
+ - name: ManagementGroupDimensionsListWithFilter-Legacy
+ text: |-
+ az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \
+\'resourceId\'" --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" \
+--external-cloud-provider-type "externalBillingAccounts"
+ - name: ExternalSubscriptionDimensionList
+ text: |-
+ az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalSubscriptions"
+"""
+
+helps['costmanagement query'] = """
+ type: group
+ short-summary: Manage query with costmanagement
+"""
+
+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: --configuration
+ short-summary: "Has configuration information for the data in the export. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --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: --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: --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 --grouping argument.
+ examples:
+ - name: BillingAccountQuery-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/70664866"
+ - name: BillingAccountQuery-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789"
+ - name: BillingAccountQueryGrouping-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/70664866"
+ - name: BillingAccountQueryGrouping-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789"
+ - name: BillingProfileQuery-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+ - name: BillingProfileQueryGrouping-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+ - name: CustomerQuery-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"
+ - name: CustomerQueryGrouping-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"
+ - name: DepartmentQuery-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/departments/123"
+ - name: DepartmentQueryGrouping-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/departments/123"
+ - name: EnrollmentAccountQuery-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+ - name: EnrollmentAccountQueryGrouping-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+ - name: InvoiceSectionQuery-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876"
+ - name: InvoiceSectionQueryGrouping-Modern
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876"
+ - name: ManagementGroupQuery-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"providers/Microsoft.Management/managementGroups/MyMgId"
+ - name: ManagementGroupQueryGrouping-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Management/managementGroups/MyMgId"
+ - name: ResourceGroupQuery-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+ - name: ResourceGroupQueryGrouping-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --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" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\
+\\":\\"ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\
+\\":\\"Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"R\
+esourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000"
+ - name: SubscriptionQueryGrouping-Legacy
+ text: |-
+ az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\\
+",\\"function\\":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --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: --configuration
+ short-summary: "Has configuration information for the data in the export. The configuration will be ignored if \
+aggregation and grouping are provided."
+ long-summary: |
+ Usage: --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: --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: --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 --grouping argument.
+ examples:
+ - name: ExternalBillingAccountQueryList
+ text: |-
+ az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalBillingAccounts" --type "Usage" --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" \
+--external-cloud-provider-type "externalSubscriptions" --type "Usage" --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 export'] = """
+ type: group
+ short-summary: Manage export with costmanagement
+"""
+
+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 a export. Update operation requires latest eTag to be set in the request. \
+You may obtain the latest eTag by performing a get operation. Create operation does not require eTag."
+ parameters:
+ - name: --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: --recurrence-period from=XX to=XX
+
+ from: Required. The start date of recurrence.
+ to: The end date of recurrence.
+ - name: --time-period
+ short-summary: "Has time period for pulling data for the export."
+ long-summary: |
+ Usage: --time-period from=XX to=XX
+
+ from: Required. The start date for export data.
+ to: Required. The end date for export data.
+ - name: --configuration
+ short-summary: "The export dataset configuration."
+ long-summary: |
+ Usage: --configuration columns=XX
+
+ 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).
+ - name: --destination
+ short-summary: "Has destination for the export being delivered."
+ long-summary: |
+ Usage: --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.
+ examples:
+ - name: ExportCreateOrUpdateByBillingAccount
+ text: |-
+ az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Billing/billingAccounts/123456"
+ - name: ExportCreateOrUpdateByDepartment
+ text: |-
+ az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Billing/billingAccounts/12/departments/1234"
+ - name: ExportCreateOrUpdateByEnrollmentAccount
+ text: |-
+ az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+ - name: ExportCreateOrUpdateByManagementGroup
+ text: |-
+ az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Management/managementGroups/TestMG"
+ - name: ExportCreateOrUpdateByResourceGroup
+ text: |-
+ az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
+ - name: ExportCreateOrUpdateBySubscription
+ text: |-
+ az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000"
+"""
+
+helps['costmanagement export update'] = """
+ type: command
+ short-summary: "The operation to Update a export. Update operation requires latest eTag to be set in the request. \
+You may obtain the latest eTag by performing a get operation. Update operation does not require eTag."
+ parameters:
+ - name: --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: --recurrence-period from=XX to=XX
+
+ from: Required. The start date of recurrence.
+ to: The end date of recurrence.
+ - name: --time-period
+ short-summary: "Has time period for pulling data for the export."
+ long-summary: |
+ Usage: --time-period from=XX to=XX
+
+ from: Required. The start date for export data.
+ to: Required. The end date for export data.
+ - name: --configuration
+ short-summary: "The export dataset configuration."
+ long-summary: |
+ Usage: --configuration columns=XX
+
+ 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).
+ - name: --destination
+ short-summary: "Has destination for the export being delivered."
+ long-summary: |
+ Usage: --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.
+"""
+
+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 show-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 show-execution-history --name "TestExport" --scope \
+"providers/Microsoft.Billing/billingAccounts/123456"
+ - name: ExportRunHistoryGetByDepartment
+ text: |-
+ az costmanagement export show-execution-history --name "TestExport" --scope \
+"providers/Microsoft.Billing/billingAccounts/12/departments/1234"
+ - name: ExportRunHistoryGetByEnrollmentAccount
+ text: |-
+ az costmanagement export show-execution-history --name "TestExport" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+ - name: ExportRunHistoryGetByManagementGroup
+ text: |-
+ az costmanagement export show-execution-history --name "TestExport" --scope \
+"providers/Microsoft.Management/managementGroups/TestMG"
+ - name: ExportRunHistoryGetByResourceGroup
+ text: |-
+ az costmanagement export show-execution-history --name "TestExport" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
+ - name: ExportRunHistoryGetBySubscription
+ text: |-
+ az costmanagement export show-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..251ea547642 100644
--- a/src/costmanagement/azext_costmanagement/generated/_params.py
+++ b/src/costmanagement/azext_costmanagement/generated/_params.py
@@ -1,467 +1,626 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-# pylint: disable=too-many-lines
-# pylint: disable=too-many-statements
-
-from knack.arguments import CLIArgumentType
-from azure.cli.core.commands.parameters import (
- get_three_state_flag,
- get_enum_type
-)
-from azext_costmanagement.action import (
- AddKpis,
- AddPivots,
- AddQueryTimePeriod,
- AddTimePeriod,
- AddDatasetConfiguration,
- AddDatasetGrouping,
- 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.')
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+# pylint: disable=too-many-statements
+
+from azure.cli.core.commands.parameters import (
+ get_three_state_flag,
+ get_enum_type
+)
+from azure.cli.core.commands.validators import validate_file_or_dict
+from azext_costmanagement.action import (
+ AddKpis,
+ AddPivots,
+ AddViewsTimePeriod,
+ AddViewsConfiguration,
+ AddViewsGrouping,
+ AddSorting,
+ AddDefinition,
+ AddForecastTimePeriod,
+ AddForecastConfiguration,
+ AddQueryGrouping,
+ AddRecurrencePeriod,
+ AddTimePeriod,
+ AddConfiguration,
+ AddDestination
+)
+
+
+def load_arguments(self, _):
+
+ with self.argument_context('costmanagement view list') as c:
+ c.argument('scope', type=str, help='The scope associated with view operations. This includes '
+ '\'subscriptions/{subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourc'
+ 'eGroups/{resourceGroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{bi'
+ 'llingAccountId}/departments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/bi'
+ 'llingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount '
+ 'scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingPro'
+ 'fileId}\' for BillingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId'
+ '}/invoiceSections/{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/m'
+ 'anagementGroups/{managementGroupId}\' for Management Group scope, \'providers/Microsoft.CostManagem'
+ 'ent/externalBillingAccounts/{externalBillingAccountName}\' for External Billing Account scope and '
+ '\'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for '
+ 'External Subscription scope.')
+
+ with self.argument_context('costmanagement view show') as c:
+ c.argument('scope', type=str, help='The scope associated with view operations. This includes '
+ '\'subscriptions/{subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourc'
+ 'eGroups/{resourceGroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{bi'
+ 'llingAccountId}/departments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/bi'
+ 'llingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount '
+ 'scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingPro'
+ 'fileId}\' for BillingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId'
+ '}/invoiceSections/{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/m'
+ 'anagementGroups/{managementGroupId}\' for Management Group scope, \'providers/Microsoft.CostManagem'
+ 'ent/externalBillingAccounts/{externalBillingAccountName}\' for External Billing Account scope and '
+ '\'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for '
+ 'External Subscription scope.')
+ c.argument('view_name', options_list=['--name', '-n', '--view-name'], type=str, help='View name')
+
+ with self.argument_context('costmanagement view create') as c:
+ c.argument('scope', type=str, help='The scope associated with view operations. This includes '
+ '\'subscriptions/{subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourc'
+ 'eGroups/{resourceGroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{bi'
+ 'llingAccountId}/departments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/bi'
+ 'llingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount '
+ 'scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingPro'
+ 'fileId}\' for BillingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId'
+ '}/invoiceSections/{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/m'
+ 'anagementGroups/{managementGroupId}\' for Management Group scope, \'providers/Microsoft.CostManagem'
+ 'ent/externalBillingAccounts/{externalBillingAccountName}\' for External Billing Account scope and '
+ '\'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for '
+ 'External Subscription scope.')
+ c.argument('view_name', options_list=['--name', '-n', '--view-name'], type=str, help='View name')
+ c.argument('e_tag', type=str, help='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.')
+ c.argument('display_name', type=str, help='User input name of the view. Required.')
+ c.argument('view_properties_scope', type=str, help='Cost Management scope to save the view on. This includes '
+ '\'subscriptions/{subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourc'
+ 'eGroups/{resourceGroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{bi'
+ 'llingAccountId}/departments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/bi'
+ 'llingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount '
+ 'scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingPro'
+ 'fileId}\' for BillingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId'
+ '}/invoiceSections/{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/m'
+ 'anagementGroups/{managementGroupId}\' for Management Group scope, \'/providers/Microsoft.CostManage'
+ 'ment/externalBillingAccounts/{externalBillingAccountName}\' for ExternalBillingAccount scope, and '
+ '\'/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for '
+ 'ExternalSubscription scope.')
+ 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('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.', arg_group='Query')
+ c.argument('time_period', action=AddViewsTimePeriod, nargs='+', help='Has time period for pulling data for the '
+ 'report.', arg_group='Query')
+ c.argument('granularity', arg_type=get_enum_type(['Daily', 'Monthly']), help='The granularity of rows in the '
+ 'report.', arg_group='Query Dataset')
+ c.argument('configuration', action=AddViewsConfiguration, nargs='+', help='Has configuration information for '
+ 'the data in the report. The configuration will be ignored if aggregation and grouping are '
+ 'provided.', arg_group='Query Dataset')
+ c.argument('aggregation', type=validate_file_or_dict, help='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. Expected value: json-string/@json-file.', arg_group='Query '
+ 'Dataset')
+ c.argument('grouping', action=AddViewsGrouping, nargs='+', help='Array of group by expression to use in the '
+ 'report. Report can have up to 2 group by clauses.', arg_group='Query Dataset')
+ c.argument('sorting', action=AddSorting, nargs='+', help='Array of order by expression to use in the report.',
+ arg_group='Query Dataset')
+ c.argument('filter_', options_list=['--filter'], type=validate_file_or_dict, help='Has filter expression to '
+ 'use in the report. Expected value: json-string/@json-file.', arg_group='Query Dataset')
+
+ with self.argument_context('costmanagement view update') as c:
+ c.argument('view_name', options_list=['--name', '-n', '--view-name'], type=str, help='View name')
+ c.argument('e_tag', type=str, help='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.')
+ c.argument('display_name', type=str, help='User input name of the view. Required.')
+ c.argument('scope', type=str, help='Cost Management scope to save the view on. This includes '
+ '\'subscriptions/{subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourc'
+ 'eGroups/{resourceGroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{bi'
+ 'llingAccountId}/departments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/bi'
+ 'llingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount '
+ 'scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingPro'
+ 'fileId}\' for BillingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId'
+ '}/invoiceSections/{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/m'
+ 'anagementGroups/{managementGroupId}\' for Management Group scope, \'/providers/Microsoft.CostManage'
+ 'ment/externalBillingAccounts/{externalBillingAccountName}\' for ExternalBillingAccount scope, and '
+ '\'/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for '
+ 'ExternalSubscription scope.')
+ 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('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.', arg_group='Query')
+ c.argument('time_period', action=AddViewsTimePeriod, nargs='+', help='Has time period for pulling data for the '
+ 'report.', arg_group='Query')
+ c.argument('granularity', arg_type=get_enum_type(['Daily', 'Monthly']), help='The granularity of rows in the '
+ 'report.', arg_group='Query Dataset')
+ c.argument('configuration', action=AddViewsConfiguration, nargs='+', help='Has configuration information for '
+ 'the data in the report. The configuration will be ignored if aggregation and grouping are '
+ 'provided.', arg_group='Query Dataset')
+ c.argument('aggregation', type=validate_file_or_dict, help='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. Expected value: json-string/@json-file.', arg_group='Query '
+ 'Dataset')
+ c.argument('grouping', action=AddViewsGrouping, nargs='+', help='Array of group by expression to use in the '
+ 'report. Report can have up to 2 group by clauses.', arg_group='Query Dataset')
+ c.argument('sorting', action=AddSorting, nargs='+', help='Array of order by expression to use in the report.',
+ arg_group='Query Dataset')
+ c.argument('filter_', options_list=['--filter'], type=validate_file_or_dict, help='Has filter expression to '
+ 'use in the report. Expected value: json-string/@json-file.', arg_group='Query Dataset')
+ c.ignore('parameters')
+
+ with self.argument_context('costmanagement view delete') as c:
+ c.argument('scope', type=str, help='The scope associated with view operations. This includes '
+ '\'subscriptions/{subscriptionId}\' for subscription scope, \'subscriptions/{subscriptionId}/resourc'
+ 'eGroups/{resourceGroupName}\' for resourceGroup scope, \'providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}\' for Billing Account scope, \'providers/Microsoft.Billing/billingAccounts/{bi'
+ 'llingAccountId}/departments/{departmentId}\' for Department scope, \'providers/Microsoft.Billing/bi'
+ 'llingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}\' for EnrollmentAccount '
+ 'scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingPro'
+ 'fileId}\' for BillingProfile scope, \'providers/Microsoft.Billing/billingAccounts/{billingAccountId'
+ '}/invoiceSections/{invoiceSectionId}\' for InvoiceSection scope, \'providers/Microsoft.Management/m'
+ 'anagementGroups/{managementGroupId}\' for Management Group scope, \'providers/Microsoft.CostManagem'
+ 'ent/externalBillingAccounts/{externalBillingAccountName}\' for External Billing Account scope and '
+ '\'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}\' for '
+ 'External Subscription scope.')
+ c.argument('view_name', options_list=['--name', '-n', '--view-name'], type=str, help='View name')
+
+ with self.argument_context('costmanagement alert list') as c:
+ c.argument('scope', type=str, help='The scope associated with alerts operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+
+ with self.argument_context('costmanagement alert show') as c:
+ c.argument('scope', type=str, help='The scope associated with alerts operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('alert_id', type=str, help='Alert ID')
+
+ with self.argument_context('costmanagement alert dismiss') as c:
+ c.argument('scope', type=str, help='The scope associated with alerts operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('alert_id', type=str, help='Alert ID')
+ c.argument('definition', action=AddDefinition, nargs='+', help='defines the type of alert')
+ c.argument('description', type=str, help='Alert description')
+ c.argument('source', arg_type=get_enum_type(['Preset', 'User']), help='Source of alert')
+ c.argument('cost_entity_id', type=str, help='related budget')
+ c.argument('status', arg_type=get_enum_type(['None', 'Active', 'Overridden', 'Resolved', 'Dismissed']),
+ help='alert status')
+ c.argument('creation_time', type=str, help='dateTime in which alert was created')
+ c.argument('close_time', type=str, help='dateTime in which alert was closed')
+ c.argument('modification_time', type=str, help='dateTime in which alert was last modified')
+ c.argument('status_modification_user_name', type=str, help='')
+ c.argument('status_modification_time', type=str, help='dateTime in which the alert status was last modified')
+ c.argument('time_grain_type', arg_type=get_enum_type(['None', 'Monthly', 'Quarterly', 'Annually',
+ 'BillingMonth', 'BillingQuarter', 'BillingAnnual']),
+ help='Type of timegrain cadence', arg_group='Details')
+ c.argument('period_start_date', type=str, help='datetime of periodStartDate', arg_group='Details')
+ c.argument('triggered_by', type=str, help='notificationId that triggered this alert', arg_group='Details')
+ c.argument('resource_group_filter', type=validate_file_or_dict, help='array of resourceGroups to filter by '
+ 'Expected value: json-string/@json-file.', arg_group='Details')
+ c.argument('resource_filter', type=validate_file_or_dict, help='array of resources to filter by Expected '
+ 'value: json-string/@json-file.', arg_group='Details')
+ c.argument('meter_filter', type=validate_file_or_dict, help='array of meters to filter by Expected value: '
+ 'json-string/@json-file.', arg_group='Details')
+ c.argument('tag_filter', type=validate_file_or_dict, help='tags to filter by Expected value: '
+ 'json-string/@json-file.', arg_group='Details')
+ c.argument('threshold', type=float, help='notification threshold percentage as a decimal which activated this '
+ 'alert', arg_group='Details')
+ c.argument('operator', arg_type=get_enum_type(['None', 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo',
+ 'LessThan', 'LessThanOrEqualTo']), help='operator used to '
+ 'compare currentSpend with amount', arg_group='Details')
+ c.argument('amount', type=float, help='budget threshold amount', arg_group='Details')
+ c.argument('unit', type=str, help='unit of currency being used', arg_group='Details')
+ c.argument('current_spend', type=float, help='current spend', arg_group='Details')
+ c.argument('contact_emails', nargs='+', help='list of emails to contact', arg_group='Details')
+ c.argument('contact_groups', nargs='+', help='list of action groups to broadcast to', arg_group='Details')
+ c.argument('contact_roles', nargs='+', help='list of contact roles', arg_group='Details')
+ c.argument('overriding_alert', type=str, help='overriding alert', arg_group='Details')
+
+ with self.argument_context('costmanagement alert list-external') as c:
+ c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions',
+ 'externalBillingAccounts']), help='The '
+ 'external cloud provider type associated with dimension/query operations. This includes '
+ '\'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidated '
+ 'account.')
+ c.argument('external_cloud_provider_id', type=str, help='This can be \'{externalSubscriptionId}\' for linked '
+ 'account or \'{externalBillingAccountId}\' for consolidated account used with dimension/query '
+ 'operations.')
+
+ with self.argument_context('costmanagement forecast external-cloud-provider-usage') as c:
+ c.argument('filter_', options_list=['--filter'], type=str, help='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\'.')
+ c.argument('external_cloud_provider_type', arg_type=get_enum_type(['externalSubscriptions',
+ 'externalBillingAccounts']), help='The '
+ 'external cloud provider type associated with dimension/query operations. This includes '
+ '\'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidated '
+ 'account.')
+ c.argument('external_cloud_provider_id', type=str, 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',
+ 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The '
+ 'time frame for pulling data for the forecast. If custom, then a specific time period must be '
+ 'provided.')
+ c.argument('time_period', action=AddForecastTimePeriod, nargs='+', help='Has time period for pulling data for '
+ 'the forecast.')
+ c.argument('include_actual_cost', arg_type=get_three_state_flag(), help='a boolean determining if actualCost '
+ 'will be included')
+ c.argument('include_fresh_partial_cost', arg_type=get_three_state_flag(), help='a boolean determining if '
+ 'FreshPartialCost will be included')
+ c.argument('configuration', action=AddForecastConfiguration, nargs='+', help='Has configuration information '
+ 'for the data in the export. The configuration will be ignored if aggregation and grouping are '
+ 'provided.', arg_group='Dataset')
+ c.argument('aggregation', type=validate_file_or_dict, help='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. Expected value: json-string/@json-file.',
+ arg_group='Dataset')
+ c.argument('query_filter', type=validate_file_or_dict, help='Has filter expression to use in the forecast. '
+ 'Expected value: json-string/@json-file.', arg_group='Dataset')
+
+ with self.argument_context('costmanagement forecast usage') as c:
+ c.argument('filter_', options_list=['--filter'], type=str, help='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\'.')
+ c.argument('scope', type=str, help='The scope associated with forecast operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ 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',
+ 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The '
+ 'time frame for pulling data for the forecast. If custom, then a specific time period must be '
+ 'provided.')
+ c.argument('time_period', action=AddForecastTimePeriod, nargs='+', help='Has time period for pulling data for '
+ 'the forecast.')
+ c.argument('include_actual_cost', arg_type=get_three_state_flag(), help='a boolean determining if actualCost '
+ 'will be included')
+ c.argument('include_fresh_partial_cost', arg_type=get_three_state_flag(), help='a boolean determining if '
+ 'FreshPartialCost will be included')
+ c.argument('configuration', action=AddForecastConfiguration, nargs='+', help='Has configuration information '
+ 'for the data in the export. The configuration will be ignored if aggregation and grouping are '
+ 'provided.', arg_group='Dataset')
+ c.argument('aggregation', type=validate_file_or_dict, help='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. Expected value: json-string/@json-file.',
+ arg_group='Dataset')
+ c.argument('query_filter', type=validate_file_or_dict, help='Has filter expression to use in the forecast. '
+ 'Expected value: json-string/@json-file.', arg_group='Dataset')
+
+ with self.argument_context('costmanagement dimension list') as c:
+ c.argument('scope', type=str, help='The scope associated with dimension operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope, \'/providers/Microsoft.Billing/billingAccount'
+ 's/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId}\' for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAcc'
+ 'ountId}/billingProfiles/{billingProfileId}\' for billingProfile scope, '
+ '\'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
+ '/invoiceSections/{invoiceSectionId}\' for invoiceSection scope, and \'providers/Microsoft.Billing/b'
+ 'illingAccounts/{billingAccountId}/customers/{customerId}\' specific for partners.')
+ c.argument('filter_', options_list=['--filter'], type=str, help='May be used to filter dimensions by '
+ 'properties/category, properties/usageStart, properties/usageEnd. Supported operators are '
+ '\'eq\',\'lt\', \'gt\', \'le\', \'ge\'.')
+ c.argument('expand', type=str, help='May be used to expand the properties/data within a dimension category. By '
+ 'default, data is not included when listing dimensions.')
+ c.argument('skiptoken', type=str, help='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.')
+ c.argument('top', type=int, help='May be used to limit the number of results to the most recent N dimension '
+ 'data.')
+
+ 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',
+ 'externalBillingAccounts']), help='The '
+ 'external cloud provider type associated with dimension/query operations. This includes '
+ '\'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidated '
+ 'account.')
+ c.argument('external_cloud_provider_id', type=str, help='This can be \'{externalSubscriptionId}\' for linked '
+ 'account or \'{externalBillingAccountId}\' for consolidated account used with dimension/query '
+ 'operations.')
+ c.argument('filter_', options_list=['--filter'], type=str, help='May be used to filter dimensions by '
+ 'properties/category, properties/usageStart, properties/usageEnd. Supported operators are '
+ '\'eq\',\'lt\', \'gt\', \'le\', \'ge\'.')
+ c.argument('expand', type=str, help='May be used to expand the properties/data within a dimension category. By '
+ 'default, data is not included when listing dimensions.')
+ c.argument('skiptoken', type=str, help='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.')
+ c.argument('top', type=int, help='May be used to limit the number of results to the most recent N dimension '
+ 'data.')
+
+ with self.argument_context('costmanagement query usage') as c:
+ c.argument('scope', type=str, help='The scope associated with query and export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ 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',
+ 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The '
+ 'time frame for pulling data for the query. If custom, then a specific time period must be '
+ 'provided.')
+ c.argument('time_period', action=AddForecastTimePeriod, nargs='+', help='Has time period for pulling data for '
+ 'the query.')
+ c.argument('configuration', action=AddForecastConfiguration, nargs='+', help='Has configuration information '
+ 'for the data in the export. The configuration will be ignored if aggregation and grouping are '
+ 'provided.', arg_group='Dataset')
+ c.argument('aggregation', type=validate_file_or_dict, help='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. Expected value: json-string/@json-file.', arg_group='Dataset')
+ c.argument('grouping', action=AddQueryGrouping, nargs='+', help='Array of group by expression to use in the '
+ 'query. Query can have up to 2 group by clauses.', arg_group='Dataset')
+ c.argument('filter_', options_list=['--filter'], type=validate_file_or_dict, help='Has filter expression to '
+ 'use in the query. Expected value: json-string/@json-file.', arg_group='Dataset')
+
+ 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',
+ 'externalBillingAccounts']), help='The '
+ 'external cloud provider type associated with dimension/query operations. This includes '
+ '\'externalSubscriptions\' for linked account and \'externalBillingAccounts\' for consolidated '
+ 'account.')
+ c.argument('external_cloud_provider_id', type=str, 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',
+ 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The '
+ 'time frame for pulling data for the query. If custom, then a specific time period must be '
+ 'provided.')
+ c.argument('time_period', action=AddForecastTimePeriod, nargs='+', help='Has time period for pulling data for '
+ 'the query.')
+ c.argument('configuration', action=AddForecastConfiguration, nargs='+', help='Has configuration information '
+ 'for the data in the export. The configuration will be ignored if aggregation and grouping are '
+ 'provided.', arg_group='Dataset')
+ c.argument('aggregation', type=validate_file_or_dict, help='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. Expected value: json-string/@json-file.', arg_group='Dataset')
+ c.argument('grouping', action=AddQueryGrouping, nargs='+', help='Array of group by expression to use in the '
+ 'query. Query can have up to 2 group by clauses.', arg_group='Dataset')
+ c.argument('filter_', options_list=['--filter'], type=validate_file_or_dict, help='Has filter expression to '
+ 'use in the query. Expected value: json-string/@json-file.', arg_group='Dataset')
+
+ with self.argument_context('costmanagement export list') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('expand', type=str, 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 show') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('export_name', options_list=['--name', '-n', '--export-name'], type=str, help='Export Name.')
+ c.argument('expand', type=str, 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 create') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('export_name', options_list=['--name', '-n', '--export-name'], type=str, help='Export Name.')
+ c.argument('e_tag', type=str, help='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.')
+ c.argument('status', arg_type=get_enum_type(['Active', 'Inactive']), help='The status of the export\'s '
+ 'schedule. If \'Inactive\', the export\'s schedule is paused.', arg_group='Schedule')
+ c.argument('recurrence', arg_type=get_enum_type(['Daily', 'Weekly', 'Monthly', 'Annually']), help='The '
+ 'schedule recurrence.', arg_group='Schedule')
+ c.argument('recurrence_period', action=AddRecurrencePeriod, 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.', arg_group='Schedule')
+ c.argument('type_', options_list=['--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 that do not yet provide data for charges or amortization for service reservations.',
+ arg_group='Definition')
+ c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth',
+ 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The '
+ 'time frame for pulling data for the export. If custom, then a specific time period must be '
+ 'provided.', arg_group='Definition')
+ c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the '
+ 'export.', arg_group='Definition')
+ c.argument('configuration', action=AddConfiguration, nargs='+', help='The export dataset configuration.',
+ arg_group='Definition Data Set')
+ c.argument('destination', action=AddDestination, nargs='+', help='Has destination for the export being '
+ 'delivered.', arg_group='Delivery Info')
+
+ with self.argument_context('costmanagement export update') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('export_name', options_list=['--name', '-n', '--export-name'], type=str, help='Export Name.')
+ c.argument('e_tag', type=str, help='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.')
+ c.argument('status', arg_type=get_enum_type(['Active', 'Inactive']), help='The status of the export\'s '
+ 'schedule. If \'Inactive\', the export\'s schedule is paused.', arg_group='Schedule')
+ c.argument('recurrence', arg_type=get_enum_type(['Daily', 'Weekly', 'Monthly', 'Annually']), help='The '
+ 'schedule recurrence.', arg_group='Schedule')
+ c.argument('recurrence_period', action=AddRecurrencePeriod, 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.', arg_group='Schedule')
+ c.argument('type_', options_list=['--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 that do not yet provide data for charges or amortization for service reservations.',
+ arg_group='Definition')
+ c.argument('timeframe', arg_type=get_enum_type(['MonthToDate', 'BillingMonthToDate', 'TheLastMonth',
+ 'TheLastBillingMonth', 'WeekToDate', 'Custom']), help='The '
+ 'time frame for pulling data for the export. If custom, then a specific time period must be '
+ 'provided.', arg_group='Definition')
+ c.argument('time_period', action=AddTimePeriod, nargs='+', help='Has time period for pulling data for the '
+ 'export.', arg_group='Definition')
+ c.argument('configuration', action=AddConfiguration, nargs='+', help='The export dataset configuration.',
+ arg_group='Definition Data Set')
+ c.argument('destination', action=AddDestination, nargs='+', help='Has destination for the export being '
+ 'delivered.', arg_group='Delivery Info')
+ c.ignore('parameters')
+
+ with self.argument_context('costmanagement export delete') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('export_name', options_list=['--name', '-n', '--export-name'], type=str, help='Export Name.')
+
+ with self.argument_context('costmanagement export execute') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('export_name', options_list=['--name', '-n', '--export-name'], type=str, help='Export Name.')
+
+ with self.argument_context('costmanagement export show-execution-history') as c:
+ c.argument('scope', type=str, help='The scope associated with export operations. This includes '
+ '\'/subscriptions/{subscriptionId}/\' for subscription scope, \'/subscriptions/{subscriptionId}/reso'
+ 'urceGroups/{resourceGroupName}\' for resourceGroup scope, \'/providers/Microsoft.Billing/billingAcc'
+ 'ounts/{billingAccountId}\' for Billing Account scope and \'/providers/Microsoft.Billing/billingAcco'
+ 'unts/{billingAccountId}/departments/{departmentId}\' for Department scope, '
+ '\'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAcc'
+ 'ountId}\' for EnrollmentAccount scope, \'/providers/Microsoft.Management/managementGroups/{manageme'
+ 'ntGroupId} for Management Group scope, \'/providers/Microsoft.Billing/billingAccounts/{billingAccou'
+ 'ntId}/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.')
+ c.argument('export_name', options_list=['--name', '-n', '--export-name'], type=str, help='Export Name.')
diff --git a/src/costmanagement/azext_costmanagement/generated/_validators.py b/src/costmanagement/azext_costmanagement/generated/_validators.py
index 7536d0531ea..b33a44c1ebf 100644
--- a/src/costmanagement/azext_costmanagement/generated/_validators.py
+++ b/src/costmanagement/azext_costmanagement/generated/_validators.py
@@ -1,23 +1,9 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-
-def 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
- )
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
diff --git a/src/costmanagement/azext_costmanagement/generated/action.py b/src/costmanagement/azext_costmanagement/generated/action.py
index e56edb2b2fb..99e7a3c0bb9 100644
--- a/src/costmanagement/azext_costmanagement/generated/action.py
+++ b/src/costmanagement/azext_costmanagement/generated/action.py
@@ -1,214 +1,392 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-# pylint: disable=protected-access
-
-import argparse
-from knack.util import CLIError
-from collections import defaultdict
-
-
-class AddKpis(argparse._AppendAction):
- def __call__(self, parser, namespace, values, option_string=None):
- action = self.get_action(values, option_string)
- super(AddKpis, self).__call__(parser, namespace, action, option_string)
-
- 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 == 'id':
- d['id'] = v[0]
- elif kl == 'enabled':
- d['enabled'] = v[0]
- return d
-
-
-class AddPivots(argparse._AppendAction):
- def __call__(self, parser, namespace, values, option_string=None):
- action = self.get_action(values, option_string)
- super(AddPivots, self).__call__(parser, namespace, action, option_string)
-
- 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 == 'name':
- d['name'] = v[0]
- return d
-
-
-class AddQueryTimePeriod(argparse.Action):
- def __call__(self, parser, namespace, values, option_string=None):
- action = self.get_action(values, option_string)
- namespace.query_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 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
-
- 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 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
-
- 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 AddDatasetGrouping(argparse._AppendAction):
- def __call__(self, parser, namespace, values, option_string=None):
- action = self.get_action(values, option_string)
- super(AddDatasetGrouping, self).__call__(parser, namespace, action, option_string)
-
- 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 == 'name':
- d['name'] = v[0]
- return d
-
-
-class AddDeliveryInfoDestination(argparse.Action):
- def __call__(self, parser, namespace, values, option_string=None):
- action = self.get_action(values, option_string)
- namespace.delivery_info_destination = 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 == 'resource-id':
- d['resource_id'] = v[0]
- elif kl == 'container':
- d['container'] = v[0]
- elif kl == 'root-folder-path':
- d['root_folder_path'] = v[0]
- return d
-
-
-class AddScheduleRecurrencePeriod(argparse.Action):
- def __call__(self, parser, namespace, values, option_string=None):
- action = self.get_action(values, option_string)
- namespace.schedule_recurrence_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
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=protected-access
+
+import argparse
+from collections import defaultdict
+from knack.util import CLIError
+
+
+class AddKpis(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddKpis, self).__call__(parser, namespace, action, option_string)
+
+ 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 == 'id':
+ d['id'] = v[0]
+ elif kl == 'enabled':
+ d['enabled'] = v[0]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter kpis. All possible keys are: type, id, '
+ 'enabled'.format(k))
+ return d
+
+
+class AddPivots(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddPivots, self).__call__(parser, namespace, action, option_string)
+
+ 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 == 'name':
+ d['name'] = v[0]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter pivots. All possible keys are: type, name'
+ .format(k))
+ return d
+
+
+class AddViewsTimePeriod(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.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]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter time_period. All possible keys are: from, '
+ 'to'.format(k))
+ return d
+
+
+class AddViewsConfiguration(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.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
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter configuration. All possible keys are: '
+ 'columns'.format(k))
+ return d
+
+
+class AddViewsGrouping(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddViewsGrouping, self).__call__(parser, namespace, action, option_string)
+
+ 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 == 'name':
+ d['name'] = v[0]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter grouping. All possible keys are: type, '
+ 'name'.format(k))
+ return d
+
+
+class AddSorting(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddSorting, self).__call__(parser, namespace, action, option_string)
+
+ 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 == 'direction':
+ d['direction'] = v[0]
+ elif kl == 'name':
+ d['name'] = v[0]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter sorting. All possible keys are: '
+ 'direction, name'.format(k))
+ 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]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter definition. All possible keys are: type, '
+ 'category, criteria'.format(k))
+ return d
+
+
+class AddForecastTimePeriod(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.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]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter time_period. All possible keys are: from, '
+ 'to'.format(k))
+ return d
+
+
+class AddForecastConfiguration(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.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
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter configuration. All possible keys are: '
+ 'columns'.format(k))
+ return d
+
+
+class AddQueryGrouping(argparse._AppendAction):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ super(AddQueryGrouping, self).__call__(parser, namespace, action, option_string)
+
+ 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 == 'name':
+ d['name'] = v[0]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter grouping. All possible keys are: type, '
+ 'name'.format(k))
+ return d
+
+
+class AddRecurrencePeriod(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.recurrence_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]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter recurrence_period. All possible keys are: '
+ 'from, to'.format(k))
+ return d
+
+
+class AddTimePeriod(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.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]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter time_period. All possible keys are: from, '
+ 'to'.format(k))
+ return d
+
+
+class AddConfiguration(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.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
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter configuration. All possible keys are: '
+ 'columns'.format(k))
+ return d
+
+
+class AddDestination(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ action = self.get_action(values, option_string)
+ namespace.destination = 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 == 'resource-id':
+ d['resource_id'] = v[0]
+ elif kl == 'container':
+ d['container'] = v[0]
+ elif kl == 'root-folder-path':
+ d['root_folder_path'] = v[0]
+ else:
+ raise CLIError('Unsupported Key {} is provided for parameter destination. All possible keys are: '
+ 'resource-id, container, root-folder-path'.format(k))
+ return d
diff --git a/src/costmanagement/azext_costmanagement/generated/commands.py b/src/costmanagement/azext_costmanagement/generated/commands.py
index 8a61dbaec20..844cff5534c 100644
--- a/src/costmanagement/azext_costmanagement/generated/commands.py
+++ b/src/costmanagement/azext_costmanagement/generated/commands.py
@@ -1,83 +1,85 @@
-# --------------------------------------------------------------------------
-# 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.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_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_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_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')
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-statements
+# pylint: disable=too-many-locals
+
+from azure.cli.core.commands import CliCommandType
+
+
+def load_command_table(self, _):
+
+ from azext_costmanagement.generated._client_factory import cf_view
+ costmanagement_view = CliCommandType(
+ operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._views_operations#ViewsOperations'
+ '.{}',
+ client_factory=cf_view)
+ with self.command_group('costmanagement view', costmanagement_view, client_factory=cf_view) 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.generic_update_command('update', custom_func_name='costmanagement_view_update')
+ g.custom_command('delete', 'costmanagement_view_delete', confirmation=True)
+
+ from azext_costmanagement.generated._client_factory import cf_alert
+ costmanagement_alert = CliCommandType(
+ operations_tmpl='azext_costmanagement.vendored_sdks.costmanagement.operations._alerts_operations#AlertsOperatio'
+ 'ns.{}',
+ client_factory=cf_alert)
+ with self.command_group('costmanagement alert', costmanagement_alert, client_factory=cf_alert) 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) 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._dimensions_operations#Dimensions'
+ 'Operations.{}',
+ client_factory=cf_dimension)
+ with self.command_group('costmanagement dimension', costmanagement_dimension, client_factory=cf_dimension) 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) 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._exports_operations#ExportsOperat'
+ 'ions.{}',
+ client_factory=cf_export)
+ with self.command_group('costmanagement export', costmanagement_export, client_factory=cf_export) 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.generic_update_command('update', custom_func_name='costmanagement_export_update')
+ g.custom_command('delete', 'costmanagement_export_delete', confirmation=True)
+ g.custom_command('execute', 'costmanagement_export_execute')
+ g.custom_command('show-execution-history', 'costmanagement_export_show_execution_history')
+
+ with self.command_group('costmanagement', is_experimental=True):
+ pass
diff --git a/src/costmanagement/azext_costmanagement/generated/custom.py b/src/costmanagement/azext_costmanagement/generated/custom.py
index 2c3fce143c8..0e6685599c0 100644
--- a/src/costmanagement/azext_costmanagement/generated/custom.py
+++ b/src/costmanagement/azext_costmanagement/generated/custom.py
@@ -1,328 +1,476 @@
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-# pylint: disable=too-many-lines
-
-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,
- scope,
- type_,
- timeframe,
- time_period=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(scope=scope,
- type=type_,
- timeframe=timeframe,
- time_period=time_period,
- configuration=dataset_configuration,
- aggregation=dataset_aggregation,
- grouping=dataset_grouping,
- filter=dataset_filter)
-
-
-def costmanagement_query_usage_by_external_cloud_provider_type(cmd, client,
- external_cloud_provider_type,
- external_cloud_provider_id,
- type_,
- timeframe,
- time_period=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_by_external_cloud_provider_type(external_cloud_provider_type=external_cloud_provider_type,
- external_cloud_provider_id=external_cloud_provider_id,
- type=type_,
- timeframe=timeframe,
- time_period=time_period,
- configuration=dataset_configuration,
- aggregation=dataset_aggregation,
- grouping=dataset_grouping,
- 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)
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=too-many-lines
+# pylint: disable=unused-argument
+
+
+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,
+ 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(client,
+ view_name,
+ scope=None,
+ e_tag=None,
+ display_name=None,
+ view_properties_scope=None,
+ chart=None,
+ accumulated=None,
+ metric=None,
+ kpis=None,
+ pivots=None,
+ timeframe=None,
+ time_period=None,
+ granularity=None,
+ configuration=None,
+ aggregation=None,
+ grouping=None,
+ sorting=None,
+ filter_=None):
+ parameters = {}
+ parameters['e_tag'] = e_tag
+ parameters['display_name'] = display_name
+ parameters['scope'] = view_properties_scope
+ parameters['chart'] = chart
+ parameters['accumulated'] = accumulated
+ parameters['metric'] = metric
+ parameters['kpis'] = kpis
+ parameters['pivots'] = pivots
+ parameters['type_properties_query_type'] = "Usage"
+ parameters['timeframe'] = timeframe
+ parameters['time_period'] = time_period
+ parameters['dataset'] = {}
+ parameters['dataset']['granularity'] = granularity
+ parameters['dataset']['configuration'] = configuration
+ parameters['dataset']['aggregation'] = aggregation
+ parameters['dataset']['grouping'] = grouping
+ parameters['dataset']['sorting'] = sorting
+ parameters['dataset']['filter'] = filter_
+ parameters = {}
+ parameters['e_tag'] = e_tag
+ parameters['display_name'] = display_name
+ parameters['scope'] = scope
+ parameters['chart'] = chart
+ parameters['accumulated'] = accumulated
+ parameters['metric'] = metric
+ parameters['kpis'] = kpis
+ parameters['pivots'] = pivots
+ parameters['type_properties_query_type'] = "Usage"
+ parameters['timeframe'] = timeframe
+ parameters['time_period'] = time_period
+ parameters['dataset'] = {}
+ parameters['dataset']['granularity'] = granularity
+ parameters['dataset']['configuration'] = configuration
+ parameters['dataset']['aggregation'] = aggregation
+ parameters['dataset']['grouping'] = grouping
+ parameters['dataset']['sorting'] = sorting
+ parameters['dataset']['filter'] = filter_
+ if scope is not None and view_name is not None:
+ return client.create_or_update_by_scope(scope=scope,
+ view_name=view_name,
+ parameters=parameters)
+ return client.create_or_update(view_name=view_name,
+ parameters=parameters)
+
+
+def costmanagement_view_update(instance,
+ view_name,
+ e_tag=None,
+ display_name=None,
+ scope=None,
+ chart=None,
+ accumulated=None,
+ metric=None,
+ kpis=None,
+ pivots=None,
+ timeframe=None,
+ time_period=None,
+ granularity=None,
+ configuration=None,
+ aggregation=None,
+ grouping=None,
+ sorting=None,
+ filter_=None):
+ if e_tag is not None:
+ instance.e_tag = e_tag
+ if display_name is not None:
+ instance.display_name = display_name
+ if scope is not None:
+ instance.scope = scope
+ if chart is not None:
+ instance.chart = chart
+ if accumulated is not None:
+ instance.accumulated = accumulated
+ if metric is not None:
+ instance.metric = metric
+ if kpis is not None:
+ instance.kpis = kpis
+ if pivots is not None:
+ instance.pivots = pivots
+ if "Usage" is not None:
+ instance.type_properties_query_type = "Usage"
+ if timeframe is not None:
+ instance.timeframe = timeframe
+ if time_period is not None:
+ instance.time_period = time_period
+ if granularity is not None:
+ instance.dataset.granularity = granularity
+ if configuration is not None:
+ instance.dataset.configuration = configuration
+ if aggregation is not None:
+ instance.dataset.aggregation = aggregation
+ if grouping is not None:
+ instance.dataset.grouping = grouping
+ if sorting is not None:
+ instance.dataset.sorting = sorting
+ if filter_ is not None:
+ instance.dataset.filter = filter_
+ return instance
+
+
+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_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,
+ time_grain_type=None,
+ period_start_date=None,
+ triggered_by=None,
+ resource_group_filter=None,
+ resource_filter=None,
+ meter_filter=None,
+ tag_filter=None,
+ threshold=None,
+ operator=None,
+ amount=None,
+ unit=None,
+ current_spend=None,
+ contact_emails=None,
+ contact_groups=None,
+ contact_roles=None,
+ overriding_alert=None):
+ parameters = {}
+ parameters['definition'] = definition
+ parameters['description'] = description
+ parameters['source'] = source
+ parameters['cost_entity_id'] = cost_entity_id
+ parameters['status'] = status
+ parameters['creation_time'] = creation_time
+ parameters['close_time'] = close_time
+ parameters['modification_time'] = modification_time
+ parameters['status_modification_user_name'] = status_modification_user_name
+ parameters['status_modification_time'] = status_modification_time
+ parameters['details'] = {}
+ parameters['details']['time_grain_type'] = time_grain_type
+ parameters['details']['period_start_date'] = period_start_date
+ parameters['details']['triggered_by'] = triggered_by
+ parameters['details']['resource_group_filter'] = resource_group_filter
+ parameters['details']['resource_filter'] = resource_filter
+ parameters['details']['meter_filter'] = meter_filter
+ parameters['details']['tag_filter'] = tag_filter
+ parameters['details']['threshold'] = threshold
+ parameters['details']['operator'] = operator
+ parameters['details']['amount'] = amount
+ parameters['details']['unit'] = unit
+ parameters['details']['current_spend'] = current_spend
+ parameters['details']['contact_emails'] = contact_emails
+ parameters['details']['contact_groups'] = contact_groups
+ parameters['details']['contact_roles'] = contact_roles
+ parameters['details']['overriding_alert'] = overriding_alert
+ return client.dismiss(scope=scope,
+ alert_id=alert_id,
+ parameters=parameters)
+
+
+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,
+ configuration=None,
+ aggregation=None,
+ query_filter=None):
+ parameters = {}
+ parameters['type'] = type_
+ parameters['timeframe'] = timeframe
+ parameters['time_period'] = time_period
+ parameters['include_actual_cost'] = include_actual_cost
+ parameters['include_fresh_partial_cost'] = include_fresh_partial_cost
+ parameters['dataset'] = {}
+ parameters['dataset']['granularity'] = "Daily"
+ parameters['dataset']['configuration'] = configuration
+ parameters['dataset']['aggregation'] = aggregation
+ parameters['dataset']['filter'] = query_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,
+ parameters=parameters)
+
+
+def costmanagement_forecast_usage(client,
+ scope,
+ type_,
+ timeframe,
+ filter_=None,
+ time_period=None,
+ include_actual_cost=None,
+ include_fresh_partial_cost=None,
+ configuration=None,
+ aggregation=None,
+ query_filter=None):
+ parameters = {}
+ parameters['type'] = type_
+ parameters['timeframe'] = timeframe
+ parameters['time_period'] = time_period
+ parameters['include_actual_cost'] = include_actual_cost
+ parameters['include_fresh_partial_cost'] = include_fresh_partial_cost
+ parameters['dataset'] = {}
+ parameters['dataset']['granularity'] = "Daily"
+ parameters['dataset']['configuration'] = configuration
+ parameters['dataset']['aggregation'] = aggregation
+ parameters['dataset']['filter'] = query_filter
+ return client.usage(filter=filter_,
+ scope=scope,
+ parameters=parameters)
+
+
+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,
+ time_period=None,
+ configuration=None,
+ aggregation=None,
+ grouping=None,
+ filter_=None):
+ parameters = {}
+ parameters['type'] = type_
+ parameters['timeframe'] = timeframe
+ parameters['time_period'] = time_period
+ parameters['dataset'] = {}
+ parameters['dataset']['granularity'] = "Daily"
+ parameters['dataset']['configuration'] = configuration
+ parameters['dataset']['aggregation'] = aggregation
+ parameters['dataset']['grouping'] = grouping
+ parameters['dataset']['filter'] = filter_
+ return client.usage(scope=scope,
+ parameters=parameters)
+
+
+def costmanagement_query_usage_by_external_cloud_provider_type(client,
+ external_cloud_provider_type,
+ external_cloud_provider_id,
+ type_,
+ timeframe,
+ time_period=None,
+ configuration=None,
+ aggregation=None,
+ grouping=None,
+ filter_=None):
+ parameters = {}
+ parameters['type'] = type_
+ parameters['timeframe'] = timeframe
+ parameters['time_period'] = time_period
+ parameters['dataset'] = {}
+ parameters['dataset']['granularity'] = "Daily"
+ parameters['dataset']['configuration'] = configuration
+ parameters['dataset']['aggregation'] = aggregation
+ parameters['dataset']['grouping'] = grouping
+ parameters['dataset']['filter'] = filter_
+ return client.usage_by_external_cloud_provider_type(external_cloud_provider_type=external_cloud_provider_type,
+ external_cloud_provider_id=external_cloud_provider_id,
+ parameters=parameters)
+
+
+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,
+ status=None,
+ recurrence=None,
+ recurrence_period=None,
+ type_=None,
+ timeframe=None,
+ time_period=None,
+ configuration=None,
+ destination=None):
+ parameters = {}
+ parameters['e_tag'] = e_tag
+ parameters['format'] = "Csv"
+ parameters['schedule'] = {}
+ parameters['schedule']['status'] = status
+ parameters['schedule']['recurrence'] = recurrence
+ parameters['schedule']['recurrence_period'] = recurrence_period
+ parameters['definition'] = {}
+ parameters['definition']['type'] = type_
+ parameters['definition']['timeframe'] = timeframe
+ parameters['definition']['time_period'] = time_period
+ parameters['definition']['data_set'] = {}
+ parameters['definition']['data_set']['granularity'] = "Daily"
+ parameters['definition']['data_set']['configuration'] = configuration
+ parameters['delivery_info'] = {}
+ parameters['delivery_info']['destination'] = destination
+ return client.create_or_update(scope=scope,
+ export_name=export_name,
+ parameters=parameters)
+
+
+def costmanagement_export_update(instance,
+ scope,
+ export_name,
+ e_tag=None,
+ status=None,
+ recurrence=None,
+ recurrence_period=None,
+ type_=None,
+ timeframe=None,
+ time_period=None,
+ configuration=None,
+ destination=None):
+ if e_tag is not None:
+ instance.e_tag = e_tag
+ if "Csv" is not None:
+ instance.format = "Csv"
+ if status is not None:
+ instance.schedule.status = status
+ if recurrence is not None:
+ instance.schedule.recurrence = recurrence
+ if recurrence_period is not None:
+ instance.schedule.recurrence_period = recurrence_period
+ if type_ is not None:
+ instance.definition.type = type_
+ if timeframe is not None:
+ instance.definition.timeframe = timeframe
+ if time_period is not None:
+ instance.definition.time_period = time_period
+ if "Daily" is not None:
+ instance.definition.data_set.granularity = "Daily"
+ if configuration is not None:
+ instance.definition.data_set.configuration = configuration
+ if destination is not None:
+ instance.delivery_info.destination = destination
+ return instance
+
+
+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_show_execution_history(client,
+ scope,
+ export_name):
+ return client.get_execution_history(scope=scope,
+ export_name=export_name)
diff --git a/src/costmanagement/azext_costmanagement/manual/__init__.py b/src/costmanagement/azext_costmanagement/manual/__init__.py
index ee0c4f36bd0..c9cfdc73e77 100644
--- a/src/costmanagement/azext_costmanagement/manual/__init__.py
+++ b/src/costmanagement/azext_costmanagement/manual/__init__.py
@@ -1,12 +1,12 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/costmanagement/azext_costmanagement/tests/__init__.py b/src/costmanagement/azext_costmanagement/tests/__init__.py
index fe1bd438b46..70488e93851 100644
--- a/src/costmanagement/azext_costmanagement/tests/__init__.py
+++ b/src/costmanagement/azext_costmanagement/tests/__init__.py
@@ -1,49 +1,116 @@
-# 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.
-# --------------------------------------------------------------------------
-import inspect
-import os
-
-
-__path__ = __import__('pkgutil').extend_path(__path__, __name__)
-
-
-def try_manual(func):
- def import_manual_function(origin_func):
- from importlib import import_module
- decorated_path = inspect.getfile(origin_func)
- module_path = __path__[0]
- if not decorated_path.startswith(module_path):
- raise Exception("Decorator can only be used in submodules!")
- manual_path = os.path.join(
- decorated_path[module_path.rfind(os.path.sep) + 1:])
- manual_file_path, manual_file_name = os.path.split(manual_path)
- module_name, _ = os.path.splitext(manual_file_name)
- manual_module = "..manual." + \
- ".".join(manual_file_path.split(os.path.sep) + [module_name, ])
- return getattr(import_module(manual_module, package=__name__), origin_func.__name__)
-
- def get_func_to_call():
- func_to_call = func
- try:
- func_to_call = import_manual_function(func)
- except (ImportError, AttributeError):
- pass
- return 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)
-
- if inspect.isclass(func):
- return get_func_to_call()
- else:
- return wrapper
+# 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.
+# --------------------------------------------------------------------------
+import inspect
+import logging
+import os
+import sys
+import traceback
+import datetime as dt
+
+from azure.core.exceptions import AzureError
+from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError
+
+
+logger = logging.getLogger('azure.cli.testsdk')
+logger.addHandler(logging.StreamHandler())
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+exceptions = []
+test_map = dict()
+SUCCESSED = "successed"
+FAILED = "failed"
+
+
+def try_manual(func):
+ def import_manual_function(origin_func):
+ from importlib import import_module
+ decorated_path = inspect.getfile(origin_func).lower()
+ module_path = __path__[0].lower()
+ if not decorated_path.startswith(module_path):
+ raise Exception("Decorator can only be used in submodules!")
+ manual_path = os.path.join(
+ decorated_path[module_path.rfind(os.path.sep) + 1:])
+ manual_file_path, manual_file_name = os.path.split(manual_path)
+ module_name, _ = os.path.splitext(manual_file_name)
+ manual_module = "..manual." + \
+ ".".join(manual_file_path.split(os.path.sep) + [module_name, ])
+ return getattr(import_module(manual_module, package=__name__), origin_func.__name__)
+
+ def get_func_to_call():
+ func_to_call = func
+ try:
+ func_to_call = import_manual_function(func)
+ logger.info("Found manual override for %s(...)", func.__name__)
+ except (ImportError, AttributeError):
+ pass
+ return func_to_call
+
+ def wrapper(*args, **kwargs):
+ func_to_call = get_func_to_call()
+ logger.info("running %s()...", func.__name__)
+ try:
+ test_map[func.__name__] = dict()
+ test_map[func.__name__]["result"] = SUCCESSED
+ test_map[func.__name__]["error_message"] = ""
+ test_map[func.__name__]["error_stack"] = ""
+ test_map[func.__name__]["error_normalized"] = ""
+ test_map[func.__name__]["start_dt"] = dt.datetime.utcnow()
+ ret = func_to_call(*args, **kwargs)
+ except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit,
+ JMESPathCheckAssertionError) as e:
+ use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE")
+ if use_exception_cache is None or use_exception_cache.lower() != "true":
+ raise
+ test_map[func.__name__]["end_dt"] = dt.datetime.utcnow()
+ test_map[func.__name__]["result"] = FAILED
+ test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500]
+ test_map[func.__name__]["error_stack"] = traceback.format_exc().replace(
+ "\r\n", " ").replace("\n", " ")[:500]
+ logger.info("--------------------------------------")
+ logger.info("step exception: %s", e)
+ logger.error("--------------------------------------")
+ logger.error("step exception in %s: %s", func.__name__, e)
+ logger.info(traceback.format_exc())
+ exceptions.append((func.__name__, sys.exc_info()))
+ else:
+ test_map[func.__name__]["end_dt"] = dt.datetime.utcnow()
+ return ret
+
+ if inspect.isclass(func):
+ return get_func_to_call()
+ return wrapper
+
+
+def calc_coverage(filename):
+ filename = filename.split(".")[0]
+ coverage_name = filename + "_coverage.md"
+ with open(coverage_name, "w") as f:
+ f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n")
+ total = len(test_map)
+ covered = 0
+ for k, v in test_map.items():
+ if not k.startswith("step_"):
+ total -= 1
+ continue
+ if v["result"] == SUCCESSED:
+ covered += 1
+ f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|"
+ "{end_dt}|\n".format(step_name=k, **v))
+ f.write("Coverage: {}/{}\n".format(covered, total))
+ print("Create coverage\n", file=sys.stderr)
+
+
+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/__init__.py b/src/costmanagement/azext_costmanagement/tests/latest/__init__.py
index ee0c4f36bd0..c9cfdc73e77 100644
--- a/src/costmanagement/azext_costmanagement/tests/latest/__init__.py
+++ b/src/costmanagement/azext_costmanagement/tests/latest/__init__.py
@@ -1,12 +1,12 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/costmanagement/azext_costmanagement/tests/latest/example_steps.py b/src/costmanagement/azext_costmanagement/tests/latest/example_steps.py
new file mode 100644
index 00000000000..ff57bec4efa
--- /dev/null
+++ b/src/costmanagement/azext_costmanagement/tests/latest/example_steps.py
@@ -0,0 +1,1512 @@
+# --------------------------------------------------------------------------
+# 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 .. import try_manual
+
+
+# EXAMPLE: /Alerts/get/BillingAccountAlerts
+@try_manual
+def step_alert_list(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/BillingProfileAlerts
+@try_manual
+def step_alert_list2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/DepartmentAlerts
+@try_manual
+def step_alert_list3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/EnrollmentAccountAlerts
+@try_manual
+def step_alert_list4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/ExternalBillingAccountAlerts
+@try_manual
+def step_alert_list_external(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list-external '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalBillingAccounts"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/ExternalSubscriptionAlerts
+@try_manual
+def step_alert_list_external2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list-external '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalSubscriptions"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/InvoiceSectionAlerts
+@try_manual
+def step_alert_list5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987'
+ '6"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/ResourceGroupAlerts
+@try_manual
+def step_alert_list6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/get/SubscriptionAlerts
+@try_manual
+def step_alert_list7(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert list '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Alerts/patch/ResourceGroupAlerts
+@try_manual
+def step_alert_dismiss(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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=checks)
+
+
+# EXAMPLE: /Alerts/patch/SubscriptionAlerts
+@try_manual
+def step_alert_dismiss2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement alert dismiss '
+ '--alert-id "22222222-2222-2222-2222-222222222222" '
+ '--status "Dismissed" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingAccountDimensionsList-Legacy
+@try_manual
+def step_dimension_list(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingAccountDimensionsList-Modern
+@try_manual
+def step_dimension_list2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListExpandAndTop-Legacy
+@try_manual
+def step_dimension_list3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListExpandAndTop-Modern
+@try_manual
+def step_dimension_list4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListWithFilter-Legacy
+@try_manual
+def step_dimension_list5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--filter "properties/category eq \'resourceId\'" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingAccountDimensionsListWithFilter-Modern
+@try_manual
+def step_dimension_list6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--filter "properties/category eq \'resourceId\'" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingProfileDimensionsList-Modern
+@try_manual
+def step_dimension_list7(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingProfileDimensionsListExpandAndTop-Modern
+@try_manual
+def step_dimension_list8(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/BillingProfileDimensionsListWithFilter-Modern
+@try_manual
+def step_dimension_list9(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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=checks)
+
+
+# EXAMPLE: /Dimensions/get/CustomerDimensionsList-Modern
+@try_manual
+def step_dimension_list10(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/CustomerDimensionsListExpandAndTop-Modern
+@try_manual
+def step_dimension_list11(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/CustomerDimensionsListWithFilter-Modern
+@try_manual
+def step_dimension_list12(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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=checks)
+
+
+# EXAMPLE: /Dimensions/get/DepartmentDimensionsList-Legacy
+@try_manual
+def step_dimension_list13(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/DepartmentDimensionsListExpandAndTop-Legacy
+@try_manual
+def step_dimension_list14(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/DepartmentDimensionsListWithFilter-Legacy
+@try_manual
+def step_dimension_list15(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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=checks)
+
+
+# EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsList-Legacy
+@try_manual
+def step_dimension_list16(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsListExpandAndTop-Legacy
+@try_manual
+def step_dimension_list17(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/EnrollmentAccountDimensionsListWithFilter-Legacy
+@try_manual
+def step_dimension_list18(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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=checks)
+
+
+# EXAMPLE: /Dimensions/get/ExternalBillingAccountDimensionList
+@try_manual
+def step_dimension_by_external_cloud_provider_type(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension by-external-cloud-provider-type '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalBillingAccounts"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/ExternalSubscriptionDimensionList
+@try_manual
+def step_dimension_by_external_cloud_provider_type2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension by-external-cloud-provider-type '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalSubscriptions"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsList-Modern
+@try_manual
+def step_dimension_list19(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987'
+ '6"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsListExpandAndTop-Modern
+@try_manual
+def step_dimension_list20(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987'
+ '6"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/InvoiceSectionDimensionsListWithFilter-Modern
+@try_manual
+def step_dimension_list21(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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=checks)
+
+
+# EXAMPLE: /Dimensions/get/ManagementGroupDimensionsList-Legacy
+@try_manual
+def step_dimension_list22(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--scope "providers/Microsoft.Management/managementGroups/MyMgId"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/ManagementGroupDimensionsListExpandAndTop-Legacy
+@try_manual
+def step_dimension_list23(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Management/managementGroups/MyMgId"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/ManagementGroupDimensionsListWithFilter-Legacy
+@try_manual
+def step_dimension_list24(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--filter "properties/category eq \'resourceId\'" '
+ '--top 5 '
+ '--scope "providers/Microsoft.Management/managementGroups/MyMgId"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/ResourceGroupDimensionsList-Legacy
+@try_manual
+def step_dimension_list25(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/system.orlando"',
+ checks=checks)
+
+
+# EXAMPLE: /Dimensions/get/SubscriptionDimensionsList-Legacy
+@try_manual
+def step_dimension_list26(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement dimension list '
+ '--expand "properties/data" '
+ '--top 5 '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/put/ExportCreateOrUpdateByBillingAccount
+@try_manual
+def step_export_create(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export create '
+ '--name "{myExport}" '
+ '--type "ActualCost" '
+ '--configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" '
+ 'columns="Quantity" '
+ '--timeframe "MonthToDate" '
+ '--destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
+ 'ders/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" '
+ '--recurrence "Weekly" '
+ '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" '
+ '--status "Active" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/123456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/put/ExportCreateOrUpdateByDepartment
+@try_manual
+def step_export_create2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export create '
+ '--name "{myExport}" '
+ '--type "ActualCost" '
+ '--configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" '
+ 'columns="Quantity" '
+ '--timeframe "MonthToDate" '
+ '--destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
+ 'ders/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" '
+ '--recurrence "Weekly" '
+ '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" '
+ '--status "Active" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/put/ExportCreateOrUpdateByEnrollmentAccount
+@try_manual
+def step_export_create3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export create '
+ '--name "{myExport}" '
+ '--type "ActualCost" '
+ '--configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" '
+ 'columns="Quantity" '
+ '--timeframe "MonthToDate" '
+ '--destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
+ 'ders/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" '
+ '--recurrence "Weekly" '
+ '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" '
+ '--status "Active" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/put/ExportCreateOrUpdateByManagementGroup
+@try_manual
+def step_export_create4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export create '
+ '--name "{myExport}" '
+ '--type "ActualCost" '
+ '--configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" '
+ 'columns="Quantity" '
+ '--timeframe "MonthToDate" '
+ '--destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
+ 'ders/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" '
+ '--recurrence "Weekly" '
+ '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" '
+ '--status "Active" '
+ '--scope "providers/Microsoft.Management/managementGroups/TestMG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/put/ExportCreateOrUpdateByResourceGroup
+@try_manual
+def step_export_create5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export create '
+ '--name "{myExport}" '
+ '--type "ActualCost" '
+ '--configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" '
+ 'columns="Quantity" '
+ '--timeframe "MonthToDate" '
+ '--destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
+ 'ders/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" '
+ '--recurrence "Weekly" '
+ '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" '
+ '--status "Active" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/put/ExportCreateOrUpdateBySubscription
+@try_manual
+def step_export_create6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export create '
+ '--name "{myExport}" '
+ '--type "ActualCost" '
+ '--configuration columns="Date" columns="MeterId" columns="ResourceId" columns="ResourceLocation" '
+ 'columns="Quantity" '
+ '--timeframe "MonthToDate" '
+ '--destination container="exports" resource-id="/subscriptions/{subscription_id}/resourceGroups/{rg}/provi'
+ 'ders/Microsoft.Storage/storageAccounts/{sa}" root-folder-path="ad-hoc" '
+ '--recurrence "Weekly" '
+ '--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" '
+ '--status "Active" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportGetByBillingAccount
+@try_manual
+def step_export_show(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/123456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportGetByDepartment
+@try_manual
+def step_export_show2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportGetByEnrollmentAccount
+@try_manual
+def step_export_show3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportGetByManagementGroup
+@try_manual
+def step_export_show4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Management/managementGroups/TestMG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportGetByResourceGroup
+@try_manual
+def step_export_show5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportGetBySubscription
+@try_manual
+def step_export_show6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportRunHistoryGetByBillingAccount
+@try_manual
+def step_export_show_execution_history(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show-execution-history '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/123456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportRunHistoryGetByDepartment
+@try_manual
+def step_export_show_execution_history2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show-execution-history '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportRunHistoryGetByEnrollmentAccount
+@try_manual
+def step_export_show_execution_history3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show-execution-history '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportRunHistoryGetByManagementGroup
+@try_manual
+def step_export_show_execution_history4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show-execution-history '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Management/managementGroups/TestMG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportRunHistoryGetByResourceGroup
+@try_manual
+def step_export_show_execution_history5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show-execution-history '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportRunHistoryGetBySubscription
+@try_manual
+def step_export_show_execution_history6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export show-execution-history '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportsGetByBillingAccount
+@try_manual
+def step_export_list(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/123456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportsGetByDepartment
+@try_manual
+def step_export_list2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/123"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportsGetByEnrollmentAccount
+@try_manual
+def step_export_list3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export list '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportsGetByManagementGroup
+@try_manual
+def step_export_list4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export list '
+ '--scope "providers/Microsoft.Management/managementGroups/TestMG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportsGetByResourceGroup
+@try_manual
+def step_export_list5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export list '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/get/ExportsGetBySubscription
+@try_manual
+def step_export_list6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export list '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/post/ExportRunByBillingAccount
+@try_manual
+def step_export_execute(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export execute '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/123456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/post/ExportRunByDepartment
+@try_manual
+def step_export_execute2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export execute '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/post/ExportRunByEnrollmentAccount
+@try_manual
+def step_export_execute3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export execute '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/post/ExportRunByManagementGroup
+@try_manual
+def step_export_execute4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export execute '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Management/managementGroups/TestMG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/post/ExportRunByResourceGroup
+@try_manual
+def step_export_execute5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export execute '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/post/ExportRunBySubscription
+@try_manual
+def step_export_execute6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export execute '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/delete/ExportDeleteByBillingAccount
+@try_manual
+def step_export_delete(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export delete -y '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/123456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/delete/ExportDeleteByDepartment
+@try_manual
+def step_export_delete2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export delete -y '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12/departments/1234"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/delete/ExportDeleteByEnrollmentAccount
+@try_manual
+def step_export_delete3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export delete -y '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/delete/ExportDeleteByManagementGroup
+@try_manual
+def step_export_delete4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export delete -y '
+ '--name "{myExport}" '
+ '--scope "providers/Microsoft.Management/managementGroups/TestMG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/delete/ExportDeleteByResourceGroup
+@try_manual
+def step_export_delete5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export delete -y '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Exports/delete/ExportDeleteBySubscription
+@try_manual
+def step_export_delete6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement export delete -y '
+ '--name "{myExport}" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Forecast/post/BillingAccountForecast
+@try_manual
+def step_forecast_usage(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Forecast/post/BillingProfileForecast
+@try_manual
+def step_forecast_usage2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Forecast/post/DepartmentForecast
+@try_manual
+def step_forecast_usage3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Forecast/post/EnrollmentAccountForecast
+@try_manual
+def step_forecast_usage4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Forecast/post/ExternalBillingAccountForecast
+@try_manual
+def step_forecast_external_cloud_provider_usage(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast external-cloud-provider-usage '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalBillingAccounts" '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"'
+ 'ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate"',
+ checks=checks)
+
+
+# EXAMPLE: /Forecast/post/ExternalSubscriptionForecast
+@try_manual
+def step_forecast_external_cloud_provider_usage2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast external-cloud-provider-usage '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalSubscriptions" '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"'
+ 'ResourceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate"',
+ checks=checks)
+
+
+# EXAMPLE: /Forecast/post/InvoiceSectionForecast
+@try_manual
+def step_forecast_usage5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Forecast/post/ResourceGroupForecast
+@try_manual
+def step_forecast_usage6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Forecast/post/SubscriptionForecast
+@try_manual
+def step_forecast_usage7(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement forecast usage '
+ '--type "Usage" '
+ '--query-filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operato'
+ 'r\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment'
+ '\\",\\"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=checks)
+
+
+# EXAMPLE: /Query/post/BillingAccountQuery-Legacy
+@try_manual
+def step_query_usage(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/70664866"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/BillingAccountQuery-Modern
+@try_manual
+def step_query_usage2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/BillingAccountQueryGrouping-Legacy
+@try_manual
+def step_query_usage3(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/70664866"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/BillingAccountQueryGrouping-Modern
+@try_manual
+def step_query_usage4(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/BillingProfileQuery-Modern
+@try_manual
+def step_query_usage5(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/BillingProfileQueryGrouping-Modern
+@try_manual
+def step_query_usage6(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/CustomerQuery-Modern
+@try_manual
+def step_query_usage7(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/CustomerQueryGrouping-Modern
+@try_manual
+def step_query_usage8(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/DepartmentQuery-Legacy
+@try_manual
+def step_query_usage9(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/DepartmentQueryGrouping-Legacy
+@try_manual
+def step_query_usage10(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/EnrollmentAccountQuery-Legacy
+@try_manual
+def step_query_usage11(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/EnrollmentAccountQueryGrouping-Legacy
+@try_manual
+def step_query_usage12(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/ExternalBillingAccountQueryList
+@try_manual
+def step_query_usage_by_external_cloud_provider_type(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage-by-external-cloud-provider-type '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalBillingAccounts" '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/ExternalSubscriptionsQuery
+@try_manual
+def step_query_usage_by_external_cloud_provider_type2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage-by-external-cloud-provider-type '
+ '--external-cloud-provider-id "100" '
+ '--external-cloud-provider-type "externalSubscriptions" '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/InvoiceSectionQuery-Modern
+@try_manual
+def step_query_usage13(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987'
+ '6"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/InvoiceSectionQueryGrouping-Modern
+@try_manual
+def step_query_usage14(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/987'
+ '6"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/ManagementGroupQuery-Legacy
+@try_manual
+def step_query_usage15(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "providers/Microsoft.Management/managementGroups/MyMgId"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/ManagementGroupQueryGrouping-Legacy
+@try_manual
+def step_query_usage16(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "providers/Microsoft.Management/managementGroups/MyMgId"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/ResourceGroupQuery-Legacy
+@try_manual
+def step_query_usage17(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/ResourceGroupQueryGrouping-Legacy
+@try_manual
+def step_query_usage18(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceType" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/SubscriptionQuery-Legacy
+@try_manual
+def step_query_usage19(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--filter "{{\\"and\\":[{{\\"or\\":[{{\\"dimension\\":{{\\"name\\":\\"ResourceLocation\\",\\"operator\\":'
+ '\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}}}},{{\\"tag\\":{{\\"name\\":\\"Environment\\",\\'
+ '"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}}}]}},{{\\"dimension\\":{{\\"name\\":\\"Resour'
+ 'ceGroup\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}}}]}}" '
+ '--timeframe "MonthToDate" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Query/post/SubscriptionQueryGrouping-Legacy
+@try_manual
+def step_query_usage20(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement query usage '
+ '--type "Usage" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--grouping name="ResourceGroup" type="Dimension" '
+ '--timeframe "TheLastMonth" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/put/CreateOrUpdatePrivateView
+@try_manual
+def step_view_create(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--granularity "Daily" '
+ '--sorting name="UsageDate" direction="Ascending" '
+ '--timeframe "MonthToDate" '
+ '--name "{myView}"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/put/ResourceGroupCreateOrUpdateView
+@try_manual
+def step_view_create2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ 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" '
+ '--aggregation "{{\\"totalCost\\":{{\\"name\\":\\"PreTaxCost\\",\\"function\\":\\"Sum\\"}}}}" '
+ '--granularity "Daily" '
+ '--sorting name="UsageDate" direction="Ascending" '
+ '--timeframe "MonthToDate" '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" '
+ '--name "{myView}"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/get/PrivateView
+@try_manual
+def step_view_show(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement view show '
+ '--name "{myView}"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/get/PrivateViewList
+@try_manual
+def step_view_list(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement view list',
+ checks=checks)
+
+
+# EXAMPLE: /Views/get/ResourceGroupView
+@try_manual
+def step_view_show2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement view show '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" '
+ '--name "{myView}"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/get/ResourceGroupViewList
+@try_manual
+def step_view_list2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement view list '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/delete/DeletePrivateView
+@try_manual
+def step_view_delete(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement view delete -y '
+ '--name "{myView2}"',
+ checks=checks)
+
+
+# EXAMPLE: /Views/delete/ResourceGroupDeleteView
+@try_manual
+def step_view_delete2(test, rg, checks=None):
+ if checks is None:
+ checks = []
+ test.cmd('az costmanagement view delete -y '
+ '--scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" '
+ '--name "{myView2}"',
+ checks=checks)
+
diff --git a/src/costmanagement/azext_costmanagement/tests/latest/preparers.py b/src/costmanagement/azext_costmanagement/tests/latest/preparers.py
deleted file mode 100644
index 3d6672de64f..00000000000
--- a/src/costmanagement/azext_costmanagement/tests/latest/preparers.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# --------------------------------------------------------------------------
-# 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.
-# --------------------------------------------------------------------------
-
-import os
-from datetime import datetime
-from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
-from azure_devtools.scenario_tests import SingleValueReplacer
-from azure.cli.testsdk.exceptions import CliTestError
-from azure.cli.testsdk.reverse_dependency import get_dummy_cli
-
-
-KEY_RESOURCE_GROUP = 'rg'
-KEY_VIRTUAL_NETWORK = 'vnet'
-KEY_VNET_SUBNET = 'subnet'
-
-
-class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer):
- def __init__(self, name_prefix='clitest.vn',
- parameter_name='virtual_network',
- resource_group_name=None,
- resource_group_key=KEY_RESOURCE_GROUP,
- dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME',
- random_name_length=24, key=KEY_VIRTUAL_NETWORK):
- if ' ' in name_prefix:
- raise CliTestError(
- 'Error: Space character in name prefix \'%s\'' % name_prefix)
- super(VirtualNetworkPreparer, self).__init__(
- name_prefix, random_name_length)
- 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.dev_setting_name = os.environ.get(dev_setting_name, None)
-
- def create_resource(self, name, **kwargs):
- 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:
- raise CliTestError("Error: No resource group configured!")
-
- tags = {'product': 'azurecli', 'cause': 'automation',
- 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')}
- if 'ENV_JOB_NAME' in os.environ:
- 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
- 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):
- # 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))
-
-
-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):
- if ' ' in name_prefix:
- raise CliTestError(
- 'Error: Space character in name prefix \'%s\'' % name_prefix)
- super(VnetSubnetPreparer, self).__init__(
- name_prefix, random_name_length)
- 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.address_prefixes = address_prefixes
- self.dev_setting_name = os.environ.get(dev_setting_name, None)
-
- def create_resource(self, name, **kwargs):
- 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:
- 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:
- 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):
- pass
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..d647e002ce5 100644
--- a/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_scenario.py
+++ b/src/costmanagement/azext_costmanagement/tests/latest/test_costmanagement_scenario.py
@@ -1,1363 +1,460 @@
-# --------------------------------------------------------------------------
-# 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.
-# --------------------------------------------------------------------------
-
-# 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)
+# --------------------------------------------------------------------------
+# 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.
+# --------------------------------------------------------------------------
+
+import os
+from azure.cli.testsdk import ScenarioTest
+from azure.cli.testsdk import ResourceGroupPreparer
+from azure.cli.testsdk import StorageAccountPreparer
+from .example_steps import step_alert_list
+from .example_steps import step_alert_list2
+from .example_steps import step_alert_list3
+from .example_steps import step_alert_list4
+from .example_steps import step_alert_list_external
+from .example_steps import step_alert_list_external2
+from .example_steps import step_alert_list5
+from .example_steps import step_alert_list6
+from .example_steps import step_alert_list7
+from .example_steps import step_alert_dismiss
+from .example_steps import step_alert_dismiss2
+from .example_steps import step_dimension_list
+from .example_steps import step_dimension_list2
+from .example_steps import step_dimension_list3
+from .example_steps import step_dimension_list4
+from .example_steps import step_dimension_list5
+from .example_steps import step_dimension_list6
+from .example_steps import step_dimension_list7
+from .example_steps import step_dimension_list8
+from .example_steps import step_dimension_list9
+from .example_steps import step_dimension_list10
+from .example_steps import step_dimension_list11
+from .example_steps import step_dimension_list12
+from .example_steps import step_dimension_list13
+from .example_steps import step_dimension_list14
+from .example_steps import step_dimension_list15
+from .example_steps import step_dimension_list16
+from .example_steps import step_dimension_list17
+from .example_steps import step_dimension_list18
+from .example_steps import step_dimension_by_external_cloud_provider_type
+from .example_steps import step_dimension_by_external_cloud_provider_type2
+from .example_steps import step_dimension_list19
+from .example_steps import step_dimension_list20
+from .example_steps import step_dimension_list21
+from .example_steps import step_dimension_list22
+from .example_steps import step_dimension_list23
+from .example_steps import step_dimension_list24
+from .example_steps import step_dimension_list25
+from .example_steps import step_dimension_list26
+from .example_steps import step_export_create
+from .example_steps import step_export_create2
+from .example_steps import step_export_create3
+from .example_steps import step_export_create4
+from .example_steps import step_export_create5
+from .example_steps import step_export_create6
+from .example_steps import step_export_show
+from .example_steps import step_export_show2
+from .example_steps import step_export_show3
+from .example_steps import step_export_show4
+from .example_steps import step_export_show5
+from .example_steps import step_export_show6
+from .example_steps import step_export_show_execution_history
+from .example_steps import step_export_show_execution_history2
+from .example_steps import step_export_show_execution_history3
+from .example_steps import step_export_show_execution_history4
+from .example_steps import step_export_show_execution_history5
+from .example_steps import step_export_show_execution_history6
+from .example_steps import step_export_list
+from .example_steps import step_export_list2
+from .example_steps import step_export_list3
+from .example_steps import step_export_list4
+from .example_steps import step_export_list5
+from .example_steps import step_export_list6
+from .example_steps import step_export_execute
+from .example_steps import step_export_execute2
+from .example_steps import step_export_execute3
+from .example_steps import step_export_execute4
+from .example_steps import step_export_execute5
+from .example_steps import step_export_execute6
+from .example_steps import step_export_delete
+from .example_steps import step_export_delete2
+from .example_steps import step_export_delete3
+from .example_steps import step_export_delete4
+from .example_steps import step_export_delete5
+from .example_steps import step_export_delete6
+from .example_steps import step_forecast_usage
+from .example_steps import step_forecast_usage2
+from .example_steps import step_forecast_usage3
+from .example_steps import step_forecast_usage4
+from .example_steps import step_forecast_external_cloud_provider_usage
+from .example_steps import step_forecast_external_cloud_provider_usage2
+from .example_steps import step_forecast_usage5
+from .example_steps import step_forecast_usage6
+from .example_steps import step_forecast_usage7
+from .example_steps import step_query_usage
+from .example_steps import step_query_usage2
+from .example_steps import step_query_usage3
+from .example_steps import step_query_usage4
+from .example_steps import step_query_usage5
+from .example_steps import step_query_usage6
+from .example_steps import step_query_usage7
+from .example_steps import step_query_usage8
+from .example_steps import step_query_usage9
+from .example_steps import step_query_usage10
+from .example_steps import step_query_usage11
+from .example_steps import step_query_usage12
+from .example_steps import step_query_usage_by_external_cloud_provider_type
+from .example_steps import step_query_usage_by_external_cloud_provider_type2
+from .example_steps import step_query_usage13
+from .example_steps import step_query_usage14
+from .example_steps import step_query_usage15
+from .example_steps import step_query_usage16
+from .example_steps import step_query_usage17
+from .example_steps import step_query_usage18
+from .example_steps import step_query_usage19
+from .example_steps import step_query_usage20
+from .example_steps import step_view_create
+from .example_steps import step_view_create2
+from .example_steps import step_view_show
+from .example_steps import step_view_list
+from .example_steps import step_view_show2
+from .example_steps import step_view_list2
+from .example_steps import step_view_delete
+from .example_steps import step_view_delete2
+from .. import (
+ try_manual,
+ raise_if,
+ calc_coverage
+)
+
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+
+# Env setup_scenario
+@try_manual
+def setup_scenario(test, rg):
+ pass
+
+
+# Env cleanup_scenario
+@try_manual
+def cleanup_scenario(test, rg):
+ pass
+
+
+# Testcase: Scenario
+@try_manual
+def call_scenario(test, rg):
+ setup_scenario(test, rg)
+ step_alert_list(test, rg, checks=[])
+ step_alert_list2(test, rg, checks=[])
+ step_alert_list3(test, rg, checks=[])
+ step_alert_list4(test, rg, checks=[])
+ step_alert_list_external(test, rg, checks=[])
+ step_alert_list_external2(test, rg, checks=[])
+ step_alert_list5(test, rg, checks=[])
+ step_alert_list6(test, rg, checks=[])
+ step_alert_list6(test, rg, checks=[])
+ step_alert_list7(test, rg, checks=[])
+ step_alert_list7(test, rg, checks=[])
+ step_alert_dismiss(test, rg, checks=[])
+ step_alert_dismiss2(test, rg, checks=[])
+ step_dimension_list(test, rg, checks=[])
+ step_dimension_list2(test, rg, checks=[])
+ step_dimension_list3(test, rg, checks=[])
+ step_dimension_list4(test, rg, checks=[])
+ step_dimension_list5(test, rg, checks=[])
+ step_dimension_list6(test, rg, checks=[])
+ step_dimension_list7(test, rg, checks=[])
+ step_dimension_list8(test, rg, checks=[])
+ step_dimension_list9(test, rg, checks=[])
+ step_dimension_list10(test, rg, checks=[])
+ step_dimension_list11(test, rg, checks=[])
+ step_dimension_list12(test, rg, checks=[])
+ step_dimension_list13(test, rg, checks=[])
+ step_dimension_list14(test, rg, checks=[])
+ step_dimension_list15(test, rg, checks=[])
+ step_dimension_list16(test, rg, checks=[])
+ step_dimension_list17(test, rg, checks=[])
+ step_dimension_list18(test, rg, checks=[])
+ step_dimension_by_external_cloud_provider_type(test, rg, checks=[])
+ step_dimension_by_external_cloud_provider_type2(test, rg, checks=[])
+ step_dimension_list19(test, rg, checks=[])
+ step_dimension_list20(test, rg, checks=[])
+ step_dimension_list21(test, rg, checks=[])
+ step_dimension_list22(test, rg, checks=[])
+ step_dimension_list23(test, rg, checks=[])
+ step_dimension_list24(test, rg, checks=[])
+ step_dimension_list25(test, rg, checks=[])
+ step_dimension_list26(test, rg, checks=[])
+ step_export_create(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("definition.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ test.check("schedule.recurrence", "Weekly", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.from", "2020-06-01T00:00:00Z", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.to", "2020-10-31T00:00:00Z", case_sensitive=False),
+ test.check("schedule.status", "Active", case_sensitive=False),
+ ])
+ step_export_create2(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("definition.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ test.check("schedule.recurrence", "Weekly", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.from", "2020-06-01T00:00:00Z", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.to", "2020-10-31T00:00:00Z", case_sensitive=False),
+ test.check("schedule.status", "Active", case_sensitive=False),
+ ])
+ step_export_create3(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("definition.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ test.check("schedule.recurrence", "Weekly", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.from", "2020-06-01T00:00:00Z", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.to", "2020-10-31T00:00:00Z", case_sensitive=False),
+ test.check("schedule.status", "Active", case_sensitive=False),
+ ])
+ step_export_create4(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("definition.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ test.check("schedule.recurrence", "Weekly", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.from", "2020-06-01T00:00:00Z", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.to", "2020-10-31T00:00:00Z", case_sensitive=False),
+ test.check("schedule.status", "Active", case_sensitive=False),
+ ])
+ step_export_create5(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("definition.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ test.check("schedule.recurrence", "Weekly", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.from", "2020-06-01T00:00:00Z", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.to", "2020-10-31T00:00:00Z", case_sensitive=False),
+ test.check("schedule.status", "Active", case_sensitive=False),
+ ])
+ step_export_create6(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("definition.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ test.check("schedule.recurrence", "Weekly", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.from", "2020-06-01T00:00:00Z", case_sensitive=False),
+ test.check("schedule.recurrencePeriod.to", "2020-10-31T00:00:00Z", case_sensitive=False),
+ test.check("schedule.status", "Active", case_sensitive=False),
+ ])
+ step_export_show(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ ])
+ step_export_show2(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ ])
+ step_export_show3(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ ])
+ step_export_show4(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ ])
+ step_export_show5(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ ])
+ step_export_show6(test, rg, checks=[
+ test.check("name", "{myExport}", case_sensitive=False),
+ test.check("definition.type", "ActualCost", case_sensitive=False),
+ test.check("deliveryInfo.destination.container", "exports", case_sensitive=False),
+ test.check("deliveryInfo.destination.resourceId", "/subscriptions/{subscription_id}/resourceGroups/{rg}/provide"
+ "rs/Microsoft.Storage/storageAccounts/{sa}", case_sensitive=False),
+ test.check("deliveryInfo.destination.rootFolderPath", "ad-hoc", case_sensitive=False),
+ ])
+ step_export_show_execution_history(test, rg, checks=[])
+ step_export_show_execution_history2(test, rg, checks=[])
+ step_export_show_execution_history3(test, rg, checks=[])
+ step_export_show_execution_history4(test, rg, checks=[])
+ step_export_show_execution_history5(test, rg, checks=[])
+ step_export_show_execution_history6(test, rg, checks=[])
+ step_export_list(test, rg, checks=[])
+ step_export_list2(test, rg, checks=[])
+ step_export_list3(test, rg, checks=[])
+ step_export_list4(test, rg, checks=[])
+ step_export_list5(test, rg, checks=[])
+ step_export_list6(test, rg, checks=[
+ test.check('length(@)', 1),
+ ])
+ step_export_execute(test, rg, checks=[])
+ step_export_execute2(test, rg, checks=[])
+ step_export_execute3(test, rg, checks=[])
+ step_export_execute4(test, rg, checks=[])
+ step_export_execute5(test, rg, checks=[])
+ step_export_execute6(test, rg, checks=[])
+ step_export_delete(test, rg, checks=[])
+ step_export_delete2(test, rg, checks=[])
+ step_export_delete3(test, rg, checks=[])
+ step_export_delete4(test, rg, checks=[])
+ step_export_delete5(test, rg, checks=[])
+ step_export_delete6(test, rg, checks=[])
+ step_forecast_usage(test, rg, checks=[])
+ step_forecast_usage2(test, rg, checks=[])
+ step_forecast_usage3(test, rg, checks=[])
+ step_forecast_usage4(test, rg, checks=[])
+ step_forecast_external_cloud_provider_usage(test, rg, checks=[])
+ step_forecast_external_cloud_provider_usage2(test, rg, checks=[])
+ step_forecast_usage5(test, rg, checks=[])
+ step_forecast_usage6(test, rg, checks=[])
+ step_forecast_usage7(test, rg, checks=[])
+ step_query_usage(test, rg, checks=[])
+ step_query_usage2(test, rg, checks=[])
+ step_query_usage3(test, rg, checks=[])
+ step_query_usage4(test, rg, checks=[])
+ step_query_usage5(test, rg, checks=[])
+ step_query_usage6(test, rg, checks=[])
+ step_query_usage7(test, rg, checks=[])
+ step_query_usage8(test, rg, checks=[])
+ step_query_usage9(test, rg, checks=[])
+ step_query_usage10(test, rg, checks=[])
+ step_query_usage11(test, rg, checks=[])
+ step_query_usage12(test, rg, checks=[])
+ step_query_usage_by_external_cloud_provider_type(test, rg, checks=[])
+ step_query_usage_by_external_cloud_provider_type2(test, rg, checks=[])
+ step_query_usage13(test, rg, checks=[])
+ step_query_usage14(test, rg, checks=[])
+ step_query_usage15(test, rg, checks=[])
+ step_query_usage16(test, rg, checks=[])
+ step_query_usage17(test, rg, checks=[])
+ step_query_usage18(test, rg, checks=[])
+ step_query_usage19(test, rg, checks=[])
+ step_query_usage20(test, rg, checks=[])
+ step_view_create(test, rg, checks=[
+ test.check("accumulated", "true", case_sensitive=False),
+ test.check("chart", "Table", case_sensitive=False),
+ test.check("displayName", "swagger Example", case_sensitive=False),
+ test.check("metric", "ActualCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.name", "PreTaxCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.function", "Sum", case_sensitive=False),
+ test.check("query..dataset.granularity", "Daily", case_sensitive=False),
+ test.check("query.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("name", "{myView}", case_sensitive=False),
+ ])
+ step_view_create2(test, rg, checks=[
+ test.check("accumulated", "true", case_sensitive=False),
+ test.check("chart", "Table", case_sensitive=False),
+ test.check("displayName", "swagger Example", case_sensitive=False),
+ test.check("metric", "ActualCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.name", "PreTaxCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.function", "Sum", case_sensitive=False),
+ test.check("query..dataset.granularity", "Daily", case_sensitive=False),
+ test.check("query.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("name", "{myView}", case_sensitive=False),
+ ])
+ step_view_show(test, rg, checks=[
+ test.check("eTag", "\"1d4ff9fe66f1d10\"", case_sensitive=False),
+ test.check("accumulated", "true", case_sensitive=False),
+ test.check("chart", "Table", case_sensitive=False),
+ test.check("displayName", "swagger Example", case_sensitive=False),
+ test.check("metric", "ActualCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.name", "PreTaxCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.function", "Sum", case_sensitive=False),
+ test.check("query..dataset.granularity", "Daily", case_sensitive=False),
+ test.check("query.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("name", "{myView}", case_sensitive=False),
+ ])
+ step_view_list(test, rg, checks=[
+ test.check('length(@)', 1),
+ ])
+ step_view_show2(test, rg, checks=[
+ test.check("eTag", "\"1d4ff9fe66f1d10\"", case_sensitive=False),
+ test.check("accumulated", "true", case_sensitive=False),
+ test.check("chart", "Table", case_sensitive=False),
+ test.check("displayName", "swagger Example", case_sensitive=False),
+ test.check("metric", "ActualCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.name", "PreTaxCost", case_sensitive=False),
+ test.check("query..dataset.aggregation.totalCost.function", "Sum", case_sensitive=False),
+ test.check("query..dataset.granularity", "Daily", case_sensitive=False),
+ test.check("query.timeframe", "MonthToDate", case_sensitive=False),
+ test.check("name", "{myView}", case_sensitive=False),
+ ])
+ step_view_list2(test, rg, checks=[
+ test.check('length(@)', 1),
+ ])
+ step_view_delete(test, rg, checks=[])
+ step_view_delete2(test, rg, checks=[])
+ cleanup_scenario(test, rg)
+
+
+# Test class for Scenario
+@try_manual
+class CostmanagementScenarioTest(ScenarioTest):
+
+ def __init__(self, *args, **kwargs):
+ super(CostmanagementScenarioTest, self).__init__(*args, **kwargs)
+ self.kwargs.update({
+ 'subscription_id': self.get_subscription_id()
+ })
+
+ self.kwargs.update({
+ 'myView': 'swaggerExample',
+ 'myView2': 'TestView',
+ 'myExport': 'TestExport',
+ })
+
+
+ @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_Scenario(self, rg):
+ call_scenario(self, rg)
+ calc_coverage(__file__)
+ raise_if()
+
diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/__init__.py
index ee0c4f36bd0..c9cfdc73e77 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/__init__.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/__init__.py
@@ -1,12 +1,12 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for
-# license information.
-#
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is
-# regenerated.
-# --------------------------------------------------------------------------
-
-__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/__init__.py
index 80154bae521..ebf3b35fe49 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 # type: ignore
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..d18f066ef2e 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_configuration.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/_configuration.py
@@ -10,8 +10,7 @@
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-
-from ._version import VERSION
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
@@ -19,6 +18,7 @@
from azure.core.credentials import TokenCredential
+VERSION = "unknown"
class CostManagementClientConfiguration(Configuration):
"""Configuration for CostManagementClient.
@@ -41,9 +41,9 @@ def __init__(
super(CostManagementClientConfiguration, self).__init__(**kwargs)
self.credential = credential
- self.api_version = "2019-11-01"
- self.credential_scopes = ['https://management.azure.com/.default']
- kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION))
+ self.api_version = "2020-06-01"
+ self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
+ kwargs.setdefault('sdk_moniker', 'costmanagementclient/{}'.format(VERSION))
self._configure(**kwargs)
def _configure(
@@ -55,6 +55,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
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..47b1bb4708a 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,34 +15,36 @@
# 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
+from .operations import ViewsOperations
+from .operations import AlertsOperations
from .operations import ForecastOperations
-from .operations import DimensionOperations
+from .operations import DimensionsOperations
from .operations import QueryOperations
-from .operations import ExportOperations
-from .operations import OperationOperations
+from .operations import Operations
+from .operations import ExportsOperations
from . import models
class CostManagementClient(object):
"""CostManagementClient.
- :ivar view: ViewOperations operations
- :vartype view: azure.mgmt.costmanagement.operations.ViewOperations
- :ivar alert: AlertOperations operations
- :vartype alert: azure.mgmt.costmanagement.operations.AlertOperations
+ :ivar views: ViewsOperations operations
+ :vartype views: cost_management_client.operations.ViewsOperations
+ :ivar alerts: AlertsOperations operations
+ :vartype alerts: cost_management_client.operations.AlertsOperations
:ivar forecast: ForecastOperations operations
- :vartype forecast: azure.mgmt.costmanagement.operations.ForecastOperations
- :ivar dimension: DimensionOperations operations
- :vartype dimension: azure.mgmt.costmanagement.operations.DimensionOperations
+ :vartype forecast: cost_management_client.operations.ForecastOperations
+ :ivar dimensions: DimensionsOperations operations
+ :vartype dimensions: cost_management_client.operations.DimensionsOperations
:ivar query: QueryOperations operations
- :vartype query: azure.mgmt.costmanagement.operations.QueryOperations
- :ivar export: ExportOperations operations
- :vartype export: azure.mgmt.costmanagement.operations.ExportOperations
- :ivar operation: OperationOperations operations
- :vartype operation: azure.mgmt.costmanagement.operations.OperationOperations
+ :vartype query: cost_management_client.operations.QueryOperations
+ :ivar operations: Operations operations
+ :vartype operations: cost_management_client.operations.Operations
+ :ivar exports: ExportsOperations operations
+ :vartype exports: cost_management_client.operations.ExportsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param str base_url: Service URL
@@ -64,19 +66,19 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
- self.view = ViewOperations(
+ self.views = ViewsOperations(
self._client, self._config, self._serialize, self._deserialize)
- self.alert = AlertOperations(
+ self.alerts = AlertsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.forecast = ForecastOperations(
self._client, self._config, self._serialize, self._deserialize)
- self.dimension = DimensionOperations(
+ self.dimensions = DimensionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.query = QueryOperations(
self._client, self._config, self._serialize, self._deserialize)
- self.export = ExportOperations(
+ self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
- self.operation = OperationOperations(
+ self.exports = ExportsOperations(
self._client, self._config, self._serialize, self._deserialize)
def close(self):
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/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/__init__.py
index 5e5f35e29c0..7dec206f98a 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/__init__.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/__init__.py
@@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from ._cost_management_client_async import CostManagementClient
+from ._cost_management_client import CostManagementClient
__all__ = ['CostManagementClient']
diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration.py
similarity index 83%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration.py
index 15d87f41cbf..d79e91b605a 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration_async.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_configuration.py
@@ -10,13 +10,13 @@
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
-
-from .._version import VERSION
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy
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 +38,9 @@ def __init__(
super(CostManagementClientConfiguration, self).__init__(**kwargs)
self.credential = credential
- self.api_version = "2019-11-01"
- self.credential_scopes = ['https://management.azure.com/.default']
- kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION))
+ self.api_version = "2020-06-01"
+ self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
+ kwargs.setdefault('sdk_moniker', 'costmanagementclient/{}'.format(VERSION))
self._configure(**kwargs)
def _configure(
@@ -51,6 +51,7 @@ def _configure(
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
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.py
similarity index 61%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_cost_management_client_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/_cost_management_client.py
index 0f81334bb70..032f535064c 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.py
@@ -6,39 +6,43 @@
# 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
-from ._configuration_async import CostManagementClientConfiguration
-from .operations_async import ViewOperations
-from .operations_async import AlertOperations
-from .operations_async import ForecastOperations
-from .operations_async import DimensionOperations
-from .operations_async import QueryOperations
-from .operations_async import ExportOperations
-from .operations_async import OperationOperations
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core.credentials_async import AsyncTokenCredential
+
+from ._configuration import CostManagementClientConfiguration
+from .operations import ViewsOperations
+from .operations import AlertsOperations
+from .operations import ForecastOperations
+from .operations import DimensionsOperations
+from .operations import QueryOperations
+from .operations import Operations
+from .operations import ExportsOperations
from .. import models
class CostManagementClient(object):
"""CostManagementClient.
- :ivar view: ViewOperations operations
- :vartype view: azure.mgmt.costmanagement.aio.operations_async.ViewOperations
- :ivar alert: AlertOperations operations
- :vartype alert: azure.mgmt.costmanagement.aio.operations_async.AlertOperations
+ :ivar views: ViewsOperations operations
+ :vartype views: cost_management_client.aio.operations.ViewsOperations
+ :ivar alerts: AlertsOperations operations
+ :vartype alerts: cost_management_client.aio.operations.AlertsOperations
:ivar forecast: ForecastOperations operations
- :vartype forecast: azure.mgmt.costmanagement.aio.operations_async.ForecastOperations
- :ivar dimension: DimensionOperations operations
- :vartype dimension: azure.mgmt.costmanagement.aio.operations_async.DimensionOperations
+ :vartype forecast: cost_management_client.aio.operations.ForecastOperations
+ :ivar dimensions: DimensionsOperations operations
+ :vartype dimensions: cost_management_client.aio.operations.DimensionsOperations
:ivar query: QueryOperations operations
- :vartype query: azure.mgmt.costmanagement.aio.operations_async.QueryOperations
- :ivar export: ExportOperations operations
- :vartype export: azure.mgmt.costmanagement.aio.operations_async.ExportOperations
- :ivar operation: OperationOperations operations
- :vartype operation: azure.mgmt.costmanagement.aio.operations_async.OperationOperations
+ :vartype query: cost_management_client.aio.operations.QueryOperations
+ :ivar operations: Operations operations
+ :vartype operations: cost_management_client.aio.operations.Operations
+ :ivar exports: ExportsOperations operations
+ :vartype exports: cost_management_client.aio.operations.ExportsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param str base_url: Service URL
@@ -59,19 +63,19 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
- self.view = ViewOperations(
+ self.views = ViewsOperations(
self._client, self._config, self._serialize, self._deserialize)
- self.alert = AlertOperations(
+ self.alerts = AlertsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.forecast = ForecastOperations(
self._client, self._config, self._serialize, self._deserialize)
- self.dimension = DimensionOperations(
+ self.dimensions = DimensionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.query = QueryOperations(
self._client, self._config, self._serialize, self._deserialize)
- self.export = ExportOperations(
+ self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
- self.operation = OperationOperations(
+ self.exports = ExportsOperations(
self._client, self._config, self._serialize, self._deserialize)
async def close(self) -> None:
diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/__init__.py
similarity index 50%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/__init__.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/__init__.py
index e2738b1b3eb..6065b201f9c 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/__init__.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/__init__.py
@@ -6,20 +6,20 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from ._view_operations_async import ViewOperations
-from ._alert_operations_async import AlertOperations
-from ._forecast_operations_async import ForecastOperations
-from ._dimension_operations_async import DimensionOperations
-from ._query_operations_async import QueryOperations
-from ._export_operations_async import ExportOperations
-from ._operation_operations_async import OperationOperations
+from ._views_operations import ViewsOperations
+from ._alerts_operations import AlertsOperations
+from ._forecast_operations import ForecastOperations
+from ._dimensions_operations import DimensionsOperations
+from ._query_operations import QueryOperations
+from ._operations import Operations
+from ._exports_operations import ExportsOperations
__all__ = [
- 'ViewOperations',
- 'AlertOperations',
+ 'ViewsOperations',
+ 'AlertsOperations',
'ForecastOperations',
- 'DimensionOperations',
+ 'DimensionsOperations',
'QueryOperations',
- 'ExportOperations',
- 'OperationOperations',
+ 'Operations',
+ 'ExportsOperations',
]
diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_alerts_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_alerts_operations.py
new file mode 100644
index 00000000000..e92dacafb7b
--- /dev/null
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_alerts_operations.py
@@ -0,0 +1,325 @@
+# 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.
+# --------------------------------------------------------------------------
+from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models
+
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class AlertsOperations:
+ """AlertsOperations async operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~cost_management_client.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer) -> None:
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ async def list(
+ self,
+ scope: str,
+ **kwargs
+ ) -> "models.AlertsResult":
+ """Lists the alerts for scope defined.
+
+ :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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
+
+ # Construct 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')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ 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('AlertsResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
+
+ # 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'] = self._serialize.header("accept", accept, 'str')
+
+ 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,
+ parameters: "models.DismissAlertPayload",
+ **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 parameters: Parameters supplied to the Dismiss Alert operation.
+ :type parameters: ~cost_management_client.models.DismissAlertPayload
+ :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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'] = self._serialize.header("accept", accept, 'str')
+
+ 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,
+ external_cloud_provider_type: Union[str, "models.ExternalCloudProviderType"],
+ external_cloud_provider_id: str,
+ **kwargs
+ ) -> "models.AlertsResult":
+ """Lists the Alerts for external cloud provider type defined.
+
+ :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 ~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: ~cost_management_client.models.AlertsResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertsResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
+
+ # Construct 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'),
+ }
+ 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'] = self._serialize.header("accept", accept, 'str')
+
+ 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('AlertsResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ 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/_dimensions_operations.py
similarity index 55%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_dimension_operations_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_dimensions_operations.py
index 9e7580d0894..14545535ba8 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/_dimensions_operations.py
@@ -5,11 +5,11 @@
# 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
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -19,14 +19,14 @@
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class DimensionOperations:
- """DimensionOperations async operations.
+class DimensionsOperations:
+ """DimensionsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,76 +49,80 @@ 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
- '/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.
+ '/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.
:type scope: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
- properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
+ properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
- default, data is not included when listing dimensions.
+ default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: 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.
+ 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.
:type skiptoken: str
: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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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)
+
+ request = self._client.get(url, query_parameters, header_parameters)
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)
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
@@ -144,7 +148,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,67 +159,71 @@ 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
+ dimension/query operations. This includes 'externalSubscriptions' for linked account and
+ 'externalBillingAccounts' for consolidated account.
+ :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.
+ '{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
- properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
+ properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
- default, data is not included when listing dimensions.
+ default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: 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.
+ 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.
:type skiptoken: str
: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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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)
+
+ request = self._client.get(url, query_parameters, header_parameters)
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)
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
@@ -241,4 +249,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/_exports_operations.py
similarity index 72%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_export_operations_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_exports_operations.py
index 4d14c7ab9a2..fdd630d0044 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/_exports_operations.py
@@ -5,10 +5,10 @@
# 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
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -18,14 +18,14 @@
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class ExportOperations:
- """ExportOperations async operations.
+class ExportsOperations:
+ """ExportsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,11 +43,12 @@ 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.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -64,17 +65,24 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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,12 +91,13 @@ 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]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -101,20 +110,21 @@ 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.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -133,17 +143,24 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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,12 +170,13 @@ 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]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -171,32 +189,23 @@ 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,
- 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,
- destination: Optional["models.ExportDeliveryDestination"] = None,
- status: Optional[Union[str, "models.StatusType"]] = None,
- recurrence: Optional[Union[str, "models.RecurrenceType"]] = None,
- recurrence_period: Optional["models.ExportRecurrencePeriod"] = None,
+ parameters: "models.Export",
**kwargs
) -> "models.Export":
- """The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
+ """The operation to create or update a export. Update operation requires latest eTag to be set in
+ the request. You may obtain the latest eTag by performing a get operation. Create operation
+ does not require eTag.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -215,52 +224,24 @@ async def create_or_update(
:type scope: str
:param export_name: Export Name.
:type export_name: str
- :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
- 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
- :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
- :param recurrence: The schedule recurrence.
- :type recurrence: str or ~azure.mgmt.costmanagement.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
+ :param parameters: Parameters supplied to the CreateOrUpdate Export operation.
+ :type parameters: ~cost_management_client.models.Export
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -274,14 +255,12 @@ async def create_or_update(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'Export')
+ body_content = self._serialize.body(parameters, 'Export')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -290,7 +269,6 @@ async def create_or_update(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('Export', pipeline_response)
@@ -298,10 +276,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,
@@ -311,7 +289,7 @@ async def delete(
) -> None:
"""The operation to delete a export.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -331,16 +309,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -353,8 +335,8 @@ async def delete(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -365,9 +347,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,9 +357,9 @@ 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
+ :param scope: The scope associated with 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
@@ -397,16 +379,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -419,8 +405,8 @@ async def execute(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.post(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -431,9 +417,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,9 +427,9 @@ 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
+ :param scope: The scope associated with 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
@@ -463,16 +449,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -485,9 +475,8 @@ async def get_execution_history(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -500,7 +489,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/_forecast_operations.py
similarity index 56%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_forecast_operations_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_forecast_operations.py
index 50b4a7cf64c..bdc05037e1d 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/_forecast_operations.py
@@ -5,10 +5,10 @@
# 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
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -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.
@@ -43,16 +43,8 @@ def __init__(self, client, config, serializer, deserializer) -> None:
async def usage(
self,
scope: str,
- type: Union[str, "models.ForecastType"],
- timeframe: Union[str, "models.ForecastTimeframeType"],
+ parameters: "models.ForecastDefinition",
filter: Optional[str] = None,
- time_period: Optional["models.QueryTimePeriod"] = None,
- 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,
- query_filter: Optional["models.QueryFilter"] = None,
**kwargs
) -> "models.QueryResult":
"""Lists the forecast charges for scope defined.
@@ -74,47 +66,28 @@ async def usage(
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
- :param type: The type of the forecast.
- :type type: str or ~azure.mgmt.costmanagement.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
+ :param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
+ :type parameters: ~cost_management_client.models.ForecastDefinition
: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
- :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
- 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
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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),
}
@@ -129,14 +102,12 @@ async def usage(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'ForecastDefinition')
+ body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -148,25 +119,17 @@ 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,
external_cloud_provider_type: Union[str, "models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
- type: Union[str, "models.ForecastType"],
- timeframe: Union[str, "models.ForecastTimeframeType"],
+ parameters: "models.ForecastDefinition",
filter: Optional[str] = None,
- time_period: Optional["models.QueryTimePeriod"] = None,
- 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,
- query_filter: Optional["models.QueryFilter"] = None,
**kwargs
) -> "models.QueryResult":
"""Lists the forecast charges for external cloud provider type defined.
@@ -174,51 +137,32 @@ 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
- :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
+ :param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
+ :type parameters: ~cost_management_client.models.ForecastDefinition
: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
- :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
- 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
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -234,14 +178,12 @@ async def external_cloud_provider_usage(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'ForecastDefinition')
+ body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -253,7 +195,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/_operations.py
similarity index 69%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_operation_operations_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_operations.py
index 3100d06cf5b..2c3594349a6 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/_operations.py
@@ -5,11 +5,11 @@
# 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
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -19,14 +19,14 @@
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class OperationOperations:
- """OperationOperations async operations.
+class Operations:
+ """Operations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,35 +44,39 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
@@ -98,4 +102,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/_alert_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_query_operations.py
similarity index 60%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_alert_operations_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_query_operations.py
index db9ca7b4425..638ea80a6cd 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/_query_operations.py
@@ -8,7 +8,7 @@
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -18,14 +18,14 @@
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class AlertOperations:
- """AlertOperations async operations.
+class QueryOperations:
+ """QueryOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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.
@@ -40,14 +40,15 @@ def __init__(self, client, config, serializer, deserializer) -> None:
self._deserialize = deserializer
self._config = config
- async def list(
+ async def usage(
self,
scope: str,
+ parameters: "models.QueryDefinition",
**kwargs
- ) -> "models.AlertsResult":
- """Lists the alerts for scope defined.
+ ) -> "models.QueryResult":
+ """Query the usage data for scope defined.
- :param scope: The scope associated with alerts operations. This includes
+ :param scope: 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
@@ -64,17 +65,24 @@ async def list(
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
+ :param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
+ :type parameters: ~cost_management_client.models.QueryDefinition
: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: 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.AlertsResult"]
- error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError})
- api_version = "2019-11-01"
+ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
# Construct URL
- url = self.list.metadata['url']
+ url = self.usage.metadata['url'] # type: ignore
path_format_arguments = {
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
}
@@ -86,10 +94,13 @@ async def list(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'QueryDefinition')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -98,40 +109,48 @@ async def list(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize('AlertsResult', pipeline_response)
+ deserialized = self._deserialize('QueryResult', pipeline_response)
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {})
return deserialized
- list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'}
+ usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore
- async def list_external(
+ async def usage_by_external_cloud_provider_type(
self,
external_cloud_provider_type: Union[str, "models.ExternalCloudProviderType"],
external_cloud_provider_id: str,
+ parameters: "models.QueryDefinition",
**kwargs
- ) -> "models.AlertsResult":
- """Lists the Alerts for external cloud provider type defined.
+ ) -> "models.QueryResult":
+ """Query the usage data for external cloud provider type defined.
: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 parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
+ :type parameters: ~cost_management_client.models.QueryDefinition
: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: 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.AlertsResult"]
- error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError})
- api_version = "2019-11-01"
+ cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "application/json"
# Construct URL
- url = self.list_external.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'),
@@ -144,10 +163,13 @@ async def list_external(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
- request = self._client.get(url, query_parameters, header_parameters)
+ body_content_kwargs = {} # type: Dict[str, Any]
+ body_content = self._serialize.body(parameters, 'QueryDefinition')
+ body_content_kwargs['content'] = body_content
+ request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -156,10 +178,10 @@ async def list_external(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize('AlertsResult', pipeline_response)
+ deserialized = self._deserialize('QueryResult', 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'}
+ 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/_views_operations.py
similarity index 62%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_view_operations_async.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations/_views_operations.py
index c606c6c32da..2a72432b911 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/_views_operations.py
@@ -5,11 +5,11 @@
# 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, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -19,14 +19,14 @@
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-class ViewOperations:
- """ViewOperations async operations.
+class ViewsOperations:
+ """ViewsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,35 +44,39 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
@@ -98,63 +102,67 @@ 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
- '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.
+ '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.
: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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
@@ -180,7 +188,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 +200,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
}
@@ -213,9 +225,8 @@ async def get(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -228,85 +239,41 @@ 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,
view_name: str,
- e_tag: Optional[str] = None,
- display_name: Optional[str] = None,
- scope: Optional[str] = None,
- 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,
- timeframe: Optional[Union[str, "models.ReportTimeframeType"]] = None,
- time_period: Optional["models.ReportConfigTimePeriod"] = None,
- dataset: Optional["models.ReportConfigDataset"] = None,
+ parameters: "models.View",
**kwargs
) -> "models.View":
- """The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
+ """The operation to create or update a view. Update operation requires latest eTag to be set in
+ the request. You may obtain the latest eTag by performing a get operation. Create operation
+ does not require eTag.
:param view_name: View name.
:type view_name: str
- :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 display_name: User input name of the view. Required.
- :type display_name: str
- :param scope: 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.
- :type scope: str
- :param chart: Chart type of the main view in Cost Analysis. Required.
- :type chart: str or ~azure.mgmt.costmanagement.models.ChartType
- :param accumulated: Show costs accumulated over time.
- :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType
- :param metric: Metric to use when displaying costs.
- :type metric: str or ~azure.mgmt.costmanagement.models.MetricType
- :param kpis: List of KPIs to show in Cost Analysis UI.
- :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties]
- :param pivots: Configuration of 3 sub-views in the Cost Analysis UI.
- :type pivots: list[~azure.mgmt.costmanagement.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
- :param time_period: Has time period for pulling data for the report.
- :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
- :param dataset: Has definition for data in this report config.
- :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset
+ :param parameters: Parameters supplied to the CreateOrUpdate View operation.
+ :type parameters: ~cost_management_client.models.View
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
}
@@ -319,14 +286,12 @@ async def create_or_update(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'View')
+ body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -335,7 +300,6 @@ async def create_or_update(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
@@ -343,10 +307,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 +322,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
}
@@ -379,8 +347,8 @@ async def delete(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -391,9 +359,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 +392,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -446,9 +418,8 @@ async def get_by_scope(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -461,29 +432,21 @@ 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,
scope: str,
view_name: str,
- e_tag: Optional[str] = None,
- display_name: Optional[str] = None,
- view_properties_scope: Optional[str] = None,
- 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,
- timeframe: Optional[Union[str, "models.ReportTimeframeType"]] = None,
- time_period: Optional["models.ReportConfigTimePeriod"] = None,
- dataset: Optional["models.ReportConfigDataset"] = None,
+ parameters: "models.View",
**kwargs
) -> "models.View":
- """The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
+ """The operation to create or update a view. Update operation requires latest eTag to be set in
+ the request. You may obtain the latest eTag by performing a get operation. Create operation
+ does not require eTag.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
@@ -505,60 +468,24 @@ async def create_or_update_by_scope(
:type scope: str
:param view_name: View name.
:type view_name: str
- :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 display_name: User input name of the view. Required.
- :type display_name: str
- :param view_properties_scope: 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.
- :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
- :param accumulated: Show costs accumulated over time.
- :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType
- :param metric: Metric to use when displaying costs.
- :type metric: str or ~azure.mgmt.costmanagement.models.MetricType
- :param kpis: List of KPIs to show in Cost Analysis UI.
- :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties]
- :param pivots: Configuration of 3 sub-views in the Cost Analysis UI.
- :type pivots: list[~azure.mgmt.costmanagement.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
- :param time_period: Has time period for pulling data for the report.
- :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
- :param dataset: Has definition for data in this report config.
- :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset
+ :param parameters: Parameters supplied to the CreateOrUpdate View operation.
+ :type parameters: ~cost_management_client.models.View
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -572,14 +499,12 @@ async def create_or_update_by_scope(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'View')
+ body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -588,7 +513,6 @@ async def create_or_update_by_scope(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
@@ -596,10 +520,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 +554,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -652,8 +580,8 @@ async def delete_by_scope(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -664,6 +592,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/aio/operations_async/_query_operations_async.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_query_operations_async.py
deleted file mode 100644
index 994fc5fa69f..00000000000
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/aio/operations_async/_query_operations_async.py
+++ /dev/null
@@ -1,233 +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.
-# --------------------------------------------------------------------------
-from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
-import warnings
-
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from ... import models
-
-T = TypeVar('T')
-ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class QueryOperations:
- """QueryOperations async operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- 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
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
- """
-
- models = models
-
- def __init__(self, client, config, serializer, deserializer) -> None:
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
-
- async def usage(
- self,
- scope: str,
- type: Union[str, "models.ExportType"],
- 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,
- filter: Optional["models.QueryFilter"] = None,
- **kwargs
- ) -> "models.QueryResult":
- """Query the usage data for scope defined.
-
- :param scope: 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.
- :type scope: 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
- 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
- :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
- :raises: ~azure.core.exceptions.HttpResponseError
- """
- cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"]
- error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError})
-
- _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter)
- api_version = "2019-11-01"
- content_type = kwargs.pop("content_type", "application/json")
-
- # Construct URL
- url = self.usage.metadata['url']
- 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')
-
- # 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, 'QueryDefinition')
- body_content_kwargs['content'] = body_content
- request = self._client.post(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('QueryResult', pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
- usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'}
-
- async def usage_by_external_cloud_provider_type(
- self,
- external_cloud_provider_type: Union[str, "models.ExternalCloudProviderType"],
- external_cloud_provider_id: str,
- type: Union[str, "models.ExportType"],
- 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,
- filter: Optional["models.QueryFilter"] = None,
- **kwargs
- ) -> "models.QueryResult":
- """Query the usage data for external cloud provider type defined.
-
- :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
- :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
- :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
- :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
- :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
- :raises: ~azure.core.exceptions.HttpResponseError
- """
- cls = kwargs.pop('cls', None) # type: ClsType["models.QueryResult"]
- error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError})
-
- _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter)
- api_version = "2019-11-01"
- content_type = kwargs.pop("content_type", "application/json")
-
- # Construct URL
- url = self.usage_by_external_cloud_provider_type.metadata['url']
- 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')
-
- # 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, 'QueryDefinition')
- body_content_kwargs['content'] = body_content
- request = self._client.post(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('QueryResult', pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
- usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'}
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..b12f8ba91ce 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/__init__.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/models/__init__.py
@@ -14,15 +14,23 @@
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 ExportDataset
+ from ._models_py3 import ExportDatasetConfiguration
+ from ._models_py3 import ExportDefinition
from ._models_py3 import ExportDeliveryDestination
+ from ._models_py3 import ExportDeliveryInfo
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 ExportSchedule
+ from ._models_py3 import ExportTimePeriod
+ from ._models_py3 import ForecastDataset
from ._models_py3 import ForecastDefinition
from ._models_py3 import KpiProperties
from ._models_py3 import Operation
@@ -33,6 +41,7 @@
from ._models_py3 import QueryAggregation
from ._models_py3 import QueryColumn
from ._models_py3 import QueryComparisonExpression
+ from ._models_py3 import QueryDataset
from ._models_py3 import QueryDatasetConfiguration
from ._models_py3 import QueryDefinition
from ._models_py3 import QueryFilter
@@ -43,7 +52,10 @@
from ._models_py3 import ReportConfigComparisonExpression
from ._models_py3 import ReportConfigDataset
from ._models_py3 import ReportConfigDatasetConfiguration
+ from ._models_py3 import ReportConfigDatasetautogenerated
+ from ._models_py3 import ReportConfigDefinition
from ._models_py3 import ReportConfigFilter
+ from ._models_py3 import ReportConfigFilterautogenerated
from ._models_py3 import ReportConfigGrouping
from ._models_py3 import ReportConfigSorting
from ._models_py3 import ReportConfigTimePeriod
@@ -58,15 +70,23 @@
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 ExportDataset # type: ignore
+ from ._models import ExportDatasetConfiguration # type: ignore
+ from ._models import ExportDefinition # type: ignore
from ._models import ExportDeliveryDestination # type: ignore
+ from ._models import ExportDeliveryInfo # 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 ExportSchedule # type: ignore
+ from ._models import ExportTimePeriod # type: ignore
+ from ._models import ForecastDataset # type: ignore
from ._models import ForecastDefinition # type: ignore
from ._models import KpiProperties # type: ignore
from ._models import Operation # type: ignore
@@ -77,6 +97,7 @@
from ._models import QueryAggregation # type: ignore
from ._models import QueryColumn # type: ignore
from ._models import QueryComparisonExpression # type: ignore
+ from ._models import QueryDataset # type: ignore
from ._models import QueryDatasetConfiguration # type: ignore
from ._models import QueryDefinition # type: ignore
from ._models import QueryFilter # type: ignore
@@ -87,7 +108,10 @@
from ._models import ReportConfigComparisonExpression # type: ignore
from ._models import ReportConfigDataset # type: ignore
from ._models import ReportConfigDatasetConfiguration # type: ignore
+ from ._models import ReportConfigDatasetautogenerated # type: ignore
+ from ._models import ReportConfigDefinition # type: ignore
from ._models import ReportConfigFilter # type: ignore
+ from ._models import ReportConfigFilterautogenerated # type: ignore
from ._models import ReportConfigGrouping # type: ignore
from ._models import ReportConfigSorting # type: ignore
from ._models import ReportConfigTimePeriod # type: ignore
@@ -97,6 +121,13 @@
from ._cost_management_client_enums import (
AccumulatedType,
+ AlertCategory,
+ AlertCriteria,
+ AlertOperator,
+ AlertSource,
+ AlertStatus,
+ AlertTimeGrainType,
+ AlertType,
ChartType,
ExecutionStatus,
ExecutionType,
@@ -104,16 +135,21 @@
ExternalCloudProviderType,
ForecastTimeframeType,
ForecastType,
+ FormatType,
+ FunctionType,
+ GranularityType,
KpiType,
MetricType,
OperatorType,
PivotType,
QueryColumnType,
+ QueryOperatorType,
RecurrenceType,
ReportConfigColumnType,
ReportConfigSortingDirection,
ReportGranularityType,
ReportTimeframeType,
+ ReportType,
StatusType,
TimeframeType,
)
@@ -126,15 +162,23 @@
'CommonExportProperties',
'Dimension',
'DimensionsListResult',
+ 'DismissAlertPayload',
'ErrorDetails',
'ErrorResponse',
'Export',
+ 'ExportDataset',
+ 'ExportDatasetConfiguration',
+ 'ExportDefinition',
'ExportDeliveryDestination',
+ 'ExportDeliveryInfo',
'ExportExecution',
'ExportExecutionListResult',
'ExportListResult',
'ExportProperties',
'ExportRecurrencePeriod',
+ 'ExportSchedule',
+ 'ExportTimePeriod',
+ 'ForecastDataset',
'ForecastDefinition',
'KpiProperties',
'Operation',
@@ -145,6 +189,7 @@
'QueryAggregation',
'QueryColumn',
'QueryComparisonExpression',
+ 'QueryDataset',
'QueryDatasetConfiguration',
'QueryDefinition',
'QueryFilter',
@@ -155,7 +200,10 @@
'ReportConfigComparisonExpression',
'ReportConfigDataset',
'ReportConfigDatasetConfiguration',
+ 'ReportConfigDatasetautogenerated',
+ 'ReportConfigDefinition',
'ReportConfigFilter',
+ 'ReportConfigFilterautogenerated',
'ReportConfigGrouping',
'ReportConfigSorting',
'ReportConfigTimePeriod',
@@ -163,6 +211,13 @@
'View',
'ViewListResult',
'AccumulatedType',
+ 'AlertCategory',
+ 'AlertCriteria',
+ 'AlertOperator',
+ 'AlertSource',
+ 'AlertStatus',
+ 'AlertTimeGrainType',
+ 'AlertType',
'ChartType',
'ExecutionStatus',
'ExecutionType',
@@ -170,16 +225,21 @@
'ExternalCloudProviderType',
'ForecastTimeframeType',
'ForecastType',
+ 'FormatType',
+ 'FunctionType',
+ 'GranularityType',
'KpiType',
'MetricType',
'OperatorType',
'PivotType',
'QueryColumnType',
+ 'QueryOperatorType',
'RecurrenceType',
'ReportConfigColumnType',
'ReportConfigSortingDirection',
'ReportGranularityType',
'ReportTimeframeType',
+ 'ReportType',
'StatusType',
'TimeframeType',
]
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..884450e0a1c 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
@@ -6,169 +6,298 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from enum import Enum
-
-class AccumulatedType(str, Enum):
+from enum import Enum, EnumMeta
+from six import with_metaclass
+
+class _CaseInsensitiveEnumMeta(EnumMeta):
+ def __getitem__(self, name):
+ return super().__getitem__(name.upper())
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+ """
+ try:
+ return cls._member_map_[name.upper()]
+ except KeyError:
+ raise AttributeError(name)
+
+
+class AccumulatedType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Show costs accumulated over time.
"""
- true = "true"
- false = "false"
+ TRUE = "true"
+ FALSE = "false"
+
+class AlertCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Alert category
+ """
+
+ COST = "Cost"
+ USAGE = "Usage"
+ BILLING = "Billing"
+ SYSTEM = "System"
+
+class AlertCriteria(with_metaclass(_CaseInsensitiveEnumMeta, 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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """operator used to compare currentSpend with amount
+ """
-class ChartType(str, Enum):
+ 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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """Source of alert
+ """
+
+ PRESET = "Preset"
+ USER = "User"
+
+class AlertStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """alert status
+ """
+
+ NONE = "None"
+ ACTIVE = "Active"
+ OVERRIDDEN = "Overridden"
+ RESOLVED = "Resolved"
+ DISMISSED = "Dismissed"
+
+class AlertTimeGrainType(with_metaclass(_CaseInsensitiveEnumMeta, 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(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """type of alert
+ """
+
+ BUDGET = "Budget"
+ INVOICE = "Invoice"
+ CREDIT = "Credit"
+ QUOTA = "Quota"
+ GENERAL = "General"
+ X_CLOUD = "xCloud"
+ BUDGET_FORECAST = "BudgetForecast"
+
+class ChartType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Chart type of the main view in Cost Analysis. Required.
"""
- area = "Area"
- line = "Line"
- stacked_column = "StackedColumn"
- grouped_column = "GroupedColumn"
- table = "Table"
+ AREA = "Area"
+ LINE = "Line"
+ STACKED_COLUMN = "StackedColumn"
+ GROUPED_COLUMN = "GroupedColumn"
+ TABLE = "Table"
-class ExecutionStatus(str, Enum):
- """The status of the export execution.
+class ExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The last known status of the export execution.
"""
- queued = "Queued"
- in_progress = "InProgress"
- completed = "Completed"
- failed = "Failed"
- timeout = "Timeout"
- new_data_not_available = "NewDataNotAvailable"
- data_not_available = "DataNotAvailable"
+ QUEUED = "Queued"
+ IN_PROGRESS = "InProgress"
+ COMPLETED = "Completed"
+ FAILED = "Failed"
+ TIMEOUT = "Timeout"
+ NEW_DATA_NOT_AVAILABLE = "NewDataNotAvailable"
+ DATA_NOT_AVAILABLE = "DataNotAvailable"
-class ExecutionType(str, Enum):
+class ExecutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of the export execution.
"""
- on_demand = "OnDemand"
- scheduled = "Scheduled"
+ ON_DEMAND = "OnDemand"
+ SCHEDULED = "Scheduled"
-class ExportType(str, Enum):
+class ExportType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of the query.
"""
- usage = "Usage"
- actual_cost = "ActualCost"
- amortized_cost = "AmortizedCost"
+ USAGE = "Usage"
+ ACTUAL_COST = "ActualCost"
+ AMORTIZED_COST = "AmortizedCost"
-class ExternalCloudProviderType(str, Enum):
+class ExternalCloudProviderType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
- external_subscriptions = "externalSubscriptions"
- external_billing_accounts = "externalBillingAccounts"
+ EXTERNAL_SUBSCRIPTIONS = "externalSubscriptions"
+ EXTERNAL_BILLING_ACCOUNTS = "externalBillingAccounts"
-class ForecastTimeframeType(str, Enum):
+class ForecastTimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The time frame for pulling data for the forecast. If custom, then a specific time period must
be provided.
"""
- month_to_date = "MonthToDate"
- billing_month_to_date = "BillingMonthToDate"
- the_last_month = "TheLastMonth"
- the_last_billing_month = "TheLastBillingMonth"
- week_to_date = "WeekToDate"
- custom = "Custom"
+ MONTH_TO_DATE = "MonthToDate"
+ BILLING_MONTH_TO_DATE = "BillingMonthToDate"
+ THE_LAST_MONTH = "TheLastMonth"
+ THE_LAST_BILLING_MONTH = "TheLastBillingMonth"
+ WEEK_TO_DATE = "WeekToDate"
+ CUSTOM = "Custom"
-class ForecastType(str, Enum):
+class ForecastType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of the forecast.
"""
- usage = "Usage"
- actual_cost = "ActualCost"
- amortized_cost = "AmortizedCost"
+ USAGE = "Usage"
+ ACTUAL_COST = "ActualCost"
+ AMORTIZED_COST = "AmortizedCost"
+
+class FormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The format of the export being delivered. Currently only 'Csv' is supported.
+ """
+
+ CSV = "Csv"
+
+class FunctionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The name of the aggregation function to use.
+ """
+
+ SUM = "Sum"
+
+class GranularityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The granularity of rows in the forecast.
+ """
+
+ DAILY = "Daily"
-class KpiType(str, Enum):
+class KpiType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""KPI type (Forecast, Budget).
"""
- forecast = "Forecast"
- budget = "Budget"
+ FORECAST = "Forecast"
+ BUDGET = "Budget"
-class MetricType(str, Enum):
+class MetricType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Metric to use when displaying costs.
"""
- actual_cost = "ActualCost"
- amortized_cost = "AmortizedCost"
- ahub = "AHUB"
+ ACTUAL_COST = "ActualCost"
+ AMORTIZED_COST = "AmortizedCost"
+ AHUB = "AHUB"
-class OperatorType(str, Enum):
+class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The operator to use for comparison.
"""
- in_enum = "In"
- contains = "Contains"
+ IN_ENUM = "In"
+ CONTAINS = "Contains"
-class PivotType(str, Enum):
+class PivotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Data type to show in view.
"""
- dimension = "Dimension"
- tag_key = "TagKey"
+ DIMENSION = "Dimension"
+ TAG_KEY = "TagKey"
-class QueryColumnType(str, Enum):
+class QueryColumnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of the column in the export.
"""
- tag = "Tag"
- dimension = "Dimension"
+ TAG = "Tag"
+ DIMENSION = "Dimension"
+
+class QueryOperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The operator to use for comparison.
+ """
-class RecurrenceType(str, Enum):
+ IN_ENUM = "In"
+
+class RecurrenceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The schedule recurrence.
"""
- daily = "Daily"
- weekly = "Weekly"
- monthly = "Monthly"
- annually = "Annually"
+ DAILY = "Daily"
+ WEEKLY = "Weekly"
+ MONTHLY = "Monthly"
+ ANNUALLY = "Annually"
-class ReportConfigColumnType(str, Enum):
+class ReportConfigColumnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The type of the column in the report.
"""
- tag = "Tag"
- dimension = "Dimension"
+ TAG = "Tag"
+ DIMENSION = "Dimension"
-class ReportConfigSortingDirection(str, Enum):
+class ReportConfigSortingDirection(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Direction of sort.
"""
- ascending = "Ascending"
- descending = "Descending"
+ ASCENDING = "Ascending"
+ DESCENDING = "Descending"
-class ReportGranularityType(str, Enum):
+class ReportGranularityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The granularity of rows in the report.
"""
- daily = "Daily"
- monthly = "Monthly"
+ DAILY = "Daily"
+ MONTHLY = "Monthly"
-class ReportTimeframeType(str, Enum):
+class ReportTimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The time frame for pulling data for the report. If custom, then a specific time period must be
provided.
"""
- week_to_date = "WeekToDate"
- month_to_date = "MonthToDate"
- year_to_date = "YearToDate"
- custom = "Custom"
+ WEEK_TO_DATE = "WeekToDate"
+ MONTH_TO_DATE = "MonthToDate"
+ YEAR_TO_DATE = "YearToDate"
+ CUSTOM = "Custom"
+
+class ReportType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """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.
+ """
+
+ USAGE = "Usage"
-class StatusType(str, Enum):
- """The status of the schedule. Whether active or not. If inactive, the export's scheduled
- execution is paused.
+class StatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
+ """The status of the export's schedule. If 'Inactive', the export's schedule is paused.
"""
- active = "Active"
- inactive = "Inactive"
+ ACTIVE = "Active"
+ INACTIVE = "Inactive"
-class TimeframeType(str, Enum):
+class TimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""The time frame for pulling data for the query. If custom, then a specific time period must be
provided.
"""
- month_to_date = "MonthToDate"
- billing_month_to_date = "BillingMonthToDate"
- the_last_month = "TheLastMonth"
- the_last_billing_month = "TheLastBillingMonth"
- week_to_date = "WeekToDate"
- custom = "Custom"
+ MONTH_TO_DATE = "MonthToDate"
+ BILLING_MONTH_TO_DATE = "BillingMonthToDate"
+ THE_LAST_MONTH = "TheLastMonth"
+ THE_LAST_BILLING_MONTH = "TheLastBillingMonth"
+ WEEK_TO_DATE = "WeekToDate"
+ CUSTOM = "Custom"
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..67660b86f17 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,18 @@ 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 source: Source of alert. Possible values include: "Preset", "User".
+ :type source: str or ~cost_management_client.models.AlertSource
:param details: Alert details.
- :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails
+ :type details: ~cost_management_client.models.AlertPropertiesDetails
: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.
@@ -133,12 +134,18 @@ def __init__(
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 = {
@@ -160,8 +167,9 @@ def __init__(
class AlertPropertiesDetails(msrest.serialization.Model):
"""Alert details.
- :param time_grain_type: Type of timegrain cadence.
- :type time_grain_type: 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.
@@ -176,8 +184,9 @@ class AlertPropertiesDetails(msrest.serialization.Model):
: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 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.
@@ -242,7 +251,7 @@ class AlertsResult(msrest.serialization.Model):
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,73 +282,44 @@ 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".
- :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
- 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".
- :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 destination: Required. Has destination for the export being delivered.
- :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination
+ :param format: The format of the export being delivered. Currently only 'Csv' is supported.
+ Possible values include: "Csv".
+ :type format: str or ~cost_management_client.models.FormatType
+ :param delivery_info: Required. Has delivery information for the export.
+ :type delivery_info: ~cost_management_client.models.ExportDeliveryInfo
+ :param definition: Required. Has the definition for the export.
+ :type definition: ~cost_management_client.models.ExportDefinition
+ :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
"""
_validation = {
- 'format': {'constant': True},
- 'type': {'required': True},
- 'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
- 'destination': {'required': True},
+ 'delivery_info': {'required': True},
+ 'definition': {'required': True},
+ 'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
'format': {'key': 'format', 'type': 'str'},
- 'type': {'key': 'definition.type', 'type': 'str'},
- 'timeframe': {'key': 'definition.timeframe', 'type': 'str'},
- 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'},
- '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'},
- 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'},
+ 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
+ 'definition': {'key': 'definition', 'type': 'ExportDefinition'},
+ 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'},
+ 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'},
}
- format = "Csv"
- granularity = "Daily"
-
def __init__(
self,
**kwargs
):
super(CommonExportProperties, self).__init__(**kwargs)
- 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']
+ self.format = kwargs.get('format', None)
+ self.delivery_info = kwargs['delivery_info']
+ self.definition = kwargs['definition']
+ self.run_history = kwargs.get('run_history', None)
+ self.next_run_time_estimate = None
class Dimension(Resource):
@@ -428,7 +408,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 +427,66 @@ 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 details: Alert details.
+ :type details: ~cost_management_client.models.AlertPropertiesDetails
+ :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
+ """
+
+ _attribute_map = {
+ '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'},
+ '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'},
+ }
+
+ 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.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)
+ 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)
+
+
class ErrorDetails(msrest.serialization.Model):
"""The details of the error.
@@ -478,19 +518,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 +586,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,51 +599,27 @@ 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".
- :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
- 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".
- :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 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
- :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
- "Monthly", "Annually".
- :type recurrence: str or ~azure.mgmt.costmanagement.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
+ :param format: The format of the export being delivered. Currently only 'Csv' is supported.
+ Possible values include: "Csv".
+ :type format: str or ~cost_management_client.models.FormatType
+ :param delivery_info: Has delivery information for the export.
+ :type delivery_info: ~cost_management_client.models.ExportDeliveryInfo
+ :param definition: Has the definition for the export.
+ :type definition: ~cost_management_client.models.ExportDefinition
+ :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 schedule: Has schedule information for the export.
+ :type schedule: ~cost_management_client.models.ExportSchedule
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
- 'format': {'constant': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
+ 'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
@@ -612,39 +628,111 @@ class Export(ProxyResource):
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'format': {'key': 'properties.format', 'type': 'str'},
- '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'},
- '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'},
- 'destination': {'key': 'properties.deliveryInfo.destination', 'type': 'ExportDeliveryDestination'},
- 'status': {'key': 'properties.schedule.status', 'type': 'str'},
- 'recurrence': {'key': 'properties.schedule.recurrence', 'type': 'str'},
- 'recurrence_period': {'key': 'properties.schedule.recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
- }
-
- format = "Csv"
- granularity = "Daily"
+ 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'},
+ 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'},
+ 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'},
+ 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'},
+ 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'},
+ }
def __init__(
self,
**kwargs
):
super(Export, self).__init__(**kwargs)
- 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.format = kwargs.get('format', None)
+ self.delivery_info = kwargs.get('delivery_info', None)
+ self.definition = kwargs.get('definition', None)
+ self.run_history = kwargs.get('run_history', None)
+ self.next_run_time_estimate = None
+ self.schedule = kwargs.get('schedule', None)
+
+
+class ExportDataset(msrest.serialization.Model):
+ """The definition for data in the export.
+
+ :param granularity: The granularity of rows in the export. Currently only 'Daily' is supported.
+ Possible values include: "Daily".
+ :type granularity: str or ~cost_management_client.models.GranularityType
+ :param configuration: The export dataset configuration.
+ :type configuration: ~cost_management_client.models.ExportDatasetConfiguration
+ """
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'ExportDatasetConfiguration'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ExportDataset, self).__init__(**kwargs)
+ self.granularity = kwargs.get('granularity', 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 ExportDefinition(msrest.serialization.Model):
+ """The definition of an export.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :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 ~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 data_set: The definition for data in the export.
+ :type data_set: ~cost_management_client.models.ExportDataset
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ 'timeframe': {'required': True},
+ }
+
+ _attribute_map = {
+ 'type': {'key': 'type', 'type': 'str'},
+ 'timeframe': {'key': 'timeframe', 'type': 'str'},
+ 'time_period': {'key': 'timePeriod', 'type': 'ExportTimePeriod'},
+ 'data_set': {'key': 'dataSet', 'type': 'ExportDataset'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ExportDefinition, self).__init__(**kwargs)
+ self.type = kwargs['type']
+ self.timeframe = kwargs['timeframe']
+ self.time_period = kwargs.get('time_period', None)
+ self.data_set = kwargs.get('data_set', None)
class ExportDeliveryDestination(msrest.serialization.Model):
@@ -682,8 +770,33 @@ def __init__(
self.root_folder_path = kwargs.get('root_folder_path', None)
-class ExportExecution(Resource):
- """A export execution.
+class ExportDeliveryInfo(msrest.serialization.Model):
+ """The delivery information associated with a export.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param destination: Required. Has destination for the export being delivered.
+ :type destination: ~cost_management_client.models.ExportDeliveryDestination
+ """
+
+ _validation = {
+ 'destination': {'required': True},
+ }
+
+ _attribute_map = {
+ 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ExportDeliveryInfo, self).__init__(**kwargs)
+ self.destination = kwargs['destination']
+
+
+class ExportExecution(ProxyResource):
+ """An export execution.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -693,41 +806,44 @@ class ExportExecution(Resource):
:vartype name: str
:ivar type: Resource type.
:vartype type: str
- :ivar tags: A set of tags. Resource tags.
- :vartype tags: dict[str, str]
+ :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 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 = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
- 'tags': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
- 'tags': {'key': 'tags', 'type': '{str}'},
+ 'e_tag': {'key': 'eTag', 'type': 'str'},
'execution_type': {'key': 'properties.executionType', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'},
@@ -736,6 +852,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 +868,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 +902,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,80 +928,43 @@ 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".
- :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
- 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".
- :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 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
- :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
- "Monthly", "Annually".
- :type recurrence: str or ~azure.mgmt.costmanagement.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
+ :param format: The format of the export being delivered. Currently only 'Csv' is supported.
+ Possible values include: "Csv".
+ :type format: str or ~cost_management_client.models.FormatType
+ :param delivery_info: Required. Has delivery information for the export.
+ :type delivery_info: ~cost_management_client.models.ExportDeliveryInfo
+ :param definition: Required. Has the definition for the export.
+ :type definition: ~cost_management_client.models.ExportDefinition
+ :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 schedule: Has schedule information for the export.
+ :type schedule: ~cost_management_client.models.ExportSchedule
"""
_validation = {
- 'format': {'constant': True},
- 'type': {'required': True},
- 'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
- 'destination': {'required': True},
+ 'delivery_info': {'required': True},
+ 'definition': {'required': True},
+ 'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
'format': {'key': 'format', 'type': 'str'},
- 'type': {'key': 'definition.type', 'type': 'str'},
- 'timeframe': {'key': 'definition.timeframe', 'type': 'str'},
- 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'},
- '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'},
- 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'},
- 'status': {'key': 'schedule.status', 'type': 'str'},
- 'recurrence': {'key': 'schedule.recurrence', 'type': 'str'},
- 'recurrence_period': {'key': 'schedule.recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
- }
-
- format = "Csv"
- granularity = "Daily"
+ 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
+ 'definition': {'key': 'definition', 'type': 'ExportDefinition'},
+ 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'},
+ 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'},
+ 'schedule': {'key': 'schedule', 'type': 'ExportSchedule'},
+ }
def __init__(
self,
**kwargs
):
super(ExportProperties, self).__init__(**kwargs)
- self.status = kwargs.get('status', None)
- self.recurrence = kwargs.get('recurrence', None)
- self.recurrence_period = kwargs.get('recurrence_period', None)
+ self.schedule = kwargs.get('schedule', None)
class ExportRecurrencePeriod(msrest.serialization.Model):
@@ -915,64 +996,136 @@ def __init__(
self.to = kwargs.get('to', None)
+class ExportSchedule(msrest.serialization.Model):
+ """The schedule associated with the export.
+
+ :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 ~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: ~cost_management_client.models.ExportRecurrencePeriod
+ """
+
+ _attribute_map = {
+ 'status': {'key': 'status', 'type': 'str'},
+ 'recurrence': {'key': 'recurrence', 'type': 'str'},
+ 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ExportSchedule, self).__init__(**kwargs)
+ self.status = kwargs.get('status', None)
+ self.recurrence = kwargs.get('recurrence', None)
+ self.recurrence_period = kwargs.get('recurrence_period', 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 ForecastDataset(msrest.serialization.Model):
+ """The definition of data present in the forecast.
+
+ :param granularity: The granularity of rows in the forecast. Possible values include: "Daily".
+ :type granularity: str or ~cost_management_client.models.GranularityType
+ :param configuration: Has configuration information for the data in the export. The
+ configuration will be ignored if aggregation and grouping are provided.
+ :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, ~cost_management_client.models.QueryAggregation]
+ :param filter: Has filter expression to use in the forecast.
+ :type filter: ~cost_management_client.models.QueryFilter
+ """
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'},
+ 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'},
+ 'filter': {'key': 'filter', 'type': 'QueryFilter'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ForecastDataset, self).__init__(**kwargs)
+ self.granularity = kwargs.get('granularity', None)
+ self.configuration = kwargs.get('configuration', None)
+ self.aggregation = kwargs.get('aggregation', None)
+ self.filter = kwargs.get('filter', None)
+
+
class ForecastDefinition(msrest.serialization.Model):
"""The definition of a forecast.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
: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 dataset: Has definition for data in this forecast.
+ :type dataset: ~cost_management_client.models.ForecastDataset
: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".
- :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
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timeframe': {'key': 'timeframe', 'type': 'str'},
'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'},
+ 'dataset': {'key': 'dataset', 'type': 'ForecastDataset'},
'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'},
'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'},
- '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"
-
def __init__(
self,
**kwargs
@@ -981,19 +1134,16 @@ def __init__(
self.type = kwargs['type']
self.timeframe = kwargs['timeframe']
self.time_period = kwargs.get('time_period', None)
+ self.dataset = kwargs.get('dataset', None)
self.include_actual_cost = kwargs.get('include_actual_cost', None)
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)
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 +1174,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 +1237,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 +1265,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
"""
@@ -1137,19 +1287,18 @@ def __init__(
class QueryAggregation(msrest.serialization.Model):
"""The aggregation expression to be used in the query.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
- :ivar function: Required. The name of the aggregation function to use. Default value: "Sum".
- :vartype function: str
+ :param function: Required. The name of the aggregation function to use. Possible values
+ include: "Sum".
+ :type function: str or ~cost_management_client.models.FunctionType
"""
_validation = {
'name': {'required': True},
- 'function': {'required': True, 'constant': True},
+ 'function': {'required': True},
}
_attribute_map = {
@@ -1157,14 +1306,13 @@ class QueryAggregation(msrest.serialization.Model):
'function': {'key': 'function', 'type': 'str'},
}
- function = "Sum"
-
def __init__(
self,
**kwargs
):
super(QueryAggregation, self).__init__(**kwargs)
self.name = kwargs['name']
+ self.function = kwargs['function']
class QueryColumn(msrest.serialization.Model):
@@ -1197,9 +1345,8 @@ class QueryComparisonExpression(msrest.serialization.Model):
:param name: Required. The name of the column to use in comparison.
: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
+ :param operator: Required. The operator to use for comparison. Possible values include: "In".
+ :type operator: str or ~cost_management_client.models.QueryOperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
"""
@@ -1226,6 +1373,49 @@ def __init__(
self.values = kwargs['values']
+class QueryDataset(msrest.serialization.Model):
+ """The definition of data present in the query.
+
+ :param granularity: The granularity of rows in the query. Possible values include: "Daily".
+ :type granularity: str or ~cost_management_client.models.GranularityType
+ :param configuration: Has configuration information for the data in the export. The
+ configuration will be ignored if aggregation and grouping are provided.
+ :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, ~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[~cost_management_client.models.QueryGrouping]
+ :param filter: Has filter expression to use in the query.
+ :type filter: ~cost_management_client.models.QueryFilter
+ """
+
+ _validation = {
+ 'grouping': {'max_items': 2, 'min_items': 0},
+ }
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'},
+ 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'},
+ 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'},
+ 'filter': {'key': 'filter', 'type': 'QueryFilter'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(QueryDataset, self).__init__(**kwargs)
+ self.granularity = kwargs.get('granularity', 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)
+
+
class QueryDatasetConfiguration(msrest.serialization.Model):
"""The configuration of dataset in the query.
@@ -1249,55 +1439,33 @@ def __init__(
class QueryDefinition(msrest.serialization.Model):
"""The definition of a query.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
: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
- :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
- :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 time_period: ~cost_management_client.models.QueryTimePeriod
+ :param dataset: Has definition for data in this query.
+ :type dataset: ~cost_management_client.models.QueryDataset
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'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'},
+ 'dataset': {'key': 'dataset', 'type': 'QueryDataset'},
}
- granularity = "Daily"
-
def __init__(
self,
**kwargs
@@ -1306,25 +1474,22 @@ def __init__(
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.dataset = kwargs.get('dataset', None)
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 +1524,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 +1564,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]]
"""
@@ -1464,19 +1629,18 @@ def __init__(
class ReportConfigAggregation(msrest.serialization.Model):
"""The aggregation expression to be used in the report.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
- :ivar function: Required. The name of the aggregation function to use. Default value: "Sum".
- :vartype function: str
+ :param function: Required. The name of the aggregation function to use. Possible values
+ include: "Sum".
+ :type function: str or ~cost_management_client.models.FunctionType
"""
_validation = {
'name': {'required': True},
- 'function': {'required': True, 'constant': True},
+ 'function': {'required': True},
}
_attribute_map = {
@@ -1484,14 +1648,13 @@ class ReportConfigAggregation(msrest.serialization.Model):
'function': {'key': 'function', 'type': 'str'},
}
- function = "Sum"
-
def __init__(
self,
**kwargs
):
super(ReportConfigAggregation, self).__init__(**kwargs)
self.name = kwargs['name']
+ self.function = kwargs['function']
class ReportConfigComparisonExpression(msrest.serialization.Model):
@@ -1503,7 +1666,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 +1698,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 = {
@@ -1578,6 +1741,54 @@ def __init__(
self.filter = kwargs.get('filter', None)
+class ReportConfigDatasetautogenerated(msrest.serialization.Model):
+ """The definition of data present in the report.
+
+ :param granularity: The granularity of rows in the report. Possible values include: "Daily",
+ "Monthly".
+ :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: ~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, ~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[~cost_management_client.models.ReportConfigGrouping]
+ :param sorting: Array of order by expression to use in the report.
+ :type sorting: list[~cost_management_client.models.ReportConfigSorting]
+ :param filter: Has filter expression to use in the report.
+ :type filter: ~cost_management_client.models.ReportConfigFilterautogenerated
+ """
+
+ _validation = {
+ 'grouping': {'max_items': 2, 'min_items': 0},
+ }
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'},
+ 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'},
+ 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'},
+ 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'},
+ 'filter': {'key': 'filter', 'type': 'ReportConfigFilterautogenerated'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ReportConfigDatasetautogenerated, self).__init__(**kwargs)
+ self.granularity = kwargs.get('granularity', None)
+ self.configuration = kwargs.get('configuration', None)
+ self.aggregation = kwargs.get('aggregation', None)
+ self.grouping = kwargs.get('grouping', None)
+ self.sorting = kwargs.get('sorting', None)
+ self.filter = kwargs.get('filter', None)
+
+
class ReportConfigDatasetConfiguration(msrest.serialization.Model):
"""The configuration of dataset in the report.
@@ -1598,19 +1809,62 @@ def __init__(
self.columns = kwargs.get('columns', None)
+class ReportConfigDefinition(msrest.serialization.Model):
+ """The definition of a report config.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. 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. Possible values include:
+ "Usage".
+ :type type: str or ~cost_management_client.models.ReportType
+ :param timeframe: Required. 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 ~cost_management_client.models.ReportTimeframeType
+ :param time_period: Has time period for pulling data for the report.
+ :type time_period: ~cost_management_client.models.ReportConfigTimePeriod
+ :param dataset: Has definition for data in this report config.
+ :type dataset: ~cost_management_client.models.ReportConfigDatasetautogenerated
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ 'timeframe': {'required': True},
+ }
+
+ _attribute_map = {
+ 'type': {'key': 'type', 'type': 'str'},
+ 'timeframe': {'key': 'timeframe', 'type': 'str'},
+ 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'},
+ 'dataset': {'key': 'dataset', 'type': 'ReportConfigDatasetautogenerated'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ReportConfigDefinition, self).__init__(**kwargs)
+ self.type = kwargs['type']
+ self.timeframe = kwargs['timeframe']
+ self.time_period = kwargs.get('time_period', None)
+ self.dataset = kwargs.get('dataset', None)
+
+
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 = {
@@ -1638,6 +1892,46 @@ def __init__(
self.tag = kwargs.get('tag', None)
+class ReportConfigFilterautogenerated(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[~cost_management_client.models.ReportConfigFilterautogenerated]
+ :param or_property: The logical "OR" expression. Must have at least 2 items.
+ :type or_property: list[~cost_management_client.models.ReportConfigFilterautogenerated]
+ :param not_property: The logical "NOT" expression.
+ :type not_property: ~cost_management_client.models.ReportConfigFilterautogenerated
+ :param dimension: Has comparison expression for a dimension.
+ :type dimension: ~cost_management_client.models.ReportConfigComparisonExpression
+ :param tag: Has comparison expression for a tag.
+ :type tag: ~cost_management_client.models.ReportConfigComparisonExpression
+ """
+
+ _validation = {
+ 'and_property': {'min_items': 2},
+ 'or_property': {'min_items': 2},
+ }
+
+ _attribute_map = {
+ 'and_property': {'key': 'and', 'type': '[ReportConfigFilterautogenerated]'},
+ 'or_property': {'key': 'or', 'type': '[ReportConfigFilterautogenerated]'},
+ 'not_property': {'key': 'not', 'type': 'ReportConfigFilterautogenerated'},
+ 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'},
+ 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'},
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(ReportConfigFilterautogenerated, self).__init__(**kwargs)
+ self.and_property = kwargs.get('and_property', None)
+ self.or_property = kwargs.get('or_property', None)
+ self.not_property = kwargs.get('not_property', None)
+ self.dimension = kwargs.get('dimension', None)
+ self.tag = kwargs.get('tag', None)
+
+
class ReportConfigGrouping(msrest.serialization.Model):
"""The group by expression to be used in the report.
@@ -1645,7 +1939,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 +1970,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,29 +2063,29 @@ 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]
- :ivar type_properties_query_type: The type of the report. Usage represents actual usage,
+ :type pivots: list[~cost_management_client.models.PivotProperties]
+ :param 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:
- "Usage".
- :vartype type_properties_query_type: str
+ data. Actual usage and forecasted data can be differentiated based on dates. Possible values
+ include: "Usage".
+ :type type_properties_query_type: str or ~cost_management_client.models.ReportType
: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 = {
@@ -1800,7 +2094,6 @@ class View(ProxyResource):
'type': {'readonly': True},
'created_on': {'readonly': True},
'modified_on': {'readonly': True},
- 'type_properties_query_type': {'constant': True},
}
_attribute_map = {
@@ -1823,8 +2116,6 @@ class View(ProxyResource):
'dataset': {'key': 'properties.query.dataset', 'type': 'ReportConfigDataset'},
}
- type_properties_query_type = "Usage"
-
def __init__(
self,
**kwargs
@@ -1839,6 +2130,7 @@ def __init__(
self.metric = kwargs.get('metric', None)
self.kpis = kwargs.get('kpis', None)
self.pivots = kwargs.get('pivots', None)
+ self.type_properties_query_type = kwargs.get('type_properties_query_type', None)
self.timeframe = kwargs.get('timeframe', None)
self.time_period = kwargs.get('time_period', None)
self.dataset = kwargs.get('dataset', None)
@@ -1850,7 +2142,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..92267a2e054 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,18 @@ 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 source: Source of alert. Possible values include: "Preset", "User".
+ :type source: str or ~cost_management_client.models.AlertSource
:param details: Alert details.
- :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails
+ :type details: ~cost_management_client.models.AlertPropertiesDetails
: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.
@@ -120,10 +123,10 @@ def __init__(
*,
definition: Optional["AlertPropertiesDefinition"] = None,
description: Optional[str] = None,
- source: Optional[str] = None,
+ source: Optional[Union[str, "AlertSource"]] = None,
details: Optional["AlertPropertiesDetails"] = 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,
@@ -148,12 +151,18 @@ def __init__(
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 +174,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)
@@ -179,8 +188,9 @@ def __init__(
class AlertPropertiesDetails(msrest.serialization.Model):
"""Alert details.
- :param time_grain_type: Type of timegrain cadence.
- :type time_grain_type: 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.
@@ -195,8 +205,9 @@ class AlertPropertiesDetails(msrest.serialization.Model):
: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 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.
@@ -235,7 +246,7 @@ class AlertPropertiesDetails(msrest.serialization.Model):
def __init__(
self,
*,
- time_grain_type: 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,
@@ -243,7 +254,7 @@ def __init__(
meter_filter: Optional[List[object]] = None,
tag_filter: Optional[object] = None,
threshold: Optional[float] = None,
- operator: Optional[str] = None,
+ operator: Optional[Union[str, "AlertOperator"]] = None,
amount: Optional[float] = None,
unit: Optional[str] = None,
current_spend: Optional[float] = None,
@@ -278,7 +289,7 @@ class AlertsResult(msrest.serialization.Model):
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,82 +320,49 @@ 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".
- :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
- 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".
- :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 destination: Required. Has destination for the export being delivered.
- :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination
+ :param format: The format of the export being delivered. Currently only 'Csv' is supported.
+ Possible values include: "Csv".
+ :type format: str or ~cost_management_client.models.FormatType
+ :param delivery_info: Required. Has delivery information for the export.
+ :type delivery_info: ~cost_management_client.models.ExportDeliveryInfo
+ :param definition: Required. Has the definition for the export.
+ :type definition: ~cost_management_client.models.ExportDefinition
+ :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
"""
_validation = {
- 'format': {'constant': True},
- 'type': {'required': True},
- 'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
- 'destination': {'required': True},
+ 'delivery_info': {'required': True},
+ 'definition': {'required': True},
+ 'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
'format': {'key': 'format', 'type': 'str'},
- 'type': {'key': 'definition.type', 'type': 'str'},
- 'timeframe': {'key': 'definition.timeframe', 'type': 'str'},
- 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'},
- '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'},
- 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'},
+ 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
+ 'definition': {'key': 'definition', 'type': 'ExportDefinition'},
+ 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'},
+ 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'},
}
- format = "Csv"
- granularity = "Daily"
-
def __init__(
self,
*,
- 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,
+ delivery_info: "ExportDeliveryInfo",
+ definition: "ExportDefinition",
+ format: Optional[Union[str, "FormatType"]] = None,
+ run_history: Optional["ExportExecutionListResult"] = None,
**kwargs
):
super(CommonExportProperties, self).__init__(**kwargs)
- 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
+ self.format = format
+ self.delivery_info = delivery_info
+ self.definition = definition
+ self.run_history = run_history
+ self.next_run_time_estimate = None
class Dimension(Resource):
@@ -475,7 +453,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 +472,78 @@ 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 details: Alert details.
+ :type details: ~cost_management_client.models.AlertPropertiesDetails
+ :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
+ """
+
+ _attribute_map = {
+ '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'},
+ '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'},
+ }
+
+ def __init__(
+ self,
+ *,
+ definition: Optional["AlertPropertiesDefinition"] = None,
+ description: Optional[str] = None,
+ source: Optional[Union[str, "AlertSource"]] = None,
+ details: Optional["AlertPropertiesDetails"] = 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,
+ **kwargs
+ ):
+ super(DismissAlertPayload, 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
+ 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
+
+
class ErrorDetails(msrest.serialization.Model):
"""The details of the error.
@@ -525,18 +575,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 +647,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,51 +660,27 @@ 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".
- :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
- 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".
- :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 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
- :param recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly",
- "Monthly", "Annually".
- :type recurrence: str or ~azure.mgmt.costmanagement.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
+ :param format: The format of the export being delivered. Currently only 'Csv' is supported.
+ Possible values include: "Csv".
+ :type format: str or ~cost_management_client.models.FormatType
+ :param delivery_info: Has delivery information for the export.
+ :type delivery_info: ~cost_management_client.models.ExportDeliveryInfo
+ :param definition: Has the definition for the export.
+ :type definition: ~cost_management_client.models.ExportDefinition
+ :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 schedule: Has schedule information for the export.
+ :type schedule: ~cost_management_client.models.ExportSchedule
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
- 'format': {'constant': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
+ 'next_run_time_estimate': {'readonly': True},
}
_attribute_map = {
@@ -662,52 +689,128 @@ class Export(ProxyResource):
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'format': {'key': 'properties.format', 'type': 'str'},
- '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'},
- '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'},
- 'destination': {'key': 'properties.deliveryInfo.destination', 'type': 'ExportDeliveryDestination'},
- 'status': {'key': 'properties.schedule.status', 'type': 'str'},
- 'recurrence': {'key': 'properties.schedule.recurrence', 'type': 'str'},
- 'recurrence_period': {'key': 'properties.schedule.recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
- }
-
- format = "Csv"
- granularity = "Daily"
+ 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'},
+ 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'},
+ 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'},
+ 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'},
+ 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'},
+ }
def __init__(
self,
*,
e_tag: Optional[str] = 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,
- destination: Optional["ExportDeliveryDestination"] = None,
- status: Optional[Union[str, "StatusType"]] = None,
- recurrence: Optional[Union[str, "RecurrenceType"]] = None,
- recurrence_period: Optional["ExportRecurrencePeriod"] = None,
+ format: Optional[Union[str, "FormatType"]] = None,
+ delivery_info: Optional["ExportDeliveryInfo"] = None,
+ definition: Optional["ExportDefinition"] = None,
+ run_history: Optional["ExportExecutionListResult"] = None,
+ schedule: Optional["ExportSchedule"] = None,
**kwargs
):
super(Export, self).__init__(e_tag=e_tag, **kwargs)
- self.type_properties_definition_type = type_properties_definition_type
+ self.format = format
+ self.delivery_info = delivery_info
+ self.definition = definition
+ self.run_history = run_history
+ self.next_run_time_estimate = None
+ self.schedule = schedule
+
+
+class ExportDataset(msrest.serialization.Model):
+ """The definition for data in the export.
+
+ :param granularity: The granularity of rows in the export. Currently only 'Daily' is supported.
+ Possible values include: "Daily".
+ :type granularity: str or ~cost_management_client.models.GranularityType
+ :param configuration: The export dataset configuration.
+ :type configuration: ~cost_management_client.models.ExportDatasetConfiguration
+ """
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'ExportDatasetConfiguration'},
+ }
+
+ def __init__(
+ self,
+ *,
+ granularity: Optional[Union[str, "GranularityType"]] = None,
+ configuration: Optional["ExportDatasetConfiguration"] = None,
+ **kwargs
+ ):
+ super(ExportDataset, self).__init__(**kwargs)
+ self.granularity = granularity
+ self.configuration = configuration
+
+
+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 ExportDefinition(msrest.serialization.Model):
+ """The definition of an export.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :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 ~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 data_set: The definition for data in the export.
+ :type data_set: ~cost_management_client.models.ExportDataset
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ 'timeframe': {'required': True},
+ }
+
+ _attribute_map = {
+ 'type': {'key': 'type', 'type': 'str'},
+ 'timeframe': {'key': 'timeframe', 'type': 'str'},
+ 'time_period': {'key': 'timePeriod', 'type': 'ExportTimePeriod'},
+ 'data_set': {'key': 'dataSet', 'type': 'ExportDataset'},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Union[str, "ExportType"],
+ timeframe: Union[str, "TimeframeType"],
+ time_period: Optional["ExportTimePeriod"] = None,
+ data_set: Optional["ExportDataset"] = None,
+ **kwargs
+ ):
+ super(ExportDefinition, self).__init__(**kwargs)
+ 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
- self.status = status
- self.recurrence = recurrence
- self.recurrence_period = recurrence_period
+ self.data_set = data_set
class ExportDeliveryDestination(msrest.serialization.Model):
@@ -749,8 +852,35 @@ def __init__(
self.root_folder_path = root_folder_path
-class ExportExecution(Resource):
- """A export execution.
+class ExportDeliveryInfo(msrest.serialization.Model):
+ """The delivery information associated with a export.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param destination: Required. Has destination for the export being delivered.
+ :type destination: ~cost_management_client.models.ExportDeliveryDestination
+ """
+
+ _validation = {
+ 'destination': {'required': True},
+ }
+
+ _attribute_map = {
+ 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'},
+ }
+
+ def __init__(
+ self,
+ *,
+ destination: "ExportDeliveryDestination",
+ **kwargs
+ ):
+ super(ExportDeliveryInfo, self).__init__(**kwargs)
+ self.destination = destination
+
+
+class ExportExecution(ProxyResource):
+ """An export execution.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -760,41 +890,44 @@ class ExportExecution(Resource):
:vartype name: str
:ivar type: Resource type.
:vartype type: str
- :ivar tags: A set of tags. Resource tags.
- :vartype tags: dict[str, str]
+ :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 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 = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
- 'tags': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
- 'tags': {'key': 'tags', 'type': '{str}'},
+ 'e_tag': {'key': 'eTag', 'type': 'str'},
'execution_type': {'key': 'properties.executionType', 'type': 'str'},
'status': {'key': 'properties.status', 'type': 'str'},
'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'},
@@ -803,11 +936,13 @@ 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__(
self,
*,
+ e_tag: Optional[str] = None,
execution_type: Optional[Union[str, "ExecutionType"]] = None,
status: Optional[Union[str, "ExecutionStatus"]] = None,
submitted_by: Optional[str] = None,
@@ -816,9 +951,10 @@ 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)
+ super(ExportExecution, self).__init__(e_tag=e_tag, **kwargs)
self.execution_type = execution_type
self.status = status
self.submitted_by = submitted_by
@@ -827,15 +963,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 +997,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,107 +1023,131 @@ 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".
- :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
- 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".
- :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 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
+ :param format: The format of the export being delivered. Currently only 'Csv' is supported.
+ Possible values include: "Csv".
+ :type format: str or ~cost_management_client.models.FormatType
+ :param delivery_info: Required. Has delivery information for the export.
+ :type delivery_info: ~cost_management_client.models.ExportDeliveryInfo
+ :param definition: Required. Has the definition for the export.
+ :type definition: ~cost_management_client.models.ExportDefinition
+ :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 schedule: Has schedule information for the export.
+ :type schedule: ~cost_management_client.models.ExportSchedule
+ """
+
+ _validation = {
+ 'delivery_info': {'required': True},
+ 'definition': {'required': True},
+ 'next_run_time_estimate': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'format': {'key': 'format', 'type': 'str'},
+ 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'},
+ 'definition': {'key': 'definition', 'type': 'ExportDefinition'},
+ 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'},
+ 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'},
+ 'schedule': {'key': 'schedule', 'type': 'ExportSchedule'},
+ }
+
+ def __init__(
+ self,
+ *,
+ delivery_info: "ExportDeliveryInfo",
+ definition: "ExportDefinition",
+ format: Optional[Union[str, "FormatType"]] = None,
+ run_history: Optional["ExportExecutionListResult"] = None,
+ schedule: Optional["ExportSchedule"] = None,
+ **kwargs
+ ):
+ super(ExportProperties, self).__init__(format=format, delivery_info=delivery_info, definition=definition, run_history=run_history, **kwargs)
+ self.schedule = schedule
+
+
+class ExportRecurrencePeriod(msrest.serialization.Model):
+ """The start and end date for recurrence schedule.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param from_property: Required. The start date of recurrence.
+ :type from_property: ~datetime.datetime
+ :param to: The end date of recurrence.
+ :type to: ~datetime.datetime
+ """
+
+ _validation = {
+ 'from_property': {'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: Optional[datetime.datetime] = None,
+ **kwargs
+ ):
+ super(ExportRecurrencePeriod, self).__init__(**kwargs)
+ self.from_property = from_property
+ self.to = to
+
+
+class ExportSchedule(msrest.serialization.Model):
+ """The schedule associated with the export.
+
+ :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},
- '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'},
- 'type': {'key': 'definition.type', 'type': 'str'},
- 'timeframe': {'key': 'definition.timeframe', 'type': 'str'},
- 'time_period': {'key': 'definition.timePeriod', 'type': 'QueryTimePeriod'},
- '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'},
- 'destination': {'key': 'deliveryInfo.destination', 'type': 'ExportDeliveryDestination'},
- 'status': {'key': 'schedule.status', 'type': 'str'},
- 'recurrence': {'key': 'schedule.recurrence', 'type': 'str'},
- 'recurrence_period': {'key': 'schedule.recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
- }
-
- format = "Csv"
- granularity = "Daily"
+ 'status': {'key': 'status', 'type': 'str'},
+ 'recurrence': {'key': 'recurrence', 'type': 'str'},
+ 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'},
+ }
def __init__(
self,
*,
- 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,
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(ExportSchedule, self).__init__(**kwargs)
self.status = status
self.recurrence = recurrence
self.recurrence_period = recurrence_period
-class ExportRecurrencePeriod(msrest.serialization.Model):
- """The start and end date for recurrence schedule.
+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 of recurrence.
+ :param from_property: Required. The start date for export data.
:type from_property: ~datetime.datetime
- :param to: The end date of recurrence.
+ :param to: Required. The end date for export data.
:type to: ~datetime.datetime
"""
_validation = {
'from_property': {'required': True},
+ 'to': {'required': True},
}
_attribute_map = {
@@ -998,103 +1159,114 @@ def __init__(
self,
*,
from_property: datetime.datetime,
- to: Optional[datetime.datetime] = None,
+ to: datetime.datetime,
**kwargs
):
- super(ExportRecurrencePeriod, self).__init__(**kwargs)
+ super(ExportTimePeriod, self).__init__(**kwargs)
self.from_property = from_property
self.to = to
+class ForecastDataset(msrest.serialization.Model):
+ """The definition of data present in the forecast.
+
+ :param granularity: The granularity of rows in the forecast. Possible values include: "Daily".
+ :type granularity: str or ~cost_management_client.models.GranularityType
+ :param configuration: Has configuration information for the data in the export. The
+ configuration will be ignored if aggregation and grouping are provided.
+ :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, ~cost_management_client.models.QueryAggregation]
+ :param filter: Has filter expression to use in the forecast.
+ :type filter: ~cost_management_client.models.QueryFilter
+ """
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'},
+ 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'},
+ 'filter': {'key': 'filter', 'type': 'QueryFilter'},
+ }
+
+ def __init__(
+ self,
+ *,
+ granularity: Optional[Union[str, "GranularityType"]] = None,
+ configuration: Optional["QueryDatasetConfiguration"] = None,
+ aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
+ filter: Optional["QueryFilter"] = None,
+ **kwargs
+ ):
+ super(ForecastDataset, self).__init__(**kwargs)
+ self.granularity = granularity
+ self.configuration = configuration
+ self.aggregation = aggregation
+ self.filter = filter
+
+
class ForecastDefinition(msrest.serialization.Model):
"""The definition of a forecast.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
: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 dataset: Has definition for data in this forecast.
+ :type dataset: ~cost_management_client.models.ForecastDataset
: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".
- :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
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timeframe': {'key': 'timeframe', 'type': 'str'},
'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'},
+ 'dataset': {'key': 'dataset', 'type': 'ForecastDataset'},
'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'},
'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'},
- '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"
-
def __init__(
self,
*,
type: Union[str, "ForecastType"],
timeframe: Union[str, "ForecastTimeframeType"],
time_period: Optional["QueryTimePeriod"] = None,
+ dataset: Optional["ForecastDataset"] = None,
include_actual_cost: Optional[bool] = None,
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
):
super(ForecastDefinition, self).__init__(**kwargs)
self.type = type
self.timeframe = timeframe
self.time_period = time_period
+ self.dataset = dataset
self.include_actual_cost = include_actual_cost
self.include_fresh_partial_cost = include_fresh_partial_cost
- self.configuration = configuration
- self.aggregation = aggregation
- self.grouping = grouping
- self.filter = filter
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 +1301,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 +1366,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 +1394,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
"""
@@ -1247,19 +1419,18 @@ def __init__(
class QueryAggregation(msrest.serialization.Model):
"""The aggregation expression to be used in the query.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
- :ivar function: Required. The name of the aggregation function to use. Default value: "Sum".
- :vartype function: str
+ :param function: Required. The name of the aggregation function to use. Possible values
+ include: "Sum".
+ :type function: str or ~cost_management_client.models.FunctionType
"""
_validation = {
'name': {'required': True},
- 'function': {'required': True, 'constant': True},
+ 'function': {'required': True},
}
_attribute_map = {
@@ -1267,16 +1438,16 @@ class QueryAggregation(msrest.serialization.Model):
'function': {'key': 'function', 'type': 'str'},
}
- function = "Sum"
-
def __init__(
self,
*,
name: str,
+ function: Union[str, "FunctionType"],
**kwargs
):
super(QueryAggregation, self).__init__(**kwargs)
self.name = name
+ self.function = function
class QueryColumn(msrest.serialization.Model):
@@ -1312,9 +1483,8 @@ class QueryComparisonExpression(msrest.serialization.Model):
:param name: Required. The name of the column to use in comparison.
: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
+ :param operator: Required. The operator to use for comparison. Possible values include: "In".
+ :type operator: str or ~cost_management_client.models.QueryOperatorType
:param values: Required. Array of values to use for comparison.
:type values: list[str]
"""
@@ -1335,7 +1505,7 @@ def __init__(
self,
*,
name: str,
- operator: Union[str, "OperatorType"],
+ operator: Union[str, "QueryOperatorType"],
values: List[str],
**kwargs
):
@@ -1345,6 +1515,55 @@ def __init__(
self.values = values
+class QueryDataset(msrest.serialization.Model):
+ """The definition of data present in the query.
+
+ :param granularity: The granularity of rows in the query. Possible values include: "Daily".
+ :type granularity: str or ~cost_management_client.models.GranularityType
+ :param configuration: Has configuration information for the data in the export. The
+ configuration will be ignored if aggregation and grouping are provided.
+ :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, ~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[~cost_management_client.models.QueryGrouping]
+ :param filter: Has filter expression to use in the query.
+ :type filter: ~cost_management_client.models.QueryFilter
+ """
+
+ _validation = {
+ 'grouping': {'max_items': 2, 'min_items': 0},
+ }
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'},
+ 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'},
+ 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'},
+ 'filter': {'key': 'filter', 'type': 'QueryFilter'},
+ }
+
+ def __init__(
+ self,
+ *,
+ granularity: Optional[Union[str, "GranularityType"]] = None,
+ configuration: Optional["QueryDatasetConfiguration"] = None,
+ aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
+ grouping: Optional[List["QueryGrouping"]] = None,
+ filter: Optional["QueryFilter"] = None,
+ **kwargs
+ ):
+ super(QueryDataset, self).__init__(**kwargs)
+ self.granularity = granularity
+ self.configuration = configuration
+ self.aggregation = aggregation
+ self.grouping = grouping
+ self.filter = filter
+
+
class QueryDatasetConfiguration(msrest.serialization.Model):
"""The configuration of dataset in the query.
@@ -1370,90 +1589,62 @@ def __init__(
class QueryDefinition(msrest.serialization.Model):
"""The definition of a query.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
: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
- :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
- :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 time_period: ~cost_management_client.models.QueryTimePeriod
+ :param dataset: Has definition for data in this query.
+ :type dataset: ~cost_management_client.models.QueryDataset
"""
_validation = {
'type': {'required': True},
'timeframe': {'required': True},
- 'granularity': {'constant': True},
- 'grouping': {'max_items': 2, 'min_items': 0},
}
_attribute_map = {
'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'},
+ 'dataset': {'key': 'dataset', 'type': 'QueryDataset'},
}
- granularity = "Daily"
-
def __init__(
self,
*,
type: Union[str, "ExportType"],
timeframe: Union[str, "TimeframeType"],
time_period: Optional["QueryTimePeriod"] = None,
- configuration: Optional["QueryDatasetConfiguration"] = None,
- aggregation: Optional[Dict[str, "QueryAggregation"]] = None,
- grouping: Optional[List["QueryGrouping"]] = None,
- filter: Optional["QueryFilter"] = None,
+ dataset: Optional["QueryDataset"] = None,
**kwargs
):
super(QueryDefinition, self).__init__(**kwargs)
self.type = type
self.timeframe = timeframe
self.time_period = time_period
- self.configuration = configuration
- self.aggregation = aggregation
- self.grouping = grouping
- self.filter = filter
+ self.dataset = dataset
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 +1685,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 +1728,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]]
"""
@@ -1609,19 +1800,18 @@ def __init__(
class ReportConfigAggregation(msrest.serialization.Model):
"""The aggregation expression to be used in the report.
- Variables are only populated by the server, and will be ignored when sending a request.
-
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the column to aggregate.
:type name: str
- :ivar function: Required. The name of the aggregation function to use. Default value: "Sum".
- :vartype function: str
+ :param function: Required. The name of the aggregation function to use. Possible values
+ include: "Sum".
+ :type function: str or ~cost_management_client.models.FunctionType
"""
_validation = {
'name': {'required': True},
- 'function': {'required': True, 'constant': True},
+ 'function': {'required': True},
}
_attribute_map = {
@@ -1629,16 +1819,16 @@ class ReportConfigAggregation(msrest.serialization.Model):
'function': {'key': 'function', 'type': 'str'},
}
- function = "Sum"
-
def __init__(
self,
*,
name: str,
+ function: Union[str, "FunctionType"],
**kwargs
):
super(ReportConfigAggregation, self).__init__(**kwargs)
self.name = name
+ self.function = function
class ReportConfigComparisonExpression(msrest.serialization.Model):
@@ -1650,7 +1840,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 +1876,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 = {
@@ -1736,6 +1926,61 @@ def __init__(
self.filter = filter
+class ReportConfigDatasetautogenerated(msrest.serialization.Model):
+ """The definition of data present in the report.
+
+ :param granularity: The granularity of rows in the report. Possible values include: "Daily",
+ "Monthly".
+ :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: ~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, ~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[~cost_management_client.models.ReportConfigGrouping]
+ :param sorting: Array of order by expression to use in the report.
+ :type sorting: list[~cost_management_client.models.ReportConfigSorting]
+ :param filter: Has filter expression to use in the report.
+ :type filter: ~cost_management_client.models.ReportConfigFilterautogenerated
+ """
+
+ _validation = {
+ 'grouping': {'max_items': 2, 'min_items': 0},
+ }
+
+ _attribute_map = {
+ 'granularity': {'key': 'granularity', 'type': 'str'},
+ 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'},
+ 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'},
+ 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'},
+ 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'},
+ 'filter': {'key': 'filter', 'type': 'ReportConfigFilterautogenerated'},
+ }
+
+ def __init__(
+ self,
+ *,
+ granularity: Optional[Union[str, "ReportGranularityType"]] = None,
+ configuration: Optional["ReportConfigDatasetConfiguration"] = None,
+ aggregation: Optional[Dict[str, "ReportConfigAggregation"]] = None,
+ grouping: Optional[List["ReportConfigGrouping"]] = None,
+ sorting: Optional[List["ReportConfigSorting"]] = None,
+ filter: Optional["ReportConfigFilterautogenerated"] = None,
+ **kwargs
+ ):
+ super(ReportConfigDatasetautogenerated, self).__init__(**kwargs)
+ self.granularity = granularity
+ self.configuration = configuration
+ self.aggregation = aggregation
+ self.grouping = grouping
+ self.sorting = sorting
+ self.filter = filter
+
+
class ReportConfigDatasetConfiguration(msrest.serialization.Model):
"""The configuration of dataset in the report.
@@ -1758,19 +2003,67 @@ def __init__(
self.columns = columns
+class ReportConfigDefinition(msrest.serialization.Model):
+ """The definition of a report config.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. 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. Possible values include:
+ "Usage".
+ :type type: str or ~cost_management_client.models.ReportType
+ :param timeframe: Required. 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 ~cost_management_client.models.ReportTimeframeType
+ :param time_period: Has time period for pulling data for the report.
+ :type time_period: ~cost_management_client.models.ReportConfigTimePeriod
+ :param dataset: Has definition for data in this report config.
+ :type dataset: ~cost_management_client.models.ReportConfigDatasetautogenerated
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ 'timeframe': {'required': True},
+ }
+
+ _attribute_map = {
+ 'type': {'key': 'type', 'type': 'str'},
+ 'timeframe': {'key': 'timeframe', 'type': 'str'},
+ 'time_period': {'key': 'timePeriod', 'type': 'ReportConfigTimePeriod'},
+ 'dataset': {'key': 'dataset', 'type': 'ReportConfigDatasetautogenerated'},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Union[str, "ReportType"],
+ timeframe: Union[str, "ReportTimeframeType"],
+ time_period: Optional["ReportConfigTimePeriod"] = None,
+ dataset: Optional["ReportConfigDatasetautogenerated"] = None,
+ **kwargs
+ ):
+ super(ReportConfigDefinition, self).__init__(**kwargs)
+ self.type = type
+ self.timeframe = timeframe
+ self.time_period = time_period
+ self.dataset = dataset
+
+
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 = {
@@ -1804,6 +2097,52 @@ def __init__(
self.tag = tag
+class ReportConfigFilterautogenerated(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[~cost_management_client.models.ReportConfigFilterautogenerated]
+ :param or_property: The logical "OR" expression. Must have at least 2 items.
+ :type or_property: list[~cost_management_client.models.ReportConfigFilterautogenerated]
+ :param not_property: The logical "NOT" expression.
+ :type not_property: ~cost_management_client.models.ReportConfigFilterautogenerated
+ :param dimension: Has comparison expression for a dimension.
+ :type dimension: ~cost_management_client.models.ReportConfigComparisonExpression
+ :param tag: Has comparison expression for a tag.
+ :type tag: ~cost_management_client.models.ReportConfigComparisonExpression
+ """
+
+ _validation = {
+ 'and_property': {'min_items': 2},
+ 'or_property': {'min_items': 2},
+ }
+
+ _attribute_map = {
+ 'and_property': {'key': 'and', 'type': '[ReportConfigFilterautogenerated]'},
+ 'or_property': {'key': 'or', 'type': '[ReportConfigFilterautogenerated]'},
+ 'not_property': {'key': 'not', 'type': 'ReportConfigFilterautogenerated'},
+ 'dimension': {'key': 'dimension', 'type': 'ReportConfigComparisonExpression'},
+ 'tag': {'key': 'tag', 'type': 'ReportConfigComparisonExpression'},
+ }
+
+ def __init__(
+ self,
+ *,
+ and_property: Optional[List["ReportConfigFilterautogenerated"]] = None,
+ or_property: Optional[List["ReportConfigFilterautogenerated"]] = None,
+ not_property: Optional["ReportConfigFilterautogenerated"] = None,
+ dimension: Optional["ReportConfigComparisonExpression"] = None,
+ tag: Optional["ReportConfigComparisonExpression"] = None,
+ **kwargs
+ ):
+ super(ReportConfigFilterautogenerated, self).__init__(**kwargs)
+ self.and_property = and_property
+ self.or_property = or_property
+ self.not_property = not_property
+ self.dimension = dimension
+ self.tag = tag
+
+
class ReportConfigGrouping(msrest.serialization.Model):
"""The group by expression to be used in the report.
@@ -1811,7 +2150,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 +2184,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,29 +2283,29 @@ 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]
- :ivar type_properties_query_type: The type of the report. Usage represents actual usage,
+ :type pivots: list[~cost_management_client.models.PivotProperties]
+ :param 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:
- "Usage".
- :vartype type_properties_query_type: str
+ data. Actual usage and forecasted data can be differentiated based on dates. Possible values
+ include: "Usage".
+ :type type_properties_query_type: str or ~cost_management_client.models.ReportType
: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 = {
@@ -1975,7 +2314,6 @@ class View(ProxyResource):
'type': {'readonly': True},
'created_on': {'readonly': True},
'modified_on': {'readonly': True},
- 'type_properties_query_type': {'constant': True},
}
_attribute_map = {
@@ -1998,8 +2336,6 @@ class View(ProxyResource):
'dataset': {'key': 'properties.query.dataset', 'type': 'ReportConfigDataset'},
}
- type_properties_query_type = "Usage"
-
def __init__(
self,
*,
@@ -2011,6 +2347,7 @@ def __init__(
metric: Optional[Union[str, "MetricType"]] = None,
kpis: Optional[List["KpiProperties"]] = None,
pivots: Optional[List["PivotProperties"]] = None,
+ type_properties_query_type: Optional[Union[str, "ReportType"]] = None,
timeframe: Optional[Union[str, "ReportTimeframeType"]] = None,
time_period: Optional["ReportConfigTimePeriod"] = None,
dataset: Optional["ReportConfigDataset"] = None,
@@ -2026,6 +2363,7 @@ def __init__(
self.metric = metric
self.kpis = kpis
self.pivots = pivots
+ self.type_properties_query_type = type_properties_query_type
self.timeframe = timeframe
self.time_period = time_period
self.dataset = dataset
@@ -2037,7 +2375,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/__init__.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/__init__.py
index 6c9a4311b92..6065b201f9c 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/__init__.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/__init__.py
@@ -6,20 +6,20 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from ._view_operations import ViewOperations
-from ._alert_operations import AlertOperations
+from ._views_operations import ViewsOperations
+from ._alerts_operations import AlertsOperations
from ._forecast_operations import ForecastOperations
-from ._dimension_operations import DimensionOperations
+from ._dimensions_operations import DimensionsOperations
from ._query_operations import QueryOperations
-from ._export_operations import ExportOperations
-from ._operation_operations import OperationOperations
+from ._operations import Operations
+from ._exports_operations import ExportsOperations
__all__ = [
- 'ViewOperations',
- 'AlertOperations',
+ 'ViewsOperations',
+ 'AlertsOperations',
'ForecastOperations',
- 'DimensionOperations',
+ 'DimensionsOperations',
'QueryOperations',
- 'ExportOperations',
- 'OperationOperations',
+ 'Operations',
+ 'ExportsOperations',
]
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
deleted file mode 100644
index dc1b90de5db..00000000000
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alert_operations.py
+++ /dev/null
@@ -1,171 +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.
-# --------------------------------------------------------------------------
-from typing import TYPE_CHECKING
-import warnings
-
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
-from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpRequest, HttpResponse
-from azure.mgmt.core.exceptions import ARMErrorFormat
-
-from .. import models
-
-if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
- from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
-
- T = TypeVar('T')
- ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-
-class AlertOperations(object):
- """AlertOperations operations.
-
- You should not instantiate this class directly. Instead, you should create a Client instance that
- 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
- :param client: Client for service requests.
- :param config: Configuration of service client.
- :param serializer: An object model serializer.
- :param deserializer: An object model deserializer.
- """
-
- models = models
-
- def __init__(self, client, config, serializer, deserializer):
- self._client = client
- self._serialize = serializer
- self._deserialize = deserializer
- self._config = config
-
- def list(
- self,
- scope, # type: str
- **kwargs # type: Any
- ):
- # type: (...) -> "models.AlertsResult"
- """Lists the alerts for scope defined.
-
- :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
- :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
- :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"
-
- # Construct URL
- url = self.list.metadata['url']
- 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')
-
- # 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('AlertsResult', pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
- list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'}
-
- def list_external(
- self,
- external_cloud_provider_type, # type: Union[str, "models.ExternalCloudProviderType"]
- external_cloud_provider_id, # type: str
- **kwargs # type: Any
- ):
- # type: (...) -> "models.AlertsResult"
- """Lists the Alerts for external cloud provider type defined.
-
- :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
- :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
- :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"
-
- # Construct URL
- url = self.list_external.metadata['url']
- 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')
-
- # 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('AlertsResult', pipeline_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {})
-
- return deserialized
- list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'}
diff --git a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alerts_operations.py b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alerts_operations.py
new file mode 100644
index 00000000000..22e49ad127b
--- /dev/null
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_alerts_operations.py
@@ -0,0 +1,333 @@
+# 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.
+# --------------------------------------------------------------------------
+from typing import TYPE_CHECKING
+import warnings
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.pipeline.transport import HttpRequest, HttpResponse
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
+
+ T = TypeVar('T')
+ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+class AlertsOperations(object):
+ """AlertsOperations operations.
+
+ You should not instantiate this class directly. Instead, you should create a Client instance that
+ instantiates it for you and attaches it as an attribute.
+
+ :ivar models: Alias to model classes used in this operation group.
+ :type models: ~cost_management_client.models
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An object model deserializer.
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self._config = config
+
+ def list(
+ self,
+ scope, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.AlertsResult"
+ """Lists the alerts for scope defined.
+
+ :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
+ :keyword callable cls: A custom type or function that will be passed the direct response
+ :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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
+
+ # Construct 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')
+
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
+ 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('AlertsResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
+
+ # 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'] = self._serialize.header("accept", accept, 'str')
+
+ 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
+ parameters, # type: "models.DismissAlertPayload"
+ **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 parameters: Parameters supplied to the Dismiss Alert operation.
+ :type parameters: ~cost_management_client.models.DismissAlertPayload
+ :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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'] = self._serialize.header("accept", accept, 'str')
+
+ 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,
+ external_cloud_provider_type, # type: Union[str, "models.ExternalCloudProviderType"]
+ external_cloud_provider_id, # type: str
+ **kwargs # type: Any
+ ):
+ # type: (...) -> "models.AlertsResult"
+ """Lists the Alerts for external cloud provider type defined.
+
+ :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 ~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: ~cost_management_client.models.AlertsResult
+ :raises: ~azure.core.exceptions.HttpResponseError
+ """
+ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertsResult"]
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
+
+ # Construct 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'),
+ }
+ 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'] = self._serialize.header("accept", accept, 'str')
+
+ 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('AlertsResult', pipeline_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {})
+
+ return deserialized
+ 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/_dimensions_operations.py
similarity index 56%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimension_operations.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimensions_operations.py
index aa72450bb03..1ef67bf5255 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimension_operations.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_dimensions_operations.py
@@ -8,7 +8,7 @@
from typing import TYPE_CHECKING
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
@@ -18,19 +18,19 @@
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]]
-class DimensionOperations(object):
- """DimensionOperations operations.
+class DimensionsOperations(object):
+ """DimensionsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,76 +54,80 @@ 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
- '/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.
+ '/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.
:type scope: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
- properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
+ properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
- default, data is not included when listing dimensions.
+ default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: 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.
+ 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.
:type skiptoken: str
: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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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)
+
+ request = self._client.get(url, query_parameters, header_parameters)
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)
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
@@ -149,7 +153,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,67 +165,71 @@ 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
+ dimension/query operations. This includes 'externalSubscriptions' for linked account and
+ 'externalBillingAccounts' for consolidated account.
+ :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.
+ '{externalBillingAccountId}' for consolidated account used with dimension/query operations.
:type external_cloud_provider_id: str
:param filter: May be used to filter dimensions by properties/category, properties/usageStart,
- properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
+ properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.
:type filter: str
:param expand: May be used to expand the properties/data within a dimension category. By
- default, data is not included when listing dimensions.
+ default, data is not included when listing dimensions.
:type expand: str
:param skiptoken: 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.
+ 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.
:type skiptoken: str
: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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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)
+
+ request = self._client.get(url, query_parameters, header_parameters)
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)
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
@@ -247,4 +255,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/_exports_operations.py
similarity index 72%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_export_operations.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_exports_operations.py
index b77ce24bc8a..cfba66c4786 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_export_operations.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_exports_operations.py
@@ -8,7 +8,7 @@
from typing import TYPE_CHECKING
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -17,19 +17,19 @@
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]]
-class ExportOperations(object):
- """ExportOperations operations.
+class ExportsOperations(object):
+ """ExportsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,12 +47,13 @@ def __init__(self, client, config, serializer, deserializer):
def list(
self,
scope, # type: str
+ expand=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "models.ExportListResult"
"""The operation to list all exports at the given scope.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -69,17 +70,24 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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,12 +96,13 @@ 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]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -106,21 +115,22 @@ 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"
"""The operation to get the export for the defined scope by export name.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -139,17 +149,24 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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,12 +176,13 @@ 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]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -177,33 +195,24 @@ 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]
- 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"]
- destination=None, # type: Optional["models.ExportDeliveryDestination"]
- status=None, # type: Optional[Union[str, "models.StatusType"]]
- recurrence=None, # type: Optional[Union[str, "models.RecurrenceType"]]
- recurrence_period=None, # type: Optional["models.ExportRecurrencePeriod"]
+ parameters, # type: "models.Export"
**kwargs # type: Any
):
# type: (...) -> "models.Export"
- """The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
+ """The operation to create or update a export. Update operation requires latest eTag to be set in
+ the request. You may obtain the latest eTag by performing a get operation. Create operation
+ does not require eTag.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -222,52 +231,24 @@ def create_or_update(
:type scope: str
:param export_name: Export Name.
:type export_name: str
- :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
- 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
- :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
- :param recurrence: The schedule recurrence.
- :type recurrence: str or ~azure.mgmt.costmanagement.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
+ :param parameters: Parameters supplied to the CreateOrUpdate Export operation.
+ :type parameters: ~cost_management_client.models.Export
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -281,14 +262,12 @@ def create_or_update(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'Export')
+ body_content = self._serialize.body(parameters, 'Export')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -297,7 +276,6 @@ def create_or_update(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('Export', pipeline_response)
@@ -305,10 +283,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,
@@ -319,7 +297,7 @@ def delete(
# type: (...) -> None
"""The operation to delete a export.
- :param scope: The scope associated with query and export operations. This includes
+ :param scope: The scope associated with 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
@@ -339,16 +317,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -361,8 +343,8 @@ def delete(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -373,9 +355,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,9 +366,9 @@ 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
+ :param scope: The scope associated with 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
@@ -406,16 +388,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -428,8 +414,8 @@ def execute(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.post(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -440,9 +426,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,9 +437,9 @@ 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
+ :param scope: The scope associated with 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
@@ -473,16 +459,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -495,9 +485,8 @@ def get_execution_history(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -510,7 +499,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..58bed8f515f 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
@@ -8,7 +8,7 @@
from typing import TYPE_CHECKING
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -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.
@@ -47,16 +47,8 @@ def __init__(self, client, config, serializer, deserializer):
def usage(
self,
scope, # type: str
- type, # type: Union[str, "models.ForecastType"]
- timeframe, # type: Union[str, "models.ForecastTimeframeType"]
+ parameters, # type: "models.ForecastDefinition"
filter=None, # type: Optional[str]
- time_period=None, # type: Optional["models.QueryTimePeriod"]
- 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"]]
- query_filter=None, # type: Optional["models.QueryFilter"]
**kwargs # type: Any
):
# type: (...) -> "models.QueryResult"
@@ -79,47 +71,28 @@ def usage(
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: str
- :param type: The type of the forecast.
- :type type: str or ~azure.mgmt.costmanagement.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
+ :param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
+ :type parameters: ~cost_management_client.models.ForecastDefinition
: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
- :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
- 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
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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),
}
@@ -134,14 +107,12 @@ def usage(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'ForecastDefinition')
+ body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -153,25 +124,17 @@ 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,
external_cloud_provider_type, # type: Union[str, "models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
- type, # type: Union[str, "models.ForecastType"]
- timeframe, # type: Union[str, "models.ForecastTimeframeType"]
+ parameters, # type: "models.ForecastDefinition"
filter=None, # type: Optional[str]
- time_period=None, # type: Optional["models.QueryTimePeriod"]
- 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"]]
- query_filter=None, # type: Optional["models.QueryFilter"]
**kwargs # type: Any
):
# type: (...) -> "models.QueryResult"
@@ -180,51 +143,32 @@ 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
- :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
+ :param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
+ :type parameters: ~cost_management_client.models.ForecastDefinition
: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
- :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
- 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
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -240,14 +184,12 @@ def external_cloud_provider_usage(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'ForecastDefinition')
+ body_content = self._serialize.body(parameters, 'ForecastDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -259,7 +201,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/_operations.py
similarity index 69%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operation_operations.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operations.py
index 6d83e16b9dc..e9d06dfa8d3 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operation_operations.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_operations.py
@@ -8,7 +8,7 @@
from typing import TYPE_CHECKING
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
@@ -18,19 +18,19 @@
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]]
-class OperationOperations(object):
- """OperationOperations operations.
+class Operations(object):
+ """Operations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,35 +49,39 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
@@ -103,4 +107,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..fdc43d3d55b 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
@@ -8,7 +8,7 @@
from typing import TYPE_CHECKING
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -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 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.
@@ -47,13 +47,7 @@ def __init__(self, client, config, serializer, deserializer):
def usage(
self,
scope, # type: str
- type, # type: Union[str, "models.ExportType"]
- 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"]]
- filter=None, # type: Optional["models.QueryFilter"]
+ parameters, # type: "models.QueryDefinition"
**kwargs # type: Any
):
# type: (...) -> "models.QueryResult"
@@ -76,39 +70,24 @@ def usage(
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners.
:type scope: 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
- 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
+ :param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
+ :type parameters: ~cost_management_client.models.QueryDefinition
: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})
-
- _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter)
- api_version = "2019-11-01"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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),
}
@@ -121,14 +100,12 @@ def usage(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'QueryDefinition')
+ body_content = self._serialize.body(parameters, 'QueryDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -140,22 +117,16 @@ 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,
external_cloud_provider_type, # type: Union[str, "models.ExternalCloudProviderType"]
external_cloud_provider_id, # type: str
- type, # type: Union[str, "models.ExportType"]
- 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"]]
- filter=None, # type: Optional["models.QueryFilter"]
+ parameters, # type: "models.QueryDefinition"
**kwargs # type: Any
):
# type: (...) -> "models.QueryResult"
@@ -164,43 +135,28 @@ 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
- :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
- :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
+ :param parameters: Parameters supplied to the CreateOrUpdate Query Config operation.
+ :type parameters: ~cost_management_client.models.QueryDefinition
: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})
-
- _parameters = models.QueryDefinition(type=type, timeframe=timeframe, time_period=time_period, configuration=configuration, aggregation=aggregation, grouping=grouping, filter=filter)
- api_version = "2019-11-01"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -214,14 +170,12 @@ def usage_by_external_cloud_provider_type(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'QueryDefinition')
+ body_content = self._serialize.body(parameters, 'QueryDefinition')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -233,7 +187,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/_views_operations.py
similarity index 62%
rename from src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py
rename to src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_views_operations.py
index bf08f8e37e3..b3803f688ce 100644
--- a/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_view_operations.py
+++ b/src/costmanagement/azext_costmanagement/vendored_sdks/costmanagement/operations/_views_operations.py
@@ -8,7 +8,7 @@
from typing import TYPE_CHECKING
import warnings
-from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
@@ -18,19 +18,19 @@
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, Optional, TypeVar, Union
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
-class ViewOperations(object):
- """ViewOperations operations.
+class ViewsOperations(object):
+ """ViewsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
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,35 +49,39 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
@@ -103,64 +107,68 @@ 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
- '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.
+ '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.
: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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
def prepare_request(next_link=None):
+ # Construct headers
+ header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
+
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')
+
+ request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
-
- # 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)
+ query_parameters = {} # type: Dict[str, Any]
+ request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
@@ -186,7 +194,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 +207,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
}
@@ -220,9 +232,8 @@ def get(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -235,86 +246,42 @@ 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,
view_name, # type: str
- e_tag=None, # type: Optional[str]
- display_name=None, # type: Optional[str]
- scope=None, # type: Optional[str]
- 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"]]
- timeframe=None, # type: Optional[Union[str, "models.ReportTimeframeType"]]
- time_period=None, # type: Optional["models.ReportConfigTimePeriod"]
- dataset=None, # type: Optional["models.ReportConfigDataset"]
+ parameters, # type: "models.View"
**kwargs # type: Any
):
# type: (...) -> "models.View"
- """The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
+ """The operation to create or update a view. Update operation requires latest eTag to be set in
+ the request. You may obtain the latest eTag by performing a get operation. Create operation
+ does not require eTag.
:param view_name: View name.
:type view_name: str
- :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 display_name: User input name of the view. Required.
- :type display_name: str
- :param scope: 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.
- :type scope: str
- :param chart: Chart type of the main view in Cost Analysis. Required.
- :type chart: str or ~azure.mgmt.costmanagement.models.ChartType
- :param accumulated: Show costs accumulated over time.
- :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType
- :param metric: Metric to use when displaying costs.
- :type metric: str or ~azure.mgmt.costmanagement.models.MetricType
- :param kpis: List of KPIs to show in Cost Analysis UI.
- :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties]
- :param pivots: Configuration of 3 sub-views in the Cost Analysis UI.
- :type pivots: list[~azure.mgmt.costmanagement.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
- :param time_period: Has time period for pulling data for the report.
- :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
- :param dataset: Has definition for data in this report config.
- :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset
+ :param parameters: Parameters supplied to the CreateOrUpdate View operation.
+ :type parameters: ~cost_management_client.models.View
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
}
@@ -327,14 +294,12 @@ def create_or_update(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'View')
+ body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -343,7 +308,6 @@ def create_or_update(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
@@ -351,10 +315,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 +331,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
}
@@ -388,8 +356,8 @@ def delete(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -400,9 +368,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 +402,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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'),
@@ -456,9 +428,8 @@ def get_by_scope(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
- header_parameters['Accept'] = 'application/json'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # 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
@@ -471,30 +442,22 @@ 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,
scope, # type: str
view_name, # type: str
- e_tag=None, # type: Optional[str]
- display_name=None, # type: Optional[str]
- view_properties_scope=None, # type: Optional[str]
- 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"]]
- timeframe=None, # type: Optional[Union[str, "models.ReportTimeframeType"]]
- time_period=None, # type: Optional["models.ReportConfigTimePeriod"]
- dataset=None, # type: Optional["models.ReportConfigDataset"]
+ parameters, # type: "models.View"
**kwargs # type: Any
):
# type: (...) -> "models.View"
- """The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
+ """The operation to create or update a view. Update operation requires latest eTag to be set in
+ the request. You may obtain the latest eTag by performing a get operation. Create operation
+ does not require eTag.
:param scope: The scope associated with view operations. This includes
'subscriptions/{subscriptionId}' for subscription scope,
@@ -516,60 +479,24 @@ def create_or_update_by_scope(
:type scope: str
:param view_name: View name.
:type view_name: str
- :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 display_name: User input name of the view. Required.
- :type display_name: str
- :param view_properties_scope: 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.
- :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
- :param accumulated: Show costs accumulated over time.
- :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType
- :param metric: Metric to use when displaying costs.
- :type metric: str or ~azure.mgmt.costmanagement.models.MetricType
- :param kpis: List of KPIs to show in Cost Analysis UI.
- :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties]
- :param pivots: Configuration of 3 sub-views in the Cost Analysis UI.
- :type pivots: list[~azure.mgmt.costmanagement.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
- :param time_period: Has time period for pulling data for the report.
- :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod
- :param dataset: Has definition for data in this report config.
- :type dataset: ~azure.mgmt.costmanagement.models.ReportConfigDataset
+ :param parameters: Parameters supplied to the CreateOrUpdate View operation.
+ :type parameters: ~cost_management_client.models.View
: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})
-
- _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"
+ error_map = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
content_type = kwargs.pop("content_type", "application/json")
+ accept = "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'),
@@ -583,14 +510,12 @@ def create_or_update_by_scope(
# 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'
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
- body_content = self._serialize.body(_parameters, 'View')
+ body_content = self._serialize.body(parameters, 'View')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
-
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -599,7 +524,6 @@ def create_or_update_by_scope(
error = self._deserialize(models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('View', pipeline_response)
@@ -607,10 +531,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 +566,20 @@ 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 = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
+ }
+ error_map.update(kwargs.pop('error_map', {}))
+ api_version = "2020-06-01"
+ accept = "application/json"
# 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,8 +592,8 @@ def delete_by_scope(
# Construct headers
header_parameters = {} # type: Dict[str, Any]
+ header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
- # Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
@@ -676,6 +604,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..bbe97cffe87
--- /dev/null
+++ b/src/costmanagement/report.md
@@ -0,0 +1,1055 @@
+# Azure CLI Module Creation Report
+
+## EXTENSION
+|CLI Extension|Command Groups|
+|---------|------------|
+|az costmanagement|[groups](#CommandGroups)
+
+## GROUPS
+### Command groups in `az costmanagement` extension
+|CLI Command Group|Group Swagger name|Commands|
+|---------|------------|--------|
+|az costmanagement view|Views|[commands](#CommandsInViews)|
+|az costmanagement alert|Alerts|[commands](#CommandsInAlerts)|
+|az costmanagement forecast|Forecast|[commands](#CommandsInForecast)|
+|az costmanagement dimension|Dimensions|[commands](#CommandsInDimensions)|
+|az costmanagement query|Query|[commands](#CommandsInQuery)|
+|az costmanagement export|Exports|[commands](#CommandsInExports)|
+
+## COMMANDS
+### Commands in `az costmanagement alert` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az costmanagement alert list](#AlertsList)|List|[Parameters](#ParametersAlertsList)|[Example](#ExamplesAlertsList)|
+|[az costmanagement alert show](#AlertsGet)|Get|[Parameters](#ParametersAlertsGet)|[Example](#ExamplesAlertsGet)|
+|[az costmanagement alert dismiss](#AlertsDismiss)|Dismiss|[Parameters](#ParametersAlertsDismiss)|[Example](#ExamplesAlertsDismiss)|
+|[az costmanagement alert list-external](#AlertsListExternal)|ListExternal|[Parameters](#ParametersAlertsListExternal)|[Example](#ExamplesAlertsListExternal)|
+
+### Commands in `az costmanagement dimension` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az costmanagement dimension list](#DimensionsList)|List|[Parameters](#ParametersDimensionsList)|[Example](#ExamplesDimensionsList)|
+|[az costmanagement dimension by-external-cloud-provider-type](#DimensionsByExternalCloudProviderType)|ByExternalCloudProviderType|[Parameters](#ParametersDimensionsByExternalCloudProviderType)|[Example](#ExamplesDimensionsByExternalCloudProviderType)|
+
+### Commands in `az costmanagement export` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az costmanagement export list](#ExportsList)|List|[Parameters](#ParametersExportsList)|[Example](#ExamplesExportsList)|
+|[az costmanagement export show](#ExportsGet)|Get|[Parameters](#ParametersExportsGet)|[Example](#ExamplesExportsGet)|
+|[az costmanagement export create](#ExportsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersExportsCreateOrUpdate#Create)|[Example](#ExamplesExportsCreateOrUpdate#Create)|
+|[az costmanagement export update](#ExportsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersExportsCreateOrUpdate#Update)|Not Found|
+|[az costmanagement export delete](#ExportsDelete)|Delete|[Parameters](#ParametersExportsDelete)|[Example](#ExamplesExportsDelete)|
+|[az costmanagement export execute](#ExportsExecute)|Execute|[Parameters](#ParametersExportsExecute)|[Example](#ExamplesExportsExecute)|
+|[az costmanagement export show-execution-history](#ExportsGetExecutionHistory)|GetExecutionHistory|[Parameters](#ParametersExportsGetExecutionHistory)|[Example](#ExamplesExportsGetExecutionHistory)|
+
+### Commands in `az costmanagement forecast` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az costmanagement forecast external-cloud-provider-usage](#ForecastExternalCloudProviderUsage)|ExternalCloudProviderUsage|[Parameters](#ParametersForecastExternalCloudProviderUsage)|[Example](#ExamplesForecastExternalCloudProviderUsage)|
+|[az costmanagement forecast usage](#ForecastUsage)|Usage|[Parameters](#ParametersForecastUsage)|[Example](#ExamplesForecastUsage)|
+
+### Commands in `az costmanagement query` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az costmanagement query usage](#QueryUsage)|Usage|[Parameters](#ParametersQueryUsage)|[Example](#ExamplesQueryUsage)|
+|[az costmanagement query usage-by-external-cloud-provider-type](#QueryUsageByExternalCloudProviderType)|UsageByExternalCloudProviderType|[Parameters](#ParametersQueryUsageByExternalCloudProviderType)|[Example](#ExamplesQueryUsageByExternalCloudProviderType)|
+
+### Commands in `az costmanagement view` group
+|CLI Command|Operation Swagger name|Parameters|Examples|
+|---------|------------|--------|-----------|
+|[az costmanagement view list](#ViewsListByScope)|ListByScope|[Parameters](#ParametersViewsListByScope)|[Example](#ExamplesViewsListByScope)|
+|[az costmanagement view list](#ViewsList)|List|[Parameters](#ParametersViewsList)|[Example](#ExamplesViewsList)|
+|[az costmanagement view show](#ViewsGetByScope)|GetByScope|[Parameters](#ParametersViewsGetByScope)|[Example](#ExamplesViewsGetByScope)|
+|[az costmanagement view show](#ViewsGet)|Get|[Parameters](#ParametersViewsGet)|[Example](#ExamplesViewsGet)|
+|[az costmanagement view create](#ViewsCreateOrUpdateByScope)|CreateOrUpdateByScope|[Parameters](#ParametersViewsCreateOrUpdateByScope)|[Example](#ExamplesViewsCreateOrUpdateByScope)|
+|[az costmanagement view create](#ViewsCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersViewsCreateOrUpdate#Create)|[Example](#ExamplesViewsCreateOrUpdate#Create)|
+|[az costmanagement view update](#ViewsCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersViewsCreateOrUpdate#Update)|Not Found|
+|[az costmanagement view delete](#ViewsDeleteByScope)|DeleteByScope|[Parameters](#ParametersViewsDeleteByScope)|[Example](#ExamplesViewsDeleteByScope)|
+|[az costmanagement view delete](#ViewsDelete)|Delete|[Parameters](#ParametersViewsDelete)|[Example](#ExamplesViewsDelete)|
+
+
+## COMMAND DETAILS
+
+### group `az costmanagement alert`
+#### Command `az costmanagement alert list`
+
+##### Example
+```
+az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789"
+```
+##### Example
+```
+az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123"
+```
+##### Example
+```
+az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement alert list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invo\
+iceSections/9876"
+```
+##### Example
+```
+az costmanagement alert list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTe\
+st-peer"
+```
+##### Example
+```
+az costmanagement alert list --scope "subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+
+#### Command `az costmanagement alert show`
+
+##### Example
+```
+az costmanagement alert show --alert-id "22222222-2222-2222-2222-222222222222" --scope "subscriptions/00000000-0000-000\
+0-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+```
+##### Example
+```
+az costmanagement alert show --alert-id "22222222-2222-2222-2222-222222222222" --scope "subscriptions/00000000-0000-000\
+0-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--alert-id**|string|Alert ID|alert_id|alertId|
+
+#### Command `az costmanagement alert dismiss`
+
+##### Example
+```
+az costmanagement alert dismiss --alert-id "22222222-2222-2222-2222-222222222222" --status "Dismissed" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+```
+##### Example
+```
+az costmanagement alert dismiss --alert-id "22222222-2222-2222-2222-222222222222" --status "Dismissed" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--alert-id**|string|Alert ID|alert_id|alertId|
+|**--definition**|object|defines the type of alert|definition|definition|
+|**--description**|string|Alert description|description|description|
+|**--source**|choice|Source of alert|source|source|
+|**--cost-entity-id**|string|related budget|cost_entity_id|costEntityId|
+|**--status**|choice|alert status|status|status|
+|**--creation-time**|string|dateTime in which alert was created|creation_time|creationTime|
+|**--close-time**|string|dateTime in which alert was closed|close_time|closeTime|
+|**--modification-time**|string|dateTime in which alert was last modified|modification_time|modificationTime|
+|**--status-modification-user-name**|string||status_modification_user_name|statusModificationUserName|
+|**--status-modification-time**|string|dateTime in which the alert status was last modified|status_modification_time|statusModificationTime|
+|**--time-grain-type**|choice|Type of timegrain cadence|time_grain_type|timeGrainType|
+|**--period-start-date**|string|datetime of periodStartDate|period_start_date|periodStartDate|
+|**--triggered-by**|string|notificationId that triggered this alert|triggered_by|triggeredBy|
+|**--resource-group-filter**|array|array of resourceGroups to filter by|resource_group_filter|resourceGroupFilter|
+|**--resource-filter**|array|array of resources to filter by|resource_filter|resourceFilter|
+|**--meter-filter**|array|array of meters to filter by|meter_filter|meterFilter|
+|**--tag-filter**|any|tags to filter by|tag_filter|tagFilter|
+|**--threshold**|number|notification threshold percentage as a decimal which activated this alert|threshold|threshold|
+|**--operator**|choice|operator used to compare currentSpend with amount|operator|operator|
+|**--amount**|number|budget threshold amount|amount|amount|
+|**--unit**|string|unit of currency being used|unit|unit|
+|**--current-spend**|number|current spend|current_spend|currentSpend|
+|**--contact-emails**|array|list of emails to contact|contact_emails|contactEmails|
+|**--contact-groups**|array|list of action groups to broadcast to|contact_groups|contactGroups|
+|**--contact-roles**|array|list of contact roles|contact_roles|contactRoles|
+|**--overriding-alert**|string|overriding alert|overriding_alert|overridingAlert|
+
+#### Command `az costmanagement alert list-external`
+
+##### Example
+```
+az costmanagement alert list-external --external-cloud-provider-id "100" --external-cloud-provider-type \
+"externalBillingAccounts"
+```
+##### Example
+```
+az costmanagement alert list-external --external-cloud-provider-id "100" --external-cloud-provider-type \
+"externalSubscriptions"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|externalCloudProviderType|
+|**--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|externalCloudProviderId|
+
+### group `az costmanagement dimension`
+#### Command `az costmanagement dimension list`
+
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/100"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/12345:6789"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/100"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/12345:6789"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/12345:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/12345:6789/customers/5678"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/100/departments/123"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/100/departments/123"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/\
+invoiceSections/9876"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Billing/billingAccount\
+s/12345:6789/billingProfiles/13579/invoiceSections/9876"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876"
+```
+##### Example
+```
+az costmanagement dimension list --scope "providers/Microsoft.Management/managementGroups/MyMgId"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "providers/Microsoft.Management/managementG\
+roups/MyMgId"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --filter "properties/category eq \'resourceId\'" --top 5 \
+--scope "providers/Microsoft.Management/managementGroups/MyMgId"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "subscriptions/00000000-0000-0000-0000-0000\
+00000000/resourceGroups/system.orlando"
+```
+##### Example
+```
+az costmanagement dimension list --expand "properties/data" --top 5 --scope "subscriptions/00000000-0000-0000-0000-0000\
+00000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|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|$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|$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|$skiptoken|
+|**--top**|integer|May be used to limit the number of results to the most recent N dimension data.|top|$top|
+
+#### Command `az costmanagement dimension by-external-cloud-provider-type`
+
+##### Example
+```
+az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalBillingAccounts"
+```
+##### Example
+```
+az costmanagement dimension by-external-cloud-provider-type --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalSubscriptions"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|externalCloudProviderType|
+|**--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|externalCloudProviderId|
+|**--filter**|string|May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.|filter|$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|$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|$skiptoken|
+|**--top**|integer|May be used to limit the number of results to the most recent N dimension data.|top|$top|
+
+### group `az costmanagement export`
+#### Command `az costmanagement export list`
+
+##### Example
+```
+az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/123456"
+```
+##### Example
+```
+az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/12/departments/123"
+```
+##### Example
+```
+az costmanagement export list --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement export list --scope "providers/Microsoft.Management/managementGroups/TestMG"
+```
+##### Example
+```
+az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
+```
+##### Example
+```
+az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|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|$expand|
+
+#### Command `az costmanagement export show`
+
+##### Example
+```
+az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/123456"
+```
+##### Example
+```
+az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/12/departments/1\
+234"
+```
+##### Example
+```
+az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmentAc\
+counts/456"
+```
+##### Example
+```
+az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
+```
+##### Example
+```
+az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceG\
+roups/MYDEVTESTRG"
+```
+##### Example
+```
+az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|scope|
+|**--export-name**|string|Export Name.|export_name|exportName|
+|**--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|$expand|
+
+#### Command `az costmanagement export create`
+
+##### Example
+```
+az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Billing/billingAccounts/123456"
+```
+##### Example
+```
+az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Billing/billingAccounts/12/departments/1234"
+```
+##### Example
+```
+az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"providers/Microsoft.Management/managementGroups/TestMG"
+```
+##### Example
+```
+az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
+```
+##### Example
+```
+az costmanagement export create --name "TestExport" --type "ActualCost" --configuration columns="Date" \
+columns="MeterId" columns="ResourceId" columns="ResourceLocation" columns="Quantity" --timeframe "MonthToDate" \
+--destination container="exports" resource-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEV\
+TESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" root-folder-path="ad-hoc" --recurrence "Weekly" \
+--recurrence-period from="2020-06-01T00:00:00Z" to="2020-10-31T00:00:00Z" --status "Active" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|scope|
+|**--export-name**|string|Export Name.|export_name|exportName|
+|**--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|eTag|
+|**--status**|choice|The status of the export's schedule. If 'Inactive', the export's schedule is paused.|status|status|
+|**--recurrence**|choice|The schedule recurrence.|recurrence|recurrence|
+|**--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|recurrencePeriod|
+|**--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|type|
+|**--timeframe**|choice|The time frame for pulling data for the export. If custom, then a specific time period must be provided.|timeframe|timeframe|
+|**--time-period**|object|Has time period for pulling data for the export.|time_period|timePeriod|
+|**--configuration**|object|The export dataset configuration.|configuration|configuration|
+|**--destination**|object|Has destination for the export being delivered.|destination|destination|
+
+#### Command `az costmanagement export update`
+
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|scope|
+|**--export-name**|string|Export Name.|export_name|exportName|
+|**--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|eTag|
+|**--status**|choice|The status of the export's schedule. If 'Inactive', the export's schedule is paused.|status|status|
+|**--recurrence**|choice|The schedule recurrence.|recurrence|recurrence|
+|**--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|recurrencePeriod|
+|**--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|type|
+|**--timeframe**|choice|The time frame for pulling data for the export. If custom, then a specific time period must be provided.|timeframe|timeframe|
+|**--time-period**|object|Has time period for pulling data for the export.|time_period|timePeriod|
+|**--configuration**|object|The export dataset configuration.|configuration|configuration|
+|**--destination**|object|Has destination for the export being delivered.|destination|destination|
+
+#### Command `az costmanagement export delete`
+
+##### Example
+```
+az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/123456"
+```
+##### Example
+```
+az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/12/departments\
+/1234"
+```
+##### Example
+```
+az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollment\
+Accounts/456"
+```
+##### Example
+```
+az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
+```
+##### Example
+```
+az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourc\
+eGroups/MYDEVTESTRG"
+```
+##### Example
+```
+az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|scope|
+|**--export-name**|string|Export Name.|export_name|exportName|
+
+#### Command `az costmanagement export execute`
+
+##### Example
+```
+az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/123456"
+```
+##### Example
+```
+az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/12/department\
+s/1234"
+```
+##### Example
+```
+az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Billing/billingAccounts/100/enrollmen\
+tAccounts/456"
+```
+##### Example
+```
+az costmanagement export execute --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
+```
+##### Example
+```
+az costmanagement export execute --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resour\
+ceGroups/MYDEVTESTRG"
+```
+##### Example
+```
+az costmanagement export execute --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|scope|
+|**--export-name**|string|Export Name.|export_name|exportName|
+
+#### Command `az costmanagement export show-execution-history`
+
+##### Example
+```
+az costmanagement export show-execution-history --name "TestExport" --scope "providers/Microsoft.Billing/billingAccount\
+s/123456"
+```
+##### Example
+```
+az costmanagement export show-execution-history --name "TestExport" --scope "providers/Microsoft.Billing/billingAccount\
+s/12/departments/1234"
+```
+##### Example
+```
+az costmanagement export show-execution-history --name "TestExport" --scope "providers/Microsoft.Billing/billingAccount\
+s/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement export show-execution-history --name "TestExport" --scope "providers/Microsoft.Management/managementG\
+roups/TestMG"
+```
+##### Example
+```
+az costmanagement export show-execution-history --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-0000\
+00000000/resourceGroups/MYDEVTESTRG"
+```
+##### Example
+```
+az costmanagement export show-execution-history --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-0000\
+00000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--scope**|string|The scope associated with 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|scope|
+|**--export-name**|string|Export Name.|export_name|exportName|
+
+### group `az costmanagement forecast`
+#### Command `az costmanagement forecast external-cloud-provider-usage`
+
+##### Example
+```
+az costmanagement forecast external-cloud-provider-usage --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalBillingAccounts" --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dime\
+nsion\\":{\\"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"
+```
+##### Example
+```
+az costmanagement forecast external-cloud-provider-usage --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalSubscriptions" --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimens\
+ion\\":{\\"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"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|externalCloudProviderType|
+|**--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|externalCloudProviderId|
+|**--type**|choice|The type of the forecast.|type|type|
+|**--timeframe**|choice|The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.|timeframe|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|$filter|
+|**--time-period**|object|Has time period for pulling data for the forecast.|time_period|timePeriod|
+|**--include-actual-cost**|boolean|a boolean determining if actualCost will be included|include_actual_cost|includeActualCost|
+|**--include-fresh-partial-cost**|boolean|a boolean determining if FreshPartialCost will be included|include_fresh_partial_cost|includeFreshPartialCost|
+|**--configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration|configuration|
+|**--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|aggregation|
+|**--query-filter**|object|Has filter expression to use in the forecast.|query_filter|filter|
+
+#### Command `az costmanagement forecast usage`
+
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false \
+--include-fresh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345\
+:6789"
+```
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false \
+--include-fresh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345\
+:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false \
+--include-fresh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345\
+:6789/departments/123"
+```
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false \
+--include-fresh-partial-cost false --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/billingAccounts/12345\
+:6789/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"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/9876"
+```
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false \
+--include-fresh-partial-cost false --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-00000000000\
+0/resourceGroups/ScreenSharingTest-peer"
+```
+##### Example
+```
+az costmanagement forecast usage --type "Usage" --query-filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"\
+ResourceLocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"\
+Environment\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"Resource\
+Group\\",\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --include-actual-cost false \
+--include-fresh-partial-cost false --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-00000000000\
+0"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--type**|choice|The type of the forecast.|type|type|
+|**--timeframe**|choice|The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.|timeframe|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|$filter|
+|**--time-period**|object|Has time period for pulling data for the forecast.|time_period|timePeriod|
+|**--include-actual-cost**|boolean|a boolean determining if actualCost will be included|include_actual_cost|includeActualCost|
+|**--include-fresh-partial-cost**|boolean|a boolean determining if FreshPartialCost will be included|include_fresh_partial_cost|includeFreshPartialCost|
+|**--configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration|configuration|
+|**--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|aggregation|
+|**--query-filter**|object|Has filter expression to use in the forecast.|query_filter|filter|
+
+### group `az costmanagement query`
+#### Command `az costmanagement query usage`
+
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/70664866"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/12345:6789"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/70664866"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/12345:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/12345:6789/customers/5678"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/100/departments/123"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/departments/123"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Billing/bi\
+llingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "providers/Microsoft.Management\
+/managementGroups/MyMgId"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"providers/Microsoft.Management/managementGroups/MyMgId"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-00\
+00-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceType" type="Dimension" --timeframe "TheLastMonth" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --filter "{\\"and\\":[{\\"or\\":[{\\"dimension\\":{\\"name\\":\\"ResourceL\
+ocation\\",\\"operator\\":\\"In\\",\\"values\\":[\\"East US\\",\\"West Europe\\"]}},{\\"tag\\":{\\"name\\":\\"Environme\
+nt\\",\\"operator\\":\\"In\\",\\"values\\":[\\"UAT\\",\\"Prod\\"]}}]},{\\"dimension\\":{\\"name\\":\\"ResourceGroup\\",\
+\\"operator\\":\\"In\\",\\"values\\":[\\"API\\"]}}]}" --timeframe "MonthToDate" --scope "subscriptions/00000000-0000-00\
+00-0000-000000000000"
+```
+##### Example
+```
+az costmanagement query usage --type "Usage" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\\",\\"function\\\
+":\\"Sum\\"}}" --grouping name="ResourceGroup" type="Dimension" --timeframe "TheLastMonth" --scope \
+"subscriptions/00000000-0000-0000-0000-000000000000"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--type**|choice|The type of the query.|type|type|
+|**--timeframe**|choice|The time frame for pulling data for the query. If custom, then a specific time period must be provided.|timeframe|timeframe|
+|**--time-period**|object|Has time period for pulling data for the query.|time_period|timePeriod|
+|**--configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration|configuration|
+|**--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|aggregation|
+|**--grouping**|array|Array of group by expression to use in the query. Query can have up to 2 group by clauses.|grouping|grouping|
+|**--filter**|object|Has filter expression to use in the query.|filter|filter|
+
+#### Command `az costmanagement query usage-by-external-cloud-provider-type`
+
+##### Example
+```
+az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalBillingAccounts" --type "Usage" --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"
+```
+##### Example
+```
+az costmanagement query usage-by-external-cloud-provider-type --external-cloud-provider-id "100" \
+--external-cloud-provider-type "externalSubscriptions" --type "Usage" --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"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|externalCloudProviderType|
+|**--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|externalCloudProviderId|
+|**--type**|choice|The type of the query.|type|type|
+|**--timeframe**|choice|The time frame for pulling data for the query. If custom, then a specific time period must be provided.|timeframe|timeframe|
+|**--time-period**|object|Has time period for pulling data for the query.|time_period|timePeriod|
+|**--configuration**|object|Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.|configuration|configuration|
+|**--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|aggregation|
+|**--grouping**|array|Array of group by expression to use in the query. Query can have up to 2 group by clauses.|grouping|grouping|
+|**--filter**|object|Has filter expression to use in the query.|filter|filter|
+
+### group `az costmanagement view`
+#### Command `az costmanagement view list`
+
+##### Example
+```
+az costmanagement view list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+
+#### Command `az costmanagement view list`
+
+##### Example
+```
+az costmanagement view list
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+#### Command `az costmanagement view show`
+
+##### Example
+```
+az costmanagement view show --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" \
+--name "swaggerExample"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--view-name**|string|View name|view_name|viewName|
+
+#### Command `az costmanagement view show`
+
+##### Example
+```
+az costmanagement view show --name "swaggerExample"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+#### Command `az costmanagement view create`
+
+##### Example
+```
+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/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budg\
+ets/swaggerDemo" --metric "ActualCost" --pivots name="ServiceName" type="Dimension" --pivots name="MeterCategory" \
+type="Dimension" --pivots name="swaggerTagKey" type="TagKey" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\
+\\",\\"function\\":\\"Sum\\"}}" --granularity "Daily" --sorting name="UsageDate" direction="Ascending" --timeframe \
+"MonthToDate" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" --name \
+"swaggerExample"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--view-name**|string|View name|view_name|viewName|
+|**--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|eTag|
+|**--display-name**|string|User input name of the view. Required.|display_name|displayName|
+|**--view-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.|view_properties_scope|scope|
+|**--chart**|choice|Chart type of the main view in Cost Analysis. Required.|chart|chart|
+|**--accumulated**|choice|Show costs accumulated over time.|accumulated|accumulated|
+|**--metric**|choice|Metric to use when displaying costs.|metric|metric|
+|**--kpis**|array|List of KPIs to show in Cost Analysis UI.|kpis|kpis|
+|**--pivots**|array|Configuration of 3 sub-views in the Cost Analysis UI.|pivots|pivots|
+|**--timeframe**|choice|The time frame for pulling data for the report. If custom, then a specific time period must be provided.|timeframe|timeframe|
+|**--time-period**|object|Has time period for pulling data for the report.|time_period|timePeriod|
+|**--granularity**|choice|The granularity of rows in the report.|granularity|granularity|
+|**--configuration**|object|Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.|configuration|configuration|
+|**--aggregation**|dictionary|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.|aggregation|aggregation|
+|**--grouping**|array|Array of group by expression to use in the report. Report can have up to 2 group by clauses.|grouping|grouping|
+|**--sorting**|array|Array of order by expression to use in the report.|sorting|sorting|
+|**--filter**|object|Has filter expression to use in the report.|filter|filter|
+
+#### Command `az costmanagement view create`
+
+##### Example
+```
+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/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budg\
+ets/swaggerDemo" --metric "ActualCost" --pivots name="ServiceName" type="Dimension" --pivots name="MeterCategory" \
+type="Dimension" --pivots name="swaggerTagKey" type="TagKey" --aggregation "{\\"totalCost\\":{\\"name\\":\\"PreTaxCost\
+\\",\\"function\\":\\"Sum\\"}}" --granularity "Daily" --sorting name="UsageDate" direction="Ascending" --timeframe \
+"MonthToDate" --name "swaggerExample"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+
+#### Command `az costmanagement view update`
+
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--view-name**|string|View name|view_name|viewName|
+|**--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|eTag|
+|**--display-name**|string|User input name of the view. Required.|display_name|displayName|
+|**--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|scope|
+|**--chart**|choice|Chart type of the main view in Cost Analysis. Required.|chart|chart|
+|**--accumulated**|choice|Show costs accumulated over time.|accumulated|accumulated|
+|**--metric**|choice|Metric to use when displaying costs.|metric|metric|
+|**--kpis**|array|List of KPIs to show in Cost Analysis UI.|kpis|kpis|
+|**--pivots**|array|Configuration of 3 sub-views in the Cost Analysis UI.|pivots|pivots|
+|**--timeframe**|choice|The time frame for pulling data for the report. If custom, then a specific time period must be provided.|timeframe|timeframe|
+|**--time-period**|object|Has time period for pulling data for the report.|time_period|timePeriod|
+|**--granularity**|choice|The granularity of rows in the report.|granularity|granularity|
+|**--configuration**|object|Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.|configuration|configuration|
+|**--aggregation**|dictionary|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.|aggregation|aggregation|
+|**--grouping**|array|Array of group by expression to use in the report. Report can have up to 2 group by clauses.|grouping|grouping|
+|**--sorting**|array|Array of order by expression to use in the report.|sorting|sorting|
+|**--filter**|object|Has filter expression to use in the report.|filter|filter|
+
+#### Command `az costmanagement view delete`
+
+##### Example
+```
+az costmanagement view delete --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG" \
+--name "TestView"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
+|**--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|scope|
+|**--view-name**|string|View name|view_name|viewName|
+
+#### Command `az costmanagement view delete`
+
+##### Example
+```
+az costmanagement view delete --name "TestView"
+```
+##### Parameters
+|Option|Type|Description|Path (SDK)|Swagger name|
+|------|----|-----------|----------|------------|
\ No newline at end of file
diff --git a/src/costmanagement/setup.py b/src/costmanagement/setup.py
index 2a2f3f7c5f7..2eee2be9a02 100644
--- a/src/costmanagement/setup.py
+++ b/src/costmanagement/setup.py
@@ -1,52 +1,58 @@
-#!/usr/bin/env python
-
-# --------------------------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# --------------------------------------------------------------------------------------------
-
-
-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.1'
-
-# The full list of classifiers is available at
-# https://pypi.python.org/pypi?%3Aaction=list_classifiers
-CLASSIFIERS = [
- 'Development Status :: 4 - Beta',
- 'Intended Audience :: Developers',
- 'Intended Audience :: System Administrators',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8',
- 'License :: OSI Approved :: MIT License',
-]
-
-# TODO: Add any additional SDK dependencies here
-DEPENDENCIES = []
-
-with open('README.md', 'r', encoding='utf-8') as f:
- README = f.read()
-with open('HISTORY.rst', 'r', encoding='utf-8') as f:
- HISTORY = f.read()
-
-setup(
- 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',
- url='https://github.com/Azure/azure-cli-extensions/tree/master/src/costmanagement',
- long_description=README + '\n\n' + HISTORY,
- license='MIT',
- classifiers=CLASSIFIERS,
- packages=find_packages(),
- install_requires=DEPENDENCIES,
- package_data={'azext_costmanagement': ['azext_metadata.json']},
-)
+#!/usr/bin/env python
+
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+
+from codecs import open
+from setuptools import setup, find_packages
+
+# HISTORY.rst entry.
+VERSION = '0.1.0'
+try:
+ from azext_costmanagement.manual.version import VERSION
+except ImportError:
+ pass
+
+# The full list of classifiers is available at
+# https://pypi.python.org/pypi?%3Aaction=list_classifiers
+CLASSIFIERS = [
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'License :: OSI Approved :: MIT License',
+]
+
+DEPENDENCIES = []
+
+try:
+ from azext_costmanagement.manual.dependency import DEPENDENCIES
+except ImportError:
+ pass
+
+with open('README.md', 'r', encoding='utf-8') as f:
+ README = f.read()
+with open('HISTORY.rst', 'r', encoding='utf-8') as f:
+ HISTORY = f.read()
+
+setup(
+ name='costmanagement',
+ version=VERSION,
+ description='Microsoft Azure Command-Line Tools CostManagementClient Extension',
+ author='Microsoft Corporation',
+ author_email='azpycli@microsoft.com',
+ url='https://github.com/Azure/azure-cli-extensions/tree/master/src/costmanagement',
+ long_description=README + '\n\n' + HISTORY,
+ license='MIT',
+ classifiers=CLASSIFIERS,
+ packages=find_packages(),
+ install_requires=DEPENDENCIES,
+ package_data={'azext_costmanagement': ['azext_metadata.json']},
+)