Class: Azure::CostManagement::Mgmt::V2019_03_01_preview::Dimensions

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb

Overview

Dimensions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Dimensions

Creates and initializes a new instance of the Dimensions class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCostManagementClient (readonly)

Returns reference to the CostManagementClient.

Returns:



22
23
24
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 22

def client
  @client
end

Instance Method Details

#list_by_billing_account(billing_account_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ DimensionsListResult

Lists the dimensions by billingAccount Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DimensionsListResult)

    operation results.



44
45
46
47
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 44

def (, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  response = (, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_billing_account_async(billing_account_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the dimensions by billingAccount Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 93

def (, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'billing_account_id is nil' if .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


  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.CostManagement/dimensions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'billingAccountId' => },
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_billing_account_with_http_info(billing_account_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the dimensions by billingAccount Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



69
70
71
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 69

def (, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  (, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end

#list_by_department(billing_account_id, department_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ DimensionsListResult

Lists the dimensions by Department Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • department_id (String)

    Department ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DimensionsListResult)

    operation results.



297
298
299
300
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 297

def list_by_department(, department_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  response = list_by_department_async(, department_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_department_async(billing_account_id, department_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the dimensions by Department Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • department_id (String)

    Department ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 348

def list_by_department_async(, department_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'billing_account_id is nil' if .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


  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}/departments/{departmentId}/providers/Microsoft.CostManagement/dimensions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'billingAccountId' => ,'departmentId' => department_id},
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_department_with_http_info(billing_account_id, department_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the dimensions by Department Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • department_id (String)

    Department ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



323
324
325
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 323

def list_by_department_with_http_info(, department_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  list_by_department_async(, department_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end

#list_by_enrollment_account(billing_account_id, enrollment_account_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ DimensionsListResult

Lists the dimensions by Enrollment Account Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • enrollment_account_id (String)

    Enrollment Account ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DimensionsListResult)

    operation results.



169
170
171
172
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 169

def (, , filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  response = (, , filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_enrollment_account_async(billing_account_id, enrollment_account_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the dimensions by Enrollment Account Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • enrollment_account_id (String)

    Enrollment Account ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 220

def (, , filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'billing_account_id is nil' if .nil?
  fail ArgumentError, 'enrollment_account_id is nil' if .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


  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}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/dimensions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'billingAccountId' => ,'enrollmentAccountId' => },
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_enrollment_account_with_http_info(billing_account_id, enrollment_account_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the dimensions by Enrollment Account Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • billing_account_id (String)

    BillingAccount ID

  • enrollment_account_id (String)

    Enrollment Account ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



195
196
197
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 195

def (, , filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  (, , filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end

#list_by_management_group(management_group_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ DimensionsListResult

Lists the dimensions by managementGroup Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • management_group_id (String)

    ManagementGroup ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DimensionsListResult)

    operation results.



424
425
426
427
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 424

def list_by_management_group(management_group_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  response = list_by_management_group_async(management_group_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_management_group_async(management_group_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the dimensions by managementGroup Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. to the HTTP request.

Parameters:

  • management_group_id (String)

    ManagementGroup ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 473

def list_by_management_group_async(management_group_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'management_group_id is nil' if management_group_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


  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.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/dimensions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'managementGroupId' => management_group_id},
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_management_group_with_http_info(management_group_id, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the dimensions by managementGroup Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • management_group_id (String)

    ManagementGroup ID

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



449
450
451
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 449

def list_by_management_group_with_http_info(management_group_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  list_by_management_group_async(management_group_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end

#list_by_resource_group(resource_group_name, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ DimensionsListResult

Lists the dimensions by resource group Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Azure Resource Group Name.

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DimensionsListResult)

    operation results.



669
670
671
672
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 669

def list_by_resource_group(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_async(resource_group_name, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the dimensions by resource group Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Azure Resource Group Name.

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



718
719
720
721
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
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 718

def list_by_resource_group_async(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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


  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}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_with_http_info(resource_group_name, filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the dimensions by resource group Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Azure Resource Group Name.

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



694
695
696
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 694

def list_by_resource_group_with_http_info(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end

#list_by_subscription(filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ DimensionsListResult

Lists the dimensions by subscription Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (DimensionsListResult)

    operation results.



547
548
549
550
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 547

def list_by_subscription(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  response = list_by_subscription_async(filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_async(filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the dimensions by subscription Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 594

def list_by_subscription_async(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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


  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.CostManagement/dimensions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_with_http_info(filter: nil, expand: nil, skiptoken: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the dimensions by subscription Id.

properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. dimension category. By default, data is not included when listing dimensions. 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 dimension data. will be added to the HTTP request.

Parameters:

  • filter (String) (defaults to: nil)

    May be used to filter dimensions by

  • expand (String) (defaults to: nil)

    May be used to expand the properties/data within a

  • skiptoken (String) (defaults to: nil)

    Skiptoken is only used if a previous operation

  • top (Integer) (defaults to: nil)

    May be used to limit the number of results to the most

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



571
572
573
# File 'lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb', line 571

def list_by_subscription_with_http_info(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
  list_by_subscription_async(filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end