azure_mgmt_devtestlabs 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_devtestlabs/artifact_operations.rb +38 -50
- data/lib/generated/azure_mgmt_devtestlabs/artifact_source_operations.rb +56 -74
- data/lib/generated/azure_mgmt_devtestlabs/cost_operations.rb +9 -12
- data/lib/generated/azure_mgmt_devtestlabs/custom_image_operations.rb +47 -62
- data/lib/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +55 -4
- data/lib/generated/azure_mgmt_devtestlabs/formula_operations.rb +47 -62
- data/lib/generated/azure_mgmt_devtestlabs/gallery_image_operations.rb +20 -26
- data/lib/generated/azure_mgmt_devtestlabs/lab_operations.rb +114 -150
- data/lib/generated/azure_mgmt_devtestlabs/policy_operations.rb +56 -74
- data/lib/generated/azure_mgmt_devtestlabs/policy_set.rb +9 -12
- data/lib/generated/azure_mgmt_devtestlabs/schedule_operations.rb +65 -86
- data/lib/generated/azure_mgmt_devtestlabs/version.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb +83 -110
- data/lib/generated/azure_mgmt_devtestlabs/virtual_network_operations.rb +56 -74
- metadata +5 -5
@@ -42,8 +42,8 @@ module Azure::ARM::DevTestLabs
|
|
42
42
|
response = list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
|
43
43
|
unless response.nil?
|
44
44
|
page = response.body
|
45
|
-
page.next_method = Proc.new do |
|
46
|
-
list_next_async(
|
45
|
+
page.next_method = Proc.new do |next_page_link|
|
46
|
+
list_next_async(next_page_link, custom_headers)
|
47
47
|
end
|
48
48
|
page
|
49
49
|
end
|
@@ -116,30 +116,27 @@ module Azure::ARM::DevTestLabs
|
|
116
116
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
117
117
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
118
118
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages'
|
119
|
+
|
120
|
+
request_url = @base_url || @client.base_url
|
121
|
+
|
119
122
|
options = {
|
120
123
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
121
124
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name},
|
122
125
|
query_params: {'$filter' => filter,'$top' => top,'$orderBy' => order_by,'api-version' => @client.api_version},
|
123
|
-
headers: request_headers.merge(custom_headers || {})
|
126
|
+
headers: request_headers.merge(custom_headers || {}),
|
127
|
+
base_url: request_url
|
124
128
|
}
|
129
|
+
promise = @client.make_request_async(:get, path_template, options)
|
125
130
|
|
126
|
-
|
127
|
-
|
128
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
129
|
-
promise = request.run_promise do |req|
|
130
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
131
|
-
end
|
132
|
-
|
133
|
-
promise = promise.then do |http_response|
|
131
|
+
promise = promise.then do |result|
|
132
|
+
http_response = result.response
|
134
133
|
status_code = http_response.status
|
135
134
|
response_content = http_response.body
|
136
135
|
unless status_code == 200
|
137
136
|
error_model = JSON.load(response_content)
|
138
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
137
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
139
138
|
end
|
140
139
|
|
141
|
-
# Create Result
|
142
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
143
140
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
144
141
|
# Deserialize Response
|
145
142
|
if status_code == 200
|
@@ -214,30 +211,27 @@ module Azure::ARM::DevTestLabs
|
|
214
211
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
215
212
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
216
213
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}'
|
214
|
+
|
215
|
+
request_url = @base_url || @client.base_url
|
216
|
+
|
217
217
|
options = {
|
218
218
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
219
219
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
220
220
|
query_params: {'api-version' => @client.api_version},
|
221
|
-
headers: request_headers.merge(custom_headers || {})
|
221
|
+
headers: request_headers.merge(custom_headers || {}),
|
222
|
+
base_url: request_url
|
222
223
|
}
|
224
|
+
promise = @client.make_request_async(:get, path_template, options)
|
223
225
|
|
224
|
-
|
225
|
-
|
226
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
227
|
-
promise = request.run_promise do |req|
|
228
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
229
|
-
end
|
230
|
-
|
231
|
-
promise = promise.then do |http_response|
|
226
|
+
promise = promise.then do |result|
|
227
|
+
http_response = result.response
|
232
228
|
status_code = http_response.status
|
233
229
|
response_content = http_response.body
|
234
230
|
unless status_code == 200
|
235
231
|
error_model = JSON.load(response_content)
|
236
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
232
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
237
233
|
end
|
238
234
|
|
239
|
-
# Create Result
|
240
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
241
235
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
242
236
|
# Deserialize Response
|
243
237
|
if status_code == 200
|
@@ -374,31 +368,28 @@ module Azure::ARM::DevTestLabs
|
|
374
368
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
375
369
|
|
376
370
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}'
|
371
|
+
|
372
|
+
request_url = @base_url || @client.base_url
|
373
|
+
|
377
374
|
options = {
|
378
375
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
379
376
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
380
377
|
query_params: {'api-version' => @client.api_version},
|
381
378
|
body: request_content,
|
382
|
-
headers: request_headers.merge(custom_headers || {})
|
379
|
+
headers: request_headers.merge(custom_headers || {}),
|
380
|
+
base_url: request_url
|
383
381
|
}
|
382
|
+
promise = @client.make_request_async(:put, path_template, options)
|
384
383
|
|
385
|
-
|
386
|
-
|
387
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
|
388
|
-
promise = request.run_promise do |req|
|
389
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
390
|
-
end
|
391
|
-
|
392
|
-
promise = promise.then do |http_response|
|
384
|
+
promise = promise.then do |result|
|
385
|
+
http_response = result.response
|
393
386
|
status_code = http_response.status
|
394
387
|
response_content = http_response.body
|
395
388
|
unless status_code == 200 || status_code == 201
|
396
389
|
error_model = JSON.load(response_content)
|
397
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
390
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
398
391
|
end
|
399
392
|
|
400
|
-
# Create Result
|
401
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
402
393
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
403
394
|
# Deserialize Response
|
404
395
|
if status_code == 200
|
@@ -522,30 +513,27 @@ module Azure::ARM::DevTestLabs
|
|
522
513
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
523
514
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
524
515
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/customimages/{name}'
|
516
|
+
|
517
|
+
request_url = @base_url || @client.base_url
|
518
|
+
|
525
519
|
options = {
|
526
520
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
527
521
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
528
522
|
query_params: {'api-version' => @client.api_version},
|
529
|
-
headers: request_headers.merge(custom_headers || {})
|
523
|
+
headers: request_headers.merge(custom_headers || {}),
|
524
|
+
base_url: request_url
|
530
525
|
}
|
526
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
531
527
|
|
532
|
-
|
533
|
-
|
534
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
|
535
|
-
promise = request.run_promise do |req|
|
536
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
537
|
-
end
|
538
|
-
|
539
|
-
promise = promise.then do |http_response|
|
528
|
+
promise = promise.then do |result|
|
529
|
+
http_response = result.response
|
540
530
|
status_code = http_response.status
|
541
531
|
response_content = http_response.body
|
542
532
|
unless status_code == 202 || status_code == 204
|
543
533
|
error_model = JSON.load(response_content)
|
544
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
534
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
545
535
|
end
|
546
536
|
|
547
|
-
# Create Result
|
548
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
549
537
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
550
538
|
|
551
539
|
result
|
@@ -603,29 +591,26 @@ module Azure::ARM::DevTestLabs
|
|
603
591
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
604
592
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
605
593
|
path_template = '{nextLink}'
|
594
|
+
|
595
|
+
request_url = @base_url || @client.base_url
|
596
|
+
|
606
597
|
options = {
|
607
598
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
608
599
|
skip_encoding_path_params: {'nextLink' => next_page_link},
|
609
|
-
headers: request_headers.merge(custom_headers || {})
|
600
|
+
headers: request_headers.merge(custom_headers || {}),
|
601
|
+
base_url: request_url
|
610
602
|
}
|
603
|
+
promise = @client.make_request_async(:get, path_template, options)
|
611
604
|
|
612
|
-
|
613
|
-
|
614
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
615
|
-
promise = request.run_promise do |req|
|
616
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
617
|
-
end
|
618
|
-
|
619
|
-
promise = promise.then do |http_response|
|
605
|
+
promise = promise.then do |result|
|
606
|
+
http_response = result.response
|
620
607
|
status_code = http_response.status
|
621
608
|
response_content = http_response.body
|
622
609
|
unless status_code == 200
|
623
610
|
error_model = JSON.load(response_content)
|
624
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
611
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
625
612
|
end
|
626
613
|
|
627
|
-
# Create Result
|
628
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
629
614
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
630
615
|
# Deserialize Response
|
631
616
|
if status_code == 200
|
@@ -34,10 +34,6 @@ module Azure::ARM::DevTestLabs
|
|
34
34
|
# is generated and included in each request. Default is true.
|
35
35
|
attr_accessor :generate_client_request_id
|
36
36
|
|
37
|
-
# @return Subscription credentials which uniquely identify client
|
38
|
-
# subscription.
|
39
|
-
attr_accessor :credentials
|
40
|
-
|
41
37
|
# @return [LabOperations] lab_operations
|
42
38
|
attr_reader :lab_operations
|
43
39
|
|
@@ -106,5 +102,60 @@ module Azure::ARM::DevTestLabs
|
|
106
102
|
@generate_client_request_id = true
|
107
103
|
end
|
108
104
|
|
105
|
+
#
|
106
|
+
# Makes a request and returns the body of the response.
|
107
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
108
|
+
# @param path [String] the path, relative to {base_url}.
|
109
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
110
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
111
|
+
# Example:
|
112
|
+
#
|
113
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
114
|
+
# path = "/path"
|
115
|
+
# options = {
|
116
|
+
# body: request_content,
|
117
|
+
# query_params: {'api-version' => '2016-02-01'}
|
118
|
+
# }
|
119
|
+
# result = @client.make_request(:put, path, options)
|
120
|
+
#
|
121
|
+
def make_request(method, path, options = {})
|
122
|
+
result = make_request_with_http_info(method, path, options)
|
123
|
+
result.body unless result.nil?
|
124
|
+
end
|
125
|
+
|
126
|
+
#
|
127
|
+
# Makes a request and returns the operation response.
|
128
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
129
|
+
# @param path [String] the path, relative to {base_url}.
|
130
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
131
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
132
|
+
#
|
133
|
+
def make_request_with_http_info(method, path, options = {})
|
134
|
+
result = make_request_async(method, path, options).value!
|
135
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
136
|
+
result
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# Makes a request asynchronously.
|
141
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
142
|
+
# @param path [String] the path, relative to {base_url}.
|
143
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
144
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
145
|
+
#
|
146
|
+
def make_request_async(method, path, options = {})
|
147
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
148
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
149
|
+
|
150
|
+
request_url = options[:base_url] || @base_url
|
151
|
+
|
152
|
+
request_headers = @request_headers
|
153
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
154
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
155
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
156
|
+
|
157
|
+
super(request_url, method, path, options)
|
158
|
+
end
|
159
|
+
|
109
160
|
end
|
110
161
|
end
|
@@ -42,8 +42,8 @@ module Azure::ARM::DevTestLabs
|
|
42
42
|
response = list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
|
43
43
|
unless response.nil?
|
44
44
|
page = response.body
|
45
|
-
page.next_method = Proc.new do |
|
46
|
-
list_next_async(
|
45
|
+
page.next_method = Proc.new do |next_page_link|
|
46
|
+
list_next_async(next_page_link, custom_headers)
|
47
47
|
end
|
48
48
|
page
|
49
49
|
end
|
@@ -116,30 +116,27 @@ module Azure::ARM::DevTestLabs
|
|
116
116
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
117
117
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
118
118
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas'
|
119
|
+
|
120
|
+
request_url = @base_url || @client.base_url
|
121
|
+
|
119
122
|
options = {
|
120
123
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
121
124
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name},
|
122
125
|
query_params: {'$filter' => filter,'$top' => top,'$orderBy' => order_by,'api-version' => @client.api_version},
|
123
|
-
headers: request_headers.merge(custom_headers || {})
|
126
|
+
headers: request_headers.merge(custom_headers || {}),
|
127
|
+
base_url: request_url
|
124
128
|
}
|
129
|
+
promise = @client.make_request_async(:get, path_template, options)
|
125
130
|
|
126
|
-
|
127
|
-
|
128
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
129
|
-
promise = request.run_promise do |req|
|
130
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
131
|
-
end
|
132
|
-
|
133
|
-
promise = promise.then do |http_response|
|
131
|
+
promise = promise.then do |result|
|
132
|
+
http_response = result.response
|
134
133
|
status_code = http_response.status
|
135
134
|
response_content = http_response.body
|
136
135
|
unless status_code == 200
|
137
136
|
error_model = JSON.load(response_content)
|
138
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
137
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
139
138
|
end
|
140
139
|
|
141
|
-
# Create Result
|
142
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
143
140
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
144
141
|
# Deserialize Response
|
145
142
|
if status_code == 200
|
@@ -214,30 +211,27 @@ module Azure::ARM::DevTestLabs
|
|
214
211
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
215
212
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
216
213
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}'
|
214
|
+
|
215
|
+
request_url = @base_url || @client.base_url
|
216
|
+
|
217
217
|
options = {
|
218
218
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
219
219
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
220
220
|
query_params: {'api-version' => @client.api_version},
|
221
|
-
headers: request_headers.merge(custom_headers || {})
|
221
|
+
headers: request_headers.merge(custom_headers || {}),
|
222
|
+
base_url: request_url
|
222
223
|
}
|
224
|
+
promise = @client.make_request_async(:get, path_template, options)
|
223
225
|
|
224
|
-
|
225
|
-
|
226
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
227
|
-
promise = request.run_promise do |req|
|
228
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
229
|
-
end
|
230
|
-
|
231
|
-
promise = promise.then do |http_response|
|
226
|
+
promise = promise.then do |result|
|
227
|
+
http_response = result.response
|
232
228
|
status_code = http_response.status
|
233
229
|
response_content = http_response.body
|
234
230
|
unless status_code == 200
|
235
231
|
error_model = JSON.load(response_content)
|
236
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
232
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
237
233
|
end
|
238
234
|
|
239
|
-
# Create Result
|
240
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
241
235
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
242
236
|
# Deserialize Response
|
243
237
|
if status_code == 200
|
@@ -374,31 +368,28 @@ module Azure::ARM::DevTestLabs
|
|
374
368
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
375
369
|
|
376
370
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}'
|
371
|
+
|
372
|
+
request_url = @base_url || @client.base_url
|
373
|
+
|
377
374
|
options = {
|
378
375
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
379
376
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
380
377
|
query_params: {'api-version' => @client.api_version},
|
381
378
|
body: request_content,
|
382
|
-
headers: request_headers.merge(custom_headers || {})
|
379
|
+
headers: request_headers.merge(custom_headers || {}),
|
380
|
+
base_url: request_url
|
383
381
|
}
|
382
|
+
promise = @client.make_request_async(:put, path_template, options)
|
384
383
|
|
385
|
-
|
386
|
-
|
387
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
|
388
|
-
promise = request.run_promise do |req|
|
389
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
390
|
-
end
|
391
|
-
|
392
|
-
promise = promise.then do |http_response|
|
384
|
+
promise = promise.then do |result|
|
385
|
+
http_response = result.response
|
393
386
|
status_code = http_response.status
|
394
387
|
response_content = http_response.body
|
395
388
|
unless status_code == 200 || status_code == 201
|
396
389
|
error_model = JSON.load(response_content)
|
397
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
390
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
398
391
|
end
|
399
392
|
|
400
|
-
# Create Result
|
401
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
402
393
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
403
394
|
# Deserialize Response
|
404
395
|
if status_code == 200
|
@@ -482,30 +473,27 @@ module Azure::ARM::DevTestLabs
|
|
482
473
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
483
474
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
484
475
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}'
|
476
|
+
|
477
|
+
request_url = @base_url || @client.base_url
|
478
|
+
|
485
479
|
options = {
|
486
480
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
487
481
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
488
482
|
query_params: {'api-version' => @client.api_version},
|
489
|
-
headers: request_headers.merge(custom_headers || {})
|
483
|
+
headers: request_headers.merge(custom_headers || {}),
|
484
|
+
base_url: request_url
|
490
485
|
}
|
486
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
491
487
|
|
492
|
-
|
493
|
-
|
494
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
|
495
|
-
promise = request.run_promise do |req|
|
496
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
497
|
-
end
|
498
|
-
|
499
|
-
promise = promise.then do |http_response|
|
488
|
+
promise = promise.then do |result|
|
489
|
+
http_response = result.response
|
500
490
|
status_code = http_response.status
|
501
491
|
response_content = http_response.body
|
502
492
|
unless status_code == 200 || status_code == 204
|
503
493
|
error_model = JSON.load(response_content)
|
504
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
494
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
505
495
|
end
|
506
496
|
|
507
|
-
# Create Result
|
508
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
509
497
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
510
498
|
|
511
499
|
result
|
@@ -563,29 +551,26 @@ module Azure::ARM::DevTestLabs
|
|
563
551
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
564
552
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
565
553
|
path_template = '{nextLink}'
|
554
|
+
|
555
|
+
request_url = @base_url || @client.base_url
|
556
|
+
|
566
557
|
options = {
|
567
558
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
568
559
|
skip_encoding_path_params: {'nextLink' => next_page_link},
|
569
|
-
headers: request_headers.merge(custom_headers || {})
|
560
|
+
headers: request_headers.merge(custom_headers || {}),
|
561
|
+
base_url: request_url
|
570
562
|
}
|
563
|
+
promise = @client.make_request_async(:get, path_template, options)
|
571
564
|
|
572
|
-
|
573
|
-
|
574
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
575
|
-
promise = request.run_promise do |req|
|
576
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
577
|
-
end
|
578
|
-
|
579
|
-
promise = promise.then do |http_response|
|
565
|
+
promise = promise.then do |result|
|
566
|
+
http_response = result.response
|
580
567
|
status_code = http_response.status
|
581
568
|
response_content = http_response.body
|
582
569
|
unless status_code == 200
|
583
570
|
error_model = JSON.load(response_content)
|
584
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
571
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
585
572
|
end
|
586
573
|
|
587
|
-
# Create Result
|
588
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
589
574
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
590
575
|
# Deserialize Response
|
591
576
|
if status_code == 200
|