azure_mgmt_batch 0.6.0 → 0.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7f54c6c9624e6a1779a438afcb235346af1d637
4
- data.tar.gz: f8e441030db9947e9d0077e599451fb40187afe7
3
+ metadata.gz: c3a89f46821fc1bfefb62468ef43259e76cfb2eb
4
+ data.tar.gz: beaf47ba8e1124ce268c1060e3278b32dacf0024
5
5
  SHA512:
6
- metadata.gz: bda87789c0aa0c2807cdaa574b19b1941b6ec2d73e782490b82ba3b2d61463c8e7fda3c9c0ddb08ca75b191934598bea9a28be1afa89a922890cd251bfec96b5
7
- data.tar.gz: 1ff01a65a2709999252224502555a746767d3e88ccc40a4091979a40a8b2731d628249546e028239f8cb063855165d99b07f6d14c9cb6bf0f29db03946a58a21
6
+ metadata.gz: 388fc290d2948d431cc1f61c4410729e185b8f5339f57b47150ce21f404d295c927ea230a39d13670659acef08271bdafc3b4cce0752b989383ddafc6075fb10
7
+ data.tar.gz: ecdc785717313fe9791e65649f13eb3fa7892dd00e074f0bf51300fda5328184978ff9f85fa75aa881f2d1cb3f1b2917e0189bf35cb3364827926194c41edc2e
@@ -20,9 +20,10 @@ require 'generated/azure_mgmt_batch/module_definition'
20
20
  require 'ms_rest_azure'
21
21
 
22
22
  module Azure::ARM::Batch
23
- autoload :Account, 'generated/azure_mgmt_batch/account.rb'
23
+ autoload :BatchAccountOperations, 'generated/azure_mgmt_batch/batch_account_operations.rb'
24
+ autoload :ApplicationPackageOperations, 'generated/azure_mgmt_batch/application_package_operations.rb'
24
25
  autoload :ApplicationOperations, 'generated/azure_mgmt_batch/application_operations.rb'
25
- autoload :Subscription, 'generated/azure_mgmt_batch/subscription.rb'
26
+ autoload :Location, 'generated/azure_mgmt_batch/location.rb'
26
27
  autoload :BatchManagementClient, 'generated/azure_mgmt_batch/batch_management_client.rb'
27
28
 
28
29
  module Models
@@ -32,19 +33,16 @@ module Azure::ARM::Batch
32
33
  autoload :BatchAccountUpdateParameters, 'generated/azure_mgmt_batch/models/batch_account_update_parameters.rb'
33
34
  autoload :BatchAccountListResult, 'generated/azure_mgmt_batch/models/batch_account_list_result.rb'
34
35
  autoload :BatchAccountRegenerateKeyParameters, 'generated/azure_mgmt_batch/models/batch_account_regenerate_key_parameters.rb'
35
- autoload :BatchAccountRegenerateKeyResult, 'generated/azure_mgmt_batch/models/batch_account_regenerate_key_result.rb'
36
- autoload :BatchAccountListKeyResult, 'generated/azure_mgmt_batch/models/batch_account_list_key_result.rb'
36
+ autoload :BatchAccountKeys, 'generated/azure_mgmt_batch/models/batch_account_keys.rb'
37
37
  autoload :ActivateApplicationPackageParameters, 'generated/azure_mgmt_batch/models/activate_application_package_parameters.rb'
38
38
  autoload :AddApplicationParameters, 'generated/azure_mgmt_batch/models/add_application_parameters.rb'
39
- autoload :AddApplicationPackageResult, 'generated/azure_mgmt_batch/models/add_application_package_result.rb'
40
- autoload :ApplicationPackage, 'generated/azure_mgmt_batch/models/application_package.rb'
41
39
  autoload :Application, 'generated/azure_mgmt_batch/models/application.rb'
42
- autoload :GetApplicationPackageResult, 'generated/azure_mgmt_batch/models/get_application_package_result.rb'
40
+ autoload :ApplicationPackage, 'generated/azure_mgmt_batch/models/application_package.rb'
43
41
  autoload :ListApplicationsResult, 'generated/azure_mgmt_batch/models/list_applications_result.rb'
44
42
  autoload :UpdateApplicationParameters, 'generated/azure_mgmt_batch/models/update_application_parameters.rb'
45
- autoload :SubscriptionQuotasGetResult, 'generated/azure_mgmt_batch/models/subscription_quotas_get_result.rb'
46
- autoload :AccountResource, 'generated/azure_mgmt_batch/models/account_resource.rb'
47
- autoload :AccountProvisioningState, 'generated/azure_mgmt_batch/models/account_provisioning_state.rb'
43
+ autoload :BatchLocationQuota, 'generated/azure_mgmt_batch/models/batch_location_quota.rb'
44
+ autoload :BatchAccount, 'generated/azure_mgmt_batch/models/batch_account.rb'
45
+ autoload :ProvisioningState, 'generated/azure_mgmt_batch/models/provisioning_state.rb'
48
46
  autoload :AccountKeyType, 'generated/azure_mgmt_batch/models/account_key_type.rb'
49
47
  autoload :PackageState, 'generated/azure_mgmt_batch/models/package_state.rb'
50
48
  end
@@ -22,116 +22,6 @@ module Azure::ARM::Batch
22
22
  # @return [BatchManagementClient] reference to the BatchManagementClient
23
23
  attr_reader :client
24
24
 
25
- #
26
- # Activates the specified application package.
27
- #
28
- # @param resource_group_name [String] The name of the resource group that
29
- # contains the Batch account.
30
- # @param account_name [String] The name of the Batch account.
31
- # @param id [String] The id of the application.
32
- # @param version [String] The version of the application to activate.
33
- # @param parameters [ActivateApplicationPackageParameters] The parameters for
34
- # the request.
35
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
- # will be added to the HTTP request.
37
- #
38
- #
39
- def activate_application_package(resource_group_name, account_name, id, version, parameters, custom_headers = nil)
40
- response = activate_application_package_async(resource_group_name, account_name, id, version, parameters, custom_headers).value!
41
- nil
42
- end
43
-
44
- #
45
- # Activates the specified application package.
46
- #
47
- # @param resource_group_name [String] The name of the resource group that
48
- # contains the Batch account.
49
- # @param account_name [String] The name of the Batch account.
50
- # @param id [String] The id of the application.
51
- # @param version [String] The version of the application to activate.
52
- # @param parameters [ActivateApplicationPackageParameters] The parameters for
53
- # the request.
54
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
- # will be added to the HTTP request.
56
- #
57
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
- #
59
- def activate_application_package_with_http_info(resource_group_name, account_name, id, version, parameters, custom_headers = nil)
60
- activate_application_package_async(resource_group_name, account_name, id, version, parameters, custom_headers).value!
61
- end
62
-
63
- #
64
- # Activates the specified application package.
65
- #
66
- # @param resource_group_name [String] The name of the resource group that
67
- # contains the Batch account.
68
- # @param account_name [String] The name of the Batch account.
69
- # @param id [String] The id of the application.
70
- # @param version [String] The version of the application to activate.
71
- # @param parameters [ActivateApplicationPackageParameters] The parameters for
72
- # the request.
73
- # @param [Hash{String => String}] A hash of custom headers that will be added
74
- # to the HTTP request.
75
- #
76
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
- #
78
- def activate_application_package_async(resource_group_name, account_name, id, version, parameters, custom_headers = nil)
79
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
80
- fail ArgumentError, 'account_name is nil' if account_name.nil?
81
- fail ArgumentError, 'id is nil' if id.nil?
82
- fail ArgumentError, 'version is nil' if version.nil?
83
- fail ArgumentError, 'parameters is nil' if parameters.nil?
84
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
85
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
-
87
-
88
- request_headers = {}
89
-
90
- # Set Headers
91
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
-
94
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
95
-
96
- # Serialize Request
97
- request_mapper = ActivateApplicationPackageParameters.mapper()
98
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
99
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
100
-
101
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{id}/versions/{version}/activate'
102
- options = {
103
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
104
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'id' => id,'version' => version,'subscriptionId' => @client.subscription_id},
105
- query_params: {'api-version' => @client.api_version},
106
- body: request_content,
107
- headers: request_headers.merge(custom_headers || {})
108
- }
109
-
110
- request_url = @base_url || @client.base_url
111
-
112
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
113
- promise = request.run_promise do |req|
114
- @client.credentials.sign_request(req) unless @client.credentials.nil?
115
- end
116
-
117
- promise = promise.then do |http_response|
118
- status_code = http_response.status
119
- response_content = http_response.body
120
- unless status_code == 204
121
- error_model = JSON.load(response_content)
122
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
123
- end
124
-
125
- # Create Result
126
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
127
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
128
-
129
- result
130
- end
131
-
132
- promise.execute
133
- end
134
-
135
25
  #
136
26
  # Adds an application to the specified Batch account.
137
27
  #
@@ -145,8 +35,8 @@ module Azure::ARM::Batch
145
35
  #
146
36
  # @return [Application] operation results.
147
37
  #
148
- def add_application(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
149
- response = add_application_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
38
+ def create(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
39
+ response = create_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
150
40
  response.body unless response.nil?
151
41
  end
152
42
 
@@ -163,8 +53,8 @@ module Azure::ARM::Batch
163
53
  #
164
54
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
55
  #
166
- def add_application_with_http_info(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
167
- add_application_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
56
+ def create_with_http_info(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
57
+ create_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
168
58
  end
169
59
 
170
60
  #
@@ -180,7 +70,7 @@ module Azure::ARM::Batch
180
70
  #
181
71
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
182
72
  #
183
- def add_application_async(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
73
+ def create_async(resource_group_name, account_name, application_id, parameters = nil, custom_headers = nil)
184
74
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
185
75
  fail ArgumentError, 'account_name is nil' if account_name.nil?
186
76
  fail ArgumentError, 'application_id is nil' if application_id.nil?
@@ -202,31 +92,28 @@ module Azure::ARM::Batch
202
92
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
203
93
 
204
94
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
205
98
  options = {
206
99
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
207
100
  path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
208
101
  query_params: {'api-version' => @client.api_version},
209
102
  body: request_content,
210
- headers: request_headers.merge(custom_headers || {})
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
211
105
  }
106
+ promise = @client.make_request_async(:put, path_template, options)
212
107
 
213
- request_url = @base_url || @client.base_url
214
-
215
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
216
- promise = request.run_promise do |req|
217
- @client.credentials.sign_request(req) unless @client.credentials.nil?
218
- end
219
-
220
- promise = promise.then do |http_response|
108
+ promise = promise.then do |result|
109
+ http_response = result.response
221
110
  status_code = http_response.status
222
111
  response_content = http_response.body
223
112
  unless status_code == 201
224
113
  error_model = JSON.load(response_content)
225
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
226
115
  end
227
116
 
228
- # Create Result
229
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
230
117
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
231
118
  # Deserialize Response
232
119
  if status_code == 201
@@ -256,8 +143,8 @@ module Azure::ARM::Batch
256
143
  # will be added to the HTTP request.
257
144
  #
258
145
  #
259
- def delete_application(resource_group_name, account_name, application_id, custom_headers = nil)
260
- response = delete_application_async(resource_group_name, account_name, application_id, custom_headers).value!
146
+ def delete(resource_group_name, account_name, application_id, custom_headers = nil)
147
+ response = delete_async(resource_group_name, account_name, application_id, custom_headers).value!
261
148
  nil
262
149
  end
263
150
 
@@ -273,8 +160,8 @@ module Azure::ARM::Batch
273
160
  #
274
161
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
275
162
  #
276
- def delete_application_with_http_info(resource_group_name, account_name, application_id, custom_headers = nil)
277
- delete_application_async(resource_group_name, account_name, application_id, custom_headers).value!
163
+ def delete_with_http_info(resource_group_name, account_name, application_id, custom_headers = nil)
164
+ delete_async(resource_group_name, account_name, application_id, custom_headers).value!
278
165
  end
279
166
 
280
167
  #
@@ -289,7 +176,7 @@ module Azure::ARM::Batch
289
176
  #
290
177
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
291
178
  #
292
- def delete_application_async(resource_group_name, account_name, application_id, custom_headers = nil)
179
+ def delete_async(resource_group_name, account_name, application_id, custom_headers = nil)
293
180
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
294
181
  fail ArgumentError, 'account_name is nil' if account_name.nil?
295
182
  fail ArgumentError, 'application_id is nil' if application_id.nil?
@@ -303,30 +190,27 @@ module Azure::ARM::Batch
303
190
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
304
191
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
305
192
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
193
+
194
+ request_url = @base_url || @client.base_url
195
+
306
196
  options = {
307
197
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
308
198
  path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
309
199
  query_params: {'api-version' => @client.api_version},
310
- headers: request_headers.merge(custom_headers || {})
200
+ headers: request_headers.merge(custom_headers || {}),
201
+ base_url: request_url
311
202
  }
203
+ promise = @client.make_request_async(:delete, path_template, options)
312
204
 
313
- request_url = @base_url || @client.base_url
314
-
315
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
316
- promise = request.run_promise do |req|
317
- @client.credentials.sign_request(req) unless @client.credentials.nil?
318
- end
319
-
320
- promise = promise.then do |http_response|
205
+ promise = promise.then do |result|
206
+ http_response = result.response
321
207
  status_code = http_response.status
322
208
  response_content = http_response.body
323
209
  unless status_code == 204
324
210
  error_model = JSON.load(response_content)
325
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
211
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
326
212
  end
327
213
 
328
- # Create Result
329
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
330
214
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
331
215
 
332
216
  result
@@ -347,8 +231,8 @@ module Azure::ARM::Batch
347
231
  #
348
232
  # @return [Application] operation results.
349
233
  #
350
- def get_application(resource_group_name, account_name, application_id, custom_headers = nil)
351
- response = get_application_async(resource_group_name, account_name, application_id, custom_headers).value!
234
+ def get(resource_group_name, account_name, application_id, custom_headers = nil)
235
+ response = get_async(resource_group_name, account_name, application_id, custom_headers).value!
352
236
  response.body unless response.nil?
353
237
  end
354
238
 
@@ -364,8 +248,8 @@ module Azure::ARM::Batch
364
248
  #
365
249
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
366
250
  #
367
- def get_application_with_http_info(resource_group_name, account_name, application_id, custom_headers = nil)
368
- get_application_async(resource_group_name, account_name, application_id, custom_headers).value!
251
+ def get_with_http_info(resource_group_name, account_name, application_id, custom_headers = nil)
252
+ get_async(resource_group_name, account_name, application_id, custom_headers).value!
369
253
  end
370
254
 
371
255
  #
@@ -380,7 +264,7 @@ module Azure::ARM::Batch
380
264
  #
381
265
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
382
266
  #
383
- def get_application_async(resource_group_name, account_name, application_id, custom_headers = nil)
267
+ def get_async(resource_group_name, account_name, application_id, custom_headers = nil)
384
268
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
385
269
  fail ArgumentError, 'account_name is nil' if account_name.nil?
386
270
  fail ArgumentError, 'application_id is nil' if application_id.nil?
@@ -394,30 +278,27 @@ module Azure::ARM::Batch
394
278
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
395
279
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
396
280
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
281
+
282
+ request_url = @base_url || @client.base_url
283
+
397
284
  options = {
398
285
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
399
286
  path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
400
287
  query_params: {'api-version' => @client.api_version},
401
- headers: request_headers.merge(custom_headers || {})
288
+ headers: request_headers.merge(custom_headers || {}),
289
+ base_url: request_url
402
290
  }
291
+ promise = @client.make_request_async(:get, path_template, options)
403
292
 
404
- request_url = @base_url || @client.base_url
405
-
406
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, 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|
293
+ promise = promise.then do |result|
294
+ http_response = result.response
412
295
  status_code = http_response.status
413
296
  response_content = http_response.body
414
297
  unless status_code == 200
415
298
  error_model = JSON.load(response_content)
416
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
299
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
417
300
  end
418
301
 
419
- # Create Result
420
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
421
302
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
422
303
  # Deserialize Response
423
304
  if status_code == 200
@@ -449,8 +330,8 @@ module Azure::ARM::Batch
449
330
  # will be added to the HTTP request.
450
331
  #
451
332
  #
452
- def update_application(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
453
- response = update_application_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
333
+ def update(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
334
+ response = update_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
454
335
  nil
455
336
  end
456
337
 
@@ -468,8 +349,8 @@ module Azure::ARM::Batch
468
349
  #
469
350
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
470
351
  #
471
- def update_application_with_http_info(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
472
- update_application_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
352
+ def update_with_http_info(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
353
+ update_async(resource_group_name, account_name, application_id, parameters, custom_headers).value!
473
354
  end
474
355
 
475
356
  #
@@ -486,7 +367,7 @@ module Azure::ARM::Batch
486
367
  #
487
368
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
488
369
  #
489
- def update_application_async(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
370
+ def update_async(resource_group_name, account_name, application_id, parameters, custom_headers = nil)
490
371
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
491
372
  fail ArgumentError, 'account_name is nil' if account_name.nil?
492
373
  fail ArgumentError, 'application_id is nil' if application_id.nil?
@@ -509,230 +390,28 @@ module Azure::ARM::Batch
509
390
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
510
391
 
511
392
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}'
512
- options = {
513
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
514
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
515
- query_params: {'api-version' => @client.api_version},
516
- body: request_content,
517
- headers: request_headers.merge(custom_headers || {})
518
- }
519
393
 
520
394
  request_url = @base_url || @client.base_url
521
395
 
522
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
523
- promise = request.run_promise do |req|
524
- @client.credentials.sign_request(req) unless @client.credentials.nil?
525
- end
526
-
527
- promise = promise.then do |http_response|
528
- status_code = http_response.status
529
- response_content = http_response.body
530
- unless status_code == 204
531
- error_model = JSON.load(response_content)
532
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
533
- end
534
-
535
- # Create Result
536
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
537
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
538
-
539
- result
540
- end
541
-
542
- promise.execute
543
- end
544
-
545
- #
546
- # Creates an application package record.
547
- #
548
- # @param resource_group_name [String] The name of the resource group that
549
- # contains the Batch account.
550
- # @param account_name [String] The name of the Batch account.
551
- # @param application_id [String] The id of the application.
552
- # @param version [String] The version of the application.
553
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
554
- # will be added to the HTTP request.
555
- #
556
- # @return [AddApplicationPackageResult] operation results.
557
- #
558
- def add_application_package(resource_group_name, account_name, application_id, version, custom_headers = nil)
559
- response = add_application_package_async(resource_group_name, account_name, application_id, version, custom_headers).value!
560
- response.body unless response.nil?
561
- end
562
-
563
- #
564
- # Creates an application package record.
565
- #
566
- # @param resource_group_name [String] The name of the resource group that
567
- # contains the Batch account.
568
- # @param account_name [String] The name of the Batch account.
569
- # @param application_id [String] The id of the application.
570
- # @param version [String] The version of the application.
571
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
572
- # will be added to the HTTP request.
573
- #
574
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
575
- #
576
- def add_application_package_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
577
- add_application_package_async(resource_group_name, account_name, application_id, version, custom_headers).value!
578
- end
579
-
580
- #
581
- # Creates an application package record.
582
- #
583
- # @param resource_group_name [String] The name of the resource group that
584
- # contains the Batch account.
585
- # @param account_name [String] The name of the Batch account.
586
- # @param application_id [String] The id of the application.
587
- # @param version [String] The version of the application.
588
- # @param [Hash{String => String}] A hash of custom headers that will be added
589
- # to the HTTP request.
590
- #
591
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
592
- #
593
- def add_application_package_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
594
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
595
- fail ArgumentError, 'account_name is nil' if account_name.nil?
596
- fail ArgumentError, 'application_id is nil' if application_id.nil?
597
- fail ArgumentError, 'version is nil' if version.nil?
598
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
599
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
600
-
601
-
602
- request_headers = {}
603
-
604
- # Set Headers
605
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
606
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
607
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
608
396
  options = {
609
397
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
610
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
611
- query_params: {'api-version' => @client.api_version},
612
- headers: request_headers.merge(custom_headers || {})
613
- }
614
-
615
- request_url = @base_url || @client.base_url
616
-
617
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
618
- promise = request.run_promise do |req|
619
- @client.credentials.sign_request(req) unless @client.credentials.nil?
620
- end
621
-
622
- promise = promise.then do |http_response|
623
- status_code = http_response.status
624
- response_content = http_response.body
625
- unless status_code == 201
626
- error_model = JSON.load(response_content)
627
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
628
- end
629
-
630
- # Create Result
631
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
632
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
633
- # Deserialize Response
634
- if status_code == 201
635
- begin
636
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
637
- result_mapper = AddApplicationPackageResult.mapper()
638
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
639
- rescue Exception => e
640
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
641
- end
642
- end
643
-
644
- result
645
- end
646
-
647
- promise.execute
648
- end
649
-
650
- #
651
- # Deletes an application package record and its associated binary file.
652
- #
653
- # @param resource_group_name [String] The name of the resource group that
654
- # contains the Batch account.
655
- # @param account_name [String] The name of the Batch account.
656
- # @param application_id [String] The id of the application.
657
- # @param version [String] The version of the application to delete.
658
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
659
- # will be added to the HTTP request.
660
- #
661
- #
662
- def delete_application_package(resource_group_name, account_name, application_id, version, custom_headers = nil)
663
- response = delete_application_package_async(resource_group_name, account_name, application_id, version, custom_headers).value!
664
- nil
665
- end
666
-
667
- #
668
- # Deletes an application package record and its associated binary file.
669
- #
670
- # @param resource_group_name [String] The name of the resource group that
671
- # contains the Batch account.
672
- # @param account_name [String] The name of the Batch account.
673
- # @param application_id [String] The id of the application.
674
- # @param version [String] The version of the application to delete.
675
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
676
- # will be added to the HTTP request.
677
- #
678
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
679
- #
680
- def delete_application_package_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
681
- delete_application_package_async(resource_group_name, account_name, application_id, version, custom_headers).value!
682
- end
683
-
684
- #
685
- # Deletes an application package record and its associated binary file.
686
- #
687
- # @param resource_group_name [String] The name of the resource group that
688
- # contains the Batch account.
689
- # @param account_name [String] The name of the Batch account.
690
- # @param application_id [String] The id of the application.
691
- # @param version [String] The version of the application to delete.
692
- # @param [Hash{String => String}] A hash of custom headers that will be added
693
- # to the HTTP request.
694
- #
695
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
696
- #
697
- def delete_application_package_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
698
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
699
- fail ArgumentError, 'account_name is nil' if account_name.nil?
700
- fail ArgumentError, 'application_id is nil' if application_id.nil?
701
- fail ArgumentError, 'version is nil' if version.nil?
702
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
703
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
704
-
705
-
706
- request_headers = {}
707
-
708
- # Set Headers
709
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
710
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
711
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
712
- options = {
713
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
714
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
398
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'subscriptionId' => @client.subscription_id},
715
399
  query_params: {'api-version' => @client.api_version},
716
- headers: request_headers.merge(custom_headers || {})
400
+ body: request_content,
401
+ headers: request_headers.merge(custom_headers || {}),
402
+ base_url: request_url
717
403
  }
404
+ promise = @client.make_request_async(:patch, path_template, options)
718
405
 
719
- request_url = @base_url || @client.base_url
720
-
721
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
722
- promise = request.run_promise do |req|
723
- @client.credentials.sign_request(req) unless @client.credentials.nil?
724
- end
725
-
726
- promise = promise.then do |http_response|
406
+ promise = promise.then do |result|
407
+ http_response = result.response
727
408
  status_code = http_response.status
728
409
  response_content = http_response.body
729
410
  unless status_code == 204
730
411
  error_model = JSON.load(response_content)
731
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
412
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
732
413
  end
733
414
 
734
- # Create Result
735
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
736
415
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
737
416
 
738
417
  result
@@ -741,111 +420,6 @@ module Azure::ARM::Batch
741
420
  promise.execute
742
421
  end
743
422
 
744
- #
745
- # Gets information about the specified application package.
746
- #
747
- # @param resource_group_name [String] The name of the resource group that
748
- # contains the Batch account.
749
- # @param account_name [String] The name of the Batch account.
750
- # @param application_id [String] The id of the application.
751
- # @param version [String] The version of the application.
752
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
753
- # will be added to the HTTP request.
754
- #
755
- # @return [GetApplicationPackageResult] operation results.
756
- #
757
- def get_application_package(resource_group_name, account_name, application_id, version, custom_headers = nil)
758
- response = get_application_package_async(resource_group_name, account_name, application_id, version, custom_headers).value!
759
- response.body unless response.nil?
760
- end
761
-
762
- #
763
- # Gets information about the specified application package.
764
- #
765
- # @param resource_group_name [String] The name of the resource group that
766
- # contains the Batch account.
767
- # @param account_name [String] The name of the Batch account.
768
- # @param application_id [String] The id of the application.
769
- # @param version [String] The version of the application.
770
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
771
- # will be added to the HTTP request.
772
- #
773
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
774
- #
775
- def get_application_package_with_http_info(resource_group_name, account_name, application_id, version, custom_headers = nil)
776
- get_application_package_async(resource_group_name, account_name, application_id, version, custom_headers).value!
777
- end
778
-
779
- #
780
- # Gets information about the specified application package.
781
- #
782
- # @param resource_group_name [String] The name of the resource group that
783
- # contains the Batch account.
784
- # @param account_name [String] The name of the Batch account.
785
- # @param application_id [String] The id of the application.
786
- # @param version [String] The version of the application.
787
- # @param [Hash{String => String}] A hash of custom headers that will be added
788
- # to the HTTP request.
789
- #
790
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
791
- #
792
- def get_application_package_async(resource_group_name, account_name, application_id, version, custom_headers = nil)
793
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
794
- fail ArgumentError, 'account_name is nil' if account_name.nil?
795
- fail ArgumentError, 'application_id is nil' if application_id.nil?
796
- fail ArgumentError, 'version is nil' if version.nil?
797
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
798
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
799
-
800
-
801
- request_headers = {}
802
-
803
- # Set Headers
804
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
805
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
806
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}'
807
- options = {
808
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
809
- path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'applicationId' => application_id,'version' => version,'subscriptionId' => @client.subscription_id},
810
- query_params: {'api-version' => @client.api_version},
811
- headers: request_headers.merge(custom_headers || {})
812
- }
813
-
814
- request_url = @base_url || @client.base_url
815
-
816
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
817
- promise = request.run_promise do |req|
818
- @client.credentials.sign_request(req) unless @client.credentials.nil?
819
- end
820
-
821
- promise = promise.then do |http_response|
822
- status_code = http_response.status
823
- response_content = http_response.body
824
- unless status_code == 200
825
- error_model = JSON.load(response_content)
826
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
827
- end
828
-
829
- # Create Result
830
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
831
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
832
- # Deserialize Response
833
- if status_code == 200
834
- begin
835
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
836
- result_mapper = GetApplicationPackageResult.mapper()
837
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
838
- rescue Exception => e
839
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
840
- end
841
- end
842
-
843
- result
844
- end
845
-
846
- promise.execute
847
- end
848
-
849
423
  #
850
424
  # Lists all of the applications in the specified account.
851
425
  #
@@ -864,8 +438,8 @@ module Azure::ARM::Batch
864
438
  response = list_async(resource_group_name, account_name, maxresults, custom_headers).value!
865
439
  unless response.nil?
866
440
  page = response.body
867
- page.next_method = Proc.new do |next_link|
868
- list_next_async(next_link, custom_headers)
441
+ page.next_method = Proc.new do |next_page_link|
442
+ list_next_async(next_page_link, custom_headers)
869
443
  end
870
444
  page
871
445
  end
@@ -932,30 +506,27 @@ module Azure::ARM::Batch
932
506
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
933
507
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
934
508
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications'
509
+
510
+ request_url = @base_url || @client.base_url
511
+
935
512
  options = {
936
513
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
937
514
  path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
938
515
  query_params: {'maxresults' => maxresults,'api-version' => @client.api_version},
939
- headers: request_headers.merge(custom_headers || {})
516
+ headers: request_headers.merge(custom_headers || {}),
517
+ base_url: request_url
940
518
  }
519
+ promise = @client.make_request_async(:get, path_template, options)
941
520
 
942
- request_url = @base_url || @client.base_url
943
-
944
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
945
- promise = request.run_promise do |req|
946
- @client.credentials.sign_request(req) unless @client.credentials.nil?
947
- end
948
-
949
- promise = promise.then do |http_response|
521
+ promise = promise.then do |result|
522
+ http_response = result.response
950
523
  status_code = http_response.status
951
524
  response_content = http_response.body
952
525
  unless status_code == 200
953
526
  error_model = JSON.load(response_content)
954
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
527
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
955
528
  end
956
529
 
957
- # Create Result
958
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
959
530
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
960
531
  # Deserialize Response
961
532
  if status_code == 200
@@ -1023,29 +594,26 @@ module Azure::ARM::Batch
1023
594
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1024
595
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1025
596
  path_template = '{nextLink}'
597
+
598
+ request_url = @base_url || @client.base_url
599
+
1026
600
  options = {
1027
601
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1028
602
  skip_encoding_path_params: {'nextLink' => next_page_link},
1029
- headers: request_headers.merge(custom_headers || {})
603
+ headers: request_headers.merge(custom_headers || {}),
604
+ base_url: request_url
1030
605
  }
606
+ promise = @client.make_request_async(:get, path_template, options)
1031
607
 
1032
- request_url = @base_url || @client.base_url
1033
-
1034
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1035
- promise = request.run_promise do |req|
1036
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1037
- end
1038
-
1039
- promise = promise.then do |http_response|
608
+ promise = promise.then do |result|
609
+ http_response = result.response
1040
610
  status_code = http_response.status
1041
611
  response_content = http_response.body
1042
612
  unless status_code == 200
1043
613
  error_model = JSON.load(response_content)
1044
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
614
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1045
615
  end
1046
616
 
1047
- # Create Result
1048
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1049
617
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1050
618
  # Deserialize Response
1051
619
  if status_code == 200