azure_mgmt_cost_management 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management.rb +63 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/billing_account_dimensions.rb +149 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/cost_management_client.rb +455 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/dimension.rb +154 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb +56 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/error_details.rb +59 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/format_type.rb +15 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/granularity_type.rb +15 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/query.rb +138 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/query_column.rb +58 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/query_result.rb +57 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/recurrence_type.rb +18 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config.rb +130 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb +60 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_column_type.rb +16 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb +82 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_dataset.rb +121 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb +56 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_definition.rb +87 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_delivery_destination.rb +71 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_delivery_info.rb +48 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_filter.rb +121 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_grouping.rb +58 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_list_result.rb +57 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_recurrence_period.rb +58 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_schedule.rb +74 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_time_period.rb +57 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/status_type.rb +16 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/timeframe_type.rb +18 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/operations.rb +219 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/report_config_operations.rb +794 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/resource_group_dimensions.rb +150 -0
- data/lib/2018-05-31/generated/azure_mgmt_cost_management/subscription_dimensions.rb +146 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management.rb +69 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/cost_management_client.rb +144 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/dimensions.rb +182 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/exports.rb +754 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/common_export_properties.rb +72 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/dimension.rb +187 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb +56 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/error_details.rb +59 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/execution_status.rb +21 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/execution_type.rb +16 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export.rb +128 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_delivery_destination.rb +78 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_delivery_info.rb +48 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_execution.rb +173 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_execution_list_result.rb +56 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_list_result.rb +57 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_recurrence_period.rb +57 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_schedule.rb +74 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/format_type.rb +15 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/granularity_type.rb +16 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query.rb +138 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_aggregation.rb +60 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_column.rb +58 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_column_type.rb +16 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_comparison_expression.rb +82 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_dataset.rb +141 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_dataset_configuration.rb +56 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_definition.rb +88 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_filter.rb +120 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_grouping.rb +58 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_result.rb +57 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_sorting_configuration.rb +58 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_time_period.rb +57 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/recurrence_type.rb +18 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/sort_direction.rb +16 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/status_type.rb +16 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/timeframe_type.rb +23 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/operations.rb +219 -0
- data/lib/2019-01-01/generated/azure_mgmt_cost_management/query_operations.rb +161 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management.rb +82 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/cloud_connector.rb +492 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/cost_management_client.rb +164 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb +775 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/external_billing_account.rb +207 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/external_subscription.rb +482 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/forecast.rb +755 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_billing_model.rb +18 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_collection_error_info.rb +84 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_collection_info.rb +86 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_definition.rb +261 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_definition_list_result.rb +57 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_status.rb +18 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/cost_allocation_details_kind.rb +131 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/cost_allocation_policy.rb +17 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/custom_price_details_kind.rb +169 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/dimension.rb +187 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb +56 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/error_base.rb +72 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/error_details.rb +91 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_billing_account_definition.rb +133 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_billing_account_definition_list_result.rb +59 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_subscription_definition.rb +157 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_subscription_definition_list_result.rb +58 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_subscription_id_list_request.rb +54 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/function_type.rb +18 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/granularity_type.rb +16 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/markup.rb +46 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operator_type.rb +16 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/query.rb +138 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/query_column.rb +58 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/query_result.rb +57 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb +60 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_column_type.rb +16 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb +80 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset.rb +142 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb +56 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_definition.rb +90 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_filter.rb +121 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_grouping.rb +59 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_sorting.rb +58 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_time_period.rb +57 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/scope.rb +80 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule.rb +173 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule_list_result.rb +57 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule_properties.rb +138 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule_status.rb +16 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/timeframe_type.rb +18 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/operations.rb +219 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/query_operations.rb +649 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/showback_rule_operations.rb +222 -0
- data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/showback_rules.rb +114 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management.rb +69 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/budget.rb +460 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/budgets.rb +285 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/cost_management_client.rb +144 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/accumulated_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/budget_model.rb +170 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/budget_time_period.rb +58 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/budgets_list_result.rb +101 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/category_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/chart_type.rb +19 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/current_spend.rb +59 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_base.rb +72 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_details.rb +91 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/granularity_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/kpi_properties.rb +69 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/kpi_type_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/metric_type.rb +17 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/notification.rb +139 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/notification_operator_type.rb +17 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operator_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/pivot_properties.rb +58 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/pivot_type_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/proxy_resource.rb +84 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb +60 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_column_type.rb +16 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb +80 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset.rb +142 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb +56 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_filter.rb +121 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_grouping.rb +59 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_sorting.rb +58 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_time_period.rb +57 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/scope.rb +80 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/time_grain_type.rb +17 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/timeframe_type.rb +18 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/view.rb +269 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/view_list_result.rb +100 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/operations.rb +219 -0
- data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/views.rb +1248 -0
- data/lib/azure_mgmt_cost_management.rb +9 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/costmanagement_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/costmanagement_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/costmanagement_profile_module.rb +219 -0
- data/lib/version.rb +7 -0
- metadata +311 -0
@@ -0,0 +1,182 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CostManagement::Mgmt::V2019_01_01
|
7
|
+
#
|
8
|
+
# Dimensions
|
9
|
+
#
|
10
|
+
class Dimensions
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Dimensions class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [CostManagementClient] reference to the CostManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists the dimensions by the defined scope.
|
26
|
+
#
|
27
|
+
# @param scope [String] The scope associated with dimension operations. This
|
28
|
+
# includes '/subscriptions/{subscriptionId}/' for subscription scope,
|
29
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
30
|
+
# resourceGroup scope,
|
31
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
32
|
+
# Account scope,
|
33
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
34
|
+
# for Department scope,
|
35
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
36
|
+
# for EnrollmentAccount scope and
|
37
|
+
# '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
|
38
|
+
# Management Group scope..
|
39
|
+
# @param filter [String] May be used to filter dimensions by
|
40
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
41
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
42
|
+
# @param expand [String] May be used to expand the properties/data within a
|
43
|
+
# dimension category. By default, data is not included when listing dimensions.
|
44
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
45
|
+
# returned a partial result. If a previous response contains a nextLink
|
46
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
47
|
+
# that specifies a starting point to use for subsequent calls.
|
48
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
49
|
+
# recent N dimension data.
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
51
|
+
# will be added to the HTTP request.
|
52
|
+
#
|
53
|
+
# @return [DimensionsListResult] operation results.
|
54
|
+
#
|
55
|
+
def list_by_subscription(scope, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
56
|
+
response = list_by_subscription_async(scope, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
|
57
|
+
response.body unless response.nil?
|
58
|
+
end
|
59
|
+
|
60
|
+
#
|
61
|
+
# Lists the dimensions by the defined scope.
|
62
|
+
#
|
63
|
+
# @param scope [String] The scope associated with dimension operations. This
|
64
|
+
# includes '/subscriptions/{subscriptionId}/' for subscription scope,
|
65
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
66
|
+
# resourceGroup scope,
|
67
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
68
|
+
# Account scope,
|
69
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
70
|
+
# for Department scope,
|
71
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
72
|
+
# for EnrollmentAccount scope and
|
73
|
+
# '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
|
74
|
+
# Management Group scope..
|
75
|
+
# @param filter [String] May be used to filter dimensions by
|
76
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
77
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
78
|
+
# @param expand [String] May be used to expand the properties/data within a
|
79
|
+
# dimension category. By default, data is not included when listing dimensions.
|
80
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
81
|
+
# returned a partial result. If a previous response contains a nextLink
|
82
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
83
|
+
# that specifies a starting point to use for subsequent calls.
|
84
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
85
|
+
# recent N dimension data.
|
86
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
87
|
+
# will be added to the HTTP request.
|
88
|
+
#
|
89
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
90
|
+
#
|
91
|
+
def list_by_subscription_with_http_info(scope, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
92
|
+
list_by_subscription_async(scope, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
|
93
|
+
end
|
94
|
+
|
95
|
+
#
|
96
|
+
# Lists the dimensions by the defined scope.
|
97
|
+
#
|
98
|
+
# @param scope [String] The scope associated with dimension operations. This
|
99
|
+
# includes '/subscriptions/{subscriptionId}/' for subscription scope,
|
100
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
101
|
+
# resourceGroup scope,
|
102
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
103
|
+
# Account scope,
|
104
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
105
|
+
# for Department scope,
|
106
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
107
|
+
# for EnrollmentAccount scope and
|
108
|
+
# '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
|
109
|
+
# Management Group scope..
|
110
|
+
# @param filter [String] May be used to filter dimensions by
|
111
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
112
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
113
|
+
# @param expand [String] May be used to expand the properties/data within a
|
114
|
+
# dimension category. By default, data is not included when listing dimensions.
|
115
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
116
|
+
# returned a partial result. If a previous response contains a nextLink
|
117
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
118
|
+
# that specifies a starting point to use for subsequent calls.
|
119
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
120
|
+
# recent N dimension data.
|
121
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
122
|
+
# to the HTTP request.
|
123
|
+
#
|
124
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
125
|
+
#
|
126
|
+
def list_by_subscription_async(scope, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
127
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
128
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
129
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
|
130
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
|
131
|
+
|
132
|
+
|
133
|
+
request_headers = {}
|
134
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
135
|
+
|
136
|
+
# Set Headers
|
137
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
138
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
139
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/dimensions'
|
140
|
+
|
141
|
+
request_url = @base_url || @client.base_url
|
142
|
+
|
143
|
+
options = {
|
144
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
145
|
+
skip_encoding_path_params: {'scope' => scope},
|
146
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
|
147
|
+
headers: request_headers.merge(custom_headers || {}),
|
148
|
+
base_url: request_url
|
149
|
+
}
|
150
|
+
promise = @client.make_request_async(:get, path_template, options)
|
151
|
+
|
152
|
+
promise = promise.then do |result|
|
153
|
+
http_response = result.response
|
154
|
+
status_code = http_response.status
|
155
|
+
response_content = http_response.body
|
156
|
+
unless status_code == 200
|
157
|
+
error_model = JSON.load(response_content)
|
158
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
159
|
+
end
|
160
|
+
|
161
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
162
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
163
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
164
|
+
# Deserialize Response
|
165
|
+
if status_code == 200
|
166
|
+
begin
|
167
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
168
|
+
result_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::DimensionsListResult.mapper()
|
169
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
170
|
+
rescue Exception => e
|
171
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
result
|
176
|
+
end
|
177
|
+
|
178
|
+
promise.execute
|
179
|
+
end
|
180
|
+
|
181
|
+
end
|
182
|
+
end
|
@@ -0,0 +1,754 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CostManagement::Mgmt::V2019_01_01
|
7
|
+
#
|
8
|
+
# Exports
|
9
|
+
#
|
10
|
+
class Exports
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Exports class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [CostManagementClient] reference to the CostManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists all exports at the given scope.
|
26
|
+
#
|
27
|
+
# @param scope [String] The scope associated with export operations. This
|
28
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
29
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
30
|
+
# resourceGroup scope,
|
31
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
32
|
+
# Account scope and
|
33
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
34
|
+
# for Department scope,
|
35
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
36
|
+
# for EnrollmentAccount scope.
|
37
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
38
|
+
# will be added to the HTTP request.
|
39
|
+
#
|
40
|
+
# @return [ExportListResult] operation results.
|
41
|
+
#
|
42
|
+
def list(scope, custom_headers:nil)
|
43
|
+
response = list_async(scope, custom_headers:custom_headers).value!
|
44
|
+
response.body unless response.nil?
|
45
|
+
end
|
46
|
+
|
47
|
+
#
|
48
|
+
# Lists all exports at the given scope.
|
49
|
+
#
|
50
|
+
# @param scope [String] The scope associated with export operations. This
|
51
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
52
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
53
|
+
# resourceGroup scope,
|
54
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
55
|
+
# Account scope and
|
56
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
57
|
+
# for Department scope,
|
58
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
59
|
+
# for EnrollmentAccount scope.
|
60
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
61
|
+
# will be added to the HTTP request.
|
62
|
+
#
|
63
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
64
|
+
#
|
65
|
+
def list_with_http_info(scope, custom_headers:nil)
|
66
|
+
list_async(scope, custom_headers:custom_headers).value!
|
67
|
+
end
|
68
|
+
|
69
|
+
#
|
70
|
+
# Lists all exports at the given scope.
|
71
|
+
#
|
72
|
+
# @param scope [String] The scope associated with export operations. This
|
73
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
74
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
75
|
+
# resourceGroup scope,
|
76
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
77
|
+
# Account scope and
|
78
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
79
|
+
# for Department scope,
|
80
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
81
|
+
# for EnrollmentAccount scope.
|
82
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
83
|
+
# to the HTTP request.
|
84
|
+
#
|
85
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
86
|
+
#
|
87
|
+
def list_async(scope, custom_headers:nil)
|
88
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
89
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
90
|
+
|
91
|
+
|
92
|
+
request_headers = {}
|
93
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
94
|
+
|
95
|
+
# Set Headers
|
96
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
97
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
98
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/exports'
|
99
|
+
|
100
|
+
request_url = @base_url || @client.base_url
|
101
|
+
|
102
|
+
options = {
|
103
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
104
|
+
skip_encoding_path_params: {'scope' => scope},
|
105
|
+
query_params: {'api-version' => @client.api_version},
|
106
|
+
headers: request_headers.merge(custom_headers || {}),
|
107
|
+
base_url: request_url
|
108
|
+
}
|
109
|
+
promise = @client.make_request_async(:get, path_template, options)
|
110
|
+
|
111
|
+
promise = promise.then do |result|
|
112
|
+
http_response = result.response
|
113
|
+
status_code = http_response.status
|
114
|
+
response_content = http_response.body
|
115
|
+
unless status_code == 200
|
116
|
+
error_model = JSON.load(response_content)
|
117
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
118
|
+
end
|
119
|
+
|
120
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
121
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
122
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
123
|
+
# Deserialize Response
|
124
|
+
if status_code == 200
|
125
|
+
begin
|
126
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
127
|
+
result_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::ExportListResult.mapper()
|
128
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
129
|
+
rescue Exception => e
|
130
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
result
|
135
|
+
end
|
136
|
+
|
137
|
+
promise.execute
|
138
|
+
end
|
139
|
+
|
140
|
+
#
|
141
|
+
# Gets the export for the defined scope by export name.
|
142
|
+
#
|
143
|
+
# @param scope [String] The scope associated with export operations. This
|
144
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
145
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
146
|
+
# resourceGroup scope,
|
147
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
148
|
+
# Account scope and
|
149
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
150
|
+
# for Department scope,
|
151
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
152
|
+
# for EnrollmentAccount scope.
|
153
|
+
# @param export_name [String] Export Name.
|
154
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
155
|
+
# will be added to the HTTP request.
|
156
|
+
#
|
157
|
+
# @return [Export] operation results.
|
158
|
+
#
|
159
|
+
def get(scope, export_name, custom_headers:nil)
|
160
|
+
response = get_async(scope, export_name, custom_headers:custom_headers).value!
|
161
|
+
response.body unless response.nil?
|
162
|
+
end
|
163
|
+
|
164
|
+
#
|
165
|
+
# Gets the export for the defined scope by export name.
|
166
|
+
#
|
167
|
+
# @param scope [String] The scope associated with export operations. This
|
168
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
169
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
170
|
+
# resourceGroup scope,
|
171
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
172
|
+
# Account scope and
|
173
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
174
|
+
# for Department scope,
|
175
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
176
|
+
# for EnrollmentAccount scope.
|
177
|
+
# @param export_name [String] Export Name.
|
178
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
179
|
+
# will be added to the HTTP request.
|
180
|
+
#
|
181
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
182
|
+
#
|
183
|
+
def get_with_http_info(scope, export_name, custom_headers:nil)
|
184
|
+
get_async(scope, export_name, custom_headers:custom_headers).value!
|
185
|
+
end
|
186
|
+
|
187
|
+
#
|
188
|
+
# Gets the export for the defined scope by export name.
|
189
|
+
#
|
190
|
+
# @param scope [String] The scope associated with export operations. This
|
191
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
192
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
193
|
+
# resourceGroup scope,
|
194
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
195
|
+
# Account scope and
|
196
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
197
|
+
# for Department scope,
|
198
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
199
|
+
# for EnrollmentAccount scope.
|
200
|
+
# @param export_name [String] Export Name.
|
201
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
202
|
+
# to the HTTP request.
|
203
|
+
#
|
204
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
205
|
+
#
|
206
|
+
def get_async(scope, export_name, custom_headers:nil)
|
207
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
208
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
209
|
+
fail ArgumentError, 'export_name is nil' if export_name.nil?
|
210
|
+
|
211
|
+
|
212
|
+
request_headers = {}
|
213
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
214
|
+
|
215
|
+
# Set Headers
|
216
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
217
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
218
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/exports/{exportName}'
|
219
|
+
|
220
|
+
request_url = @base_url || @client.base_url
|
221
|
+
|
222
|
+
options = {
|
223
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
224
|
+
path_params: {'exportName' => export_name},
|
225
|
+
skip_encoding_path_params: {'scope' => scope},
|
226
|
+
query_params: {'api-version' => @client.api_version},
|
227
|
+
headers: request_headers.merge(custom_headers || {}),
|
228
|
+
base_url: request_url
|
229
|
+
}
|
230
|
+
promise = @client.make_request_async(:get, path_template, options)
|
231
|
+
|
232
|
+
promise = promise.then do |result|
|
233
|
+
http_response = result.response
|
234
|
+
status_code = http_response.status
|
235
|
+
response_content = http_response.body
|
236
|
+
unless status_code == 200
|
237
|
+
error_model = JSON.load(response_content)
|
238
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
239
|
+
end
|
240
|
+
|
241
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
242
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
243
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
244
|
+
# Deserialize Response
|
245
|
+
if status_code == 200
|
246
|
+
begin
|
247
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
248
|
+
result_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::Export.mapper()
|
249
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
250
|
+
rescue Exception => e
|
251
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
result
|
256
|
+
end
|
257
|
+
|
258
|
+
promise.execute
|
259
|
+
end
|
260
|
+
|
261
|
+
#
|
262
|
+
# The operation to create or update a export. Update operation requires latest
|
263
|
+
# eTag to be set in the request. You may obtain the latest eTag by performing a
|
264
|
+
# get operation. Create operation does not require eTag.
|
265
|
+
#
|
266
|
+
# @param scope [String] The scope associated with export operations. This
|
267
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
268
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
269
|
+
# resourceGroup scope,
|
270
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
271
|
+
# Account scope and
|
272
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
273
|
+
# for Department scope,
|
274
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
275
|
+
# for EnrollmentAccount scope.
|
276
|
+
# @param export_name [String] Export Name.
|
277
|
+
# @param parameters [Export] Parameters supplied to the CreateOrUpdate Export
|
278
|
+
# operation.
|
279
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
280
|
+
# will be added to the HTTP request.
|
281
|
+
#
|
282
|
+
# @return [Export] operation results.
|
283
|
+
#
|
284
|
+
def create_or_update(scope, export_name, parameters, custom_headers:nil)
|
285
|
+
response = create_or_update_async(scope, export_name, parameters, custom_headers:custom_headers).value!
|
286
|
+
response.body unless response.nil?
|
287
|
+
end
|
288
|
+
|
289
|
+
#
|
290
|
+
# The operation to create or update a export. Update operation requires latest
|
291
|
+
# eTag to be set in the request. You may obtain the latest eTag by performing a
|
292
|
+
# get operation. Create operation does not require eTag.
|
293
|
+
#
|
294
|
+
# @param scope [String] The scope associated with export operations. This
|
295
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
296
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
297
|
+
# resourceGroup scope,
|
298
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
299
|
+
# Account scope and
|
300
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
301
|
+
# for Department scope,
|
302
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
303
|
+
# for EnrollmentAccount scope.
|
304
|
+
# @param export_name [String] Export Name.
|
305
|
+
# @param parameters [Export] Parameters supplied to the CreateOrUpdate Export
|
306
|
+
# operation.
|
307
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
308
|
+
# will be added to the HTTP request.
|
309
|
+
#
|
310
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
311
|
+
#
|
312
|
+
def create_or_update_with_http_info(scope, export_name, parameters, custom_headers:nil)
|
313
|
+
create_or_update_async(scope, export_name, parameters, custom_headers:custom_headers).value!
|
314
|
+
end
|
315
|
+
|
316
|
+
#
|
317
|
+
# The operation to create or update a export. Update operation requires latest
|
318
|
+
# eTag to be set in the request. You may obtain the latest eTag by performing a
|
319
|
+
# get operation. Create operation does not require eTag.
|
320
|
+
#
|
321
|
+
# @param scope [String] The scope associated with export operations. This
|
322
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
323
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
324
|
+
# resourceGroup scope,
|
325
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
326
|
+
# Account scope and
|
327
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
328
|
+
# for Department scope,
|
329
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
330
|
+
# for EnrollmentAccount scope.
|
331
|
+
# @param export_name [String] Export Name.
|
332
|
+
# @param parameters [Export] Parameters supplied to the CreateOrUpdate Export
|
333
|
+
# operation.
|
334
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
335
|
+
# to the HTTP request.
|
336
|
+
#
|
337
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
338
|
+
#
|
339
|
+
def create_or_update_async(scope, export_name, parameters, custom_headers:nil)
|
340
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
341
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
342
|
+
fail ArgumentError, 'export_name is nil' if export_name.nil?
|
343
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
344
|
+
|
345
|
+
|
346
|
+
request_headers = {}
|
347
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
348
|
+
|
349
|
+
# Set Headers
|
350
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
351
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
352
|
+
|
353
|
+
# Serialize Request
|
354
|
+
request_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::Export.mapper()
|
355
|
+
request_content = @client.serialize(request_mapper, parameters)
|
356
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
357
|
+
|
358
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/exports/{exportName}'
|
359
|
+
|
360
|
+
request_url = @base_url || @client.base_url
|
361
|
+
|
362
|
+
options = {
|
363
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
364
|
+
path_params: {'exportName' => export_name},
|
365
|
+
skip_encoding_path_params: {'scope' => scope},
|
366
|
+
query_params: {'api-version' => @client.api_version},
|
367
|
+
body: request_content,
|
368
|
+
headers: request_headers.merge(custom_headers || {}),
|
369
|
+
base_url: request_url
|
370
|
+
}
|
371
|
+
promise = @client.make_request_async(:put, path_template, options)
|
372
|
+
|
373
|
+
promise = promise.then do |result|
|
374
|
+
http_response = result.response
|
375
|
+
status_code = http_response.status
|
376
|
+
response_content = http_response.body
|
377
|
+
unless status_code == 200 || status_code == 201
|
378
|
+
error_model = JSON.load(response_content)
|
379
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
380
|
+
end
|
381
|
+
|
382
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
383
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
384
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
385
|
+
# Deserialize Response
|
386
|
+
if status_code == 200
|
387
|
+
begin
|
388
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
389
|
+
result_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::Export.mapper()
|
390
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
391
|
+
rescue Exception => e
|
392
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
393
|
+
end
|
394
|
+
end
|
395
|
+
# Deserialize Response
|
396
|
+
if status_code == 201
|
397
|
+
begin
|
398
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
399
|
+
result_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::Export.mapper()
|
400
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
401
|
+
rescue Exception => e
|
402
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
result
|
407
|
+
end
|
408
|
+
|
409
|
+
promise.execute
|
410
|
+
end
|
411
|
+
|
412
|
+
#
|
413
|
+
# The operation to delete a export.
|
414
|
+
#
|
415
|
+
# @param scope [String] The scope associated with export operations. This
|
416
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
417
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
418
|
+
# resourceGroup scope,
|
419
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
420
|
+
# Account scope and
|
421
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
422
|
+
# for Department scope,
|
423
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
424
|
+
# for EnrollmentAccount scope.
|
425
|
+
# @param export_name [String] Export Name.
|
426
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
427
|
+
# will be added to the HTTP request.
|
428
|
+
#
|
429
|
+
#
|
430
|
+
def delete(scope, export_name, custom_headers:nil)
|
431
|
+
response = delete_async(scope, export_name, custom_headers:custom_headers).value!
|
432
|
+
nil
|
433
|
+
end
|
434
|
+
|
435
|
+
#
|
436
|
+
# The operation to delete a export.
|
437
|
+
#
|
438
|
+
# @param scope [String] The scope associated with export operations. This
|
439
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
440
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
441
|
+
# resourceGroup scope,
|
442
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
443
|
+
# Account scope and
|
444
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
445
|
+
# for Department scope,
|
446
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
447
|
+
# for EnrollmentAccount scope.
|
448
|
+
# @param export_name [String] Export Name.
|
449
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
450
|
+
# will be added to the HTTP request.
|
451
|
+
#
|
452
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
453
|
+
#
|
454
|
+
def delete_with_http_info(scope, export_name, custom_headers:nil)
|
455
|
+
delete_async(scope, export_name, custom_headers:custom_headers).value!
|
456
|
+
end
|
457
|
+
|
458
|
+
#
|
459
|
+
# The operation to delete a export.
|
460
|
+
#
|
461
|
+
# @param scope [String] The scope associated with export operations. This
|
462
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
463
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
464
|
+
# resourceGroup scope,
|
465
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
466
|
+
# Account scope and
|
467
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
468
|
+
# for Department scope,
|
469
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
470
|
+
# for EnrollmentAccount scope.
|
471
|
+
# @param export_name [String] Export Name.
|
472
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
473
|
+
# to the HTTP request.
|
474
|
+
#
|
475
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
476
|
+
#
|
477
|
+
def delete_async(scope, export_name, custom_headers:nil)
|
478
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
479
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
480
|
+
fail ArgumentError, 'export_name is nil' if export_name.nil?
|
481
|
+
|
482
|
+
|
483
|
+
request_headers = {}
|
484
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
485
|
+
|
486
|
+
# Set Headers
|
487
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
488
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
489
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/exports/{exportName}'
|
490
|
+
|
491
|
+
request_url = @base_url || @client.base_url
|
492
|
+
|
493
|
+
options = {
|
494
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
495
|
+
path_params: {'exportName' => export_name},
|
496
|
+
skip_encoding_path_params: {'scope' => scope},
|
497
|
+
query_params: {'api-version' => @client.api_version},
|
498
|
+
headers: request_headers.merge(custom_headers || {}),
|
499
|
+
base_url: request_url
|
500
|
+
}
|
501
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
502
|
+
|
503
|
+
promise = promise.then do |result|
|
504
|
+
http_response = result.response
|
505
|
+
status_code = http_response.status
|
506
|
+
response_content = http_response.body
|
507
|
+
unless status_code == 200
|
508
|
+
error_model = JSON.load(response_content)
|
509
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
510
|
+
end
|
511
|
+
|
512
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
513
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
514
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
515
|
+
|
516
|
+
result
|
517
|
+
end
|
518
|
+
|
519
|
+
promise.execute
|
520
|
+
end
|
521
|
+
|
522
|
+
#
|
523
|
+
# The operation to execute a export.
|
524
|
+
#
|
525
|
+
# @param scope [String] The scope associated with export operations. This
|
526
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
527
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
528
|
+
# resourceGroup scope,
|
529
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
530
|
+
# Account scope and
|
531
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
532
|
+
# for Department scope,
|
533
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
534
|
+
# for EnrollmentAccount scope.
|
535
|
+
# @param export_name [String] Export Name.
|
536
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
537
|
+
# will be added to the HTTP request.
|
538
|
+
#
|
539
|
+
#
|
540
|
+
def execute(scope, export_name, custom_headers:nil)
|
541
|
+
response = execute_async(scope, export_name, custom_headers:custom_headers).value!
|
542
|
+
nil
|
543
|
+
end
|
544
|
+
|
545
|
+
#
|
546
|
+
# The operation to execute a export.
|
547
|
+
#
|
548
|
+
# @param scope [String] The scope associated with export operations. This
|
549
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
550
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
551
|
+
# resourceGroup scope,
|
552
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
553
|
+
# Account scope and
|
554
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
555
|
+
# for Department scope,
|
556
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
557
|
+
# for EnrollmentAccount scope.
|
558
|
+
# @param export_name [String] Export Name.
|
559
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
560
|
+
# will be added to the HTTP request.
|
561
|
+
#
|
562
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
563
|
+
#
|
564
|
+
def execute_with_http_info(scope, export_name, custom_headers:nil)
|
565
|
+
execute_async(scope, export_name, custom_headers:custom_headers).value!
|
566
|
+
end
|
567
|
+
|
568
|
+
#
|
569
|
+
# The operation to execute a export.
|
570
|
+
#
|
571
|
+
# @param scope [String] The scope associated with export operations. This
|
572
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
573
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
574
|
+
# resourceGroup scope,
|
575
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
576
|
+
# Account scope and
|
577
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
578
|
+
# for Department scope,
|
579
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
580
|
+
# for EnrollmentAccount scope.
|
581
|
+
# @param export_name [String] Export Name.
|
582
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
583
|
+
# to the HTTP request.
|
584
|
+
#
|
585
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
586
|
+
#
|
587
|
+
def execute_async(scope, export_name, custom_headers:nil)
|
588
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
589
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
590
|
+
fail ArgumentError, 'export_name is nil' if export_name.nil?
|
591
|
+
|
592
|
+
|
593
|
+
request_headers = {}
|
594
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
595
|
+
|
596
|
+
# Set Headers
|
597
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
598
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
599
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'
|
600
|
+
|
601
|
+
request_url = @base_url || @client.base_url
|
602
|
+
|
603
|
+
options = {
|
604
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
605
|
+
path_params: {'exportName' => export_name},
|
606
|
+
skip_encoding_path_params: {'scope' => scope},
|
607
|
+
query_params: {'api-version' => @client.api_version},
|
608
|
+
headers: request_headers.merge(custom_headers || {}),
|
609
|
+
base_url: request_url
|
610
|
+
}
|
611
|
+
promise = @client.make_request_async(:post, path_template, options)
|
612
|
+
|
613
|
+
promise = promise.then do |result|
|
614
|
+
http_response = result.response
|
615
|
+
status_code = http_response.status
|
616
|
+
response_content = http_response.body
|
617
|
+
unless status_code == 200
|
618
|
+
error_model = JSON.load(response_content)
|
619
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
620
|
+
end
|
621
|
+
|
622
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
623
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
624
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
625
|
+
|
626
|
+
result
|
627
|
+
end
|
628
|
+
|
629
|
+
promise.execute
|
630
|
+
end
|
631
|
+
|
632
|
+
#
|
633
|
+
# Gets the execution history of a export for the defined scope by export name.
|
634
|
+
#
|
635
|
+
# @param scope [String] The scope associated with export operations. This
|
636
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
637
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
638
|
+
# resourceGroup scope,
|
639
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
640
|
+
# Account scope and
|
641
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
642
|
+
# for Department scope,
|
643
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
644
|
+
# for EnrollmentAccount scope.
|
645
|
+
# @param export_name [String] Export Name.
|
646
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
647
|
+
# will be added to the HTTP request.
|
648
|
+
#
|
649
|
+
# @return [ExportExecutionListResult] operation results.
|
650
|
+
#
|
651
|
+
def get_execution_history(scope, export_name, custom_headers:nil)
|
652
|
+
response = get_execution_history_async(scope, export_name, custom_headers:custom_headers).value!
|
653
|
+
response.body unless response.nil?
|
654
|
+
end
|
655
|
+
|
656
|
+
#
|
657
|
+
# Gets the execution history of a export for the defined scope by export name.
|
658
|
+
#
|
659
|
+
# @param scope [String] The scope associated with export operations. This
|
660
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
661
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
662
|
+
# resourceGroup scope,
|
663
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
664
|
+
# Account scope and
|
665
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
666
|
+
# for Department scope,
|
667
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
668
|
+
# for EnrollmentAccount scope.
|
669
|
+
# @param export_name [String] Export Name.
|
670
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
671
|
+
# will be added to the HTTP request.
|
672
|
+
#
|
673
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
674
|
+
#
|
675
|
+
def get_execution_history_with_http_info(scope, export_name, custom_headers:nil)
|
676
|
+
get_execution_history_async(scope, export_name, custom_headers:custom_headers).value!
|
677
|
+
end
|
678
|
+
|
679
|
+
#
|
680
|
+
# Gets the execution history of a export for the defined scope by export name.
|
681
|
+
#
|
682
|
+
# @param scope [String] The scope associated with export operations. This
|
683
|
+
# includes '/subscriptions/{subscriptionId}' for subscription scope,
|
684
|
+
# '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
|
685
|
+
# resourceGroup scope,
|
686
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
|
687
|
+
# Account scope and
|
688
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
|
689
|
+
# for Department scope,
|
690
|
+
# '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
|
691
|
+
# for EnrollmentAccount scope.
|
692
|
+
# @param export_name [String] Export Name.
|
693
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
694
|
+
# to the HTTP request.
|
695
|
+
#
|
696
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
697
|
+
#
|
698
|
+
def get_execution_history_async(scope, export_name, custom_headers:nil)
|
699
|
+
fail ArgumentError, 'scope is nil' if scope.nil?
|
700
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
701
|
+
fail ArgumentError, 'export_name is nil' if export_name.nil?
|
702
|
+
|
703
|
+
|
704
|
+
request_headers = {}
|
705
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
706
|
+
|
707
|
+
# Set Headers
|
708
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
709
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
710
|
+
path_template = '{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'
|
711
|
+
|
712
|
+
request_url = @base_url || @client.base_url
|
713
|
+
|
714
|
+
options = {
|
715
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
716
|
+
path_params: {'exportName' => export_name},
|
717
|
+
skip_encoding_path_params: {'scope' => scope},
|
718
|
+
query_params: {'api-version' => @client.api_version},
|
719
|
+
headers: request_headers.merge(custom_headers || {}),
|
720
|
+
base_url: request_url
|
721
|
+
}
|
722
|
+
promise = @client.make_request_async(:get, path_template, options)
|
723
|
+
|
724
|
+
promise = promise.then do |result|
|
725
|
+
http_response = result.response
|
726
|
+
status_code = http_response.status
|
727
|
+
response_content = http_response.body
|
728
|
+
unless status_code == 200
|
729
|
+
error_model = JSON.load(response_content)
|
730
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
731
|
+
end
|
732
|
+
|
733
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
734
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
735
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
736
|
+
# Deserialize Response
|
737
|
+
if status_code == 200
|
738
|
+
begin
|
739
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
740
|
+
result_mapper = Azure::CostManagement::Mgmt::V2019_01_01::Models::ExportExecutionListResult.mapper()
|
741
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
742
|
+
rescue Exception => e
|
743
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
744
|
+
end
|
745
|
+
end
|
746
|
+
|
747
|
+
result
|
748
|
+
end
|
749
|
+
|
750
|
+
promise.execute
|
751
|
+
end
|
752
|
+
|
753
|
+
end
|
754
|
+
end
|