azure_mgmt_network 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_network/application_gateways.rb +85 -112
  3. data/lib/generated/azure_mgmt_network/express_route_circuit_authorizations.rb +47 -62
  4. data/lib/generated/azure_mgmt_network/express_route_circuit_peerings.rb +47 -62
  5. data/lib/generated/azure_mgmt_network/express_route_circuits.rb +112 -148
  6. data/lib/generated/azure_mgmt_network/express_route_service_providers.rb +20 -26
  7. data/lib/generated/azure_mgmt_network/load_balancers.rb +67 -88
  8. data/lib/generated/azure_mgmt_network/local_network_gateways.rb +47 -62
  9. data/lib/generated/azure_mgmt_network/network_interfaces.rb +134 -176
  10. data/lib/generated/azure_mgmt_network/network_management_client.rb +64 -16
  11. data/lib/generated/azure_mgmt_network/network_security_groups.rb +67 -88
  12. data/lib/generated/azure_mgmt_network/public_ipaddresses.rb +67 -88
  13. data/lib/generated/azure_mgmt_network/route_tables.rb +67 -88
  14. data/lib/generated/azure_mgmt_network/routes.rb +47 -62
  15. data/lib/generated/azure_mgmt_network/security_rules.rb +47 -62
  16. data/lib/generated/azure_mgmt_network/subnets.rb +47 -62
  17. data/lib/generated/azure_mgmt_network/usages.rb +20 -26
  18. data/lib/generated/azure_mgmt_network/version.rb +1 -1
  19. data/lib/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +74 -98
  20. data/lib/generated/azure_mgmt_network/virtual_network_gateways.rb +65 -86
  21. data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +47 -62
  22. data/lib/generated/azure_mgmt_network/virtual_networks.rb +76 -100
  23. metadata +5 -5
@@ -129,30 +129,27 @@ module Azure::ARM::Network
129
129
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
130
130
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
131
131
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'
132
+
133
+ request_url = @base_url || @client.base_url
134
+
132
135
  options = {
133
136
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
134
137
  path_params: {'resourceGroupName' => resource_group_name,'networkSecurityGroupName' => network_security_group_name,'securityRuleName' => security_rule_name,'subscriptionId' => @client.subscription_id},
135
138
  query_params: {'api-version' => @client.api_version},
136
- headers: request_headers.merge(custom_headers || {})
139
+ headers: request_headers.merge(custom_headers || {}),
140
+ base_url: request_url
137
141
  }
142
+ promise = @client.make_request_async(:delete, path_template, options)
138
143
 
139
- request_url = @base_url || @client.base_url
140
-
141
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
142
- promise = request.run_promise do |req|
143
- @client.credentials.sign_request(req) unless @client.credentials.nil?
144
- end
145
-
146
- promise = promise.then do |http_response|
144
+ promise = promise.then do |result|
145
+ http_response = result.response
147
146
  status_code = http_response.status
148
147
  response_content = http_response.body
149
148
  unless status_code == 204 || status_code == 202 || status_code == 200
150
149
  error_model = JSON.load(response_content)
151
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
150
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
152
151
  end
153
152
 
154
- # Create Result
155
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
156
153
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
157
154
 
158
155
  result
@@ -223,30 +220,27 @@ module Azure::ARM::Network
223
220
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
224
221
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
225
222
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'
223
+
224
+ request_url = @base_url || @client.base_url
225
+
226
226
  options = {
227
227
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
228
228
  path_params: {'resourceGroupName' => resource_group_name,'networkSecurityGroupName' => network_security_group_name,'securityRuleName' => security_rule_name,'subscriptionId' => @client.subscription_id},
229
229
  query_params: {'api-version' => @client.api_version},
230
- headers: request_headers.merge(custom_headers || {})
230
+ headers: request_headers.merge(custom_headers || {}),
231
+ base_url: request_url
231
232
  }
233
+ promise = @client.make_request_async(:get, path_template, options)
232
234
 
233
- request_url = @base_url || @client.base_url
234
-
235
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
236
- promise = request.run_promise do |req|
237
- @client.credentials.sign_request(req) unless @client.credentials.nil?
238
- end
239
-
240
- promise = promise.then do |http_response|
235
+ promise = promise.then do |result|
236
+ http_response = result.response
241
237
  status_code = http_response.status
242
238
  response_content = http_response.body
243
239
  unless status_code == 200
244
240
  error_model = JSON.load(response_content)
245
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
241
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
246
242
  end
247
243
 
248
- # Create Result
249
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
250
244
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
251
245
  # Deserialize Response
252
246
  if status_code == 200
@@ -393,31 +387,28 @@ module Azure::ARM::Network
393
387
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
394
388
 
395
389
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'
390
+
391
+ request_url = @base_url || @client.base_url
392
+
396
393
  options = {
397
394
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
398
395
  path_params: {'resourceGroupName' => resource_group_name,'networkSecurityGroupName' => network_security_group_name,'securityRuleName' => security_rule_name,'subscriptionId' => @client.subscription_id},
399
396
  query_params: {'api-version' => @client.api_version},
400
397
  body: request_content,
401
- headers: request_headers.merge(custom_headers || {})
398
+ headers: request_headers.merge(custom_headers || {}),
399
+ base_url: request_url
402
400
  }
401
+ promise = @client.make_request_async(:put, path_template, options)
403
402
 
404
- request_url = @base_url || @client.base_url
405
-
406
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
407
- promise = request.run_promise do |req|
408
- @client.credentials.sign_request(req) unless @client.credentials.nil?
409
- end
410
-
411
- promise = promise.then do |http_response|
403
+ promise = promise.then do |result|
404
+ http_response = result.response
412
405
  status_code = http_response.status
413
406
  response_content = http_response.body
414
407
  unless status_code == 200 || status_code == 201
415
408
  error_model = JSON.load(response_content)
416
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
409
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
417
410
  end
418
411
 
419
- # Create Result
420
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
421
412
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
422
413
  # Deserialize Response
423
414
  if status_code == 200
@@ -463,8 +454,8 @@ module Azure::ARM::Network
463
454
  response = list_async(resource_group_name, network_security_group_name, custom_headers).value!
464
455
  unless response.nil?
465
456
  page = response.body
466
- page.next_method = Proc.new do |next_link|
467
- list_next_async(next_link, custom_headers)
457
+ page.next_method = Proc.new do |next_page_link|
458
+ list_next_async(next_page_link, custom_headers)
468
459
  end
469
460
  page
470
461
  end
@@ -528,30 +519,27 @@ module Azure::ARM::Network
528
519
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
529
520
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
530
521
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'
522
+
523
+ request_url = @base_url || @client.base_url
524
+
531
525
  options = {
532
526
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
533
527
  path_params: {'resourceGroupName' => resource_group_name,'networkSecurityGroupName' => network_security_group_name,'subscriptionId' => @client.subscription_id},
534
528
  query_params: {'api-version' => @client.api_version},
535
- headers: request_headers.merge(custom_headers || {})
529
+ headers: request_headers.merge(custom_headers || {}),
530
+ base_url: request_url
536
531
  }
532
+ promise = @client.make_request_async(:get, path_template, options)
537
533
 
538
- request_url = @base_url || @client.base_url
539
-
540
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
541
- promise = request.run_promise do |req|
542
- @client.credentials.sign_request(req) unless @client.credentials.nil?
543
- end
544
-
545
- promise = promise.then do |http_response|
534
+ promise = promise.then do |result|
535
+ http_response = result.response
546
536
  status_code = http_response.status
547
537
  response_content = http_response.body
548
538
  unless status_code == 200
549
539
  error_model = JSON.load(response_content)
550
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
540
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
551
541
  end
552
542
 
553
- # Create Result
554
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
555
543
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
556
544
  # Deserialize Response
557
545
  if status_code == 200
@@ -622,29 +610,26 @@ module Azure::ARM::Network
622
610
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
623
611
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
624
612
  path_template = '{nextLink}'
613
+
614
+ request_url = @base_url || @client.base_url
615
+
625
616
  options = {
626
617
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
627
618
  skip_encoding_path_params: {'nextLink' => next_page_link},
628
- headers: request_headers.merge(custom_headers || {})
619
+ headers: request_headers.merge(custom_headers || {}),
620
+ base_url: request_url
629
621
  }
622
+ promise = @client.make_request_async(:get, path_template, options)
630
623
 
631
- request_url = @base_url || @client.base_url
632
-
633
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
634
- promise = request.run_promise do |req|
635
- @client.credentials.sign_request(req) unless @client.credentials.nil?
636
- end
637
-
638
- promise = promise.then do |http_response|
624
+ promise = promise.then do |result|
625
+ http_response = result.response
639
626
  status_code = http_response.status
640
627
  response_content = http_response.body
641
628
  unless status_code == 200
642
629
  error_model = JSON.load(response_content)
643
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
630
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
644
631
  end
645
632
 
646
- # Create Result
647
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
648
633
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
649
634
  # Deserialize Response
650
635
  if status_code == 200
@@ -120,30 +120,27 @@ module Azure::ARM::Network
120
120
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
121
121
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
122
122
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'
123
+
124
+ request_url = @base_url || @client.base_url
125
+
123
126
  options = {
124
127
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
125
128
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
126
129
  query_params: {'api-version' => @client.api_version},
127
- headers: request_headers.merge(custom_headers || {})
130
+ headers: request_headers.merge(custom_headers || {}),
131
+ base_url: request_url
128
132
  }
133
+ promise = @client.make_request_async(:delete, path_template, options)
129
134
 
130
- request_url = @base_url || @client.base_url
131
-
132
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
133
- promise = request.run_promise do |req|
134
- @client.credentials.sign_request(req) unless @client.credentials.nil?
135
- end
136
-
137
- promise = promise.then do |http_response|
135
+ promise = promise.then do |result|
136
+ http_response = result.response
138
137
  status_code = http_response.status
139
138
  response_content = http_response.body
140
139
  unless status_code == 200 || status_code == 204 || status_code == 202
141
140
  error_model = JSON.load(response_content)
142
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
141
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
143
142
  end
144
143
 
145
- # Create Result
146
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
147
144
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
148
145
 
149
146
  result
@@ -211,30 +208,27 @@ module Azure::ARM::Network
211
208
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
212
209
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
213
210
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'
211
+
212
+ request_url = @base_url || @client.base_url
213
+
214
214
  options = {
215
215
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
216
216
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
217
217
  query_params: {'api-version' => @client.api_version,'$expand' => expand},
218
- headers: request_headers.merge(custom_headers || {})
218
+ headers: request_headers.merge(custom_headers || {}),
219
+ base_url: request_url
219
220
  }
221
+ promise = @client.make_request_async(:get, path_template, options)
220
222
 
221
- request_url = @base_url || @client.base_url
222
-
223
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
224
- promise = request.run_promise do |req|
225
- @client.credentials.sign_request(req) unless @client.credentials.nil?
226
- end
227
-
228
- promise = promise.then do |http_response|
223
+ promise = promise.then do |result|
224
+ http_response = result.response
229
225
  status_code = http_response.status
230
226
  response_content = http_response.body
231
227
  unless status_code == 200
232
228
  error_model = JSON.load(response_content)
233
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
229
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
234
230
  end
235
231
 
236
- # Create Result
237
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
238
232
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
239
233
  # Deserialize Response
240
234
  if status_code == 200
@@ -376,31 +370,28 @@ module Azure::ARM::Network
376
370
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
377
371
 
378
372
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'
373
+
374
+ request_url = @base_url || @client.base_url
375
+
379
376
  options = {
380
377
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
381
378
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
382
379
  query_params: {'api-version' => @client.api_version},
383
380
  body: request_content,
384
- headers: request_headers.merge(custom_headers || {})
381
+ headers: request_headers.merge(custom_headers || {}),
382
+ base_url: request_url
385
383
  }
384
+ promise = @client.make_request_async(:put, path_template, options)
386
385
 
387
- request_url = @base_url || @client.base_url
388
-
389
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
390
- promise = request.run_promise do |req|
391
- @client.credentials.sign_request(req) unless @client.credentials.nil?
392
- end
393
-
394
- promise = promise.then do |http_response|
386
+ promise = promise.then do |result|
387
+ http_response = result.response
395
388
  status_code = http_response.status
396
389
  response_content = http_response.body
397
390
  unless status_code == 200 || status_code == 201
398
391
  error_model = JSON.load(response_content)
399
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
392
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
400
393
  end
401
394
 
402
- # Create Result
403
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
404
395
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
405
396
  # Deserialize Response
406
397
  if status_code == 200
@@ -444,8 +435,8 @@ module Azure::ARM::Network
444
435
  response = list_async(resource_group_name, virtual_network_name, custom_headers).value!
445
436
  unless response.nil?
446
437
  page = response.body
447
- page.next_method = Proc.new do |next_link|
448
- list_next_async(next_link, custom_headers)
438
+ page.next_method = Proc.new do |next_page_link|
439
+ list_next_async(next_page_link, custom_headers)
449
440
  end
450
441
  page
451
442
  end
@@ -503,30 +494,27 @@ module Azure::ARM::Network
503
494
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
504
495
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
505
496
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'
497
+
498
+ request_url = @base_url || @client.base_url
499
+
506
500
  options = {
507
501
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
508
502
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subscriptionId' => @client.subscription_id},
509
503
  query_params: {'api-version' => @client.api_version},
510
- headers: request_headers.merge(custom_headers || {})
504
+ headers: request_headers.merge(custom_headers || {}),
505
+ base_url: request_url
511
506
  }
507
+ promise = @client.make_request_async(:get, path_template, options)
512
508
 
513
- request_url = @base_url || @client.base_url
514
-
515
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
516
- promise = request.run_promise do |req|
517
- @client.credentials.sign_request(req) unless @client.credentials.nil?
518
- end
519
-
520
- promise = promise.then do |http_response|
509
+ promise = promise.then do |result|
510
+ http_response = result.response
521
511
  status_code = http_response.status
522
512
  response_content = http_response.body
523
513
  unless status_code == 200
524
514
  error_model = JSON.load(response_content)
525
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
515
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
526
516
  end
527
517
 
528
- # Create Result
529
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
530
518
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
531
519
  # Deserialize Response
532
520
  if status_code == 200
@@ -594,29 +582,26 @@ module Azure::ARM::Network
594
582
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
595
583
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
596
584
  path_template = '{nextLink}'
585
+
586
+ request_url = @base_url || @client.base_url
587
+
597
588
  options = {
598
589
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
599
590
  skip_encoding_path_params: {'nextLink' => next_page_link},
600
- headers: request_headers.merge(custom_headers || {})
591
+ headers: request_headers.merge(custom_headers || {}),
592
+ base_url: request_url
601
593
  }
594
+ promise = @client.make_request_async(:get, path_template, options)
602
595
 
603
- request_url = @base_url || @client.base_url
604
-
605
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
606
- promise = request.run_promise do |req|
607
- @client.credentials.sign_request(req) unless @client.credentials.nil?
608
- end
609
-
610
- promise = promise.then do |http_response|
596
+ promise = promise.then do |result|
597
+ http_response = result.response
611
598
  status_code = http_response.status
612
599
  response_content = http_response.body
613
600
  unless status_code == 200
614
601
  error_model = JSON.load(response_content)
615
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
602
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
616
603
  end
617
604
 
618
- # Create Result
619
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
620
605
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
621
606
  # Deserialize Response
622
607
  if status_code == 200
@@ -39,8 +39,8 @@ module Azure::ARM::Network
39
39
  response = list_async(location, custom_headers).value!
40
40
  unless response.nil?
41
41
  page = response.body
42
- page.next_method = Proc.new do |next_link|
43
- list_next_async(next_link, custom_headers)
42
+ page.next_method = Proc.new do |next_page_link|
43
+ list_next_async(next_page_link, custom_headers)
44
44
  end
45
45
  page
46
46
  end
@@ -94,30 +94,27 @@ module Azure::ARM::Network
94
94
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
95
95
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
96
96
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'
97
+
98
+ request_url = @base_url || @client.base_url
99
+
97
100
  options = {
98
101
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
102
  path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
100
103
  query_params: {'api-version' => @client.api_version},
101
- headers: request_headers.merge(custom_headers || {})
104
+ headers: request_headers.merge(custom_headers || {}),
105
+ base_url: request_url
102
106
  }
107
+ promise = @client.make_request_async(:get, path_template, options)
103
108
 
104
- request_url = @base_url || @client.base_url
105
-
106
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
107
- promise = request.run_promise do |req|
108
- @client.credentials.sign_request(req) unless @client.credentials.nil?
109
- end
110
-
111
- promise = promise.then do |http_response|
109
+ promise = promise.then do |result|
110
+ http_response = result.response
112
111
  status_code = http_response.status
113
112
  response_content = http_response.body
114
113
  unless status_code == 200
115
114
  error_model = JSON.load(response_content)
116
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
115
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
117
116
  end
118
117
 
119
- # Create Result
120
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
121
118
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
122
119
  # Deserialize Response
123
120
  if status_code == 200
@@ -185,29 +182,26 @@ module Azure::ARM::Network
185
182
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
186
183
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
187
184
  path_template = '{nextLink}'
185
+
186
+ request_url = @base_url || @client.base_url
187
+
188
188
  options = {
189
189
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
190
190
  skip_encoding_path_params: {'nextLink' => next_page_link},
191
- headers: request_headers.merge(custom_headers || {})
191
+ headers: request_headers.merge(custom_headers || {}),
192
+ base_url: request_url
192
193
  }
194
+ promise = @client.make_request_async(:get, path_template, options)
193
195
 
194
- request_url = @base_url || @client.base_url
195
-
196
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
197
- promise = request.run_promise do |req|
198
- @client.credentials.sign_request(req) unless @client.credentials.nil?
199
- end
200
-
201
- promise = promise.then do |http_response|
196
+ promise = promise.then do |result|
197
+ http_response = result.response
202
198
  status_code = http_response.status
203
199
  response_content = http_response.body
204
200
  unless status_code == 200
205
201
  error_model = JSON.load(response_content)
206
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
202
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
207
203
  end
208
204
 
209
- # Create Result
210
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
211
205
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
212
206
  # Deserialize Response
213
207
  if status_code == 200