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,150 @@
|
|
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::V2018_05_31
|
7
|
+
#
|
8
|
+
# ResourceGroupDimensions
|
9
|
+
#
|
10
|
+
class ResourceGroupDimensions
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ResourceGroupDimensions 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 resource group Id.
|
26
|
+
#
|
27
|
+
# @param resource_group_name [String] Azure Resource Group Name.
|
28
|
+
# @param filter [String] May be used to filter dimensions by
|
29
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
30
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
31
|
+
# @param expand [String] May be used to expand the properties/data within a
|
32
|
+
# dimension category. By default, data is not included when listing dimensions.
|
33
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
34
|
+
# returned a partial result. If a previous response contains a nextLink
|
35
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
36
|
+
# that specifies a starting point to use for subsequent calls.
|
37
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
38
|
+
# recent N dimension data.
|
39
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
40
|
+
# will be added to the HTTP request.
|
41
|
+
#
|
42
|
+
# @return [DimensionsListResult] operation results.
|
43
|
+
#
|
44
|
+
def list(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
45
|
+
response = list_async(resource_group_name, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
|
46
|
+
response.body unless response.nil?
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Lists the dimensions by resource group Id.
|
51
|
+
#
|
52
|
+
# @param resource_group_name [String] Azure Resource Group Name.
|
53
|
+
# @param filter [String] May be used to filter dimensions by
|
54
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
55
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
56
|
+
# @param expand [String] May be used to expand the properties/data within a
|
57
|
+
# dimension category. By default, data is not included when listing dimensions.
|
58
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
59
|
+
# returned a partial result. If a previous response contains a nextLink
|
60
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
61
|
+
# that specifies a starting point to use for subsequent calls.
|
62
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
63
|
+
# recent N dimension data.
|
64
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
65
|
+
# will be added to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
68
|
+
#
|
69
|
+
def list_with_http_info(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
70
|
+
list_async(resource_group_name, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
|
71
|
+
end
|
72
|
+
|
73
|
+
#
|
74
|
+
# Lists the dimensions by resource group Id.
|
75
|
+
#
|
76
|
+
# @param resource_group_name [String] Azure Resource Group Name.
|
77
|
+
# @param filter [String] May be used to filter dimensions by
|
78
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
79
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
80
|
+
# @param expand [String] May be used to expand the properties/data within a
|
81
|
+
# dimension category. By default, data is not included when listing dimensions.
|
82
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
83
|
+
# returned a partial result. If a previous response contains a nextLink
|
84
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
85
|
+
# that specifies a starting point to use for subsequent calls.
|
86
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
87
|
+
# recent N dimension data.
|
88
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
89
|
+
# to the HTTP request.
|
90
|
+
#
|
91
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
92
|
+
#
|
93
|
+
def list_async(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
94
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
95
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
96
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
97
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
|
98
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
|
99
|
+
|
100
|
+
|
101
|
+
request_headers = {}
|
102
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
103
|
+
|
104
|
+
# Set Headers
|
105
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
106
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
107
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'
|
108
|
+
|
109
|
+
request_url = @base_url || @client.base_url
|
110
|
+
|
111
|
+
options = {
|
112
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
113
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
|
114
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
|
115
|
+
headers: request_headers.merge(custom_headers || {}),
|
116
|
+
base_url: request_url
|
117
|
+
}
|
118
|
+
promise = @client.make_request_async(:get, path_template, options)
|
119
|
+
|
120
|
+
promise = promise.then do |result|
|
121
|
+
http_response = result.response
|
122
|
+
status_code = http_response.status
|
123
|
+
response_content = http_response.body
|
124
|
+
unless status_code == 200
|
125
|
+
error_model = JSON.load(response_content)
|
126
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
127
|
+
end
|
128
|
+
|
129
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
130
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
131
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
132
|
+
# Deserialize Response
|
133
|
+
if status_code == 200
|
134
|
+
begin
|
135
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
136
|
+
result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::DimensionsListResult.mapper()
|
137
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
138
|
+
rescue Exception => e
|
139
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
result
|
144
|
+
end
|
145
|
+
|
146
|
+
promise.execute
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
end
|
@@ -0,0 +1,146 @@
|
|
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::V2018_05_31
|
7
|
+
#
|
8
|
+
# SubscriptionDimensions
|
9
|
+
#
|
10
|
+
class SubscriptionDimensions
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the SubscriptionDimensions 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 subscription Id.
|
26
|
+
#
|
27
|
+
# @param filter [String] May be used to filter dimensions by
|
28
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
29
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
30
|
+
# @param expand [String] May be used to expand the properties/data within a
|
31
|
+
# dimension category. By default, data is not included when listing dimensions.
|
32
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
33
|
+
# returned a partial result. If a previous response contains a nextLink
|
34
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
35
|
+
# that specifies a starting point to use for subsequent calls.
|
36
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
37
|
+
# recent N dimension data.
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
39
|
+
# will be added to the HTTP request.
|
40
|
+
#
|
41
|
+
# @return [DimensionsListResult] operation results.
|
42
|
+
#
|
43
|
+
def list(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
44
|
+
response = list_async(filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
|
45
|
+
response.body unless response.nil?
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# Lists the dimensions by subscription Id.
|
50
|
+
#
|
51
|
+
# @param filter [String] May be used to filter dimensions by
|
52
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
53
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
54
|
+
# @param expand [String] May be used to expand the properties/data within a
|
55
|
+
# dimension category. By default, data is not included when listing dimensions.
|
56
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
57
|
+
# returned a partial result. If a previous response contains a nextLink
|
58
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
59
|
+
# that specifies a starting point to use for subsequent calls.
|
60
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
61
|
+
# recent N dimension data.
|
62
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
63
|
+
# will be added to the HTTP request.
|
64
|
+
#
|
65
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
66
|
+
#
|
67
|
+
def list_with_http_info(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
68
|
+
list_async(filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
|
69
|
+
end
|
70
|
+
|
71
|
+
#
|
72
|
+
# Lists the dimensions by subscription Id.
|
73
|
+
#
|
74
|
+
# @param filter [String] May be used to filter dimensions by
|
75
|
+
# properties/category, properties/usageStart, properties/usageEnd. Supported
|
76
|
+
# operators are 'eq','lt', 'gt', 'le', 'ge'.
|
77
|
+
# @param expand [String] May be used to expand the properties/data within a
|
78
|
+
# dimension category. By default, data is not included when listing dimensions.
|
79
|
+
# @param skiptoken [String] Skiptoken is only used if a previous operation
|
80
|
+
# returned a partial result. If a previous response contains a nextLink
|
81
|
+
# element, the value of the nextLink element will include a skiptoken parameter
|
82
|
+
# that specifies a starting point to use for subsequent calls.
|
83
|
+
# @param top [Integer] May be used to limit the number of results to the most
|
84
|
+
# recent N dimension data.
|
85
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
86
|
+
# to the HTTP request.
|
87
|
+
#
|
88
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
89
|
+
#
|
90
|
+
def list_async(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
|
91
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
92
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
93
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
|
94
|
+
fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
|
95
|
+
|
96
|
+
|
97
|
+
request_headers = {}
|
98
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
99
|
+
|
100
|
+
# Set Headers
|
101
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
102
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
103
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'
|
104
|
+
|
105
|
+
request_url = @base_url || @client.base_url
|
106
|
+
|
107
|
+
options = {
|
108
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
109
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
110
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
|
111
|
+
headers: request_headers.merge(custom_headers || {}),
|
112
|
+
base_url: request_url
|
113
|
+
}
|
114
|
+
promise = @client.make_request_async(:get, path_template, options)
|
115
|
+
|
116
|
+
promise = promise.then do |result|
|
117
|
+
http_response = result.response
|
118
|
+
status_code = http_response.status
|
119
|
+
response_content = http_response.body
|
120
|
+
unless status_code == 200
|
121
|
+
error_model = JSON.load(response_content)
|
122
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
123
|
+
end
|
124
|
+
|
125
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
126
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
127
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
128
|
+
# Deserialize Response
|
129
|
+
if status_code == 200
|
130
|
+
begin
|
131
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
132
|
+
result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::DimensionsListResult.mapper()
|
133
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
134
|
+
rescue Exception => e
|
135
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
result
|
140
|
+
end
|
141
|
+
|
142
|
+
promise.execute
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
end
|
@@ -0,0 +1,69 @@
|
|
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
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2019-01-01/generated/azure_mgmt_cost_management/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::CostManagement::Mgmt::V2019_01_01
|
23
|
+
autoload :Dimensions, '2019-01-01/generated/azure_mgmt_cost_management/dimensions.rb'
|
24
|
+
autoload :QueryOperations, '2019-01-01/generated/azure_mgmt_cost_management/query_operations.rb'
|
25
|
+
autoload :Exports, '2019-01-01/generated/azure_mgmt_cost_management/exports.rb'
|
26
|
+
autoload :Operations, '2019-01-01/generated/azure_mgmt_cost_management/operations.rb'
|
27
|
+
autoload :CostManagementClient, '2019-01-01/generated/azure_mgmt_cost_management/cost_management_client.rb'
|
28
|
+
|
29
|
+
module Models
|
30
|
+
autoload :QueryGrouping, '2019-01-01/generated/azure_mgmt_cost_management/models/query_grouping.rb'
|
31
|
+
autoload :QuerySortingConfiguration, '2019-01-01/generated/azure_mgmt_cost_management/models/query_sorting_configuration.rb'
|
32
|
+
autoload :ErrorResponse, '2019-01-01/generated/azure_mgmt_cost_management/models/error_response.rb'
|
33
|
+
autoload :QueryComparisonExpression, '2019-01-01/generated/azure_mgmt_cost_management/models/query_comparison_expression.rb'
|
34
|
+
autoload :ErrorDetails, '2019-01-01/generated/azure_mgmt_cost_management/models/error_details.rb'
|
35
|
+
autoload :Resource, '2019-01-01/generated/azure_mgmt_cost_management/models/resource.rb'
|
36
|
+
autoload :QueryColumn, '2019-01-01/generated/azure_mgmt_cost_management/models/query_column.rb'
|
37
|
+
autoload :ExportExecutionListResult, '2019-01-01/generated/azure_mgmt_cost_management/models/export_execution_list_result.rb'
|
38
|
+
autoload :QueryResult, '2019-01-01/generated/azure_mgmt_cost_management/models/query_result.rb'
|
39
|
+
autoload :QueryFilter, '2019-01-01/generated/azure_mgmt_cost_management/models/query_filter.rb'
|
40
|
+
autoload :Operation, '2019-01-01/generated/azure_mgmt_cost_management/models/operation.rb'
|
41
|
+
autoload :QueryDataset, '2019-01-01/generated/azure_mgmt_cost_management/models/query_dataset.rb'
|
42
|
+
autoload :QueryTimePeriod, '2019-01-01/generated/azure_mgmt_cost_management/models/query_time_period.rb'
|
43
|
+
autoload :QueryDefinition, '2019-01-01/generated/azure_mgmt_cost_management/models/query_definition.rb'
|
44
|
+
autoload :QueryAggregation, '2019-01-01/generated/azure_mgmt_cost_management/models/query_aggregation.rb'
|
45
|
+
autoload :ExportRecurrencePeriod, '2019-01-01/generated/azure_mgmt_cost_management/models/export_recurrence_period.rb'
|
46
|
+
autoload :ExportSchedule, '2019-01-01/generated/azure_mgmt_cost_management/models/export_schedule.rb'
|
47
|
+
autoload :OperationListResult, '2019-01-01/generated/azure_mgmt_cost_management/models/operation_list_result.rb'
|
48
|
+
autoload :CommonExportProperties, '2019-01-01/generated/azure_mgmt_cost_management/models/common_export_properties.rb'
|
49
|
+
autoload :DimensionsListResult, '2019-01-01/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb'
|
50
|
+
autoload :ExportListResult, '2019-01-01/generated/azure_mgmt_cost_management/models/export_list_result.rb'
|
51
|
+
autoload :QueryDatasetConfiguration, '2019-01-01/generated/azure_mgmt_cost_management/models/query_dataset_configuration.rb'
|
52
|
+
autoload :ExportDeliveryDestination, '2019-01-01/generated/azure_mgmt_cost_management/models/export_delivery_destination.rb'
|
53
|
+
autoload :OperationDisplay, '2019-01-01/generated/azure_mgmt_cost_management/models/operation_display.rb'
|
54
|
+
autoload :ExportDeliveryInfo, '2019-01-01/generated/azure_mgmt_cost_management/models/export_delivery_info.rb'
|
55
|
+
autoload :Dimension, '2019-01-01/generated/azure_mgmt_cost_management/models/dimension.rb'
|
56
|
+
autoload :Query, '2019-01-01/generated/azure_mgmt_cost_management/models/query.rb'
|
57
|
+
autoload :Export, '2019-01-01/generated/azure_mgmt_cost_management/models/export.rb'
|
58
|
+
autoload :ExportExecution, '2019-01-01/generated/azure_mgmt_cost_management/models/export_execution.rb'
|
59
|
+
autoload :TimeframeType, '2019-01-01/generated/azure_mgmt_cost_management/models/timeframe_type.rb'
|
60
|
+
autoload :GranularityType, '2019-01-01/generated/azure_mgmt_cost_management/models/granularity_type.rb'
|
61
|
+
autoload :QueryColumnType, '2019-01-01/generated/azure_mgmt_cost_management/models/query_column_type.rb'
|
62
|
+
autoload :SortDirection, '2019-01-01/generated/azure_mgmt_cost_management/models/sort_direction.rb'
|
63
|
+
autoload :StatusType, '2019-01-01/generated/azure_mgmt_cost_management/models/status_type.rb'
|
64
|
+
autoload :RecurrenceType, '2019-01-01/generated/azure_mgmt_cost_management/models/recurrence_type.rb'
|
65
|
+
autoload :FormatType, '2019-01-01/generated/azure_mgmt_cost_management/models/format_type.rb'
|
66
|
+
autoload :ExecutionType, '2019-01-01/generated/azure_mgmt_cost_management/models/execution_type.rb'
|
67
|
+
autoload :ExecutionStatus, '2019-01-01/generated/azure_mgmt_cost_management/models/execution_status.rb'
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,144 @@
|
|
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
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class CostManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] Version of the API to be used with the client request.
|
21
|
+
# The current version is 2018-05-31.
|
22
|
+
attr_reader :api_version
|
23
|
+
|
24
|
+
# @return [String] Azure Subscription ID.
|
25
|
+
attr_accessor :subscription_id
|
26
|
+
|
27
|
+
# @return [String] The preferred language for the response.
|
28
|
+
attr_accessor :accept_language
|
29
|
+
|
30
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
31
|
+
# Operations. Default value is 30.
|
32
|
+
attr_accessor :long_running_operation_retry_timeout
|
33
|
+
|
34
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
35
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
36
|
+
# generated and included in each request. Default is true.
|
37
|
+
attr_accessor :generate_client_request_id
|
38
|
+
|
39
|
+
# @return [Dimensions] dimensions
|
40
|
+
attr_reader :dimensions
|
41
|
+
|
42
|
+
# @return [QueryOperations] query_operations
|
43
|
+
attr_reader :query_operations
|
44
|
+
|
45
|
+
# @return [Exports] exports
|
46
|
+
attr_reader :exports
|
47
|
+
|
48
|
+
# @return [Operations] operations
|
49
|
+
attr_reader :operations
|
50
|
+
|
51
|
+
#
|
52
|
+
# Creates initializes a new instance of the CostManagementClient class.
|
53
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
54
|
+
# @param base_url [String] the base URI of the service.
|
55
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
56
|
+
#
|
57
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
58
|
+
super(credentials, options)
|
59
|
+
@base_url = base_url || 'https://management.azure.com'
|
60
|
+
|
61
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
62
|
+
@credentials = credentials
|
63
|
+
|
64
|
+
@dimensions = Dimensions.new(self)
|
65
|
+
@query_operations = QueryOperations.new(self)
|
66
|
+
@exports = Exports.new(self)
|
67
|
+
@operations = Operations.new(self)
|
68
|
+
@api_version = '2019-01-01'
|
69
|
+
@accept_language = 'en-US'
|
70
|
+
@long_running_operation_retry_timeout = 30
|
71
|
+
@generate_client_request_id = true
|
72
|
+
add_telemetry
|
73
|
+
end
|
74
|
+
|
75
|
+
#
|
76
|
+
# Makes a request and returns the body of the response.
|
77
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
78
|
+
# @param path [String] the path, relative to {base_url}.
|
79
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
80
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
81
|
+
# Example:
|
82
|
+
#
|
83
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
84
|
+
# path = "/path"
|
85
|
+
# options = {
|
86
|
+
# body: request_content,
|
87
|
+
# query_params: {'api-version' => '2016-02-01'}
|
88
|
+
# }
|
89
|
+
# result = @client.make_request(:put, path, options)
|
90
|
+
#
|
91
|
+
def make_request(method, path, options = {})
|
92
|
+
result = make_request_with_http_info(method, path, options)
|
93
|
+
result.body unless result.nil?
|
94
|
+
end
|
95
|
+
|
96
|
+
#
|
97
|
+
# Makes a request and returns the operation response.
|
98
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
99
|
+
# @param path [String] the path, relative to {base_url}.
|
100
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
101
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
102
|
+
#
|
103
|
+
def make_request_with_http_info(method, path, options = {})
|
104
|
+
result = make_request_async(method, path, options).value!
|
105
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
106
|
+
result
|
107
|
+
end
|
108
|
+
|
109
|
+
#
|
110
|
+
# Makes a request asynchronously.
|
111
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
112
|
+
# @param path [String] the path, relative to {base_url}.
|
113
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
114
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
115
|
+
#
|
116
|
+
def make_request_async(method, path, options = {})
|
117
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
118
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
119
|
+
|
120
|
+
request_url = options[:base_url] || @base_url
|
121
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
122
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
123
|
+
end
|
124
|
+
|
125
|
+
request_headers = @request_headers
|
126
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
127
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
128
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
129
|
+
|
130
|
+
super(request_url, method, path, options)
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
private
|
135
|
+
#
|
136
|
+
# Adds telemetry information.
|
137
|
+
#
|
138
|
+
def add_telemetry
|
139
|
+
sdk_information = 'azure_mgmt_cost_management'
|
140
|
+
sdk_information = "#{sdk_information}/0.17.0"
|
141
|
+
add_user_agent_information(sdk_information)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|