azure_mgmt_redis 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-08-01/generated/azure_mgmt_redis/redis.rb +66 -62
  3. data/lib/2015-08-01/generated/azure_mgmt_redis/redis_management_client.rb +4 -1
  4. data/lib/2016-04-01/generated/azure_mgmt_redis/firewall_rules.rb +15 -13
  5. data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +1 -1
  6. data/lib/2016-04-01/generated/azure_mgmt_redis/operations.rb +15 -13
  7. data/lib/2016-04-01/generated/azure_mgmt_redis/patch_schedules.rb +18 -17
  8. data/lib/2016-04-01/generated/azure_mgmt_redis/redis.rb +100 -99
  9. data/lib/2016-04-01/generated/azure_mgmt_redis/redis_firewall_rule_operations.rb +18 -17
  10. data/lib/2016-04-01/generated/azure_mgmt_redis/redis_management_client.rb +4 -1
  11. data/lib/2017-02-01/generated/azure_mgmt_redis/firewall_rules.rb +33 -30
  12. data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +1 -1
  13. data/lib/2017-02-01/generated/azure_mgmt_redis/operations.rb +15 -13
  14. data/lib/2017-02-01/generated/azure_mgmt_redis/patch_schedules.rb +18 -17
  15. data/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb +100 -99
  16. data/lib/2017-02-01/generated/azure_mgmt_redis/redis_linked_server_operations.rb +28 -26
  17. data/lib/2017-02-01/generated/azure_mgmt_redis/redis_management_client.rb +4 -1
  18. data/lib/2017-10-01/generated/azure_mgmt_redis.rb +64 -0
  19. data/lib/2017-10-01/generated/azure_mgmt_redis/firewall_rules.rb +528 -0
  20. data/lib/2017-10-01/generated/azure_mgmt_redis/linked_server.rb +594 -0
  21. data/lib/2017-10-01/generated/azure_mgmt_redis/models/day_of_week.rb +23 -0
  22. data/lib/2017-10-01/generated/azure_mgmt_redis/models/export_rdbparameters.rb +68 -0
  23. data/lib/2017-10-01/generated/azure_mgmt_redis/models/import_rdbparameters.rb +65 -0
  24. data/lib/2017-10-01/generated/azure_mgmt_redis/models/operation.rb +58 -0
  25. data/lib/2017-10-01/generated/azure_mgmt_redis/models/operation_display.rb +80 -0
  26. data/lib/2017-10-01/generated/azure_mgmt_redis/models/operation_list_result.rb +102 -0
  27. data/lib/2017-10-01/generated/azure_mgmt_redis/models/proxy_resource.rb +63 -0
  28. data/lib/2017-10-01/generated/azure_mgmt_redis/models/reboot_type.rb +17 -0
  29. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_access_keys.rb +61 -0
  30. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_create_parameters.rb +192 -0
  31. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule.rb +85 -0
  32. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule_create_parameters.rb +57 -0
  33. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb +100 -0
  34. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_force_reboot_response.rb +47 -0
  35. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_key_type.rb +16 -0
  36. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server.rb +47 -0
  37. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_create_parameters.rb +70 -0
  38. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_with_properties.rb +110 -0
  39. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_with_properties_list.rb +100 -0
  40. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_list_result.rb +99 -0
  41. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_patch_schedule.rb +83 -0
  42. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +60 -0
  43. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +48 -0
  44. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_resource.rb +309 -0
  45. data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +130 -0
  46. data/lib/2017-10-01/generated/azure_mgmt_redis/models/replication_role.rb +16 -0
  47. data/lib/2017-10-01/generated/azure_mgmt_redis/models/resource.rb +71 -0
  48. data/lib/2017-10-01/generated/azure_mgmt_redis/models/schedule_entry.rb +72 -0
  49. data/lib/2017-10-01/generated/azure_mgmt_redis/models/sku.rb +73 -0
  50. data/lib/2017-10-01/generated/azure_mgmt_redis/models/sku_family.rb +16 -0
  51. data/lib/2017-10-01/generated/azure_mgmt_redis/models/sku_name.rb +17 -0
  52. data/lib/2017-10-01/generated/azure_mgmt_redis/models/tracked_resource.rb +92 -0
  53. data/lib/2017-10-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
  54. data/lib/2017-10-01/generated/azure_mgmt_redis/operations.rb +222 -0
  55. data/lib/2017-10-01/generated/azure_mgmt_redis/patch_schedules.rb +317 -0
  56. data/lib/2017-10-01/generated/azure_mgmt_redis/redis.rb +1482 -0
  57. data/lib/2017-10-01/generated/azure_mgmt_redis/redis_management_client.rb +148 -0
  58. data/lib/azure_mgmt_redis.rb +1 -0
  59. data/lib/profiles/latest/modules/redis_profile_module.rb +166 -147
  60. data/lib/profiles/latest/redis_latest_profile_client.rb +28 -9
  61. data/lib/profiles/latest/redis_module_definition.rb +0 -1
  62. data/lib/version.rb +1 -1
  63. metadata +43 -3
@@ -35,8 +35,8 @@ module Azure::Redis::Mgmt::V2017_02_01
35
35
  #
36
36
  # @return [RedisLinkedServerWithProperties] operation results.
37
37
  #
38
- def create(resource_group_name, name, linked_server_name, parameters, custom_headers = nil)
39
- response = create_async(resource_group_name, name, linked_server_name, parameters, custom_headers).value!
38
+ def create(resource_group_name, name, linked_server_name, parameters, custom_headers:nil)
39
+ response = create_async(resource_group_name, name, linked_server_name, parameters, custom_headers:custom_headers).value!
40
40
  response.body unless response.nil?
41
41
  end
42
42
 
@@ -53,9 +53,9 @@ module Azure::Redis::Mgmt::V2017_02_01
53
53
  # @return [Concurrent::Promise] promise which provides async access to http
54
54
  # response.
55
55
  #
56
- def create_async(resource_group_name, name, linked_server_name, parameters, custom_headers = nil)
56
+ def create_async(resource_group_name, name, linked_server_name, parameters, custom_headers:nil)
57
57
  # Send request
58
- promise = begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers)
58
+ promise = begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers:custom_headers)
59
59
 
60
60
  promise = promise.then do |response|
61
61
  # Defining deserialization method.
@@ -82,8 +82,8 @@ module Azure::Redis::Mgmt::V2017_02_01
82
82
  # will be added to the HTTP request.
83
83
  #
84
84
  #
85
- def delete(resource_group_name, name, linked_server_name, custom_headers = nil)
86
- response = delete_async(resource_group_name, name, linked_server_name, custom_headers).value!
85
+ def delete(resource_group_name, name, linked_server_name, custom_headers:nil)
86
+ response = delete_async(resource_group_name, name, linked_server_name, custom_headers:custom_headers).value!
87
87
  nil
88
88
  end
89
89
 
@@ -99,8 +99,8 @@ module Azure::Redis::Mgmt::V2017_02_01
99
99
  #
100
100
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
101
101
  #
102
- def delete_with_http_info(resource_group_name, name, linked_server_name, custom_headers = nil)
103
- delete_async(resource_group_name, name, linked_server_name, custom_headers).value!
102
+ def delete_with_http_info(resource_group_name, name, linked_server_name, custom_headers:nil)
103
+ delete_async(resource_group_name, name, linked_server_name, custom_headers:custom_headers).value!
104
104
  end
105
105
 
106
106
  #
@@ -115,7 +115,7 @@ module Azure::Redis::Mgmt::V2017_02_01
115
115
  #
116
116
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
117
117
  #
118
- def delete_async(resource_group_name, name, linked_server_name, custom_headers = nil)
118
+ def delete_async(resource_group_name, name, linked_server_name, custom_headers:nil)
119
119
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
120
120
  fail ArgumentError, 'name is nil' if name.nil?
121
121
  fail ArgumentError, 'linked_server_name is nil' if linked_server_name.nil?
@@ -124,6 +124,7 @@ module Azure::Redis::Mgmt::V2017_02_01
124
124
 
125
125
 
126
126
  request_headers = {}
127
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
127
128
 
128
129
  # Set Headers
129
130
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -170,8 +171,8 @@ module Azure::Redis::Mgmt::V2017_02_01
170
171
  #
171
172
  # @return [RedisLinkedServerWithProperties] operation results.
172
173
  #
173
- def get(resource_group_name, name, linked_server_name, custom_headers = nil)
174
- response = get_async(resource_group_name, name, linked_server_name, custom_headers).value!
174
+ def get(resource_group_name, name, linked_server_name, custom_headers:nil)
175
+ response = get_async(resource_group_name, name, linked_server_name, custom_headers:custom_headers).value!
175
176
  response.body unless response.nil?
176
177
  end
177
178
 
@@ -187,8 +188,8 @@ module Azure::Redis::Mgmt::V2017_02_01
187
188
  #
188
189
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
189
190
  #
190
- def get_with_http_info(resource_group_name, name, linked_server_name, custom_headers = nil)
191
- get_async(resource_group_name, name, linked_server_name, custom_headers).value!
191
+ def get_with_http_info(resource_group_name, name, linked_server_name, custom_headers:nil)
192
+ get_async(resource_group_name, name, linked_server_name, custom_headers:custom_headers).value!
192
193
  end
193
194
 
194
195
  #
@@ -203,7 +204,7 @@ module Azure::Redis::Mgmt::V2017_02_01
203
204
  #
204
205
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
205
206
  #
206
- def get_async(resource_group_name, name, linked_server_name, custom_headers = nil)
207
+ def get_async(resource_group_name, name, linked_server_name, custom_headers:nil)
207
208
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
208
209
  fail ArgumentError, 'name is nil' if name.nil?
209
210
  fail ArgumentError, 'linked_server_name is nil' if linked_server_name.nil?
@@ -212,6 +213,7 @@ module Azure::Redis::Mgmt::V2017_02_01
212
213
 
213
214
 
214
215
  request_headers = {}
216
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
215
217
 
216
218
  # Set Headers
217
219
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -267,8 +269,8 @@ module Azure::Redis::Mgmt::V2017_02_01
267
269
  #
268
270
  # @return [RedisLinkedServerWithPropertiesList] operation results.
269
271
  #
270
- def list(resource_group_name, name, custom_headers = nil)
271
- response = list_async(resource_group_name, name, custom_headers).value!
272
+ def list(resource_group_name, name, custom_headers:nil)
273
+ response = list_async(resource_group_name, name, custom_headers:custom_headers).value!
272
274
  response.body unless response.nil?
273
275
  end
274
276
 
@@ -283,8 +285,8 @@ module Azure::Redis::Mgmt::V2017_02_01
283
285
  #
284
286
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
285
287
  #
286
- def list_with_http_info(resource_group_name, name, custom_headers = nil)
287
- list_async(resource_group_name, name, custom_headers).value!
288
+ def list_with_http_info(resource_group_name, name, custom_headers:nil)
289
+ list_async(resource_group_name, name, custom_headers:custom_headers).value!
288
290
  end
289
291
 
290
292
  #
@@ -298,7 +300,7 @@ module Azure::Redis::Mgmt::V2017_02_01
298
300
  #
299
301
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
300
302
  #
301
- def list_async(resource_group_name, name, custom_headers = nil)
303
+ def list_async(resource_group_name, name, custom_headers:nil)
302
304
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
303
305
  fail ArgumentError, 'name is nil' if name.nil?
304
306
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -306,6 +308,7 @@ module Azure::Redis::Mgmt::V2017_02_01
306
308
 
307
309
 
308
310
  request_headers = {}
311
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
309
312
 
310
313
  # Set Headers
311
314
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -364,8 +367,8 @@ module Azure::Redis::Mgmt::V2017_02_01
364
367
  #
365
368
  # @return [RedisLinkedServerWithProperties] operation results.
366
369
  #
367
- def begin_create(resource_group_name, name, linked_server_name, parameters, custom_headers = nil)
368
- response = begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers).value!
370
+ def begin_create(resource_group_name, name, linked_server_name, parameters, custom_headers:nil)
371
+ response = begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers:custom_headers).value!
369
372
  response.body unless response.nil?
370
373
  end
371
374
 
@@ -383,8 +386,8 @@ module Azure::Redis::Mgmt::V2017_02_01
383
386
  #
384
387
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
385
388
  #
386
- def begin_create_with_http_info(resource_group_name, name, linked_server_name, parameters, custom_headers = nil)
387
- begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers).value!
389
+ def begin_create_with_http_info(resource_group_name, name, linked_server_name, parameters, custom_headers:nil)
390
+ begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers:custom_headers).value!
388
391
  end
389
392
 
390
393
  #
@@ -401,7 +404,7 @@ module Azure::Redis::Mgmt::V2017_02_01
401
404
  #
402
405
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
403
406
  #
404
- def begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers = nil)
407
+ def begin_create_async(resource_group_name, name, linked_server_name, parameters, custom_headers:nil)
405
408
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
406
409
  fail ArgumentError, 'name is nil' if name.nil?
407
410
  fail ArgumentError, 'linked_server_name is nil' if linked_server_name.nil?
@@ -411,13 +414,12 @@ module Azure::Redis::Mgmt::V2017_02_01
411
414
 
412
415
 
413
416
  request_headers = {}
417
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
414
418
 
415
419
  # Set Headers
416
420
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
417
421
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
418
422
 
419
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
420
-
421
423
  # Serialize Request
422
424
  request_mapper = Azure::Redis::Mgmt::V2017_02_01::Models::RedisLinkedServerCreateParameters.mapper()
423
425
  request_content = @client.serialize(request_mapper, parameters)
@@ -122,6 +122,9 @@ module Azure::Redis::Mgmt::V2017_02_01
122
122
  fail ArgumentError, 'path is nil' if path.nil?
123
123
 
124
124
  request_url = options[:base_url] || @base_url
125
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
126
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
127
+ end
125
128
 
126
129
  request_headers = @request_headers
127
130
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
@@ -138,7 +141,7 @@ module Azure::Redis::Mgmt::V2017_02_01
138
141
  #
139
142
  def add_telemetry
140
143
  sdk_information = 'azure_mgmt_redis'
141
- sdk_information = "#{sdk_information}/0.15.2"
144
+ sdk_information = "#{sdk_information}/0.16.0"
142
145
  add_user_agent_information(sdk_information)
143
146
  end
144
147
  end
@@ -0,0 +1,64 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-10-01/generated/azure_mgmt_redis/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Redis::Mgmt::V2017_10_01
23
+ autoload :Operations, '2017-10-01/generated/azure_mgmt_redis/operations.rb'
24
+ autoload :Redis, '2017-10-01/generated/azure_mgmt_redis/redis.rb'
25
+ autoload :FirewallRules, '2017-10-01/generated/azure_mgmt_redis/firewall_rules.rb'
26
+ autoload :PatchSchedules, '2017-10-01/generated/azure_mgmt_redis/patch_schedules.rb'
27
+ autoload :LinkedServer, '2017-10-01/generated/azure_mgmt_redis/linked_server.rb'
28
+ autoload :RedisManagementClient, '2017-10-01/generated/azure_mgmt_redis/redis_management_client.rb'
29
+
30
+ module Models
31
+ autoload :RedisListResult, '2017-10-01/generated/azure_mgmt_redis/models/redis_list_result.rb'
32
+ autoload :Sku, '2017-10-01/generated/azure_mgmt_redis/models/sku.rb'
33
+ autoload :RedisRegenerateKeyParameters, '2017-10-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb'
34
+ autoload :RedisFirewallRuleListResult, '2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb'
35
+ autoload :RedisAccessKeys, '2017-10-01/generated/azure_mgmt_redis/models/redis_access_keys.rb'
36
+ autoload :OperationDisplay, '2017-10-01/generated/azure_mgmt_redis/models/operation_display.rb'
37
+ autoload :Resource, '2017-10-01/generated/azure_mgmt_redis/models/resource.rb'
38
+ autoload :OperationListResult, '2017-10-01/generated/azure_mgmt_redis/models/operation_list_result.rb'
39
+ autoload :RedisLinkedServerCreateParameters, '2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_create_parameters.rb'
40
+ autoload :RedisUpdateParameters, '2017-10-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb'
41
+ autoload :RedisRebootParameters, '2017-10-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb'
42
+ autoload :RedisFirewallRuleCreateParameters, '2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule_create_parameters.rb'
43
+ autoload :ExportRDBParameters, '2017-10-01/generated/azure_mgmt_redis/models/export_rdbparameters.rb'
44
+ autoload :ImportRDBParameters, '2017-10-01/generated/azure_mgmt_redis/models/import_rdbparameters.rb'
45
+ autoload :Operation, '2017-10-01/generated/azure_mgmt_redis/models/operation.rb'
46
+ autoload :ScheduleEntry, '2017-10-01/generated/azure_mgmt_redis/models/schedule_entry.rb'
47
+ autoload :RedisCreateParameters, '2017-10-01/generated/azure_mgmt_redis/models/redis_create_parameters.rb'
48
+ autoload :RedisLinkedServerWithPropertiesList, '2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_with_properties_list.rb'
49
+ autoload :RedisLinkedServer, '2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server.rb'
50
+ autoload :RedisForceRebootResponse, '2017-10-01/generated/azure_mgmt_redis/models/redis_force_reboot_response.rb'
51
+ autoload :ProxyResource, '2017-10-01/generated/azure_mgmt_redis/models/proxy_resource.rb'
52
+ autoload :TrackedResource, '2017-10-01/generated/azure_mgmt_redis/models/tracked_resource.rb'
53
+ autoload :RedisFirewallRule, '2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule.rb'
54
+ autoload :RedisResource, '2017-10-01/generated/azure_mgmt_redis/models/redis_resource.rb'
55
+ autoload :RedisPatchSchedule, '2017-10-01/generated/azure_mgmt_redis/models/redis_patch_schedule.rb'
56
+ autoload :RedisLinkedServerWithProperties, '2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_with_properties.rb'
57
+ autoload :SkuName, '2017-10-01/generated/azure_mgmt_redis/models/sku_name.rb'
58
+ autoload :SkuFamily, '2017-10-01/generated/azure_mgmt_redis/models/sku_family.rb'
59
+ autoload :RedisKeyType, '2017-10-01/generated/azure_mgmt_redis/models/redis_key_type.rb'
60
+ autoload :RebootType, '2017-10-01/generated/azure_mgmt_redis/models/reboot_type.rb'
61
+ autoload :DayOfWeek, '2017-10-01/generated/azure_mgmt_redis/models/day_of_week.rb'
62
+ autoload :ReplicationRole, '2017-10-01/generated/azure_mgmt_redis/models/replication_role.rb'
63
+ end
64
+ end
@@ -0,0 +1,528 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Redis::Mgmt::V2017_10_01
7
+ #
8
+ # REST API for Azure Redis Cache Service.
9
+ #
10
+ class FirewallRules
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the FirewallRules class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RedisManagementClient] reference to the RedisManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all firewall rules in the specified redis cache.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param cache_name [String] The name of the Redis cache.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<RedisFirewallRule>] operation results.
33
+ #
34
+ def list_by_redis_resource(resource_group_name, cache_name, custom_headers:nil)
35
+ first_page = list_by_redis_resource_as_lazy(resource_group_name, cache_name, custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Gets all firewall rules in the specified redis cache.
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group.
43
+ # @param cache_name [String] The name of the Redis cache.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_by_redis_resource_with_http_info(resource_group_name, cache_name, custom_headers:nil)
50
+ list_by_redis_resource_async(resource_group_name, cache_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets all firewall rules in the specified redis cache.
55
+ #
56
+ # @param resource_group_name [String] The name of the resource group.
57
+ # @param cache_name [String] The name of the Redis cache.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_by_redis_resource_async(resource_group_name, cache_name, custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
67
+ fail ArgumentError, 'cache_name is nil' if cache_name.nil?
68
+
69
+
70
+ request_headers = {}
71
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
72
+
73
+ # Set Headers
74
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'
77
+
78
+ request_url = @base_url || @client.base_url
79
+
80
+ options = {
81
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
82
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'cacheName' => cache_name},
83
+ query_params: {'api-version' => @client.api_version},
84
+ headers: request_headers.merge(custom_headers || {}),
85
+ base_url: request_url
86
+ }
87
+ promise = @client.make_request_async(:get, path_template, options)
88
+
89
+ promise = promise.then do |result|
90
+ http_response = result.response
91
+ status_code = http_response.status
92
+ response_content = http_response.body
93
+ unless status_code == 200
94
+ error_model = JSON.load(response_content)
95
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
96
+ end
97
+
98
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
99
+ # Deserialize Response
100
+ if status_code == 200
101
+ begin
102
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
103
+ result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisFirewallRuleListResult.mapper()
104
+ result.body = @client.deserialize(result_mapper, parsed_response)
105
+ rescue Exception => e
106
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
107
+ end
108
+ end
109
+
110
+ result
111
+ end
112
+
113
+ promise.execute
114
+ end
115
+
116
+ #
117
+ # Create or update a redis cache firewall rule
118
+ #
119
+ # @param resource_group_name [String] The name of the resource group.
120
+ # @param cache_name [String] The name of the Redis cache.
121
+ # @param rule_name [String] The name of the firewall rule.
122
+ # @param parameters [RedisFirewallRuleCreateParameters] Parameters supplied to
123
+ # the create or update redis firewall rule operation.
124
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
125
+ # will be added to the HTTP request.
126
+ #
127
+ # @return [RedisFirewallRule] operation results.
128
+ #
129
+ def create_or_update(resource_group_name, cache_name, rule_name, parameters, custom_headers:nil)
130
+ response = create_or_update_async(resource_group_name, cache_name, rule_name, parameters, custom_headers:custom_headers).value!
131
+ response.body unless response.nil?
132
+ end
133
+
134
+ #
135
+ # Create or update a redis cache firewall rule
136
+ #
137
+ # @param resource_group_name [String] The name of the resource group.
138
+ # @param cache_name [String] The name of the Redis cache.
139
+ # @param rule_name [String] The name of the firewall rule.
140
+ # @param parameters [RedisFirewallRuleCreateParameters] Parameters supplied to
141
+ # the create or update redis firewall rule operation.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
146
+ #
147
+ def create_or_update_with_http_info(resource_group_name, cache_name, rule_name, parameters, custom_headers:nil)
148
+ create_or_update_async(resource_group_name, cache_name, rule_name, parameters, custom_headers:custom_headers).value!
149
+ end
150
+
151
+ #
152
+ # Create or update a redis cache firewall rule
153
+ #
154
+ # @param resource_group_name [String] The name of the resource group.
155
+ # @param cache_name [String] The name of the Redis cache.
156
+ # @param rule_name [String] The name of the firewall rule.
157
+ # @param parameters [RedisFirewallRuleCreateParameters] Parameters supplied to
158
+ # the create or update redis firewall rule operation.
159
+ # @param [Hash{String => String}] A hash of custom headers that will be added
160
+ # to the HTTP request.
161
+ #
162
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
163
+ #
164
+ def create_or_update_async(resource_group_name, cache_name, rule_name, parameters, custom_headers:nil)
165
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
166
+ fail ArgumentError, 'cache_name is nil' if cache_name.nil?
167
+ fail ArgumentError, 'rule_name is nil' if rule_name.nil?
168
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
169
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
170
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
171
+
172
+
173
+ request_headers = {}
174
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
175
+
176
+ # Set Headers
177
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
178
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
179
+
180
+ # Serialize Request
181
+ request_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisFirewallRuleCreateParameters.mapper()
182
+ request_content = @client.serialize(request_mapper, parameters)
183
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
184
+
185
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
+ options = {
190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
+ path_params: {'resourceGroupName' => resource_group_name,'cacheName' => cache_name,'ruleName' => rule_name,'subscriptionId' => @client.subscription_id},
192
+ query_params: {'api-version' => @client.api_version},
193
+ body: request_content,
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:put, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200 || status_code == 201
204
+ error_model = JSON.load(response_content)
205
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ # Deserialize Response
210
+ if status_code == 200
211
+ begin
212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
+ result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisFirewallRule.mapper()
214
+ result.body = @client.deserialize(result_mapper, parsed_response)
215
+ rescue Exception => e
216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
217
+ end
218
+ end
219
+ # Deserialize Response
220
+ if status_code == 201
221
+ begin
222
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
223
+ result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisFirewallRule.mapper()
224
+ result.body = @client.deserialize(result_mapper, parsed_response)
225
+ rescue Exception => e
226
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
227
+ end
228
+ end
229
+
230
+ result
231
+ end
232
+
233
+ promise.execute
234
+ end
235
+
236
+ #
237
+ # Gets a single firewall rule in a specified redis cache.
238
+ #
239
+ # @param resource_group_name [String] The name of the resource group.
240
+ # @param cache_name [String] The name of the Redis cache.
241
+ # @param rule_name [String] The name of the firewall rule.
242
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
+ # will be added to the HTTP request.
244
+ #
245
+ # @return [RedisFirewallRule] operation results.
246
+ #
247
+ def get(resource_group_name, cache_name, rule_name, custom_headers:nil)
248
+ response = get_async(resource_group_name, cache_name, rule_name, custom_headers:custom_headers).value!
249
+ response.body unless response.nil?
250
+ end
251
+
252
+ #
253
+ # Gets a single firewall rule in a specified redis cache.
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group.
256
+ # @param cache_name [String] The name of the Redis cache.
257
+ # @param rule_name [String] The name of the firewall rule.
258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
259
+ # will be added to the HTTP request.
260
+ #
261
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
262
+ #
263
+ def get_with_http_info(resource_group_name, cache_name, rule_name, custom_headers:nil)
264
+ get_async(resource_group_name, cache_name, rule_name, custom_headers:custom_headers).value!
265
+ end
266
+
267
+ #
268
+ # Gets a single firewall rule in a specified redis cache.
269
+ #
270
+ # @param resource_group_name [String] The name of the resource group.
271
+ # @param cache_name [String] The name of the Redis cache.
272
+ # @param rule_name [String] The name of the firewall rule.
273
+ # @param [Hash{String => String}] A hash of custom headers that will be added
274
+ # to the HTTP request.
275
+ #
276
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
277
+ #
278
+ def get_async(resource_group_name, cache_name, rule_name, custom_headers:nil)
279
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
280
+ fail ArgumentError, 'cache_name is nil' if cache_name.nil?
281
+ fail ArgumentError, 'rule_name is nil' if rule_name.nil?
282
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
283
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
284
+
285
+
286
+ request_headers = {}
287
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
288
+
289
+ # Set Headers
290
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
291
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
292
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'
293
+
294
+ request_url = @base_url || @client.base_url
295
+
296
+ options = {
297
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
298
+ path_params: {'resourceGroupName' => resource_group_name,'cacheName' => cache_name,'ruleName' => rule_name,'subscriptionId' => @client.subscription_id},
299
+ query_params: {'api-version' => @client.api_version},
300
+ headers: request_headers.merge(custom_headers || {}),
301
+ base_url: request_url
302
+ }
303
+ promise = @client.make_request_async(:get, path_template, options)
304
+
305
+ promise = promise.then do |result|
306
+ http_response = result.response
307
+ status_code = http_response.status
308
+ response_content = http_response.body
309
+ unless status_code == 200
310
+ error_model = JSON.load(response_content)
311
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
312
+ end
313
+
314
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
315
+ # Deserialize Response
316
+ if status_code == 200
317
+ begin
318
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
319
+ result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisFirewallRule.mapper()
320
+ result.body = @client.deserialize(result_mapper, parsed_response)
321
+ rescue Exception => e
322
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
323
+ end
324
+ end
325
+
326
+ result
327
+ end
328
+
329
+ promise.execute
330
+ end
331
+
332
+ #
333
+ # Deletes a single firewall rule in a specified redis cache.
334
+ #
335
+ # @param resource_group_name [String] The name of the resource group.
336
+ # @param cache_name [String] The name of the Redis cache.
337
+ # @param rule_name [String] The name of the firewall rule.
338
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
339
+ # will be added to the HTTP request.
340
+ #
341
+ #
342
+ def delete(resource_group_name, cache_name, rule_name, custom_headers:nil)
343
+ response = delete_async(resource_group_name, cache_name, rule_name, custom_headers:custom_headers).value!
344
+ nil
345
+ end
346
+
347
+ #
348
+ # Deletes a single firewall rule in a specified redis cache.
349
+ #
350
+ # @param resource_group_name [String] The name of the resource group.
351
+ # @param cache_name [String] The name of the Redis cache.
352
+ # @param rule_name [String] The name of the firewall rule.
353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
354
+ # will be added to the HTTP request.
355
+ #
356
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
357
+ #
358
+ def delete_with_http_info(resource_group_name, cache_name, rule_name, custom_headers:nil)
359
+ delete_async(resource_group_name, cache_name, rule_name, custom_headers:custom_headers).value!
360
+ end
361
+
362
+ #
363
+ # Deletes a single firewall rule in a specified redis cache.
364
+ #
365
+ # @param resource_group_name [String] The name of the resource group.
366
+ # @param cache_name [String] The name of the Redis cache.
367
+ # @param rule_name [String] The name of the firewall rule.
368
+ # @param [Hash{String => String}] A hash of custom headers that will be added
369
+ # to the HTTP request.
370
+ #
371
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
372
+ #
373
+ def delete_async(resource_group_name, cache_name, rule_name, custom_headers:nil)
374
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
375
+ fail ArgumentError, 'cache_name is nil' if cache_name.nil?
376
+ fail ArgumentError, 'rule_name is nil' if rule_name.nil?
377
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
378
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
379
+
380
+
381
+ request_headers = {}
382
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
383
+
384
+ # Set Headers
385
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
386
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
387
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'
388
+
389
+ request_url = @base_url || @client.base_url
390
+
391
+ options = {
392
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
393
+ path_params: {'resourceGroupName' => resource_group_name,'cacheName' => cache_name,'ruleName' => rule_name,'subscriptionId' => @client.subscription_id},
394
+ query_params: {'api-version' => @client.api_version},
395
+ headers: request_headers.merge(custom_headers || {}),
396
+ base_url: request_url
397
+ }
398
+ promise = @client.make_request_async(:delete, path_template, options)
399
+
400
+ promise = promise.then do |result|
401
+ http_response = result.response
402
+ status_code = http_response.status
403
+ response_content = http_response.body
404
+ unless status_code == 200 || status_code == 204
405
+ error_model = JSON.load(response_content)
406
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
407
+ end
408
+
409
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
410
+
411
+ result
412
+ end
413
+
414
+ promise.execute
415
+ end
416
+
417
+ #
418
+ # Gets all firewall rules in the specified redis cache.
419
+ #
420
+ # @param next_page_link [String] The NextLink from the previous successful call
421
+ # to List operation.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [RedisFirewallRuleListResult] operation results.
426
+ #
427
+ def list_by_redis_resource_next(next_page_link, custom_headers:nil)
428
+ response = list_by_redis_resource_next_async(next_page_link, custom_headers:custom_headers).value!
429
+ response.body unless response.nil?
430
+ end
431
+
432
+ #
433
+ # Gets all firewall rules in the specified redis cache.
434
+ #
435
+ # @param next_page_link [String] The NextLink from the previous successful call
436
+ # to List operation.
437
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
438
+ # will be added to the HTTP request.
439
+ #
440
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
441
+ #
442
+ def list_by_redis_resource_next_with_http_info(next_page_link, custom_headers:nil)
443
+ list_by_redis_resource_next_async(next_page_link, custom_headers:custom_headers).value!
444
+ end
445
+
446
+ #
447
+ # Gets all firewall rules in the specified redis cache.
448
+ #
449
+ # @param next_page_link [String] The NextLink from the previous successful call
450
+ # to List operation.
451
+ # @param [Hash{String => String}] A hash of custom headers that will be added
452
+ # to the HTTP request.
453
+ #
454
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
455
+ #
456
+ def list_by_redis_resource_next_async(next_page_link, custom_headers:nil)
457
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
458
+
459
+
460
+ request_headers = {}
461
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
462
+
463
+ # Set Headers
464
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
465
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
466
+ path_template = '{nextLink}'
467
+
468
+ request_url = @base_url || @client.base_url
469
+
470
+ options = {
471
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
472
+ skip_encoding_path_params: {'nextLink' => next_page_link},
473
+ headers: request_headers.merge(custom_headers || {}),
474
+ base_url: request_url
475
+ }
476
+ promise = @client.make_request_async(:get, path_template, options)
477
+
478
+ promise = promise.then do |result|
479
+ http_response = result.response
480
+ status_code = http_response.status
481
+ response_content = http_response.body
482
+ unless status_code == 200
483
+ error_model = JSON.load(response_content)
484
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
485
+ end
486
+
487
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
488
+ # Deserialize Response
489
+ if status_code == 200
490
+ begin
491
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
492
+ result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisFirewallRuleListResult.mapper()
493
+ result.body = @client.deserialize(result_mapper, parsed_response)
494
+ rescue Exception => e
495
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
496
+ end
497
+ end
498
+
499
+ result
500
+ end
501
+
502
+ promise.execute
503
+ end
504
+
505
+ #
506
+ # Gets all firewall rules in the specified redis cache.
507
+ #
508
+ # @param resource_group_name [String] The name of the resource group.
509
+ # @param cache_name [String] The name of the Redis cache.
510
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
511
+ # will be added to the HTTP request.
512
+ #
513
+ # @return [RedisFirewallRuleListResult] which provide lazy access to pages of
514
+ # the response.
515
+ #
516
+ def list_by_redis_resource_as_lazy(resource_group_name, cache_name, custom_headers:nil)
517
+ response = list_by_redis_resource_async(resource_group_name, cache_name, custom_headers:custom_headers).value!
518
+ unless response.nil?
519
+ page = response.body
520
+ page.next_method = Proc.new do |next_page_link|
521
+ list_by_redis_resource_next_async(next_page_link, custom_headers:custom_headers)
522
+ end
523
+ page
524
+ end
525
+ end
526
+
527
+ end
528
+ end