azure_mgmt_machine_learning 0.4.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 +7 -0
- data/.rspec +3 -0
- data/LICENSE.txt +21 -0
- data/Rakefile +5 -0
- data/azure_mgmt_machine_learning.gemspec +34 -0
- data/lib/azure_mgmt_machine_learning.rb +5 -0
- data/lib/generated/azure_mgmt_machine_learning.rb +61 -0
- data/lib/generated/azure_mgmt_machine_learning/azure_mlweb_services_management_client.rb +67 -0
- data/lib/generated/azure_mgmt_machine_learning/models/asset_item.rb +151 -0
- data/lib/generated/azure_mgmt_machine_learning/models/asset_location.rb +56 -0
- data/lib/generated/azure_mgmt_machine_learning/models/asset_type.rb +16 -0
- data/lib/generated/azure_mgmt_machine_learning/models/column_format.rb +28 -0
- data/lib/generated/azure_mgmt_machine_learning/models/column_specification.rb +100 -0
- data/lib/generated/azure_mgmt_machine_learning/models/column_type.rb +18 -0
- data/lib/generated/azure_mgmt_machine_learning/models/commitment_plan.rb +45 -0
- data/lib/generated/azure_mgmt_machine_learning/models/diagnostics_configuration.rb +58 -0
- data/lib/generated/azure_mgmt_machine_learning/models/diagnostics_level.rb +17 -0
- data/lib/generated/azure_mgmt_machine_learning/models/example_request.rb +83 -0
- data/lib/generated/azure_mgmt_machine_learning/models/graph_edge.rb +76 -0
- data/lib/generated/azure_mgmt_machine_learning/models/graph_node.rb +85 -0
- data/lib/generated/azure_mgmt_machine_learning/models/graph_package.rb +93 -0
- data/lib/generated/azure_mgmt_machine_learning/models/graph_parameter.rb +76 -0
- data/lib/generated/azure_mgmt_machine_learning/models/graph_parameter_link.rb +55 -0
- data/lib/generated/azure_mgmt_machine_learning/models/input_port.rb +46 -0
- data/lib/generated/azure_mgmt_machine_learning/models/input_port_type.rb +15 -0
- data/lib/generated/azure_mgmt_machine_learning/models/machine_learning_workspace.rb +45 -0
- data/lib/generated/azure_mgmt_machine_learning/models/mode_value_info.rb +62 -0
- data/lib/generated/azure_mgmt_machine_learning/models/module_asset_parameter.rb +73 -0
- data/lib/generated/azure_mgmt_machine_learning/models/output_port.rb +46 -0
- data/lib/generated/azure_mgmt_machine_learning/models/output_port_type.rb +15 -0
- data/lib/generated/azure_mgmt_machine_learning/models/paginated_web_services_list.rb +63 -0
- data/lib/generated/azure_mgmt_machine_learning/models/parameter_type.rb +26 -0
- data/lib/generated/azure_mgmt_machine_learning/models/provisioning_state.rb +19 -0
- data/lib/generated/azure_mgmt_machine_learning/models/realtime_configuration.rb +50 -0
- data/lib/generated/azure_mgmt_machine_learning/models/service_input_output_specification.rb +86 -0
- data/lib/generated/azure_mgmt_machine_learning/models/storage_account.rb +54 -0
- data/lib/generated/azure_mgmt_machine_learning/models/table_specification.rb +96 -0
- data/lib/generated/azure_mgmt_machine_learning/models/web_service.rb +91 -0
- data/lib/generated/azure_mgmt_machine_learning/models/web_service_keys.rb +54 -0
- data/lib/generated/azure_mgmt_machine_learning/models/web_service_properties.rb +290 -0
- data/lib/generated/azure_mgmt_machine_learning/models/web_service_properties_for_graph.rb +221 -0
- data/lib/generated/azure_mgmt_machine_learning/module_definition.rb +8 -0
- data/lib/generated/azure_mgmt_machine_learning/version.rb +8 -0
- data/lib/generated/azure_mgmt_machine_learning/web_services.rb +868 -0
- metadata +157 -0
@@ -0,0 +1,868 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::MachineLearning
|
7
|
+
#
|
8
|
+
# These APIs allow end users to operate on Azure Machine Learning Web
|
9
|
+
# Services resources. They support the following operations:<ul><li>Create
|
10
|
+
# or update a web service</li><li>Get a web service</li><li>Patch a web
|
11
|
+
# service</li><li>Delete a web service</li><li>Get All Web Services in a
|
12
|
+
# Resource Group </li><li>Get All Web Services in a
|
13
|
+
# Subscription</li><li>Get Web Services Keys</li></ul>
|
14
|
+
#
|
15
|
+
class WebServices
|
16
|
+
include Azure::ARM::MachineLearning::Models
|
17
|
+
include MsRestAzure
|
18
|
+
|
19
|
+
#
|
20
|
+
# Creates and initializes a new instance of the WebServices class.
|
21
|
+
# @param client service class for accessing basic functionality.
|
22
|
+
#
|
23
|
+
def initialize(client)
|
24
|
+
@client = client
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return reference to the AzureMLWebServicesManagementClient
|
28
|
+
attr_reader :client
|
29
|
+
|
30
|
+
#
|
31
|
+
# Creates or updates a new Azure ML web service or update an existing one.
|
32
|
+
#
|
33
|
+
# @param create_or_update_payload [WebService] The payload to create or update
|
34
|
+
# the Azure ML web service.
|
35
|
+
# @param resource_group_name [String] Name of the resource group.
|
36
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
37
|
+
# want to reach.
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
39
|
+
# will be added to the HTTP request.
|
40
|
+
#
|
41
|
+
# @return [WebService] operation results.
|
42
|
+
#
|
43
|
+
def create_or_update(create_or_update_payload, resource_group_name, web_service_name, custom_headers = nil)
|
44
|
+
response = create_or_update_async(create_or_update_payload, resource_group_name, web_service_name, custom_headers).value!
|
45
|
+
response.body unless response.nil?
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# @param create_or_update_payload [WebService] The payload to create or update
|
50
|
+
# the Azure ML web service.
|
51
|
+
# @param resource_group_name [String] Name of the resource group.
|
52
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
53
|
+
# want to reach.
|
54
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
55
|
+
# will be added to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
58
|
+
# response.
|
59
|
+
#
|
60
|
+
def create_or_update_async(create_or_update_payload, resource_group_name, web_service_name, custom_headers = nil)
|
61
|
+
# Send request
|
62
|
+
promise = begin_create_or_update_async(create_or_update_payload, resource_group_name, web_service_name, custom_headers)
|
63
|
+
|
64
|
+
promise = promise.then do |response|
|
65
|
+
# Defining deserialization method.
|
66
|
+
deserialize_method = lambda do |parsed_response|
|
67
|
+
result_mapper = WebService.mapper()
|
68
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
69
|
+
end
|
70
|
+
|
71
|
+
# Waiting for response.
|
72
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
73
|
+
end
|
74
|
+
|
75
|
+
promise
|
76
|
+
end
|
77
|
+
|
78
|
+
#
|
79
|
+
# Creates or updates a new Azure ML web service or update an existing one.
|
80
|
+
#
|
81
|
+
# @param create_or_update_payload [WebService] The payload to create or update
|
82
|
+
# the Azure ML web service.
|
83
|
+
# @param resource_group_name [String] Name of the resource group.
|
84
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
85
|
+
# want to reach.
|
86
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
87
|
+
# will be added to the HTTP request.
|
88
|
+
#
|
89
|
+
# @return [WebService] operation results.
|
90
|
+
#
|
91
|
+
def begin_create_or_update(create_or_update_payload, resource_group_name, web_service_name, custom_headers = nil)
|
92
|
+
response = begin_create_or_update_async(create_or_update_payload, resource_group_name, web_service_name, custom_headers).value!
|
93
|
+
response.body unless response.nil?
|
94
|
+
end
|
95
|
+
|
96
|
+
#
|
97
|
+
# Creates or updates a new Azure ML web service or update an existing one.
|
98
|
+
#
|
99
|
+
# @param create_or_update_payload [WebService] The payload to create or update
|
100
|
+
# the Azure ML web service.
|
101
|
+
# @param resource_group_name [String] Name of the resource group.
|
102
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
103
|
+
# want to reach.
|
104
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
105
|
+
# will be added to the HTTP request.
|
106
|
+
#
|
107
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
108
|
+
#
|
109
|
+
def begin_create_or_update_with_http_info(create_or_update_payload, resource_group_name, web_service_name, custom_headers = nil)
|
110
|
+
begin_create_or_update_async(create_or_update_payload, resource_group_name, web_service_name, custom_headers).value!
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Creates or updates a new Azure ML web service or update an existing one.
|
115
|
+
#
|
116
|
+
# @param create_or_update_payload [WebService] The payload to create or update
|
117
|
+
# the Azure ML web service.
|
118
|
+
# @param resource_group_name [String] Name of the resource group.
|
119
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
120
|
+
# want to reach.
|
121
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
122
|
+
# to the HTTP request.
|
123
|
+
#
|
124
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
125
|
+
#
|
126
|
+
def begin_create_or_update_async(create_or_update_payload, resource_group_name, web_service_name, custom_headers = nil)
|
127
|
+
fail ArgumentError, 'create_or_update_payload is nil' if create_or_update_payload.nil?
|
128
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
129
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
130
|
+
fail ArgumentError, 'web_service_name is nil' if web_service_name.nil?
|
131
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
132
|
+
|
133
|
+
|
134
|
+
request_headers = {}
|
135
|
+
|
136
|
+
# Set Headers
|
137
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
138
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
139
|
+
|
140
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
141
|
+
|
142
|
+
# Serialize Request
|
143
|
+
request_mapper = WebService.mapper()
|
144
|
+
request_content = @client.serialize(request_mapper, create_or_update_payload, 'create_or_update_payload')
|
145
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
146
|
+
|
147
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}'
|
148
|
+
options = {
|
149
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
150
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'webServiceName' => web_service_name},
|
151
|
+
query_params: {'api-version' => @client.api_version},
|
152
|
+
body: request_content,
|
153
|
+
headers: request_headers.merge(custom_headers || {})
|
154
|
+
}
|
155
|
+
|
156
|
+
request_url = @base_url || @client.base_url
|
157
|
+
|
158
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
|
159
|
+
promise = request.run_promise do |req|
|
160
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
161
|
+
end
|
162
|
+
|
163
|
+
promise = promise.then do |http_response|
|
164
|
+
status_code = http_response.status
|
165
|
+
response_content = http_response.body
|
166
|
+
unless status_code == 200 || status_code == 201
|
167
|
+
error_model = JSON.load(response_content)
|
168
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Create Result
|
172
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
173
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
174
|
+
# Deserialize Response
|
175
|
+
if status_code == 200
|
176
|
+
begin
|
177
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
178
|
+
result_mapper = WebService.mapper()
|
179
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
180
|
+
rescue Exception => e
|
181
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
# Deserialize Response
|
185
|
+
if status_code == 201
|
186
|
+
begin
|
187
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
188
|
+
result_mapper = WebService.mapper()
|
189
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
190
|
+
rescue Exception => e
|
191
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
result
|
196
|
+
end
|
197
|
+
|
198
|
+
promise.execute
|
199
|
+
end
|
200
|
+
|
201
|
+
#
|
202
|
+
# Retrieve an Azure ML web service definition by its subscription, resource
|
203
|
+
# group and name.
|
204
|
+
#
|
205
|
+
# @param resource_group_name [String] Name of the resource group.
|
206
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
207
|
+
# want to reach.
|
208
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
209
|
+
# will be added to the HTTP request.
|
210
|
+
#
|
211
|
+
# @return [WebService] operation results.
|
212
|
+
#
|
213
|
+
def get(resource_group_name, web_service_name, custom_headers = nil)
|
214
|
+
response = get_async(resource_group_name, web_service_name, custom_headers).value!
|
215
|
+
response.body unless response.nil?
|
216
|
+
end
|
217
|
+
|
218
|
+
#
|
219
|
+
# Retrieve an Azure ML web service definition by its subscription, resource
|
220
|
+
# group and name.
|
221
|
+
#
|
222
|
+
# @param resource_group_name [String] Name of the resource group.
|
223
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
224
|
+
# want to reach.
|
225
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
226
|
+
# will be added to the HTTP request.
|
227
|
+
#
|
228
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
229
|
+
#
|
230
|
+
def get_with_http_info(resource_group_name, web_service_name, custom_headers = nil)
|
231
|
+
get_async(resource_group_name, web_service_name, custom_headers).value!
|
232
|
+
end
|
233
|
+
|
234
|
+
#
|
235
|
+
# Retrieve an Azure ML web service definition by its subscription, resource
|
236
|
+
# group and name.
|
237
|
+
#
|
238
|
+
# @param resource_group_name [String] Name of the resource group.
|
239
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
240
|
+
# want to reach.
|
241
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
242
|
+
# to the HTTP request.
|
243
|
+
#
|
244
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
245
|
+
#
|
246
|
+
def get_async(resource_group_name, web_service_name, custom_headers = nil)
|
247
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
248
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
249
|
+
fail ArgumentError, 'web_service_name is nil' if web_service_name.nil?
|
250
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
251
|
+
|
252
|
+
|
253
|
+
request_headers = {}
|
254
|
+
|
255
|
+
# Set Headers
|
256
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
257
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
258
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}'
|
259
|
+
options = {
|
260
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
261
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'webServiceName' => web_service_name},
|
262
|
+
query_params: {'api-version' => @client.api_version},
|
263
|
+
headers: request_headers.merge(custom_headers || {})
|
264
|
+
}
|
265
|
+
|
266
|
+
request_url = @base_url || @client.base_url
|
267
|
+
|
268
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
269
|
+
promise = request.run_promise do |req|
|
270
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
271
|
+
end
|
272
|
+
|
273
|
+
promise = promise.then do |http_response|
|
274
|
+
status_code = http_response.status
|
275
|
+
response_content = http_response.body
|
276
|
+
unless status_code == 200
|
277
|
+
error_model = JSON.load(response_content)
|
278
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
279
|
+
end
|
280
|
+
|
281
|
+
# Create Result
|
282
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
283
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
284
|
+
# Deserialize Response
|
285
|
+
if status_code == 200
|
286
|
+
begin
|
287
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
288
|
+
result_mapper = WebService.mapper()
|
289
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
290
|
+
rescue Exception => e
|
291
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
result
|
296
|
+
end
|
297
|
+
|
298
|
+
promise.execute
|
299
|
+
end
|
300
|
+
|
301
|
+
#
|
302
|
+
# Patch an existing Azure ML web service resource.
|
303
|
+
#
|
304
|
+
# @param patch_payload [WebService] The payload to patch the Azure ML web
|
305
|
+
# service with.
|
306
|
+
# @param resource_group_name [String] Name of the resource group.
|
307
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
308
|
+
# want to reach.
|
309
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
310
|
+
# will be added to the HTTP request.
|
311
|
+
#
|
312
|
+
# @return [WebService] operation results.
|
313
|
+
#
|
314
|
+
def patch(patch_payload, resource_group_name, web_service_name, custom_headers = nil)
|
315
|
+
response = patch_async(patch_payload, resource_group_name, web_service_name, custom_headers).value!
|
316
|
+
response.body unless response.nil?
|
317
|
+
end
|
318
|
+
|
319
|
+
#
|
320
|
+
# @param patch_payload [WebService] The payload to patch the Azure ML web
|
321
|
+
# service with.
|
322
|
+
# @param resource_group_name [String] Name of the resource group.
|
323
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
324
|
+
# want to reach.
|
325
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
326
|
+
# will be added to the HTTP request.
|
327
|
+
#
|
328
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
329
|
+
# response.
|
330
|
+
#
|
331
|
+
def patch_async(patch_payload, resource_group_name, web_service_name, custom_headers = nil)
|
332
|
+
# Send request
|
333
|
+
promise = begin_patch_async(patch_payload, resource_group_name, web_service_name, custom_headers)
|
334
|
+
|
335
|
+
promise = promise.then do |response|
|
336
|
+
# Defining deserialization method.
|
337
|
+
deserialize_method = lambda do |parsed_response|
|
338
|
+
result_mapper = WebService.mapper()
|
339
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
340
|
+
end
|
341
|
+
|
342
|
+
# Waiting for response.
|
343
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
344
|
+
end
|
345
|
+
|
346
|
+
promise
|
347
|
+
end
|
348
|
+
|
349
|
+
#
|
350
|
+
# Patch an existing Azure ML web service resource.
|
351
|
+
#
|
352
|
+
# @param patch_payload [WebService] The payload to patch the Azure ML web
|
353
|
+
# service with.
|
354
|
+
# @param resource_group_name [String] Name of the resource group.
|
355
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
356
|
+
# want to reach.
|
357
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
358
|
+
# will be added to the HTTP request.
|
359
|
+
#
|
360
|
+
# @return [WebService] operation results.
|
361
|
+
#
|
362
|
+
def begin_patch(patch_payload, resource_group_name, web_service_name, custom_headers = nil)
|
363
|
+
response = begin_patch_async(patch_payload, resource_group_name, web_service_name, custom_headers).value!
|
364
|
+
response.body unless response.nil?
|
365
|
+
end
|
366
|
+
|
367
|
+
#
|
368
|
+
# Patch an existing Azure ML web service resource.
|
369
|
+
#
|
370
|
+
# @param patch_payload [WebService] The payload to patch the Azure ML web
|
371
|
+
# service with.
|
372
|
+
# @param resource_group_name [String] Name of the resource group.
|
373
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
374
|
+
# want to reach.
|
375
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
376
|
+
# will be added to the HTTP request.
|
377
|
+
#
|
378
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
379
|
+
#
|
380
|
+
def begin_patch_with_http_info(patch_payload, resource_group_name, web_service_name, custom_headers = nil)
|
381
|
+
begin_patch_async(patch_payload, resource_group_name, web_service_name, custom_headers).value!
|
382
|
+
end
|
383
|
+
|
384
|
+
#
|
385
|
+
# Patch an existing Azure ML web service resource.
|
386
|
+
#
|
387
|
+
# @param patch_payload [WebService] The payload to patch the Azure ML web
|
388
|
+
# service with.
|
389
|
+
# @param resource_group_name [String] Name of the resource group.
|
390
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
391
|
+
# want to reach.
|
392
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
393
|
+
# to the HTTP request.
|
394
|
+
#
|
395
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
396
|
+
#
|
397
|
+
def begin_patch_async(patch_payload, resource_group_name, web_service_name, custom_headers = nil)
|
398
|
+
fail ArgumentError, 'patch_payload is nil' if patch_payload.nil?
|
399
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
400
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
401
|
+
fail ArgumentError, 'web_service_name is nil' if web_service_name.nil?
|
402
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
403
|
+
|
404
|
+
|
405
|
+
request_headers = {}
|
406
|
+
|
407
|
+
# Set Headers
|
408
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
409
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
410
|
+
|
411
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
412
|
+
|
413
|
+
# Serialize Request
|
414
|
+
request_mapper = WebService.mapper()
|
415
|
+
request_content = @client.serialize(request_mapper, patch_payload, 'patch_payload')
|
416
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
417
|
+
|
418
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}'
|
419
|
+
options = {
|
420
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
421
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'webServiceName' => web_service_name},
|
422
|
+
query_params: {'api-version' => @client.api_version},
|
423
|
+
body: request_content,
|
424
|
+
headers: request_headers.merge(custom_headers || {})
|
425
|
+
}
|
426
|
+
|
427
|
+
request_url = @base_url || @client.base_url
|
428
|
+
|
429
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
|
430
|
+
promise = request.run_promise do |req|
|
431
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
432
|
+
end
|
433
|
+
|
434
|
+
promise = promise.then do |http_response|
|
435
|
+
status_code = http_response.status
|
436
|
+
response_content = http_response.body
|
437
|
+
unless status_code == 200
|
438
|
+
error_model = JSON.load(response_content)
|
439
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
440
|
+
end
|
441
|
+
|
442
|
+
# Create Result
|
443
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
444
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
445
|
+
# Deserialize Response
|
446
|
+
if status_code == 200
|
447
|
+
begin
|
448
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
449
|
+
result_mapper = WebService.mapper()
|
450
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
451
|
+
rescue Exception => e
|
452
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
456
|
+
result
|
457
|
+
end
|
458
|
+
|
459
|
+
promise.execute
|
460
|
+
end
|
461
|
+
|
462
|
+
#
|
463
|
+
# Remove an existing Azure ML web service.
|
464
|
+
#
|
465
|
+
# @param resource_group_name [String] Name of the resource group.
|
466
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
467
|
+
# want to reach.
|
468
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
469
|
+
# will be added to the HTTP request.
|
470
|
+
#
|
471
|
+
def remove(resource_group_name, web_service_name, custom_headers = nil)
|
472
|
+
response = remove_async(resource_group_name, web_service_name, custom_headers).value!
|
473
|
+
nil
|
474
|
+
end
|
475
|
+
|
476
|
+
#
|
477
|
+
# @param resource_group_name [String] Name of the resource group.
|
478
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
479
|
+
# want to reach.
|
480
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
481
|
+
# will be added to the HTTP request.
|
482
|
+
#
|
483
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
484
|
+
# response.
|
485
|
+
#
|
486
|
+
def remove_async(resource_group_name, web_service_name, custom_headers = nil)
|
487
|
+
# Send request
|
488
|
+
promise = begin_remove_async(resource_group_name, web_service_name, custom_headers)
|
489
|
+
|
490
|
+
promise = promise.then do |response|
|
491
|
+
# Defining deserialization method.
|
492
|
+
deserialize_method = lambda do |parsed_response|
|
493
|
+
end
|
494
|
+
|
495
|
+
# Waiting for response.
|
496
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
497
|
+
end
|
498
|
+
|
499
|
+
promise
|
500
|
+
end
|
501
|
+
|
502
|
+
#
|
503
|
+
# Remove an existing Azure ML web service.
|
504
|
+
#
|
505
|
+
# @param resource_group_name [String] Name of the resource group.
|
506
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
507
|
+
# want to reach.
|
508
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
509
|
+
# will be added to the HTTP request.
|
510
|
+
#
|
511
|
+
#
|
512
|
+
def begin_remove(resource_group_name, web_service_name, custom_headers = nil)
|
513
|
+
response = begin_remove_async(resource_group_name, web_service_name, custom_headers).value!
|
514
|
+
nil
|
515
|
+
end
|
516
|
+
|
517
|
+
#
|
518
|
+
# Remove an existing Azure ML web service.
|
519
|
+
#
|
520
|
+
# @param resource_group_name [String] Name of the resource group.
|
521
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
522
|
+
# want to reach.
|
523
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
524
|
+
# will be added to the HTTP request.
|
525
|
+
#
|
526
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
527
|
+
#
|
528
|
+
def begin_remove_with_http_info(resource_group_name, web_service_name, custom_headers = nil)
|
529
|
+
begin_remove_async(resource_group_name, web_service_name, custom_headers).value!
|
530
|
+
end
|
531
|
+
|
532
|
+
#
|
533
|
+
# Remove an existing Azure ML web service.
|
534
|
+
#
|
535
|
+
# @param resource_group_name [String] Name of the resource group.
|
536
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
537
|
+
# want to reach.
|
538
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
539
|
+
# to the HTTP request.
|
540
|
+
#
|
541
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
542
|
+
#
|
543
|
+
def begin_remove_async(resource_group_name, web_service_name, custom_headers = nil)
|
544
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
545
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
546
|
+
fail ArgumentError, 'web_service_name is nil' if web_service_name.nil?
|
547
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
548
|
+
|
549
|
+
|
550
|
+
request_headers = {}
|
551
|
+
|
552
|
+
# Set Headers
|
553
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
554
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
555
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}'
|
556
|
+
options = {
|
557
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
558
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'webServiceName' => web_service_name},
|
559
|
+
query_params: {'api-version' => @client.api_version},
|
560
|
+
headers: request_headers.merge(custom_headers || {})
|
561
|
+
}
|
562
|
+
|
563
|
+
request_url = @base_url || @client.base_url
|
564
|
+
|
565
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
|
566
|
+
promise = request.run_promise do |req|
|
567
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
568
|
+
end
|
569
|
+
|
570
|
+
promise = promise.then do |http_response|
|
571
|
+
status_code = http_response.status
|
572
|
+
response_content = http_response.body
|
573
|
+
unless status_code == 202 || status_code == 204
|
574
|
+
error_model = JSON.load(response_content)
|
575
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
576
|
+
end
|
577
|
+
|
578
|
+
# Create Result
|
579
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
580
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
581
|
+
|
582
|
+
result
|
583
|
+
end
|
584
|
+
|
585
|
+
promise.execute
|
586
|
+
end
|
587
|
+
|
588
|
+
#
|
589
|
+
# Get the access keys of a particular Azure ML web service
|
590
|
+
#
|
591
|
+
# @param resource_group_name [String] Name of the resource group.
|
592
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
593
|
+
# want to reach.
|
594
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
595
|
+
# will be added to the HTTP request.
|
596
|
+
#
|
597
|
+
# @return [WebServiceKeys] operation results.
|
598
|
+
#
|
599
|
+
def list_keys(resource_group_name, web_service_name, custom_headers = nil)
|
600
|
+
response = list_keys_async(resource_group_name, web_service_name, custom_headers).value!
|
601
|
+
response.body unless response.nil?
|
602
|
+
end
|
603
|
+
|
604
|
+
#
|
605
|
+
# Get the access keys of a particular Azure ML web service
|
606
|
+
#
|
607
|
+
# @param resource_group_name [String] Name of the resource group.
|
608
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
609
|
+
# want to reach.
|
610
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
611
|
+
# will be added to the HTTP request.
|
612
|
+
#
|
613
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
614
|
+
#
|
615
|
+
def list_keys_with_http_info(resource_group_name, web_service_name, custom_headers = nil)
|
616
|
+
list_keys_async(resource_group_name, web_service_name, custom_headers).value!
|
617
|
+
end
|
618
|
+
|
619
|
+
#
|
620
|
+
# Get the access keys of a particular Azure ML web service
|
621
|
+
#
|
622
|
+
# @param resource_group_name [String] Name of the resource group.
|
623
|
+
# @param web_service_name [String] The Azure ML web service name which you
|
624
|
+
# want to reach.
|
625
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
626
|
+
# to the HTTP request.
|
627
|
+
#
|
628
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
629
|
+
#
|
630
|
+
def list_keys_async(resource_group_name, web_service_name, custom_headers = nil)
|
631
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
632
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
633
|
+
fail ArgumentError, 'web_service_name is nil' if web_service_name.nil?
|
634
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
635
|
+
|
636
|
+
|
637
|
+
request_headers = {}
|
638
|
+
|
639
|
+
# Set Headers
|
640
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
641
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
642
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices/{webServiceName}/listKeys'
|
643
|
+
options = {
|
644
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
645
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'webServiceName' => web_service_name},
|
646
|
+
query_params: {'api-version' => @client.api_version},
|
647
|
+
headers: request_headers.merge(custom_headers || {})
|
648
|
+
}
|
649
|
+
|
650
|
+
request_url = @base_url || @client.base_url
|
651
|
+
|
652
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
653
|
+
promise = request.run_promise do |req|
|
654
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
655
|
+
end
|
656
|
+
|
657
|
+
promise = promise.then do |http_response|
|
658
|
+
status_code = http_response.status
|
659
|
+
response_content = http_response.body
|
660
|
+
unless status_code == 200
|
661
|
+
error_model = JSON.load(response_content)
|
662
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
663
|
+
end
|
664
|
+
|
665
|
+
# Create Result
|
666
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
667
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
668
|
+
# Deserialize Response
|
669
|
+
if status_code == 200
|
670
|
+
begin
|
671
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
672
|
+
result_mapper = WebServiceKeys.mapper()
|
673
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
674
|
+
rescue Exception => e
|
675
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
676
|
+
end
|
677
|
+
end
|
678
|
+
|
679
|
+
result
|
680
|
+
end
|
681
|
+
|
682
|
+
promise.execute
|
683
|
+
end
|
684
|
+
|
685
|
+
#
|
686
|
+
# Retrieve all Azure ML web services in a given resource group.
|
687
|
+
#
|
688
|
+
# @param resource_group_name [String] Name of the resource group.
|
689
|
+
# @param skiptoken [String] Continuation token for pagination.
|
690
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
691
|
+
# will be added to the HTTP request.
|
692
|
+
#
|
693
|
+
# @return [PaginatedWebServicesList] operation results.
|
694
|
+
#
|
695
|
+
def list_in_resource_group(resource_group_name, skiptoken = nil, custom_headers = nil)
|
696
|
+
response = list_in_resource_group_async(resource_group_name, skiptoken, custom_headers).value!
|
697
|
+
response.body unless response.nil?
|
698
|
+
end
|
699
|
+
|
700
|
+
#
|
701
|
+
# Retrieve all Azure ML web services in a given resource group.
|
702
|
+
#
|
703
|
+
# @param resource_group_name [String] Name of the resource group.
|
704
|
+
# @param skiptoken [String] Continuation token for pagination.
|
705
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
706
|
+
# will be added to the HTTP request.
|
707
|
+
#
|
708
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
709
|
+
#
|
710
|
+
def list_in_resource_group_with_http_info(resource_group_name, skiptoken = nil, custom_headers = nil)
|
711
|
+
list_in_resource_group_async(resource_group_name, skiptoken, custom_headers).value!
|
712
|
+
end
|
713
|
+
|
714
|
+
#
|
715
|
+
# Retrieve all Azure ML web services in a given resource group.
|
716
|
+
#
|
717
|
+
# @param resource_group_name [String] Name of the resource group.
|
718
|
+
# @param skiptoken [String] Continuation token for pagination.
|
719
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
720
|
+
# to the HTTP request.
|
721
|
+
#
|
722
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
723
|
+
#
|
724
|
+
def list_in_resource_group_async(resource_group_name, skiptoken = nil, custom_headers = nil)
|
725
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
726
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
727
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
728
|
+
|
729
|
+
|
730
|
+
request_headers = {}
|
731
|
+
|
732
|
+
# Set Headers
|
733
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
734
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
735
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/webServices'
|
736
|
+
options = {
|
737
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
738
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
|
739
|
+
query_params: {'api-version' => @client.api_version,'$skiptoken' => skiptoken},
|
740
|
+
headers: request_headers.merge(custom_headers || {})
|
741
|
+
}
|
742
|
+
|
743
|
+
request_url = @base_url || @client.base_url
|
744
|
+
|
745
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
746
|
+
promise = request.run_promise do |req|
|
747
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
748
|
+
end
|
749
|
+
|
750
|
+
promise = promise.then do |http_response|
|
751
|
+
status_code = http_response.status
|
752
|
+
response_content = http_response.body
|
753
|
+
unless status_code == 200
|
754
|
+
error_model = JSON.load(response_content)
|
755
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
756
|
+
end
|
757
|
+
|
758
|
+
# Create Result
|
759
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
760
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
761
|
+
# Deserialize Response
|
762
|
+
if status_code == 200
|
763
|
+
begin
|
764
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
765
|
+
result_mapper = PaginatedWebServicesList.mapper()
|
766
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
767
|
+
rescue Exception => e
|
768
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
769
|
+
end
|
770
|
+
end
|
771
|
+
|
772
|
+
result
|
773
|
+
end
|
774
|
+
|
775
|
+
promise.execute
|
776
|
+
end
|
777
|
+
|
778
|
+
#
|
779
|
+
# Retrieve all Azure ML web services in the current Azure subscription.
|
780
|
+
#
|
781
|
+
# @param skiptoken [String] Continuation token for pagination.
|
782
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
783
|
+
# will be added to the HTTP request.
|
784
|
+
#
|
785
|
+
# @return [PaginatedWebServicesList] operation results.
|
786
|
+
#
|
787
|
+
def list(skiptoken = nil, custom_headers = nil)
|
788
|
+
response = list_async(skiptoken, custom_headers).value!
|
789
|
+
response.body unless response.nil?
|
790
|
+
end
|
791
|
+
|
792
|
+
#
|
793
|
+
# Retrieve all Azure ML web services in the current Azure subscription.
|
794
|
+
#
|
795
|
+
# @param skiptoken [String] Continuation token for pagination.
|
796
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
797
|
+
# will be added to the HTTP request.
|
798
|
+
#
|
799
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
800
|
+
#
|
801
|
+
def list_with_http_info(skiptoken = nil, custom_headers = nil)
|
802
|
+
list_async(skiptoken, custom_headers).value!
|
803
|
+
end
|
804
|
+
|
805
|
+
#
|
806
|
+
# Retrieve all Azure ML web services in the current Azure subscription.
|
807
|
+
#
|
808
|
+
# @param skiptoken [String] Continuation token for pagination.
|
809
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
810
|
+
# to the HTTP request.
|
811
|
+
#
|
812
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
813
|
+
#
|
814
|
+
def list_async(skiptoken = nil, custom_headers = nil)
|
815
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
816
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
817
|
+
|
818
|
+
|
819
|
+
request_headers = {}
|
820
|
+
|
821
|
+
# Set Headers
|
822
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
823
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
824
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/webServices'
|
825
|
+
options = {
|
826
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
827
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
828
|
+
query_params: {'api-version' => @client.api_version,'$skiptoken' => skiptoken},
|
829
|
+
headers: request_headers.merge(custom_headers || {})
|
830
|
+
}
|
831
|
+
|
832
|
+
request_url = @base_url || @client.base_url
|
833
|
+
|
834
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
835
|
+
promise = request.run_promise do |req|
|
836
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
837
|
+
end
|
838
|
+
|
839
|
+
promise = promise.then do |http_response|
|
840
|
+
status_code = http_response.status
|
841
|
+
response_content = http_response.body
|
842
|
+
unless status_code == 200
|
843
|
+
error_model = JSON.load(response_content)
|
844
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
845
|
+
end
|
846
|
+
|
847
|
+
# Create Result
|
848
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
849
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
850
|
+
# Deserialize Response
|
851
|
+
if status_code == 200
|
852
|
+
begin
|
853
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
854
|
+
result_mapper = PaginatedWebServicesList.mapper()
|
855
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
856
|
+
rescue Exception => e
|
857
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
858
|
+
end
|
859
|
+
end
|
860
|
+
|
861
|
+
result
|
862
|
+
end
|
863
|
+
|
864
|
+
promise.execute
|
865
|
+
end
|
866
|
+
|
867
|
+
end
|
868
|
+
end
|