azure_mgmt_datalake_analytics 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_datalake_analytics.rb +21 -13
  3. data/lib/generated/azure_mgmt_datalake_analytics/account.rb +183 -184
  4. data/lib/generated/azure_mgmt_datalake_analytics/compute_policies.rb +682 -0
  5. data/lib/generated/azure_mgmt_datalake_analytics/data_lake_analytics_account_management_client.rb +5 -1
  6. data/lib/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb +79 -80
  7. data/lib/generated/azure_mgmt_datalake_analytics/firewall_rules.rb +20 -21
  8. data/lib/generated/azure_mgmt_datalake_analytics/models/aadobject_type.rb +17 -0
  9. data/lib/generated/azure_mgmt_datalake_analytics/models/add_data_lake_store_parameters.rb +2 -1
  10. data/lib/generated/azure_mgmt_datalake_analytics/models/add_storage_account_parameters.rb +2 -1
  11. data/lib/generated/azure_mgmt_datalake_analytics/models/compute_policy.rb +98 -0
  12. data/lib/generated/azure_mgmt_datalake_analytics/models/compute_policy_account_create_parameters.rb +97 -0
  13. data/lib/generated/azure_mgmt_datalake_analytics/models/compute_policy_create_or_update_parameters.rb +87 -0
  14. data/lib/generated/azure_mgmt_datalake_analytics/models/compute_policy_list_result.rb +96 -0
  15. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account.rb +94 -34
  16. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_basic.rb +154 -0
  17. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_data_lake_store_result.rb +2 -1
  18. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_result.rb +6 -5
  19. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_list_storage_accounts_result.rb +2 -1
  20. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_properties_basic.rb +109 -0
  21. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_state.rb +1 -1
  22. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_status.rb +1 -1
  23. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_account_update_parameters.rb +49 -1
  24. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_analytics_firewall_rule_list_result.rb +2 -1
  25. data/lib/generated/azure_mgmt_datalake_analytics/models/data_lake_store_account_info.rb +2 -1
  26. data/lib/generated/azure_mgmt_datalake_analytics/models/firewall_allow_azure_ips_state.rb +1 -1
  27. data/lib/generated/azure_mgmt_datalake_analytics/models/firewall_rule.rb +2 -1
  28. data/lib/generated/azure_mgmt_datalake_analytics/models/firewall_state.rb +1 -1
  29. data/lib/generated/azure_mgmt_datalake_analytics/models/list_sas_tokens_result.rb +2 -1
  30. data/lib/generated/azure_mgmt_datalake_analytics/models/list_storage_containers_result.rb +2 -1
  31. data/lib/generated/azure_mgmt_datalake_analytics/models/optional_sub_resource.rb +2 -1
  32. data/lib/generated/azure_mgmt_datalake_analytics/models/sas_token_info.rb +2 -1
  33. data/lib/generated/azure_mgmt_datalake_analytics/models/storage_account_info.rb +2 -1
  34. data/lib/generated/azure_mgmt_datalake_analytics/models/storage_container.rb +9 -8
  35. data/lib/generated/azure_mgmt_datalake_analytics/models/sub_resource.rb +2 -1
  36. data/lib/generated/azure_mgmt_datalake_analytics/models/tier_type.rb +1 -1
  37. data/lib/generated/azure_mgmt_datalake_analytics/models/update_firewall_rule_parameters.rb +2 -1
  38. data/lib/generated/azure_mgmt_datalake_analytics/models/update_storage_account_parameters.rb +2 -1
  39. data/lib/generated/azure_mgmt_datalake_analytics/module_definition.rb +1 -1
  40. data/lib/generated/azure_mgmt_datalake_analytics/storage_accounts.rb +163 -164
  41. data/lib/generated/azure_mgmt_datalake_analytics/version.rb +2 -2
  42. metadata +12 -4
@@ -0,0 +1,682 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::DataLakeAnalytics
7
+ #
8
+ # Creates an Azure Data Lake Analytics account management client.
9
+ #
10
+ class ComputePolicies
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ComputePolicies class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DataLakeAnalyticsAccountManagementClient] reference to the DataLakeAnalyticsAccountManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates the specified compute policy. During update, the compute
26
+ # policy with the specified name will be replaced with this new compute policy.
27
+ # An account supports, at most, 50 policies
28
+ #
29
+ # @param resource_group_name [String] The name of the Azure resource group that
30
+ # contains the Data Lake Analytics account.
31
+ # @param account_name [String] The name of the Data Lake Analytics account to
32
+ # add or replace the compute policy.
33
+ # @param compute_policy_name [String] The name of the compute policy to create
34
+ # or update.
35
+ # @param parameters [ComputePolicyCreateOrUpdateParameters] Parameters supplied
36
+ # to create or update the compute policy. The max degree of parallelism per job
37
+ # property, min priority per job property, or both must be present.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [ComputePolicy] operation results.
42
+ #
43
+ def create_or_update(resource_group_name, account_name, compute_policy_name, parameters, custom_headers = nil)
44
+ response = create_or_update_async(resource_group_name, account_name, compute_policy_name, parameters, custom_headers).value!
45
+ response.body unless response.nil?
46
+ end
47
+
48
+ #
49
+ # Creates or updates the specified compute policy. During update, the compute
50
+ # policy with the specified name will be replaced with this new compute policy.
51
+ # An account supports, at most, 50 policies
52
+ #
53
+ # @param resource_group_name [String] The name of the Azure resource group that
54
+ # contains the Data Lake Analytics account.
55
+ # @param account_name [String] The name of the Data Lake Analytics account to
56
+ # add or replace the compute policy.
57
+ # @param compute_policy_name [String] The name of the compute policy to create
58
+ # or update.
59
+ # @param parameters [ComputePolicyCreateOrUpdateParameters] Parameters supplied
60
+ # to create or update the compute policy. The max degree of parallelism per job
61
+ # property, min priority per job property, or both must be present.
62
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
63
+ # will be added to the HTTP request.
64
+ #
65
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
66
+ #
67
+ def create_or_update_with_http_info(resource_group_name, account_name, compute_policy_name, parameters, custom_headers = nil)
68
+ create_or_update_async(resource_group_name, account_name, compute_policy_name, parameters, custom_headers).value!
69
+ end
70
+
71
+ #
72
+ # Creates or updates the specified compute policy. During update, the compute
73
+ # policy with the specified name will be replaced with this new compute policy.
74
+ # An account supports, at most, 50 policies
75
+ #
76
+ # @param resource_group_name [String] The name of the Azure resource group that
77
+ # contains the Data Lake Analytics account.
78
+ # @param account_name [String] The name of the Data Lake Analytics account to
79
+ # add or replace the compute policy.
80
+ # @param compute_policy_name [String] The name of the compute policy to create
81
+ # or update.
82
+ # @param parameters [ComputePolicyCreateOrUpdateParameters] Parameters supplied
83
+ # to create or update the compute policy. The max degree of parallelism per job
84
+ # property, min priority per job property, or both must be present.
85
+ # @param [Hash{String => String}] A hash of custom headers that will be added
86
+ # to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
+ #
90
+ def create_or_update_async(resource_group_name, account_name, compute_policy_name, parameters, custom_headers = nil)
91
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
92
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
93
+ fail ArgumentError, 'compute_policy_name is nil' if compute_policy_name.nil?
94
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
95
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
96
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
97
+
98
+
99
+ request_headers = {}
100
+
101
+ # Set Headers
102
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
103
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
104
+
105
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
106
+
107
+ # Serialize Request
108
+ request_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicyCreateOrUpdateParameters.mapper()
109
+ request_content = @client.serialize(request_mapper, parameters)
110
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
111
+
112
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}'
113
+
114
+ request_url = @base_url || @client.base_url
115
+
116
+ options = {
117
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
118
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'computePolicyName' => compute_policy_name,'subscriptionId' => @client.subscription_id},
119
+ query_params: {'api-version' => @client.api_version},
120
+ body: request_content,
121
+ headers: request_headers.merge(custom_headers || {}),
122
+ base_url: request_url
123
+ }
124
+ promise = @client.make_request_async(:put, path_template, options)
125
+
126
+ promise = promise.then do |result|
127
+ http_response = result.response
128
+ status_code = http_response.status
129
+ response_content = http_response.body
130
+ unless status_code == 200
131
+ error_model = JSON.load(response_content)
132
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
133
+ end
134
+
135
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
136
+ # Deserialize Response
137
+ if status_code == 200
138
+ begin
139
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
140
+ result_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicy.mapper()
141
+ result.body = @client.deserialize(result_mapper, parsed_response)
142
+ rescue Exception => e
143
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
144
+ end
145
+ end
146
+
147
+ result
148
+ end
149
+
150
+ promise.execute
151
+ end
152
+
153
+ #
154
+ # Updates the specified compute policy.
155
+ #
156
+ # @param resource_group_name [String] The name of the Azure resource group that
157
+ # contains the Data Lake Analytics account.
158
+ # @param account_name [String] The name of the Data Lake Analytics account to
159
+ # which to update the compute policy.
160
+ # @param compute_policy_name [String] The name of the compute policy to update.
161
+ # @param parameters [ComputePolicy] Parameters supplied to update the compute
162
+ # policy.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [ComputePolicy] operation results.
167
+ #
168
+ def update(resource_group_name, account_name, compute_policy_name, parameters = nil, custom_headers = nil)
169
+ response = update_async(resource_group_name, account_name, compute_policy_name, parameters, custom_headers).value!
170
+ response.body unless response.nil?
171
+ end
172
+
173
+ #
174
+ # Updates the specified compute policy.
175
+ #
176
+ # @param resource_group_name [String] The name of the Azure resource group that
177
+ # contains the Data Lake Analytics account.
178
+ # @param account_name [String] The name of the Data Lake Analytics account to
179
+ # which to update the compute policy.
180
+ # @param compute_policy_name [String] The name of the compute policy to update.
181
+ # @param parameters [ComputePolicy] Parameters supplied to update the compute
182
+ # policy.
183
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
184
+ # will be added to the HTTP request.
185
+ #
186
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
187
+ #
188
+ def update_with_http_info(resource_group_name, account_name, compute_policy_name, parameters = nil, custom_headers = nil)
189
+ update_async(resource_group_name, account_name, compute_policy_name, parameters, custom_headers).value!
190
+ end
191
+
192
+ #
193
+ # Updates the specified compute policy.
194
+ #
195
+ # @param resource_group_name [String] The name of the Azure resource group that
196
+ # contains the Data Lake Analytics account.
197
+ # @param account_name [String] The name of the Data Lake Analytics account to
198
+ # which to update the compute policy.
199
+ # @param compute_policy_name [String] The name of the compute policy to update.
200
+ # @param parameters [ComputePolicy] Parameters supplied to update the compute
201
+ # policy.
202
+ # @param [Hash{String => String}] A hash of custom headers that will be added
203
+ # to the HTTP request.
204
+ #
205
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
206
+ #
207
+ def update_async(resource_group_name, account_name, compute_policy_name, parameters = nil, custom_headers = nil)
208
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
209
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
210
+ fail ArgumentError, 'compute_policy_name is nil' if compute_policy_name.nil?
211
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
212
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
213
+
214
+
215
+ request_headers = {}
216
+
217
+ # Set Headers
218
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
219
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
220
+
221
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
222
+
223
+ # Serialize Request
224
+ request_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicy.mapper()
225
+ request_content = @client.serialize(request_mapper, parameters)
226
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
227
+
228
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}'
229
+
230
+ request_url = @base_url || @client.base_url
231
+
232
+ options = {
233
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
234
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'computePolicyName' => compute_policy_name,'subscriptionId' => @client.subscription_id},
235
+ query_params: {'api-version' => @client.api_version},
236
+ body: request_content,
237
+ headers: request_headers.merge(custom_headers || {}),
238
+ base_url: request_url
239
+ }
240
+ promise = @client.make_request_async(:patch, path_template, options)
241
+
242
+ promise = promise.then do |result|
243
+ http_response = result.response
244
+ status_code = http_response.status
245
+ response_content = http_response.body
246
+ unless status_code == 200
247
+ error_model = JSON.load(response_content)
248
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
249
+ end
250
+
251
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
252
+ # Deserialize Response
253
+ if status_code == 200
254
+ begin
255
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
256
+ result_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicy.mapper()
257
+ result.body = @client.deserialize(result_mapper, parsed_response)
258
+ rescue Exception => e
259
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
260
+ end
261
+ end
262
+
263
+ result
264
+ end
265
+
266
+ promise.execute
267
+ end
268
+
269
+ #
270
+ # Deletes the specified compute policy from the specified Data Lake Analytics
271
+ # account
272
+ #
273
+ # @param resource_group_name [String] The name of the Azure resource group that
274
+ # contains the Data Lake Analytics account.
275
+ # @param account_name [String] The name of the Data Lake Analytics account from
276
+ # which to delete the compute policy.
277
+ # @param compute_policy_name [String] The name of the compute policy to delete.
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ #
282
+ def delete(resource_group_name, account_name, compute_policy_name, custom_headers = nil)
283
+ response = delete_async(resource_group_name, account_name, compute_policy_name, custom_headers).value!
284
+ nil
285
+ end
286
+
287
+ #
288
+ # Deletes the specified compute policy from the specified Data Lake Analytics
289
+ # account
290
+ #
291
+ # @param resource_group_name [String] The name of the Azure resource group that
292
+ # contains the Data Lake Analytics account.
293
+ # @param account_name [String] The name of the Data Lake Analytics account from
294
+ # which to delete the compute policy.
295
+ # @param compute_policy_name [String] The name of the compute policy to delete.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
300
+ #
301
+ def delete_with_http_info(resource_group_name, account_name, compute_policy_name, custom_headers = nil)
302
+ delete_async(resource_group_name, account_name, compute_policy_name, custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Deletes the specified compute policy from the specified Data Lake Analytics
307
+ # account
308
+ #
309
+ # @param resource_group_name [String] The name of the Azure resource group that
310
+ # contains the Data Lake Analytics account.
311
+ # @param account_name [String] The name of the Data Lake Analytics account from
312
+ # which to delete the compute policy.
313
+ # @param compute_policy_name [String] The name of the compute policy to delete.
314
+ # @param [Hash{String => String}] A hash of custom headers that will be added
315
+ # to the HTTP request.
316
+ #
317
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
318
+ #
319
+ def delete_async(resource_group_name, account_name, compute_policy_name, custom_headers = nil)
320
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
321
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
322
+ fail ArgumentError, 'compute_policy_name is nil' if compute_policy_name.nil?
323
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
324
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
325
+
326
+
327
+ request_headers = {}
328
+
329
+ # Set Headers
330
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
331
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
332
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}'
333
+
334
+ request_url = @base_url || @client.base_url
335
+
336
+ options = {
337
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
338
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'computePolicyName' => compute_policy_name,'subscriptionId' => @client.subscription_id},
339
+ query_params: {'api-version' => @client.api_version},
340
+ headers: request_headers.merge(custom_headers || {}),
341
+ base_url: request_url
342
+ }
343
+ promise = @client.make_request_async(:delete, path_template, options)
344
+
345
+ promise = promise.then do |result|
346
+ http_response = result.response
347
+ status_code = http_response.status
348
+ response_content = http_response.body
349
+ unless status_code == 200 || status_code == 204
350
+ error_model = JSON.load(response_content)
351
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
352
+ end
353
+
354
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
355
+
356
+ result
357
+ end
358
+
359
+ promise.execute
360
+ end
361
+
362
+ #
363
+ # Gets the specified Data Lake Analytics compute policy.
364
+ #
365
+ # @param resource_group_name [String] The name of the Azure resource group that
366
+ # contains the Data Lake Analytics account.
367
+ # @param account_name [String] The name of the Data Lake Analytics account from
368
+ # which to get the compute policy.
369
+ # @param compute_policy_name [String] The name of the compute policy to
370
+ # retrieve.
371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
+ # will be added to the HTTP request.
373
+ #
374
+ # @return [ComputePolicy] operation results.
375
+ #
376
+ def get(resource_group_name, account_name, compute_policy_name, custom_headers = nil)
377
+ response = get_async(resource_group_name, account_name, compute_policy_name, custom_headers).value!
378
+ response.body unless response.nil?
379
+ end
380
+
381
+ #
382
+ # Gets the specified Data Lake Analytics compute policy.
383
+ #
384
+ # @param resource_group_name [String] The name of the Azure resource group that
385
+ # contains the Data Lake Analytics account.
386
+ # @param account_name [String] The name of the Data Lake Analytics account from
387
+ # which to get the compute policy.
388
+ # @param compute_policy_name [String] The name of the compute policy to
389
+ # retrieve.
390
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
391
+ # will be added to the HTTP request.
392
+ #
393
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
394
+ #
395
+ def get_with_http_info(resource_group_name, account_name, compute_policy_name, custom_headers = nil)
396
+ get_async(resource_group_name, account_name, compute_policy_name, custom_headers).value!
397
+ end
398
+
399
+ #
400
+ # Gets the specified Data Lake Analytics compute policy.
401
+ #
402
+ # @param resource_group_name [String] The name of the Azure resource group that
403
+ # contains the Data Lake Analytics account.
404
+ # @param account_name [String] The name of the Data Lake Analytics account from
405
+ # which to get the compute policy.
406
+ # @param compute_policy_name [String] The name of the compute policy to
407
+ # retrieve.
408
+ # @param [Hash{String => String}] A hash of custom headers that will be added
409
+ # to the HTTP request.
410
+ #
411
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
412
+ #
413
+ def get_async(resource_group_name, account_name, compute_policy_name, custom_headers = nil)
414
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
415
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
416
+ fail ArgumentError, 'compute_policy_name is nil' if compute_policy_name.nil?
417
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
418
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
419
+
420
+
421
+ request_headers = {}
422
+
423
+ # Set Headers
424
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
425
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
426
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies/{computePolicyName}'
427
+
428
+ request_url = @base_url || @client.base_url
429
+
430
+ options = {
431
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
432
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'computePolicyName' => compute_policy_name,'subscriptionId' => @client.subscription_id},
433
+ query_params: {'api-version' => @client.api_version},
434
+ headers: request_headers.merge(custom_headers || {}),
435
+ base_url: request_url
436
+ }
437
+ promise = @client.make_request_async(:get, path_template, options)
438
+
439
+ promise = promise.then do |result|
440
+ http_response = result.response
441
+ status_code = http_response.status
442
+ response_content = http_response.body
443
+ unless status_code == 200
444
+ error_model = JSON.load(response_content)
445
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
446
+ end
447
+
448
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
449
+ # Deserialize Response
450
+ if status_code == 200
451
+ begin
452
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
453
+ result_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicy.mapper()
454
+ result.body = @client.deserialize(result_mapper, parsed_response)
455
+ rescue Exception => e
456
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
457
+ end
458
+ end
459
+
460
+ result
461
+ end
462
+
463
+ promise.execute
464
+ end
465
+
466
+ #
467
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
468
+ # Analytics account. An account supports, at most, 50 policies
469
+ #
470
+ # @param resource_group_name [String] The name of the Azure resource group that
471
+ # contains the Data Lake Analytics account.
472
+ # @param account_name [String] The name of the Data Lake Analytics account from
473
+ # which to get the compute policies.
474
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
475
+ # will be added to the HTTP request.
476
+ #
477
+ # @return [Array<ComputePolicy>] operation results.
478
+ #
479
+ def list_by_account(resource_group_name, account_name, custom_headers = nil)
480
+ first_page = list_by_account_as_lazy(resource_group_name, account_name, custom_headers)
481
+ first_page.get_all_items
482
+ end
483
+
484
+ #
485
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
486
+ # Analytics account. An account supports, at most, 50 policies
487
+ #
488
+ # @param resource_group_name [String] The name of the Azure resource group that
489
+ # contains the Data Lake Analytics account.
490
+ # @param account_name [String] The name of the Data Lake Analytics account from
491
+ # which to get the compute policies.
492
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
493
+ # will be added to the HTTP request.
494
+ #
495
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
496
+ #
497
+ def list_by_account_with_http_info(resource_group_name, account_name, custom_headers = nil)
498
+ list_by_account_async(resource_group_name, account_name, custom_headers).value!
499
+ end
500
+
501
+ #
502
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
503
+ # Analytics account. An account supports, at most, 50 policies
504
+ #
505
+ # @param resource_group_name [String] The name of the Azure resource group that
506
+ # contains the Data Lake Analytics account.
507
+ # @param account_name [String] The name of the Data Lake Analytics account from
508
+ # which to get the compute policies.
509
+ # @param [Hash{String => String}] A hash of custom headers that will be added
510
+ # to the HTTP request.
511
+ #
512
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
513
+ #
514
+ def list_by_account_async(resource_group_name, account_name, custom_headers = nil)
515
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
516
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
517
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
518
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
519
+
520
+
521
+ request_headers = {}
522
+
523
+ # Set Headers
524
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
525
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
526
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/computePolicies'
527
+
528
+ request_url = @base_url || @client.base_url
529
+
530
+ options = {
531
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
532
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
533
+ query_params: {'api-version' => @client.api_version},
534
+ headers: request_headers.merge(custom_headers || {}),
535
+ base_url: request_url
536
+ }
537
+ promise = @client.make_request_async(:get, path_template, options)
538
+
539
+ promise = promise.then do |result|
540
+ http_response = result.response
541
+ status_code = http_response.status
542
+ response_content = http_response.body
543
+ unless status_code == 200
544
+ error_model = JSON.load(response_content)
545
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
546
+ end
547
+
548
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
549
+ # Deserialize Response
550
+ if status_code == 200
551
+ begin
552
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
553
+ result_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicyListResult.mapper()
554
+ result.body = @client.deserialize(result_mapper, parsed_response)
555
+ rescue Exception => e
556
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
557
+ end
558
+ end
559
+
560
+ result
561
+ end
562
+
563
+ promise.execute
564
+ end
565
+
566
+ #
567
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
568
+ # Analytics account. An account supports, at most, 50 policies
569
+ #
570
+ # @param next_page_link [String] The NextLink from the previous successful call
571
+ # to List operation.
572
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
573
+ # will be added to the HTTP request.
574
+ #
575
+ # @return [ComputePolicyListResult] operation results.
576
+ #
577
+ def list_by_account_next(next_page_link, custom_headers = nil)
578
+ response = list_by_account_next_async(next_page_link, custom_headers).value!
579
+ response.body unless response.nil?
580
+ end
581
+
582
+ #
583
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
584
+ # Analytics account. An account supports, at most, 50 policies
585
+ #
586
+ # @param next_page_link [String] The NextLink from the previous successful call
587
+ # to List operation.
588
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
589
+ # will be added to the HTTP request.
590
+ #
591
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
592
+ #
593
+ def list_by_account_next_with_http_info(next_page_link, custom_headers = nil)
594
+ list_by_account_next_async(next_page_link, custom_headers).value!
595
+ end
596
+
597
+ #
598
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
599
+ # Analytics account. An account supports, at most, 50 policies
600
+ #
601
+ # @param next_page_link [String] The NextLink from the previous successful call
602
+ # to List operation.
603
+ # @param [Hash{String => String}] A hash of custom headers that will be added
604
+ # to the HTTP request.
605
+ #
606
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
607
+ #
608
+ def list_by_account_next_async(next_page_link, custom_headers = nil)
609
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
610
+
611
+
612
+ request_headers = {}
613
+
614
+ # Set Headers
615
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
616
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
617
+ path_template = '{nextLink}'
618
+
619
+ request_url = @base_url || @client.base_url
620
+
621
+ options = {
622
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
623
+ skip_encoding_path_params: {'nextLink' => next_page_link},
624
+ headers: request_headers.merge(custom_headers || {}),
625
+ base_url: request_url
626
+ }
627
+ promise = @client.make_request_async(:get, path_template, options)
628
+
629
+ promise = promise.then do |result|
630
+ http_response = result.response
631
+ status_code = http_response.status
632
+ response_content = http_response.body
633
+ unless status_code == 200
634
+ error_model = JSON.load(response_content)
635
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
636
+ end
637
+
638
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
639
+ # Deserialize Response
640
+ if status_code == 200
641
+ begin
642
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
643
+ result_mapper = Azure::ARM::DataLakeAnalytics::Models::ComputePolicyListResult.mapper()
644
+ result.body = @client.deserialize(result_mapper, parsed_response)
645
+ rescue Exception => e
646
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
647
+ end
648
+ end
649
+
650
+ result
651
+ end
652
+
653
+ promise.execute
654
+ end
655
+
656
+ #
657
+ # Lists the Data Lake Analytics compute policies within the specified Data Lake
658
+ # Analytics account. An account supports, at most, 50 policies
659
+ #
660
+ # @param resource_group_name [String] The name of the Azure resource group that
661
+ # contains the Data Lake Analytics account.
662
+ # @param account_name [String] The name of the Data Lake Analytics account from
663
+ # which to get the compute policies.
664
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
665
+ # will be added to the HTTP request.
666
+ #
667
+ # @return [ComputePolicyListResult] which provide lazy access to pages of the
668
+ # response.
669
+ #
670
+ def list_by_account_as_lazy(resource_group_name, account_name, custom_headers = nil)
671
+ response = list_by_account_async(resource_group_name, account_name, custom_headers).value!
672
+ unless response.nil?
673
+ page = response.body
674
+ page.next_method = Proc.new do |next_page_link|
675
+ list_by_account_next_async(next_page_link, custom_headers)
676
+ end
677
+ page
678
+ end
679
+ end
680
+
681
+ end
682
+ end