azure_mgmt_batch 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_batch.rb +11 -9
  3. data/lib/generated/azure_mgmt_batch/application_operations.rb +50 -50
  4. data/lib/generated/azure_mgmt_batch/application_package_operations.rb +17 -17
  5. data/lib/generated/azure_mgmt_batch/batch_account_operations.rb +288 -288
  6. data/lib/generated/azure_mgmt_batch/batch_management_client.rb +16 -3
  7. data/lib/generated/azure_mgmt_batch/location.rb +2 -2
  8. data/lib/generated/azure_mgmt_batch/models/account_key_type.rb +1 -1
  9. data/lib/generated/azure_mgmt_batch/models/activate_application_package_parameters.rb +1 -1
  10. data/lib/generated/azure_mgmt_batch/models/add_application_parameters.rb +1 -1
  11. data/lib/generated/azure_mgmt_batch/models/application.rb +1 -1
  12. data/lib/generated/azure_mgmt_batch/models/application_package.rb +4 -4
  13. data/lib/generated/azure_mgmt_batch/models/auto_storage_base_properties.rb +2 -2
  14. data/lib/generated/azure_mgmt_batch/models/auto_storage_properties.rb +2 -2
  15. data/lib/generated/azure_mgmt_batch/models/batch_account.rb +3 -3
  16. data/lib/generated/azure_mgmt_batch/models/batch_account_create_parameters.rb +1 -1
  17. data/lib/generated/azure_mgmt_batch/models/batch_account_keys.rb +1 -1
  18. data/lib/generated/azure_mgmt_batch/models/batch_account_list_result.rb +1 -1
  19. data/lib/generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb +1 -1
  20. data/lib/generated/azure_mgmt_batch/models/batch_account_update_parameters.rb +1 -1
  21. data/lib/generated/azure_mgmt_batch/models/batch_location_quota.rb +1 -1
  22. data/lib/generated/azure_mgmt_batch/models/error_body.rb +86 -0
  23. data/lib/generated/azure_mgmt_batch/models/error_detail.rb +67 -0
  24. data/lib/generated/azure_mgmt_batch/models/list_applications_result.rb +1 -1
  25. data/lib/generated/azure_mgmt_batch/models/package_state.rb +1 -1
  26. data/lib/generated/azure_mgmt_batch/models/provisioning_state.rb +1 -1
  27. data/lib/generated/azure_mgmt_batch/models/update_application_parameters.rb +1 -1
  28. data/lib/generated/azure_mgmt_batch/module_definition.rb +1 -1
  29. data/lib/generated/azure_mgmt_batch/version.rb +2 -2
  30. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3a89f46821fc1bfefb62468ef43259e76cfb2eb
4
- data.tar.gz: beaf47ba8e1124ce268c1060e3278b32dacf0024
3
+ metadata.gz: 0cd7cd5d2a82d1883832650e1dce46d106f4a632
4
+ data.tar.gz: 285b42794ec5617915297524d7149256c2afebb5
5
5
  SHA512:
6
- metadata.gz: 388fc290d2948d431cc1f61c4410729e185b8f5339f57b47150ce21f404d295c927ea230a39d13670659acef08271bdafc3b4cce0752b989383ddafc6075fb10
7
- data.tar.gz: ecdc785717313fe9791e65649f13eb3fa7892dd00e074f0bf51300fda5328184978ff9f85fa75aa881f2d1cb3f1b2917e0189bf35cb3364827926194c41edc2e
6
+ metadata.gz: e63346ef072252463e4424f299feef1a42c5a4a24e434aad88217c2c575c968156ce7ca6cc4863c04ada7279114e2db75ae7cb8c4c0562e863d320cfc56c4a10
7
+ data.tar.gz: b908601ec3cbd039379ee42a168a64d652408e5697b69158152cfe18f6e25470040c0c0cacb0916bc8786a4209a23a29850da6ec35d3e4f62b2d68a85db66b3c
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -27,20 +27,22 @@ module Azure::ARM::Batch
27
27
  autoload :BatchManagementClient, 'generated/azure_mgmt_batch/batch_management_client.rb'
28
28
 
29
29
  module Models
30
- autoload :AutoStorageBaseProperties, 'generated/azure_mgmt_batch/models/auto_storage_base_properties.rb'
31
- autoload :BatchAccountCreateParameters, 'generated/azure_mgmt_batch/models/batch_account_create_parameters.rb'
32
- autoload :AutoStorageProperties, 'generated/azure_mgmt_batch/models/auto_storage_properties.rb'
33
- autoload :BatchAccountUpdateParameters, 'generated/azure_mgmt_batch/models/batch_account_update_parameters.rb'
34
- autoload :BatchAccountListResult, 'generated/azure_mgmt_batch/models/batch_account_list_result.rb'
35
- autoload :BatchAccountRegenerateKeyParameters, 'generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb'
36
- autoload :BatchAccountKeys, 'generated/azure_mgmt_batch/models/batch_account_keys.rb'
37
- autoload :ActivateApplicationPackageParameters, 'generated/azure_mgmt_batch/models/activate_application_package_parameters.rb'
38
30
  autoload :AddApplicationParameters, 'generated/azure_mgmt_batch/models/add_application_parameters.rb'
31
+ autoload :AutoStorageBaseProperties, 'generated/azure_mgmt_batch/models/auto_storage_base_properties.rb'
39
32
  autoload :Application, 'generated/azure_mgmt_batch/models/application.rb'
33
+ autoload :AutoStorageProperties, 'generated/azure_mgmt_batch/models/auto_storage_properties.rb'
40
34
  autoload :ApplicationPackage, 'generated/azure_mgmt_batch/models/application_package.rb'
35
+ autoload :BatchAccountUpdateParameters, 'generated/azure_mgmt_batch/models/batch_account_update_parameters.rb'
41
36
  autoload :ListApplicationsResult, 'generated/azure_mgmt_batch/models/list_applications_result.rb'
37
+ autoload :BatchAccountRegenerateKeyParameters, 'generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb'
42
38
  autoload :UpdateApplicationParameters, 'generated/azure_mgmt_batch/models/update_application_parameters.rb'
39
+ autoload :ActivateApplicationPackageParameters, 'generated/azure_mgmt_batch/models/activate_application_package_parameters.rb'
43
40
  autoload :BatchLocationQuota, 'generated/azure_mgmt_batch/models/batch_location_quota.rb'
41
+ autoload :BatchAccountListResult, 'generated/azure_mgmt_batch/models/batch_account_list_result.rb'
42
+ autoload :BatchAccountCreateParameters, 'generated/azure_mgmt_batch/models/batch_account_create_parameters.rb'
43
+ autoload :ErrorDetail, 'generated/azure_mgmt_batch/models/error_detail.rb'
44
+ autoload :BatchAccountKeys, 'generated/azure_mgmt_batch/models/batch_account_keys.rb'
45
+ autoload :ErrorBody, 'generated/azure_mgmt_batch/models/error_body.rb'
44
46
  autoload :BatchAccount, 'generated/azure_mgmt_batch/models/batch_account.rb'
45
47
  autoload :ProvisioningState, 'generated/azure_mgmt_batch/models/provisioning_state.rb'
46
48
  autoload :AccountKeyType, 'generated/azure_mgmt_batch/models/account_key_type.rb'
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -28,7 +28,7 @@ module Azure::ARM::Batch
28
28
  # @param resource_group_name [String] The name of the resource group that
29
29
  # contains the Batch account.
30
30
  # @param account_name [String] The name of the Batch account.
31
- # @param application_id [String] The id of the application.
31
+ # @param application_id [String] The ID of the application.
32
32
  # @param parameters [AddApplicationParameters] The parameters for the request.
33
33
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
34
  # will be added to the HTTP request.
@@ -46,7 +46,7 @@ module Azure::ARM::Batch
46
46
  # @param resource_group_name [String] The name of the resource group that
47
47
  # contains the Batch account.
48
48
  # @param account_name [String] The name of the Batch account.
49
- # @param application_id [String] The id of the application.
49
+ # @param application_id [String] The ID of the application.
50
50
  # @param parameters [AddApplicationParameters] The parameters for the request.
51
51
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
52
  # will be added to the HTTP request.
@@ -63,7 +63,7 @@ module Azure::ARM::Batch
63
63
  # @param resource_group_name [String] The name of the resource group that
64
64
  # contains the Batch account.
65
65
  # @param account_name [String] The name of the Batch account.
66
- # @param application_id [String] The id of the application.
66
+ # @param application_id [String] The ID of the application.
67
67
  # @param parameters [AddApplicationParameters] The parameters for the request.
68
68
  # @param [Hash{String => String}] A hash of custom headers that will be added
69
69
  # to the HTTP request.
@@ -111,7 +111,7 @@ module Azure::ARM::Batch
111
111
  response_content = http_response.body
112
112
  unless status_code == 201
113
113
  error_model = JSON.load(response_content)
114
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
114
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
115
115
  end
116
116
 
117
117
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -138,7 +138,7 @@ module Azure::ARM::Batch
138
138
  # @param resource_group_name [String] The name of the resource group that
139
139
  # contains the Batch account.
140
140
  # @param account_name [String] The name of the Batch account.
141
- # @param application_id [String] The id of the application.
141
+ # @param application_id [String] The ID of the application.
142
142
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
143
  # will be added to the HTTP request.
144
144
  #
@@ -154,7 +154,7 @@ module Azure::ARM::Batch
154
154
  # @param resource_group_name [String] The name of the resource group that
155
155
  # contains the Batch account.
156
156
  # @param account_name [String] The name of the Batch account.
157
- # @param application_id [String] The id of the application.
157
+ # @param application_id [String] The ID of the application.
158
158
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
159
  # will be added to the HTTP request.
160
160
  #
@@ -170,7 +170,7 @@ module Azure::ARM::Batch
170
170
  # @param resource_group_name [String] The name of the resource group that
171
171
  # contains the Batch account.
172
172
  # @param account_name [String] The name of the Batch account.
173
- # @param application_id [String] The id of the application.
173
+ # @param application_id [String] The ID of the application.
174
174
  # @param [Hash{String => String}] A hash of custom headers that will be added
175
175
  # to the HTTP request.
176
176
  #
@@ -208,7 +208,7 @@ module Azure::ARM::Batch
208
208
  response_content = http_response.body
209
209
  unless status_code == 204
210
210
  error_model = JSON.load(response_content)
211
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
211
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
212
212
  end
213
213
 
214
214
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -225,7 +225,7 @@ module Azure::ARM::Batch
225
225
  # @param resource_group_name [String] The name of the resource group that
226
226
  # contains the Batch account.
227
227
  # @param account_name [String] The name of the Batch account.
228
- # @param application_id [String] The id of the application.
228
+ # @param application_id [String] The ID of the application.
229
229
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
230
230
  # will be added to the HTTP request.
231
231
  #
@@ -242,7 +242,7 @@ module Azure::ARM::Batch
242
242
  # @param resource_group_name [String] The name of the resource group that
243
243
  # contains the Batch account.
244
244
  # @param account_name [String] The name of the Batch account.
245
- # @param application_id [String] The id of the application.
245
+ # @param application_id [String] The ID of the application.
246
246
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
247
247
  # will be added to the HTTP request.
248
248
  #
@@ -258,7 +258,7 @@ module Azure::ARM::Batch
258
258
  # @param resource_group_name [String] The name of the resource group that
259
259
  # contains the Batch account.
260
260
  # @param account_name [String] The name of the Batch account.
261
- # @param application_id [String] The id of the application.
261
+ # @param application_id [String] The ID of the application.
262
262
  # @param [Hash{String => String}] A hash of custom headers that will be added
263
263
  # to the HTTP request.
264
264
  #
@@ -296,7 +296,7 @@ module Azure::ARM::Batch
296
296
  response_content = http_response.body
297
297
  unless status_code == 200
298
298
  error_model = JSON.load(response_content)
299
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
299
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
300
300
  end
301
301
 
302
302
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -323,7 +323,7 @@ module Azure::ARM::Batch
323
323
  # @param resource_group_name [String] The name of the resource group that
324
324
  # contains the Batch account.
325
325
  # @param account_name [String] The name of the Batch account.
326
- # @param application_id [String] The id of the application.
326
+ # @param application_id [String] The ID of the application.
327
327
  # @param parameters [UpdateApplicationParameters] The parameters for the
328
328
  # request.
329
329
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -341,7 +341,7 @@ module Azure::ARM::Batch
341
341
  # @param resource_group_name [String] The name of the resource group that
342
342
  # contains the Batch account.
343
343
  # @param account_name [String] The name of the Batch account.
344
- # @param application_id [String] The id of the application.
344
+ # @param application_id [String] The ID of the application.
345
345
  # @param parameters [UpdateApplicationParameters] The parameters for the
346
346
  # request.
347
347
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -359,7 +359,7 @@ module Azure::ARM::Batch
359
359
  # @param resource_group_name [String] The name of the resource group that
360
360
  # contains the Batch account.
361
361
  # @param account_name [String] The name of the Batch account.
362
- # @param application_id [String] The id of the application.
362
+ # @param application_id [String] The ID of the application.
363
363
  # @param parameters [UpdateApplicationParameters] The parameters for the
364
364
  # request.
365
365
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -409,7 +409,7 @@ module Azure::ARM::Batch
409
409
  response_content = http_response.body
410
410
  unless status_code == 204
411
411
  error_model = JSON.load(response_content)
412
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
412
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
413
413
  end
414
414
 
415
415
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -420,31 +420,6 @@ module Azure::ARM::Batch
420
420
  promise.execute
421
421
  end
422
422
 
423
- #
424
- # Lists all of the applications in the specified account.
425
- #
426
- # @param resource_group_name [String] The name of the resource group that
427
- # contains the Batch account.
428
- # @param account_name [String] The name of the Batch account.
429
- # @param maxresults [Integer] The maximum number of items to return in the
430
- # response.
431
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
- # will be added to the HTTP request.
433
- #
434
- # @return [ListApplicationsResult] which provide lazy access to pages of the
435
- # response.
436
- #
437
- def list_as_lazy(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
438
- response = list_async(resource_group_name, account_name, maxresults, custom_headers).value!
439
- unless response.nil?
440
- page = response.body
441
- page.next_method = Proc.new do |next_page_link|
442
- list_next_async(next_page_link, custom_headers)
443
- end
444
- page
445
- end
446
- end
447
-
448
423
  #
449
424
  # Lists all of the applications in the specified account.
450
425
  #
@@ -524,7 +499,7 @@ module Azure::ARM::Batch
524
499
  response_content = http_response.body
525
500
  unless status_code == 200
526
501
  error_model = JSON.load(response_content)
527
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
502
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
528
503
  end
529
504
 
530
505
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -548,8 +523,8 @@ module Azure::ARM::Batch
548
523
  #
549
524
  # Lists all of the applications in the specified account.
550
525
  #
551
- # @param next_page_link [String] The NextLink from the previous successful
552
- # call to List operation.
526
+ # @param next_page_link [String] The NextLink from the previous successful call
527
+ # to List operation.
553
528
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
554
529
  # will be added to the HTTP request.
555
530
  #
@@ -563,8 +538,8 @@ module Azure::ARM::Batch
563
538
  #
564
539
  # Lists all of the applications in the specified account.
565
540
  #
566
- # @param next_page_link [String] The NextLink from the previous successful
567
- # call to List operation.
541
+ # @param next_page_link [String] The NextLink from the previous successful call
542
+ # to List operation.
568
543
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
569
544
  # will be added to the HTTP request.
570
545
  #
@@ -577,8 +552,8 @@ module Azure::ARM::Batch
577
552
  #
578
553
  # Lists all of the applications in the specified account.
579
554
  #
580
- # @param next_page_link [String] The NextLink from the previous successful
581
- # call to List operation.
555
+ # @param next_page_link [String] The NextLink from the previous successful call
556
+ # to List operation.
582
557
  # @param [Hash{String => String}] A hash of custom headers that will be added
583
558
  # to the HTTP request.
584
559
  #
@@ -611,7 +586,7 @@ module Azure::ARM::Batch
611
586
  response_content = http_response.body
612
587
  unless status_code == 200
613
588
  error_model = JSON.load(response_content)
614
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
589
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
615
590
  end
616
591
 
617
592
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -632,5 +607,30 @@ module Azure::ARM::Batch
632
607
  promise.execute
633
608
  end
634
609
 
610
+ #
611
+ # Lists all of the applications in the specified account.
612
+ #
613
+ # @param resource_group_name [String] The name of the resource group that
614
+ # contains the Batch account.
615
+ # @param account_name [String] The name of the Batch account.
616
+ # @param maxresults [Integer] The maximum number of items to return in the
617
+ # response.
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [ListApplicationsResult] which provide lazy access to pages of the
622
+ # response.
623
+ #
624
+ def list_as_lazy(resource_group_name, account_name, maxresults = nil, custom_headers = nil)
625
+ response = list_async(resource_group_name, account_name, maxresults, custom_headers).value!
626
+ unless response.nil?
627
+ page = response.body
628
+ page.next_method = Proc.new do |next_page_link|
629
+ list_next_async(next_page_link, custom_headers)
630
+ end
631
+ page
632
+ end
633
+ end
634
+
635
635
  end
636
636
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -28,7 +28,7 @@ module Azure::ARM::Batch
28
28
  # @param resource_group_name [String] The name of the resource group that
29
29
  # contains the Batch account.
30
30
  # @param account_name [String] The name of the Batch account.
31
- # @param application_id [String] The id of the application.
31
+ # @param application_id [String] The ID of the application.
32
32
  # @param version [String] The version of the application to activate.
33
33
  # @param parameters [ActivateApplicationPackageParameters] The parameters for
34
34
  # the request.
@@ -47,7 +47,7 @@ module Azure::ARM::Batch
47
47
  # @param resource_group_name [String] The name of the resource group that
48
48
  # contains the Batch account.
49
49
  # @param account_name [String] The name of the Batch account.
50
- # @param application_id [String] The id of the application.
50
+ # @param application_id [String] The ID of the application.
51
51
  # @param version [String] The version of the application to activate.
52
52
  # @param parameters [ActivateApplicationPackageParameters] The parameters for
53
53
  # the request.
@@ -66,7 +66,7 @@ module Azure::ARM::Batch
66
66
  # @param resource_group_name [String] The name of the resource group that
67
67
  # contains the Batch account.
68
68
  # @param account_name [String] The name of the Batch account.
69
- # @param application_id [String] The id of the application.
69
+ # @param application_id [String] The ID of the application.
70
70
  # @param version [String] The version of the application to activate.
71
71
  # @param parameters [ActivateApplicationPackageParameters] The parameters for
72
72
  # the request.
@@ -118,7 +118,7 @@ module Azure::ARM::Batch
118
118
  response_content = http_response.body
119
119
  unless status_code == 204
120
120
  error_model = JSON.load(response_content)
121
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
121
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
122
122
  end
123
123
 
124
124
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -135,7 +135,7 @@ module Azure::ARM::Batch
135
135
  # @param resource_group_name [String] The name of the resource group that
136
136
  # contains the Batch account.
137
137
  # @param account_name [String] The name of the Batch account.
138
- # @param application_id [String] The id of the application.
138
+ # @param application_id [String] The ID of the application.
139
139
  # @param version [String] The version of the application.
140
140
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
141
  # will be added to the HTTP request.
@@ -153,7 +153,7 @@ module Azure::ARM::Batch
153
153
  # @param resource_group_name [String] The name of the resource group that
154
154
  # contains the Batch account.
155
155
  # @param account_name [String] The name of the Batch account.
156
- # @param application_id [String] The id of the application.
156
+ # @param application_id [String] The ID of the application.
157
157
  # @param version [String] The version of the application.
158
158
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
159
  # will be added to the HTTP request.
@@ -170,7 +170,7 @@ module Azure::ARM::Batch
170
170
  # @param resource_group_name [String] The name of the resource group that
171
171
  # contains the Batch account.
172
172
  # @param account_name [String] The name of the Batch account.
173
- # @param application_id [String] The id of the application.
173
+ # @param application_id [String] The ID of the application.
174
174
  # @param version [String] The version of the application.
175
175
  # @param [Hash{String => String}] A hash of custom headers that will be added
176
176
  # to the HTTP request.
@@ -210,7 +210,7 @@ module Azure::ARM::Batch
210
210
  response_content = http_response.body
211
211
  unless status_code == 201
212
212
  error_model = JSON.load(response_content)
213
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
213
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
214
214
  end
215
215
 
216
216
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -237,7 +237,7 @@ module Azure::ARM::Batch
237
237
  # @param resource_group_name [String] The name of the resource group that
238
238
  # contains the Batch account.
239
239
  # @param account_name [String] The name of the Batch account.
240
- # @param application_id [String] The id of the application.
240
+ # @param application_id [String] The ID of the application.
241
241
  # @param version [String] The version of the application to delete.
242
242
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
243
  # will be added to the HTTP request.
@@ -254,7 +254,7 @@ module Azure::ARM::Batch
254
254
  # @param resource_group_name [String] The name of the resource group that
255
255
  # contains the Batch account.
256
256
  # @param account_name [String] The name of the Batch account.
257
- # @param application_id [String] The id of the application.
257
+ # @param application_id [String] The ID of the application.
258
258
  # @param version [String] The version of the application to delete.
259
259
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
260
  # will be added to the HTTP request.
@@ -271,7 +271,7 @@ module Azure::ARM::Batch
271
271
  # @param resource_group_name [String] The name of the resource group that
272
272
  # contains the Batch account.
273
273
  # @param account_name [String] The name of the Batch account.
274
- # @param application_id [String] The id of the application.
274
+ # @param application_id [String] The ID of the application.
275
275
  # @param version [String] The version of the application to delete.
276
276
  # @param [Hash{String => String}] A hash of custom headers that will be added
277
277
  # to the HTTP request.
@@ -311,7 +311,7 @@ module Azure::ARM::Batch
311
311
  response_content = http_response.body
312
312
  unless status_code == 204
313
313
  error_model = JSON.load(response_content)
314
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
314
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
315
315
  end
316
316
 
317
317
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -328,7 +328,7 @@ module Azure::ARM::Batch
328
328
  # @param resource_group_name [String] The name of the resource group that
329
329
  # contains the Batch account.
330
330
  # @param account_name [String] The name of the Batch account.
331
- # @param application_id [String] The id of the application.
331
+ # @param application_id [String] The ID of the application.
332
332
  # @param version [String] The version of the application.
333
333
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
334
334
  # will be added to the HTTP request.
@@ -346,7 +346,7 @@ module Azure::ARM::Batch
346
346
  # @param resource_group_name [String] The name of the resource group that
347
347
  # contains the Batch account.
348
348
  # @param account_name [String] The name of the Batch account.
349
- # @param application_id [String] The id of the application.
349
+ # @param application_id [String] The ID of the application.
350
350
  # @param version [String] The version of the application.
351
351
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
352
  # will be added to the HTTP request.
@@ -363,7 +363,7 @@ module Azure::ARM::Batch
363
363
  # @param resource_group_name [String] The name of the resource group that
364
364
  # contains the Batch account.
365
365
  # @param account_name [String] The name of the Batch account.
366
- # @param application_id [String] The id of the application.
366
+ # @param application_id [String] The ID of the application.
367
367
  # @param version [String] The version of the application.
368
368
  # @param [Hash{String => String}] A hash of custom headers that will be added
369
369
  # to the HTTP request.
@@ -403,7 +403,7 @@ module Azure::ARM::Batch
403
403
  response_content = http_response.body
404
404
  unless status_code == 200
405
405
  error_model = JSON.load(response_content)
406
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
406
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
407
407
  end
408
408
 
409
409
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -24,16 +24,16 @@ module Azure::ARM::Batch
24
24
 
25
25
  #
26
26
  # Creates a new Batch account with the specified parameters. Existing accounts
27
- # cannot be updated with this API and should instead be updated with the
28
- # Update Batch Account API.
27
+ # cannot be updated with this API and should instead be updated with the Update
28
+ # Batch Account API.
29
29
  #
30
30
  # @param resource_group_name [String] The name of the resource group that
31
31
  # contains the new Batch account.
32
32
  # @param account_name [String] A name for the Batch account which must be
33
33
  # unique within the region. Batch account names must be between 3 and 24
34
34
  # characters in length and must use only numbers and lowercase letters. This
35
- # name is used as part of the DNS name that is used to access the Batch
36
- # service in the region in which the account is created. For example:
35
+ # name is used as part of the DNS name that is used to access the Batch service
36
+ # in the region in which the account is created. For example:
37
37
  # http://accountname.region.batch.azure.com/.
38
38
  # @param parameters [BatchAccountCreateParameters] Additional parameters for
39
39
  # account creation.
@@ -53,8 +53,8 @@ module Azure::ARM::Batch
53
53
  # @param account_name [String] A name for the Batch account which must be
54
54
  # unique within the region. Batch account names must be between 3 and 24
55
55
  # characters in length and must use only numbers and lowercase letters. This
56
- # name is used as part of the DNS name that is used to access the Batch
57
- # service in the region in which the account is created. For example:
56
+ # name is used as part of the DNS name that is used to access the Batch service
57
+ # in the region in which the account is created. For example:
58
58
  # http://accountname.region.batch.azure.com/.
59
59
  # @param parameters [BatchAccountCreateParameters] Additional parameters for
60
60
  # account creation.
@@ -82,137 +82,6 @@ module Azure::ARM::Batch
82
82
  promise
83
83
  end
84
84
 
85
- #
86
- # Creates a new Batch account with the specified parameters. Existing accounts
87
- # cannot be updated with this API and should instead be updated with the
88
- # Update Batch Account API.
89
- #
90
- # @param resource_group_name [String] The name of the resource group that
91
- # contains the new Batch account.
92
- # @param account_name [String] A name for the Batch account which must be
93
- # unique within the region. Batch account names must be between 3 and 24
94
- # characters in length and must use only numbers and lowercase letters. This
95
- # name is used as part of the DNS name that is used to access the Batch
96
- # service in the region in which the account is created. For example:
97
- # http://accountname.region.batch.azure.com/.
98
- # @param parameters [BatchAccountCreateParameters] Additional parameters for
99
- # account creation.
100
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
101
- # will be added to the HTTP request.
102
- #
103
- # @return [BatchAccount] operation results.
104
- #
105
- def begin_create(resource_group_name, account_name, parameters, custom_headers = nil)
106
- response = begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
107
- response.body unless response.nil?
108
- end
109
-
110
- #
111
- # Creates a new Batch account with the specified parameters. Existing accounts
112
- # cannot be updated with this API and should instead be updated with the
113
- # Update Batch Account API.
114
- #
115
- # @param resource_group_name [String] The name of the resource group that
116
- # contains the new Batch account.
117
- # @param account_name [String] A name for the Batch account which must be
118
- # unique within the region. Batch account names must be between 3 and 24
119
- # characters in length and must use only numbers and lowercase letters. This
120
- # name is used as part of the DNS name that is used to access the Batch
121
- # service in the region in which the account is created. For example:
122
- # http://accountname.region.batch.azure.com/.
123
- # @param parameters [BatchAccountCreateParameters] Additional parameters for
124
- # account creation.
125
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
- # will be added to the HTTP request.
127
- #
128
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
129
- #
130
- def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
131
- begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
132
- end
133
-
134
- #
135
- # Creates a new Batch account with the specified parameters. Existing accounts
136
- # cannot be updated with this API and should instead be updated with the
137
- # Update Batch Account API.
138
- #
139
- # @param resource_group_name [String] The name of the resource group that
140
- # contains the new Batch account.
141
- # @param account_name [String] A name for the Batch account which must be
142
- # unique within the region. Batch account names must be between 3 and 24
143
- # characters in length and must use only numbers and lowercase letters. This
144
- # name is used as part of the DNS name that is used to access the Batch
145
- # service in the region in which the account is created. For example:
146
- # http://accountname.region.batch.azure.com/.
147
- # @param parameters [BatchAccountCreateParameters] Additional parameters for
148
- # account creation.
149
- # @param [Hash{String => String}] A hash of custom headers that will be added
150
- # to the HTTP request.
151
- #
152
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
153
- #
154
- def begin_create_async(resource_group_name, account_name, parameters, custom_headers = nil)
155
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
156
- fail ArgumentError, 'account_name is nil' if account_name.nil?
157
- fail ArgumentError, 'parameters is nil' if parameters.nil?
158
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
159
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
160
-
161
-
162
- request_headers = {}
163
-
164
- # Set Headers
165
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
166
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
167
-
168
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
169
-
170
- # Serialize Request
171
- request_mapper = BatchAccountCreateParameters.mapper()
172
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
173
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
174
-
175
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
176
-
177
- request_url = @base_url || @client.base_url
178
-
179
- options = {
180
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
181
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
182
- query_params: {'api-version' => @client.api_version},
183
- body: request_content,
184
- headers: request_headers.merge(custom_headers || {}),
185
- base_url: request_url
186
- }
187
- promise = @client.make_request_async(:put, path_template, options)
188
-
189
- promise = promise.then do |result|
190
- http_response = result.response
191
- status_code = http_response.status
192
- response_content = http_response.body
193
- unless status_code == 202 || status_code == 200
194
- error_model = JSON.load(response_content)
195
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
196
- end
197
-
198
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
199
- # Deserialize Response
200
- if status_code == 200
201
- begin
202
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
203
- result_mapper = BatchAccount.mapper()
204
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
205
- rescue Exception => e
206
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
207
- end
208
- end
209
-
210
- result
211
- end
212
-
213
- promise.execute
214
- end
215
-
216
85
  #
217
86
  # Updates the properties of an existing Batch account.
218
87
  #
@@ -302,7 +171,7 @@ module Azure::ARM::Batch
302
171
  response_content = http_response.body
303
172
  unless status_code == 200
304
173
  error_model = JSON.load(response_content)
305
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
174
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
306
175
  end
307
176
 
308
177
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -363,89 +232,6 @@ module Azure::ARM::Batch
363
232
  promise
364
233
  end
365
234
 
366
- #
367
- # Deletes the specified Batch account.
368
- #
369
- # @param resource_group_name [String] The name of the resource group that
370
- # contains the Batch account to be deleted.
371
- # @param account_name [String] The name of the account to be deleted.
372
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
373
- # will be added to the HTTP request.
374
- #
375
- #
376
- def begin_delete(resource_group_name, account_name, custom_headers = nil)
377
- response = begin_delete_async(resource_group_name, account_name, custom_headers).value!
378
- nil
379
- end
380
-
381
- #
382
- # Deletes the specified Batch account.
383
- #
384
- # @param resource_group_name [String] The name of the resource group that
385
- # contains the Batch account to be deleted.
386
- # @param account_name [String] The name of the account to be deleted.
387
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
388
- # will be added to the HTTP request.
389
- #
390
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
391
- #
392
- def begin_delete_with_http_info(resource_group_name, account_name, custom_headers = nil)
393
- begin_delete_async(resource_group_name, account_name, custom_headers).value!
394
- end
395
-
396
- #
397
- # Deletes the specified Batch account.
398
- #
399
- # @param resource_group_name [String] The name of the resource group that
400
- # contains the Batch account to be deleted.
401
- # @param account_name [String] The name of the account to be deleted.
402
- # @param [Hash{String => String}] A hash of custom headers that will be added
403
- # to the HTTP request.
404
- #
405
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
406
- #
407
- def begin_delete_async(resource_group_name, account_name, custom_headers = nil)
408
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
409
- fail ArgumentError, 'account_name is nil' if account_name.nil?
410
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
411
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
412
-
413
-
414
- request_headers = {}
415
-
416
- # Set Headers
417
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
418
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
419
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
420
-
421
- request_url = @base_url || @client.base_url
422
-
423
- options = {
424
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
425
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
426
- query_params: {'api-version' => @client.api_version},
427
- headers: request_headers.merge(custom_headers || {}),
428
- base_url: request_url
429
- }
430
- promise = @client.make_request_async(:delete, path_template, options)
431
-
432
- promise = promise.then do |result|
433
- http_response = result.response
434
- status_code = http_response.status
435
- response_content = http_response.body
436
- unless status_code == 202 || status_code == 204 || status_code == 200
437
- error_model = JSON.load(response_content)
438
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
439
- end
440
-
441
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
442
-
443
- result
444
- end
445
-
446
- promise.execute
447
- end
448
-
449
235
  #
450
236
  # Gets information about the specified Batch account.
451
237
  #
@@ -519,7 +305,7 @@ module Azure::ARM::Batch
519
305
  response_content = http_response.body
520
306
  unless status_code == 200
521
307
  error_model = JSON.load(response_content)
522
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
308
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
523
309
  end
524
310
 
525
311
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -540,26 +326,6 @@ module Azure::ARM::Batch
540
326
  promise.execute
541
327
  end
542
328
 
543
- #
544
- # Gets information about the Batch accounts associated with the subscription.
545
- #
546
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
547
- # will be added to the HTTP request.
548
- #
549
- # @return [BatchAccountListResult] which provide lazy access to pages of the
550
- # response.
551
- #
552
- def list_as_lazy(custom_headers = nil)
553
- response = list_async(custom_headers).value!
554
- unless response.nil?
555
- page = response.body
556
- page.next_method = Proc.new do |next_page_link|
557
- list_next_async(next_page_link, custom_headers)
558
- end
559
- page
560
- end
561
- end
562
-
563
329
  #
564
330
  # Gets information about the Batch accounts associated with the subscription.
565
331
  #
@@ -622,7 +388,7 @@ module Azure::ARM::Batch
622
388
  response_content = http_response.body
623
389
  unless status_code == 200
624
390
  error_model = JSON.load(response_content)
625
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
391
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
626
392
  end
627
393
 
628
394
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -643,29 +409,6 @@ module Azure::ARM::Batch
643
409
  promise.execute
644
410
  end
645
411
 
646
- #
647
- # Gets information about the Batch accounts associated within the specified
648
- # resource group.
649
- #
650
- # @param resource_group_name [String] The name of the resource group whose
651
- # Batch accounts to list.
652
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
653
- # will be added to the HTTP request.
654
- #
655
- # @return [BatchAccountListResult] which provide lazy access to pages of the
656
- # response.
657
- #
658
- def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
659
- response = list_by_resource_group_async(resource_group_name, custom_headers).value!
660
- unless response.nil?
661
- page = response.body
662
- page.next_method = Proc.new do |next_page_link|
663
- list_by_resource_group_next_async(next_page_link, custom_headers)
664
- end
665
- page
666
- end
667
- end
668
-
669
412
  #
670
413
  # Gets information about the Batch accounts associated within the specified
671
414
  # resource group.
@@ -738,7 +481,7 @@ module Azure::ARM::Batch
738
481
  response_content = http_response.body
739
482
  unless status_code == 200
740
483
  error_model = JSON.load(response_content)
741
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
484
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
742
485
  end
743
486
 
744
487
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -834,7 +577,7 @@ module Azure::ARM::Batch
834
577
  response_content = http_response.body
835
578
  unless status_code == 204
836
579
  error_model = JSON.load(response_content)
837
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
580
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
838
581
  end
839
582
 
840
583
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -846,7 +589,7 @@ module Azure::ARM::Batch
846
589
  end
847
590
 
848
591
  #
849
- # Regenerates the specified account key for the specified Batch account.
592
+ # Regenerates the specified account key for the Batch account.
850
593
  #
851
594
  # @param resource_group_name [String] The name of the resource group that
852
595
  # contains the Batch account.
@@ -864,7 +607,7 @@ module Azure::ARM::Batch
864
607
  end
865
608
 
866
609
  #
867
- # Regenerates the specified account key for the specified Batch account.
610
+ # Regenerates the specified account key for the Batch account.
868
611
  #
869
612
  # @param resource_group_name [String] The name of the resource group that
870
613
  # contains the Batch account.
@@ -881,7 +624,7 @@ module Azure::ARM::Batch
881
624
  end
882
625
 
883
626
  #
884
- # Regenerates the specified account key for the specified Batch account.
627
+ # Regenerates the specified account key for the Batch account.
885
628
  #
886
629
  # @param resource_group_name [String] The name of the resource group that
887
630
  # contains the Batch account.
@@ -934,7 +677,7 @@ module Azure::ARM::Batch
934
677
  response_content = http_response.body
935
678
  unless status_code == 200
936
679
  error_model = JSON.load(response_content)
937
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
680
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
938
681
  end
939
682
 
940
683
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -1028,7 +771,7 @@ module Azure::ARM::Batch
1028
771
  response_content = http_response.body
1029
772
  unless status_code == 200
1030
773
  error_model = JSON.load(response_content)
1031
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
774
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1032
775
  end
1033
776
 
1034
777
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -1049,11 +792,225 @@ module Azure::ARM::Batch
1049
792
  promise.execute
1050
793
  end
1051
794
 
795
+ #
796
+ # Creates a new Batch account with the specified parameters. Existing accounts
797
+ # cannot be updated with this API and should instead be updated with the Update
798
+ # Batch Account API.
799
+ #
800
+ # @param resource_group_name [String] The name of the resource group that
801
+ # contains the new Batch account.
802
+ # @param account_name [String] A name for the Batch account which must be
803
+ # unique within the region. Batch account names must be between 3 and 24
804
+ # characters in length and must use only numbers and lowercase letters. This
805
+ # name is used as part of the DNS name that is used to access the Batch service
806
+ # in the region in which the account is created. For example:
807
+ # http://accountname.region.batch.azure.com/.
808
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
809
+ # account creation.
810
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
811
+ # will be added to the HTTP request.
812
+ #
813
+ # @return [BatchAccount] operation results.
814
+ #
815
+ def begin_create(resource_group_name, account_name, parameters, custom_headers = nil)
816
+ response = begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
817
+ response.body unless response.nil?
818
+ end
819
+
820
+ #
821
+ # Creates a new Batch account with the specified parameters. Existing accounts
822
+ # cannot be updated with this API and should instead be updated with the Update
823
+ # Batch Account API.
824
+ #
825
+ # @param resource_group_name [String] The name of the resource group that
826
+ # contains the new Batch account.
827
+ # @param account_name [String] A name for the Batch account which must be
828
+ # unique within the region. Batch account names must be between 3 and 24
829
+ # characters in length and must use only numbers and lowercase letters. This
830
+ # name is used as part of the DNS name that is used to access the Batch service
831
+ # in the region in which the account is created. For example:
832
+ # http://accountname.region.batch.azure.com/.
833
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
834
+ # account creation.
835
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
836
+ # will be added to the HTTP request.
837
+ #
838
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
839
+ #
840
+ def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
841
+ begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
842
+ end
843
+
844
+ #
845
+ # Creates a new Batch account with the specified parameters. Existing accounts
846
+ # cannot be updated with this API and should instead be updated with the Update
847
+ # Batch Account API.
848
+ #
849
+ # @param resource_group_name [String] The name of the resource group that
850
+ # contains the new Batch account.
851
+ # @param account_name [String] A name for the Batch account which must be
852
+ # unique within the region. Batch account names must be between 3 and 24
853
+ # characters in length and must use only numbers and lowercase letters. This
854
+ # name is used as part of the DNS name that is used to access the Batch service
855
+ # in the region in which the account is created. For example:
856
+ # http://accountname.region.batch.azure.com/.
857
+ # @param parameters [BatchAccountCreateParameters] Additional parameters for
858
+ # account creation.
859
+ # @param [Hash{String => String}] A hash of custom headers that will be added
860
+ # to the HTTP request.
861
+ #
862
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
863
+ #
864
+ def begin_create_async(resource_group_name, account_name, parameters, custom_headers = nil)
865
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
866
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
867
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
868
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
869
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
870
+
871
+
872
+ request_headers = {}
873
+
874
+ # Set Headers
875
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
876
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
877
+
878
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
879
+
880
+ # Serialize Request
881
+ request_mapper = BatchAccountCreateParameters.mapper()
882
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
883
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
884
+
885
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
886
+
887
+ request_url = @base_url || @client.base_url
888
+
889
+ options = {
890
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
891
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
892
+ query_params: {'api-version' => @client.api_version},
893
+ body: request_content,
894
+ headers: request_headers.merge(custom_headers || {}),
895
+ base_url: request_url
896
+ }
897
+ promise = @client.make_request_async(:put, path_template, options)
898
+
899
+ promise = promise.then do |result|
900
+ http_response = result.response
901
+ status_code = http_response.status
902
+ response_content = http_response.body
903
+ unless status_code == 200 || status_code == 202
904
+ error_model = JSON.load(response_content)
905
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
906
+ end
907
+
908
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
909
+ # Deserialize Response
910
+ if status_code == 200
911
+ begin
912
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
913
+ result_mapper = BatchAccount.mapper()
914
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
915
+ rescue Exception => e
916
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
917
+ end
918
+ end
919
+
920
+ result
921
+ end
922
+
923
+ promise.execute
924
+ end
925
+
926
+ #
927
+ # Deletes the specified Batch account.
928
+ #
929
+ # @param resource_group_name [String] The name of the resource group that
930
+ # contains the Batch account to be deleted.
931
+ # @param account_name [String] The name of the account to be deleted.
932
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
933
+ # will be added to the HTTP request.
934
+ #
935
+ #
936
+ def begin_delete(resource_group_name, account_name, custom_headers = nil)
937
+ response = begin_delete_async(resource_group_name, account_name, custom_headers).value!
938
+ nil
939
+ end
940
+
941
+ #
942
+ # Deletes the specified Batch account.
943
+ #
944
+ # @param resource_group_name [String] The name of the resource group that
945
+ # contains the Batch account to be deleted.
946
+ # @param account_name [String] The name of the account to be deleted.
947
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
948
+ # will be added to the HTTP request.
949
+ #
950
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
951
+ #
952
+ def begin_delete_with_http_info(resource_group_name, account_name, custom_headers = nil)
953
+ begin_delete_async(resource_group_name, account_name, custom_headers).value!
954
+ end
955
+
956
+ #
957
+ # Deletes the specified Batch account.
958
+ #
959
+ # @param resource_group_name [String] The name of the resource group that
960
+ # contains the Batch account to be deleted.
961
+ # @param account_name [String] The name of the account to be deleted.
962
+ # @param [Hash{String => String}] A hash of custom headers that will be added
963
+ # to the HTTP request.
964
+ #
965
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
966
+ #
967
+ def begin_delete_async(resource_group_name, account_name, custom_headers = nil)
968
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
969
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
970
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
971
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
972
+
973
+
974
+ request_headers = {}
975
+
976
+ # Set Headers
977
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
978
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
979
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}'
980
+
981
+ request_url = @base_url || @client.base_url
982
+
983
+ options = {
984
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
985
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
986
+ query_params: {'api-version' => @client.api_version},
987
+ headers: request_headers.merge(custom_headers || {}),
988
+ base_url: request_url
989
+ }
990
+ promise = @client.make_request_async(:delete, path_template, options)
991
+
992
+ promise = promise.then do |result|
993
+ http_response = result.response
994
+ status_code = http_response.status
995
+ response_content = http_response.body
996
+ unless status_code == 200 || status_code == 202
997
+ error_model = JSON.load(response_content)
998
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
999
+ end
1000
+
1001
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1002
+
1003
+ result
1004
+ end
1005
+
1006
+ promise.execute
1007
+ end
1008
+
1052
1009
  #
1053
1010
  # Gets information about the Batch accounts associated with the subscription.
1054
1011
  #
1055
- # @param next_page_link [String] The NextLink from the previous successful
1056
- # call to List operation.
1012
+ # @param next_page_link [String] The NextLink from the previous successful call
1013
+ # to List operation.
1057
1014
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1058
1015
  # will be added to the HTTP request.
1059
1016
  #
@@ -1067,8 +1024,8 @@ module Azure::ARM::Batch
1067
1024
  #
1068
1025
  # Gets information about the Batch accounts associated with the subscription.
1069
1026
  #
1070
- # @param next_page_link [String] The NextLink from the previous successful
1071
- # call to List operation.
1027
+ # @param next_page_link [String] The NextLink from the previous successful call
1028
+ # to List operation.
1072
1029
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1073
1030
  # will be added to the HTTP request.
1074
1031
  #
@@ -1081,8 +1038,8 @@ module Azure::ARM::Batch
1081
1038
  #
1082
1039
  # Gets information about the Batch accounts associated with the subscription.
1083
1040
  #
1084
- # @param next_page_link [String] The NextLink from the previous successful
1085
- # call to List operation.
1041
+ # @param next_page_link [String] The NextLink from the previous successful call
1042
+ # to List operation.
1086
1043
  # @param [Hash{String => String}] A hash of custom headers that will be added
1087
1044
  # to the HTTP request.
1088
1045
  #
@@ -1115,7 +1072,7 @@ module Azure::ARM::Batch
1115
1072
  response_content = http_response.body
1116
1073
  unless status_code == 200
1117
1074
  error_model = JSON.load(response_content)
1118
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1075
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1119
1076
  end
1120
1077
 
1121
1078
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -1140,8 +1097,8 @@ module Azure::ARM::Batch
1140
1097
  # Gets information about the Batch accounts associated within the specified
1141
1098
  # resource group.
1142
1099
  #
1143
- # @param next_page_link [String] The NextLink from the previous successful
1144
- # call to List operation.
1100
+ # @param next_page_link [String] The NextLink from the previous successful call
1101
+ # to List operation.
1145
1102
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1146
1103
  # will be added to the HTTP request.
1147
1104
  #
@@ -1156,8 +1113,8 @@ module Azure::ARM::Batch
1156
1113
  # Gets information about the Batch accounts associated within the specified
1157
1114
  # resource group.
1158
1115
  #
1159
- # @param next_page_link [String] The NextLink from the previous successful
1160
- # call to List operation.
1116
+ # @param next_page_link [String] The NextLink from the previous successful call
1117
+ # to List operation.
1161
1118
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1162
1119
  # will be added to the HTTP request.
1163
1120
  #
@@ -1171,8 +1128,8 @@ module Azure::ARM::Batch
1171
1128
  # Gets information about the Batch accounts associated within the specified
1172
1129
  # resource group.
1173
1130
  #
1174
- # @param next_page_link [String] The NextLink from the previous successful
1175
- # call to List operation.
1131
+ # @param next_page_link [String] The NextLink from the previous successful call
1132
+ # to List operation.
1176
1133
  # @param [Hash{String => String}] A hash of custom headers that will be added
1177
1134
  # to the HTTP request.
1178
1135
  #
@@ -1205,7 +1162,7 @@ module Azure::ARM::Batch
1205
1162
  response_content = http_response.body
1206
1163
  unless status_code == 200
1207
1164
  error_model = JSON.load(response_content)
1208
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1165
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1209
1166
  end
1210
1167
 
1211
1168
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
@@ -1226,5 +1183,48 @@ module Azure::ARM::Batch
1226
1183
  promise.execute
1227
1184
  end
1228
1185
 
1186
+ #
1187
+ # Gets information about the Batch accounts associated with the subscription.
1188
+ #
1189
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1190
+ # will be added to the HTTP request.
1191
+ #
1192
+ # @return [BatchAccountListResult] which provide lazy access to pages of the
1193
+ # response.
1194
+ #
1195
+ def list_as_lazy(custom_headers = nil)
1196
+ response = list_async(custom_headers).value!
1197
+ unless response.nil?
1198
+ page = response.body
1199
+ page.next_method = Proc.new do |next_page_link|
1200
+ list_next_async(next_page_link, custom_headers)
1201
+ end
1202
+ page
1203
+ end
1204
+ end
1205
+
1206
+ #
1207
+ # Gets information about the Batch accounts associated within the specified
1208
+ # resource group.
1209
+ #
1210
+ # @param resource_group_name [String] The name of the resource group whose
1211
+ # Batch accounts to list.
1212
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1213
+ # will be added to the HTTP request.
1214
+ #
1215
+ # @return [BatchAccountListResult] which provide lazy access to pages of the
1216
+ # response.
1217
+ #
1218
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
1219
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
1220
+ unless response.nil?
1221
+ page = response.body
1222
+ page.next_method = Proc.new do |next_page_link|
1223
+ list_by_resource_group_next_async(next_page_link, custom_headers)
1224
+ end
1225
+ page
1226
+ end
1227
+ end
1228
+
1229
1229
  end
1230
1230
  end