azure_mgmt_compute 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -5
  3. data/lib/generated/azure_mgmt_compute/availability_sets.rb +45 -60
  4. data/lib/generated/azure_mgmt_compute/compute_management_client.rb +55 -4
  5. data/lib/generated/azure_mgmt_compute/container_service_operations.rb +36 -52
  6. data/lib/generated/azure_mgmt_compute/models/additional_unattend_content.rb +3 -3
  7. data/lib/generated/azure_mgmt_compute/models/data_disk.rb +1 -1
  8. data/lib/generated/azure_mgmt_compute/models/data_disk_image.rb +3 -3
  9. data/lib/generated/azure_mgmt_compute/models/osdisk.rb +1 -1
  10. data/lib/generated/azure_mgmt_compute/models/ssh_public_key.rb +1 -1
  11. data/lib/generated/azure_mgmt_compute/models/virtual_machine_extension_image.rb +1 -1
  12. data/lib/generated/azure_mgmt_compute/models/virtual_machine_list_result.rb +1 -1
  13. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set.rb +3 -3
  14. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_result.rb +1 -1
  15. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_skus_result.rb +1 -2
  16. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_list_with_link_result.rb +1 -1
  17. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_osdisk.rb +1 -1
  18. data/lib/generated/azure_mgmt_compute/models/virtual_machine_scale_set_vmlist_result.rb +1 -1
  19. data/lib/generated/azure_mgmt_compute/usage_operations.rb +20 -27
  20. data/lib/generated/azure_mgmt_compute/version.rb +1 -1
  21. data/lib/generated/azure_mgmt_compute/virtual_machine_extension_images.rb +27 -36
  22. data/lib/generated/azure_mgmt_compute/virtual_machine_extensions.rb +27 -40
  23. data/lib/generated/azure_mgmt_compute/virtual_machine_images.rb +45 -60
  24. data/lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb +92 -135
  25. data/lib/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb +159 -231
  26. data/lib/generated/azure_mgmt_compute/virtual_machine_sizes.rb +9 -12
  27. data/lib/generated/azure_mgmt_compute/virtual_machines.rb +139 -202
  28. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8d02b3df402547e216935d5d5b70ebbca63894c
4
- data.tar.gz: dd1d567d66f2043cc87fbe213abaf4aa13b52424
3
+ metadata.gz: 93d08324e792c205e9423279446ab6032d0fc1a3
4
+ data.tar.gz: 1415eae154a943cbb561ab8e92ca997525e7fa2a
5
5
  SHA512:
6
- metadata.gz: 28a5adf35b73e23376c7860859b325f9116d64c1f8aa48c8c3b2ac97b3b0055c952491b4105a02c429bf61e46f90b7d0d16437ec214c3ea0f7a3fc590f4bcff3
7
- data.tar.gz: 85e18f9f55f9e74810d4918bfc898d0c9e5a8339e7f0e63e650677b075afb7762a1fd0a666accc178a0d748857010e491ce77f0a63d888772bf72e4eb0542c58
6
+ metadata.gz: 468794083f4b5875fb936629b5394a5c1d6ee86a5b608c3977f81343e9757a8cb1179c9811d596469aee9e3afa237a09fb06a4d8bd8a7512719e6d0f5c88f5f9
7
+ data.tar.gz: 1494cdc34fa5a60b2ef5ccaba3089657f6e88742988b40e1c3c8021c9ad87a4425d5228790b71e06036b58752f04b62867e8abcdc9a381bac51daba26c486aa5
data/README.md CHANGED
@@ -51,9 +51,6 @@ include Azure::ARM::Compute::Models
51
51
  client = ComputeManagementClient.new(credentials)
52
52
  client.subscription_id = subscription_id
53
53
 
54
- # Create a model for new virtual machine
55
- props = VirtualMachineProperties.new
56
-
57
54
  windows_config = WindowsConfiguration.new
58
55
  windows_config.provision_vmagent = true
59
56
  windows_config.enable_automatic_updates = true
@@ -68,11 +65,11 @@ os_profile.secrets = []
68
65
  hardware_profile = HardwareProfile.new
69
66
  hardware_profile.vm_size = 'Standard_A0'
70
67
 
71
- # create_storage_profile is hypotetical helper method which creates storage
68
+ # create_storage_profile is hypothetical helper method which creates storage
72
69
  # profile by means of ARM Storage SDK.
73
70
  params.storage_profile = create_storage_profile
74
71
 
75
- # create_network_profile is hypotetical helper method which creates network
72
+ # create_network_profile is hypothetical helper method which creates network
76
73
  # profile my means of ARM Network SDK.
77
74
  params.network_profile = create_network_profile
78
75
 
@@ -92,31 +92,28 @@ module Azure::ARM::Compute
92
92
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
93
93
 
94
94
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
95
98
  options = {
96
99
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
97
100
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
98
101
  query_params: {'api-version' => api_version},
99
102
  body: request_content,
100
- headers: request_headers.merge(custom_headers || {})
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
101
105
  }
106
+ promise = @client.make_request_async(:put, path_template, options)
102
107
 
103
- request_url = @base_url || @client.base_url
104
-
105
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
106
- promise = request.run_promise do |req|
107
- @client.credentials.sign_request(req) unless @client.credentials.nil?
108
- end
109
-
110
- promise = promise.then do |http_response|
108
+ promise = promise.then do |result|
109
+ http_response = result.response
111
110
  status_code = http_response.status
112
111
  response_content = http_response.body
113
112
  unless status_code == 200
114
113
  error_model = JSON.load(response_content)
115
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
116
115
  end
117
116
 
118
- # Create Result
119
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
120
117
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
121
118
  # Deserialize Response
122
119
  if status_code == 200
@@ -186,30 +183,27 @@ module Azure::ARM::Compute
186
183
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
187
184
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
188
185
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
189
  options = {
190
190
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
191
  path_params: {'resourceGroupName' => resource_group_name,'availabilitySetName' => availability_set_name,'subscriptionId' => @client.subscription_id},
192
192
  query_params: {'api-version' => api_version},
193
- headers: request_headers.merge(custom_headers || {})
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
194
195
  }
196
+ promise = @client.make_request_async(:delete, path_template, options)
195
197
 
196
- request_url = @base_url || @client.base_url
197
-
198
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
199
- promise = request.run_promise do |req|
200
- @client.credentials.sign_request(req) unless @client.credentials.nil?
201
- end
202
-
203
- promise = promise.then do |http_response|
198
+ promise = promise.then do |result|
199
+ http_response = result.response
204
200
  status_code = http_response.status
205
201
  response_content = http_response.body
206
202
  unless status_code == 200 || status_code == 204
207
203
  error_model = JSON.load(response_content)
208
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
209
205
  end
210
206
 
211
- # Create Result
212
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
213
207
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
214
208
 
215
209
  result
@@ -270,30 +264,27 @@ module Azure::ARM::Compute
270
264
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
271
265
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
272
266
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'
267
+
268
+ request_url = @base_url || @client.base_url
269
+
273
270
  options = {
274
271
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
275
272
  path_params: {'resourceGroupName' => resource_group_name,'availabilitySetName' => availability_set_name,'subscriptionId' => @client.subscription_id},
276
273
  query_params: {'api-version' => api_version},
277
- headers: request_headers.merge(custom_headers || {})
274
+ headers: request_headers.merge(custom_headers || {}),
275
+ base_url: request_url
278
276
  }
277
+ promise = @client.make_request_async(:get, path_template, options)
279
278
 
280
- request_url = @base_url || @client.base_url
281
-
282
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
283
- promise = request.run_promise do |req|
284
- @client.credentials.sign_request(req) unless @client.credentials.nil?
285
- end
286
-
287
- promise = promise.then do |http_response|
279
+ promise = promise.then do |result|
280
+ http_response = result.response
288
281
  status_code = http_response.status
289
282
  response_content = http_response.body
290
283
  unless status_code == 200
291
284
  error_model = JSON.load(response_content)
292
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
285
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
293
286
  end
294
287
 
295
- # Create Result
296
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
297
288
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
298
289
  # Deserialize Response
299
290
  if status_code == 200
@@ -360,30 +351,27 @@ module Azure::ARM::Compute
360
351
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
361
352
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
362
353
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'
354
+
355
+ request_url = @base_url || @client.base_url
356
+
363
357
  options = {
364
358
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
365
359
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
366
360
  query_params: {'api-version' => api_version},
367
- headers: request_headers.merge(custom_headers || {})
361
+ headers: request_headers.merge(custom_headers || {}),
362
+ base_url: request_url
368
363
  }
364
+ promise = @client.make_request_async(:get, path_template, options)
369
365
 
370
- request_url = @base_url || @client.base_url
371
-
372
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
373
- promise = request.run_promise do |req|
374
- @client.credentials.sign_request(req) unless @client.credentials.nil?
375
- end
376
-
377
- promise = promise.then do |http_response|
366
+ promise = promise.then do |result|
367
+ http_response = result.response
378
368
  status_code = http_response.status
379
369
  response_content = http_response.body
380
370
  unless status_code == 200
381
371
  error_model = JSON.load(response_content)
382
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
372
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
383
373
  end
384
374
 
385
- # Create Result
386
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
387
375
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
388
376
  # Deserialize Response
389
377
  if status_code == 200
@@ -457,30 +445,27 @@ module Azure::ARM::Compute
457
445
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
458
446
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
459
447
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'
448
+
449
+ request_url = @base_url || @client.base_url
450
+
460
451
  options = {
461
452
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
462
453
  path_params: {'resourceGroupName' => resource_group_name,'availabilitySetName' => availability_set_name,'subscriptionId' => @client.subscription_id},
463
454
  query_params: {'api-version' => api_version},
464
- headers: request_headers.merge(custom_headers || {})
455
+ headers: request_headers.merge(custom_headers || {}),
456
+ base_url: request_url
465
457
  }
458
+ promise = @client.make_request_async(:get, path_template, options)
466
459
 
467
- request_url = @base_url || @client.base_url
468
-
469
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
470
- promise = request.run_promise do |req|
471
- @client.credentials.sign_request(req) unless @client.credentials.nil?
472
- end
473
-
474
- promise = promise.then do |http_response|
460
+ promise = promise.then do |result|
461
+ http_response = result.response
475
462
  status_code = http_response.status
476
463
  response_content = http_response.body
477
464
  unless status_code == 200
478
465
  error_model = JSON.load(response_content)
479
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
466
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
480
467
  end
481
468
 
482
- # Create Result
483
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
484
469
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
485
470
  # Deserialize Response
486
471
  if status_code == 200
@@ -33,10 +33,6 @@ module Azure::ARM::Compute
33
33
  # is generated and included in each request. Default is true.
34
34
  attr_accessor :generate_client_request_id
35
35
 
36
- # @return Subscription credentials which uniquely identify client
37
- # subscription.
38
- attr_accessor :credentials
39
-
40
36
  # @return [AvailabilitySets] availability_sets
41
37
  attr_reader :availability_sets
42
38
 
@@ -96,5 +92,60 @@ module Azure::ARM::Compute
96
92
  @generate_client_request_id = true
97
93
  end
98
94
 
95
+ #
96
+ # Makes a request and returns the body of the response.
97
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
98
+ # @param path [String] the path, relative to {base_url}.
99
+ # @param options [Hash{String=>String}] specifying any request options like :body.
100
+ # @return [Hash{String=>String}] containing the body of the response.
101
+ # Example:
102
+ #
103
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
104
+ # path = "/path"
105
+ # options = {
106
+ # body: request_content,
107
+ # query_params: {'api-version' => '2016-02-01'}
108
+ # }
109
+ # result = @client.make_request(:put, path, options)
110
+ #
111
+ def make_request(method, path, options = {})
112
+ result = make_request_with_http_info(method, path, options)
113
+ result.body unless result.nil?
114
+ end
115
+
116
+ #
117
+ # Makes a request and returns the operation response.
118
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
119
+ # @param path [String] the path, relative to {base_url}.
120
+ # @param options [Hash{String=>String}] specifying any request options like :body.
121
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
122
+ #
123
+ def make_request_with_http_info(method, path, options = {})
124
+ result = make_request_async(method, path, options).value!
125
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
126
+ result
127
+ end
128
+
129
+ #
130
+ # Makes a request asynchronously.
131
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
132
+ # @param path [String] the path, relative to {base_url}.
133
+ # @param options [Hash{String=>String}] specifying any request options like :body.
134
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
135
+ #
136
+ def make_request_async(method, path, options = {})
137
+ fail ArgumentError, 'method is nil' if method.nil?
138
+ fail ArgumentError, 'path is nil' if path.nil?
139
+
140
+ request_url = options[:base_url] || @base_url
141
+
142
+ request_headers = @request_headers
143
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
144
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
145
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
146
+
147
+ super(request_url, method, path, options)
148
+ end
149
+
99
150
  end
100
151
  end
@@ -30,7 +30,6 @@ module Azure::ARM::Compute
30
30
  # within the given subscription and resource group.
31
31
  # @param parameters [ContainerService] Parameters supplied to the Create
32
32
  # Container Service operation.
33
- # @param api_version [String] Client Api Version.
34
33
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
34
  # will be added to the HTTP request.
36
35
  #
@@ -47,7 +46,6 @@ module Azure::ARM::Compute
47
46
  # within the given subscription and resource group.
48
47
  # @param parameters [ContainerService] Parameters supplied to the Create
49
48
  # Container Service operation.
50
- # @param api_version [String] Client Api Version.
51
49
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
50
  # will be added to the HTTP request.
53
51
  #
@@ -142,31 +140,28 @@ module Azure::ARM::Compute
142
140
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
143
141
 
144
142
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
143
+
144
+ request_url = @base_url || @client.base_url
145
+
145
146
  options = {
146
147
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
147
148
  path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
148
149
  query_params: {'api-version' => api_version},
149
150
  body: request_content,
150
- headers: request_headers.merge(custom_headers || {})
151
+ headers: request_headers.merge(custom_headers || {}),
152
+ base_url: request_url
151
153
  }
154
+ promise = @client.make_request_async(:put, path_template, options)
152
155
 
153
- request_url = @base_url || @client.base_url
154
-
155
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
156
- promise = request.run_promise do |req|
157
- @client.credentials.sign_request(req) unless @client.credentials.nil?
158
- end
159
-
160
- promise = promise.then do |http_response|
156
+ promise = promise.then do |result|
157
+ http_response = result.response
161
158
  status_code = http_response.status
162
159
  response_content = http_response.body
163
160
  unless status_code == 200 || status_code == 201 || status_code == 202
164
161
  error_model = JSON.load(response_content)
165
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
162
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
166
163
  end
167
164
 
168
- # Create Result
169
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
170
165
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
171
166
  # Deserialize Response
172
167
  if status_code == 200
@@ -260,30 +255,27 @@ module Azure::ARM::Compute
260
255
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
261
256
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
262
257
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
258
+
259
+ request_url = @base_url || @client.base_url
260
+
263
261
  options = {
264
262
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
265
263
  path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
266
264
  query_params: {'api-version' => api_version},
267
- headers: request_headers.merge(custom_headers || {})
265
+ headers: request_headers.merge(custom_headers || {}),
266
+ base_url: request_url
268
267
  }
268
+ promise = @client.make_request_async(:get, path_template, options)
269
269
 
270
- request_url = @base_url || @client.base_url
271
-
272
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
273
- promise = request.run_promise do |req|
274
- @client.credentials.sign_request(req) unless @client.credentials.nil?
275
- end
276
-
277
- promise = promise.then do |http_response|
270
+ promise = promise.then do |result|
271
+ http_response = result.response
278
272
  status_code = http_response.status
279
273
  response_content = http_response.body
280
274
  unless status_code == 200
281
275
  error_model = JSON.load(response_content)
282
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
276
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
283
277
  end
284
278
 
285
- # Create Result
286
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
287
279
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
288
280
  # Deserialize Response
289
281
  if status_code == 200
@@ -308,7 +300,6 @@ module Azure::ARM::Compute
308
300
  # @param resource_group_name [String] The name of the resource group.
309
301
  # @param container_service_name [String] The name of the container service
310
302
  # within the given subscription and resource group.
311
- # @param api_version [String] Client Api Version.
312
303
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
313
304
  # will be added to the HTTP request.
314
305
  #
@@ -321,7 +312,6 @@ module Azure::ARM::Compute
321
312
  # @param resource_group_name [String] The name of the resource group.
322
313
  # @param container_service_name [String] The name of the container service
323
314
  # within the given subscription and resource group.
324
- # @param api_version [String] Client Api Version.
325
315
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
326
316
  # will be added to the HTTP request.
327
317
  #
@@ -398,30 +388,27 @@ module Azure::ARM::Compute
398
388
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
399
389
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
400
390
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'
391
+
392
+ request_url = @base_url || @client.base_url
393
+
401
394
  options = {
402
395
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
403
396
  path_params: {'resourceGroupName' => resource_group_name,'containerServiceName' => container_service_name,'subscriptionId' => @client.subscription_id},
404
397
  query_params: {'api-version' => api_version},
405
- headers: request_headers.merge(custom_headers || {})
398
+ headers: request_headers.merge(custom_headers || {}),
399
+ base_url: request_url
406
400
  }
401
+ promise = @client.make_request_async(:delete, path_template, options)
407
402
 
408
- request_url = @base_url || @client.base_url
409
-
410
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
411
- promise = request.run_promise do |req|
412
- @client.credentials.sign_request(req) unless @client.credentials.nil?
413
- end
414
-
415
- promise = promise.then do |http_response|
403
+ promise = promise.then do |result|
404
+ http_response = result.response
416
405
  status_code = http_response.status
417
406
  response_content = http_response.body
418
407
  unless status_code == 202 || status_code == 204
419
408
  error_model = JSON.load(response_content)
420
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
409
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
421
410
  end
422
411
 
423
- # Create Result
424
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
425
412
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
426
413
 
427
414
  result
@@ -478,30 +465,27 @@ module Azure::ARM::Compute
478
465
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
479
466
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
480
467
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'
468
+
469
+ request_url = @base_url || @client.base_url
470
+
481
471
  options = {
482
472
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
483
473
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
484
474
  query_params: {'api-version' => api_version},
485
- headers: request_headers.merge(custom_headers || {})
475
+ headers: request_headers.merge(custom_headers || {}),
476
+ base_url: request_url
486
477
  }
478
+ promise = @client.make_request_async(:get, path_template, options)
487
479
 
488
- request_url = @base_url || @client.base_url
489
-
490
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
491
- promise = request.run_promise do |req|
492
- @client.credentials.sign_request(req) unless @client.credentials.nil?
493
- end
494
-
495
- promise = promise.then do |http_response|
480
+ promise = promise.then do |result|
481
+ http_response = result.response
496
482
  status_code = http_response.status
497
483
  response_content = http_response.body
498
484
  unless status_code == 200
499
485
  error_model = JSON.load(response_content)
500
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
486
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
501
487
  end
502
488
 
503
- # Create Result
504
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
505
489
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
506
490
  # Deserialize Response
507
491
  if status_code == 200