Class: Azure::Consumption::Mgmt::V2018_05_31::UsageDetails
- Inherits:
-
Object
- Object
- Azure::Consumption::Mgmt::V2018_05_31::UsageDetails
- Includes:
- MsRestAzure
- Defined in:
- lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb
Overview
Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.
Instance Attribute Summary collapse
-
#client ⇒ ConsumptionManagementClient
readonly
Reference to the ConsumptionManagementClient.
Instance Method Summary collapse
-
#initialize(client) ⇒ UsageDetails
constructor
Creates and initializes a new instance of the UsageDetails class.
-
#list(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details for a scope by current billing period.
-
#list_as_lazy(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by current billing period.
-
#list_async(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by current billing period.
-
#list_by_billing_account(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_account_as_lazy(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_account_async(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_account_with_http_info(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by billingAccountId for a scope by current billing period.
-
#list_by_billing_period(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details for a scope by billing period.
-
#list_by_billing_period_as_lazy(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by billing period.
-
#list_by_billing_period_async(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by billing period.
-
#list_by_billing_period_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by billing period.
-
#list_by_billing_period_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by billing period.
-
#list_by_billing_period_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by billing period.
-
#list_by_billing_period_with_http_info(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by billing period.
-
#list_by_department(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_department_as_lazy(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_department_async(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_department_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_department_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_department_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_department_with_http_info(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by departmentId for a scope by current billing period.
-
#list_by_enrollment_account(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_by_enrollment_account_as_lazy(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_by_enrollment_account_async(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_by_enrollment_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_by_enrollment_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_by_enrollment_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_by_enrollment_account_with_http_info(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by enrollmentAccountId for a scope by current billing period.
-
#list_for_billing_period_by_billing_account(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_billing_account_as_lazy(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_billing_account_async(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_billing_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_billing_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_billing_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_billing_account_with_http_info(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on billingAccountId for a scope by billing period.
-
#list_for_billing_period_by_department(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_department_as_lazy(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_department_async(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_department_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_department_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_department_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_department_with_http_info(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on departmentId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account_as_lazy(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account_async(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_for_billing_period_by_enrollment_account_with_http_info(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on enrollmentAccountId for a scope by billing period.
-
#list_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by current billing period.
-
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by current billing period.
-
#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by current billing period.
-
#list_with_http_info(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by current billing period.
Constructor Details
#initialize(client) ⇒ UsageDetails
Creates and initializes a new instance of the UsageDetails class.
18 19 20 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 18 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ConsumptionManagementClient (readonly)
Returns reference to the ConsumptionManagementClient.
23 24 25 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 23 def client @client end |
Instance Method Details
#list(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
51 52 53 54 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 51 def list(expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_as_lazy(expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_as_lazy(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2028 def list_as_lazy(expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_async(expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_async(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 112 def list_async(expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_billing_account(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
349 350 351 352 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 349 def list_by_billing_account(billing_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_by_billing_account_as_lazy(billing_account_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_billing_account_as_lazy(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2107 def list_by_billing_account_as_lazy(billing_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_by_billing_account_async(billing_account_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_billing_account_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_billing_account_async(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 414 def list_by_billing_account_async(billing_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'billingAccountId' => billing_account_id}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_billing_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1440 1441 1442 1443 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1440 def list_by_billing_account_next(next_page_link, custom_headers:nil) response = list_by_billing_account_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_billing_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1473 def list_by_billing_account_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_billing_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1457 1458 1459 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1457 def list_by_billing_account_next_with_http_info(next_page_link, custom_headers:nil) list_by_billing_account_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_billing_account_with_http_info(billing_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by billingAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
382 383 384 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 382 def list_by_billing_account_with_http_info(billing_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_by_billing_account_async(billing_account_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_by_billing_period(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
198 199 200 201 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 198 def list_by_billing_period(billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_by_billing_period_as_lazy(billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_billing_period_as_lazy(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2067 def list_by_billing_period_as_lazy(billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_by_billing_period_async(billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_billing_period_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_billing_period_async(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 261 def list_by_billing_period_async(billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'billing_period_name is nil' if billing_period_name.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'billingPeriodName' => billing_period_name}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_billing_period_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1346 1347 1348 1349 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1346 def list_by_billing_period_next(next_page_link, custom_headers:nil) response = list_by_billing_period_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_billing_period_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1377 def list_by_billing_period_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_billing_period_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1362 1363 1364 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1362 def list_by_billing_period_next_with_http_info(next_page_link, custom_headers:nil) list_by_billing_period_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_billing_period_with_http_info(billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
230 231 232 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 230 def list_by_billing_period_with_http_info(billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_by_billing_period_async(billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_by_department(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
657 658 659 660 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 657 def list_by_department(department_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_by_department_as_lazy(department_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_department_as_lazy(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2188 def list_by_department_as_lazy(department_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_by_department_async(department_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_department_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_department_async(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 722 def list_by_department_async(department_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, 'department_id is nil' if department_id.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'departmentId' => department_id}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_department_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1632 1633 1634 1635 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1632 def list_by_department_next(next_page_link, custom_headers:nil) response = list_by_department_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_department_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1665 def list_by_department_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_department_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1649 1650 1651 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1649 def list_by_department_next_with_http_info(next_page_link, custom_headers:nil) list_by_department_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_department_with_http_info(department_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
690 691 692 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 690 def list_by_department_with_http_info(department_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_by_department_async(department_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_by_enrollment_account(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
962 963 964 965 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 962 def list_by_enrollment_account(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_by_enrollment_account_as_lazy(enrollment_account_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_enrollment_account_as_lazy(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2268 def list_by_enrollment_account_as_lazy(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_by_enrollment_account_async(enrollment_account_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_enrollment_account_async(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1027 def list_by_enrollment_account_async(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, 'enrollment_account_id is nil' if enrollment_account_id.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'enrollmentAccountId' => enrollment_account_id}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_enrollment_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1821 1822 1823 1824 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1821 def list_by_enrollment_account_next(next_page_link, custom_headers:nil) response = list_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_enrollment_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1854 def list_by_enrollment_account_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_enrollment_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1838 1839 1840 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1838 def list_by_enrollment_account_next_with_http_info(next_page_link, custom_headers:nil) list_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_enrollment_account_with_http_info(enrollment_account_id, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
995 996 997 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 995 def list_by_enrollment_account_with_http_info(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_by_enrollment_account_async(enrollment_account_id, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_for_billing_period_by_billing_account(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
502 503 504 505 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 502 def list_for_billing_period_by_billing_account(billing_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_for_billing_period_by_billing_account_as_lazy(billing_account_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_for_billing_period_by_billing_account_as_lazy(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2148 def list_for_billing_period_by_billing_account_as_lazy(billing_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_for_billing_period_by_billing_account_async(billing_account_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_for_billing_period_by_billing_account_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_for_billing_period_by_billing_account_async(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 569 def list_for_billing_period_by_billing_account_async(billing_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil? fail ArgumentError, 'billing_period_name is nil' if billing_period_name.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'billingAccountId' => billing_account_id,'billingPeriodName' => billing_period_name}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_for_billing_period_by_billing_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1536 1537 1538 1539 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1536 def list_for_billing_period_by_billing_account_next(next_page_link, custom_headers:nil) response = list_for_billing_period_by_billing_account_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_for_billing_period_by_billing_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1569 def list_for_billing_period_by_billing_account_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_for_billing_period_by_billing_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1553 1554 1555 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1553 def list_for_billing_period_by_billing_account_next_with_http_info(next_page_link, custom_headers:nil) list_for_billing_period_by_billing_account_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_for_billing_period_by_billing_account_with_http_info(billing_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
536 537 538 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 536 def list_for_billing_period_by_billing_account_with_http_info(billing_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_for_billing_period_by_billing_account_async(billing_account_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_for_billing_period_by_department(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
809 810 811 812 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 809 def list_for_billing_period_by_department(department_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_for_billing_period_by_department_as_lazy(department_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_for_billing_period_by_department_as_lazy(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2228 def list_for_billing_period_by_department_as_lazy(department_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_for_billing_period_by_department_async(department_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_for_billing_period_by_department_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_for_billing_period_by_department_async(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 874 def list_for_billing_period_by_department_async(department_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, 'department_id is nil' if department_id.nil? fail ArgumentError, 'billing_period_name is nil' if billing_period_name.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'departmentId' => department_id,'billingPeriodName' => billing_period_name}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_for_billing_period_by_department_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1727 1728 1729 1730 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1727 def list_for_billing_period_by_department_next(next_page_link, custom_headers:nil) response = list_for_billing_period_by_department_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_for_billing_period_by_department_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1758 def list_for_billing_period_by_department_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_for_billing_period_by_department_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1743 1744 1745 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1743 def list_for_billing_period_by_department_next_with_http_info(next_page_link, custom_headers:nil) list_for_billing_period_by_department_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_for_billing_period_by_department_with_http_info(department_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
842 843 844 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 842 def list_for_billing_period_by_department_with_http_info(department_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_for_billing_period_by_department_async(department_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_for_billing_period_by_enrollment_account(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Array<UsageDetail>
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
1115 1116 1117 1118 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1115 def list_for_billing_period_by_enrollment_account(enrollment_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) first_page = list_for_billing_period_by_enrollment_account_as_lazy(enrollment_account_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_for_billing_period_by_enrollment_account_as_lazy(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 2309 def list_for_billing_period_by_enrollment_account_as_lazy(enrollment_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) response = list_for_billing_period_by_enrollment_account_async(enrollment_account_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_for_billing_period_by_enrollment_account_async(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1182 def list_for_billing_period_by_enrollment_account_async(enrollment_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) fail ArgumentError, 'enrollment_account_id is nil' if enrollment_account_id.nil? fail ArgumentError, 'billing_period_name is nil' if billing_period_name.nil? fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? apply = nil unless .nil? apply = .Apply end request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'enrollmentAccountId' => enrollment_account_id,'billingPeriodName' => billing_period_name}, query_params: {'$expand' => ,'$filter' => filter,'$skiptoken' => skiptoken,'$top' => top,'api-version' => @client.api_version,'$apply' => apply}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_for_billing_period_by_enrollment_account_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1917 1918 1919 1920 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1917 def list_for_billing_period_by_enrollment_account_next(next_page_link, custom_headers:nil) response = list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1950 def list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_for_billing_period_by_enrollment_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1934 1935 1936 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1934 def list_for_billing_period_by_enrollment_account_next_with_http_info(next_page_link, custom_headers:nil) list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_for_billing_period_by_enrollment_account_with_http_info(enrollment_account_id, billing_period_name, expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
1149 1150 1151 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1149 def list_for_billing_period_by_enrollment_account_with_http_info(enrollment_account_id, billing_period_name, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_for_billing_period_by_enrollment_account_async(enrollment_account_id, billing_period_name, expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |
#list_next(next_page_link, custom_headers: nil) ⇒ UsageDetailsListResult
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1253 1254 1255 1256 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1253 def list_next(next_page_link, custom_headers:nil) response = list_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. to the HTTP request.
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1284 def list_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Consumption::Mgmt::V2018_05_31::Models::UsageDetailsListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
to List operation. will be added to the HTTP request.
1269 1270 1271 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 1269 def list_next_with_http_info(next_page_link, custom_headers:nil) list_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_with_http_info(expand: nil, filter: nil, skiptoken: nil, top: nil, query_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists the usage details for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later.
properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports ‘eq’, ‘lt’, ‘gt’, ‘le’, ‘ge’, and ‘and’. It does not currently support ‘ne’, ‘or’, or ‘not’. Tag filter is a key value pair string where key and value is separated by a colon (:). returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
82 83 84 |
# File 'lib/2018-05-31/generated/azure_mgmt_consumption/usage_details.rb', line 82 def list_with_http_info(expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil) list_async(expand:, filter:filter, skiptoken:skiptoken, top:top, query_options:, custom_headers:custom_headers).value! end |