azure_mgmt_redis 0.7.0 → 0.8.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 (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_redis.rb +4 -4
  3. data/lib/generated/azure_mgmt_redis/models/day_of_week.rb +3 -1
  4. data/lib/generated/azure_mgmt_redis/models/export_rdbparameters.rb +2 -2
  5. data/lib/generated/azure_mgmt_redis/models/import_rdbparameters.rb +3 -3
  6. data/lib/generated/azure_mgmt_redis/models/reboot_type.rb +1 -1
  7. data/lib/generated/azure_mgmt_redis/models/redis_access_keys.rb +3 -3
  8. data/lib/generated/azure_mgmt_redis/models/redis_create_parameters.rb +10 -10
  9. data/lib/generated/azure_mgmt_redis/models/redis_key_type.rb +1 -1
  10. data/lib/generated/azure_mgmt_redis/models/redis_list_result.rb +3 -3
  11. data/lib/generated/azure_mgmt_redis/models/redis_patch_schedule.rb +8 -7
  12. data/lib/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +5 -5
  13. data/lib/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +3 -3
  14. data/lib/generated/azure_mgmt_redis/models/redis_resource.rb +17 -17
  15. data/lib/generated/azure_mgmt_redis/models/redis_update_parameters.rb +11 -11
  16. data/lib/generated/azure_mgmt_redis/models/schedule_entry.rb +5 -5
  17. data/lib/generated/azure_mgmt_redis/models/sku.rb +8 -7
  18. data/lib/generated/azure_mgmt_redis/models/sku_family.rb +1 -1
  19. data/lib/generated/azure_mgmt_redis/models/sku_name.rb +1 -1
  20. data/lib/generated/azure_mgmt_redis/module_definition.rb +1 -1
  21. data/lib/generated/azure_mgmt_redis/patch_schedules.rb +23 -23
  22. data/lib/generated/azure_mgmt_redis/redis.rb +482 -472
  23. data/lib/generated/azure_mgmt_redis/redis_management_client.rb +16 -3
  24. data/lib/generated/azure_mgmt_redis/version.rb +2 -2
  25. metadata +4 -4
@@ -1,20 +1,20 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Redis
7
7
  module Models
8
8
  #
9
- # Patch schedule entry for Premium Redis Cache.
9
+ # Patch schedule entry for a Premium Redis Cache.
10
10
  #
11
11
  class ScheduleEntry
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [DayOfWeek] Day of week when cache can be patched. Possible
16
- # values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
17
- # 'Friday', 'Saturday', 'Sunday'
15
+ # @return [DayOfWeek] Day of the week when a cache can be patched.
16
+ # Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
17
+ # 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend'
18
18
  attr_accessor :day_of_week
19
19
 
20
20
  # @return [Integer] Start hour after which cache patching can start.
@@ -1,28 +1,29 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Redis
7
7
  module Models
8
8
  #
9
- # Sku parameters supplied to the create redis operation.
9
+ # SKU parameters supplied to the create Redis operation.
10
10
  #
11
11
  class Sku
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [SkuName] What type of redis cache to deploy. Valid values:
15
+ # @return [SkuName] The type of Redis cache to deploy. Valid values:
16
16
  # (Basic, Standard, Premium). Possible values include: 'Basic',
17
17
  # 'Standard', 'Premium'
18
18
  attr_accessor :name
19
19
 
20
- # @return [SkuFamily] Which family to use. Valid values: (C, P).
21
- # Possible values include: 'C', 'P'
20
+ # @return [SkuFamily] The SKU family to use. Valid values: (C, P). (C =
21
+ # Basic/Standard, P = Premium). Possible values include: 'C', 'P'
22
22
  attr_accessor :family
23
23
 
24
- # @return [Integer] What size of redis cache to deploy. Valid values:
25
- # for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4)
24
+ # @return [Integer] The size of the Redis cache to deploy. Valid values:
25
+ # for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium)
26
+ # family (1, 2, 3, 4).
26
27
  attr_accessor :capacity
27
28
 
28
29
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Redis
7
7
  #
8
- # REST API for Azure Redis Cache Service
8
+ # REST API for Azure Redis Cache Service.
9
9
  #
10
10
  class PatchSchedules
11
11
  include Azure::ARM::Redis::Models
@@ -23,12 +23,12 @@ module Azure::ARM::Redis
23
23
  attr_reader :client
24
24
 
25
25
  #
26
- # Create or replace the patching schedule for redis cache.
26
+ # Create or replace the patching schedule for Redis cache.
27
27
  #
28
28
  # @param resource_group_name [String] The name of the resource group.
29
- # @param name [String] The name of the redis cache.
29
+ # @param name [String] The name of the Redis cache.
30
30
  # @param parameters [RedisPatchSchedule] Parameters to set patch schedules for
31
- # redis cache.
31
+ # Redis cache.
32
32
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
33
  # will be added to the HTTP request.
34
34
  #
@@ -40,12 +40,12 @@ module Azure::ARM::Redis
40
40
  end
41
41
 
42
42
  #
43
- # Create or replace the patching schedule for redis cache.
43
+ # Create or replace the patching schedule for Redis cache.
44
44
  #
45
45
  # @param resource_group_name [String] The name of the resource group.
46
- # @param name [String] The name of the redis cache.
46
+ # @param name [String] The name of the Redis cache.
47
47
  # @param parameters [RedisPatchSchedule] Parameters to set patch schedules for
48
- # redis cache.
48
+ # Redis cache.
49
49
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
50
  # will be added to the HTTP request.
51
51
  #
@@ -56,12 +56,12 @@ module Azure::ARM::Redis
56
56
  end
57
57
 
58
58
  #
59
- # Create or replace the patching schedule for redis cache.
59
+ # Create or replace the patching schedule for Redis cache.
60
60
  #
61
61
  # @param resource_group_name [String] The name of the resource group.
62
- # @param name [String] The name of the redis cache.
62
+ # @param name [String] The name of the Redis cache.
63
63
  # @param parameters [RedisPatchSchedule] Parameters to set patch schedules for
64
- # redis cache.
64
+ # Redis cache.
65
65
  # @param [Hash{String => String}] A hash of custom headers that will be added
66
66
  # to the HTTP request.
67
67
  #
@@ -130,10 +130,10 @@ module Azure::ARM::Redis
130
130
  end
131
131
 
132
132
  #
133
- # Deletes the patching schedule for redis cache.
133
+ # Deletes the patching schedule for Redis cache.
134
134
  #
135
135
  # @param resource_group_name [String] The name of the resource group.
136
- # @param name [String] The name of the redis cache.
136
+ # @param name [String] The name of the Redis cache.
137
137
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
138
  # will be added to the HTTP request.
139
139
  #
@@ -144,10 +144,10 @@ module Azure::ARM::Redis
144
144
  end
145
145
 
146
146
  #
147
- # Deletes the patching schedule for redis cache.
147
+ # Deletes the patching schedule for Redis cache.
148
148
  #
149
149
  # @param resource_group_name [String] The name of the resource group.
150
- # @param name [String] The name of the redis cache.
150
+ # @param name [String] The name of the Redis cache.
151
151
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
152
  # will be added to the HTTP request.
153
153
  #
@@ -158,10 +158,10 @@ module Azure::ARM::Redis
158
158
  end
159
159
 
160
160
  #
161
- # Deletes the patching schedule for redis cache.
161
+ # Deletes the patching schedule for Redis cache.
162
162
  #
163
163
  # @param resource_group_name [String] The name of the resource group.
164
- # @param name [String] The name of the redis cache.
164
+ # @param name [String] The name of the Redis cache.
165
165
  # @param [Hash{String => String}] A hash of custom headers that will be added
166
166
  # to the HTTP request.
167
167
  #
@@ -210,10 +210,10 @@ module Azure::ARM::Redis
210
210
  end
211
211
 
212
212
  #
213
- # Gets the patching schedule for redis cache.
213
+ # Gets the patching schedule for Redis cache.
214
214
  #
215
215
  # @param resource_group_name [String] The name of the resource group.
216
- # @param name [String] The name of the redis cache.
216
+ # @param name [String] The name of the Redis cache.
217
217
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
218
218
  # will be added to the HTTP request.
219
219
  #
@@ -225,10 +225,10 @@ module Azure::ARM::Redis
225
225
  end
226
226
 
227
227
  #
228
- # Gets the patching schedule for redis cache.
228
+ # Gets the patching schedule for Redis cache.
229
229
  #
230
230
  # @param resource_group_name [String] The name of the resource group.
231
- # @param name [String] The name of the redis cache.
231
+ # @param name [String] The name of the Redis cache.
232
232
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
233
233
  # will be added to the HTTP request.
234
234
  #
@@ -239,10 +239,10 @@ module Azure::ARM::Redis
239
239
  end
240
240
 
241
241
  #
242
- # Gets the patching schedule for redis cache.
242
+ # Gets the patching schedule for Redis cache.
243
243
  #
244
244
  # @param resource_group_name [String] The name of the resource group.
245
- # @param name [String] The name of the redis cache.
245
+ # @param name [String] The name of the Redis cache.
246
246
  # @param [Hash{String => String}] A hash of custom headers that will be added
247
247
  # to the HTTP request.
248
248
  #
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Redis
7
7
  #
8
- # REST API for Azure Redis Cache Service
8
+ # REST API for Azure Redis Cache Service.
9
9
  #
10
10
  class Redis
11
11
  include Azure::ARM::Redis::Models
@@ -24,12 +24,12 @@ module Azure::ARM::Redis
24
24
 
25
25
  #
26
26
  # Create or replace (overwrite/recreate, with potential downtime) an existing
27
- # redis cache
27
+ # Redis cache.
28
28
  #
29
29
  # @param resource_group_name [String] The name of the resource group.
30
- # @param name [String] The name of the redis cache.
30
+ # @param name [String] The name of the Redis cache.
31
31
  # @param parameters [RedisCreateParameters] Parameters supplied to the Create
32
- # redis operation.
32
+ # Redis operation.
33
33
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
34
  # will be added to the HTTP request.
35
35
  #
@@ -42,9 +42,9 @@ module Azure::ARM::Redis
42
42
 
43
43
  #
44
44
  # @param resource_group_name [String] The name of the resource group.
45
- # @param name [String] The name of the redis cache.
45
+ # @param name [String] The name of the Redis cache.
46
46
  # @param parameters [RedisCreateParameters] Parameters supplied to the Create
47
- # redis operation.
47
+ # Redis operation.
48
48
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
49
  # will be added to the HTTP request.
50
50
  #
@@ -70,152 +70,80 @@ module Azure::ARM::Redis
70
70
  end
71
71
 
72
72
  #
73
- # Create or replace (overwrite/recreate, with potential downtime) an existing
74
- # redis cache
73
+ # Update an existing Redis cache.
75
74
  #
76
75
  # @param resource_group_name [String] The name of the resource group.
77
- # @param name [String] The name of the redis cache.
78
- # @param parameters [RedisCreateParameters] Parameters supplied to the Create
79
- # redis operation.
76
+ # @param name [String] The name of the Redis cache.
77
+ # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
78
+ # Redis operation.
80
79
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
81
80
  # will be added to the HTTP request.
82
81
  #
83
82
  # @return [RedisResource] operation results.
84
83
  #
85
- def begin_create(resource_group_name, name, parameters, custom_headers = nil)
86
- response = begin_create_async(resource_group_name, name, parameters, custom_headers).value!
84
+ def update(resource_group_name, name, parameters, custom_headers = nil)
85
+ response = update_async(resource_group_name, name, parameters, custom_headers).value!
87
86
  response.body unless response.nil?
88
87
  end
89
88
 
90
- #
91
- # Create or replace (overwrite/recreate, with potential downtime) an existing
92
- # redis cache
93
89
  #
94
90
  # @param resource_group_name [String] The name of the resource group.
95
- # @param name [String] The name of the redis cache.
96
- # @param parameters [RedisCreateParameters] Parameters supplied to the Create
97
- # redis operation.
91
+ # @param name [String] The name of the Redis cache.
92
+ # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
93
+ # Redis operation.
98
94
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
99
95
  # will be added to the HTTP request.
100
96
  #
101
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
102
- #
103
- def begin_create_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
104
- begin_create_async(resource_group_name, name, parameters, custom_headers).value!
105
- end
106
-
107
- #
108
- # Create or replace (overwrite/recreate, with potential downtime) an existing
109
- # redis cache
110
- #
111
- # @param resource_group_name [String] The name of the resource group.
112
- # @param name [String] The name of the redis cache.
113
- # @param parameters [RedisCreateParameters] Parameters supplied to the Create
114
- # redis operation.
115
- # @param [Hash{String => String}] A hash of custom headers that will be added
116
- # to the HTTP request.
117
- #
118
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
97
+ # @return [Concurrent::Promise] promise which provides async access to http
98
+ # response.
119
99
  #
120
- def begin_create_async(resource_group_name, name, parameters, custom_headers = nil)
121
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
122
- fail ArgumentError, 'name is nil' if name.nil?
123
- fail ArgumentError, 'parameters is nil' if parameters.nil?
124
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
125
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
126
-
127
-
128
- request_headers = {}
129
-
130
- # Set Headers
131
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
132
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
133
-
134
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
135
-
136
- # Serialize Request
137
- request_mapper = RedisCreateParameters.mapper()
138
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
139
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
140
-
141
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
142
-
143
- request_url = @base_url || @client.base_url
144
-
145
- options = {
146
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
147
- path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
148
- query_params: {'api-version' => @client.api_version},
149
- body: request_content,
150
- headers: request_headers.merge(custom_headers || {}),
151
- base_url: request_url
152
- }
153
- promise = @client.make_request_async(:put, path_template, options)
154
-
155
- promise = promise.then do |result|
156
- http_response = result.response
157
- status_code = http_response.status
158
- response_content = http_response.body
159
- unless status_code == 201 || status_code == 200
160
- error_model = JSON.load(response_content)
161
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
162
- end
100
+ def update_async(resource_group_name, name, parameters, custom_headers = nil)
101
+ # Send request
102
+ promise = begin_update_async(resource_group_name, name, parameters, custom_headers)
163
103
 
164
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
165
- # Deserialize Response
166
- if status_code == 200
167
- begin
168
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
169
- result_mapper = RedisResource.mapper()
170
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
171
- rescue Exception => e
172
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
173
- end
104
+ promise = promise.then do |response|
105
+ # Defining deserialization method.
106
+ deserialize_method = lambda do |parsed_response|
107
+ result_mapper = RedisResource.mapper()
108
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
174
109
  end
175
110
 
176
- result
111
+ # Waiting for response.
112
+ @client.get_long_running_operation_result(response, deserialize_method)
177
113
  end
178
114
 
179
- promise.execute
115
+ promise
180
116
  end
181
117
 
182
118
  #
183
- # Update an existing Redis cache
119
+ # Deletes a Redis cache.
184
120
  #
185
121
  # @param resource_group_name [String] The name of the resource group.
186
- # @param name [String] The name of the redis cache.
187
- # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
188
- # redis operation.
122
+ # @param name [String] The name of the Redis cache.
189
123
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
190
124
  # will be added to the HTTP request.
191
125
  #
192
- # @return [RedisResource] operation results.
193
- #
194
- def update(resource_group_name, name, parameters, custom_headers = nil)
195
- response = update_async(resource_group_name, name, parameters, custom_headers).value!
196
- response.body unless response.nil?
126
+ def delete(resource_group_name, name, custom_headers = nil)
127
+ response = delete_async(resource_group_name, name, custom_headers).value!
128
+ nil
197
129
  end
198
130
 
199
131
  #
200
132
  # @param resource_group_name [String] The name of the resource group.
201
- # @param name [String] The name of the redis cache.
202
- # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
203
- # redis operation.
133
+ # @param name [String] The name of the Redis cache.
204
134
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
135
  # will be added to the HTTP request.
206
136
  #
207
137
  # @return [Concurrent::Promise] promise which provides async access to http
208
138
  # response.
209
139
  #
210
- def update_async(resource_group_name, name, parameters, custom_headers = nil)
140
+ def delete_async(resource_group_name, name, custom_headers = nil)
211
141
  # Send request
212
- promise = begin_update_async(resource_group_name, name, parameters, custom_headers)
142
+ promise = begin_delete_async(resource_group_name, name, custom_headers)
213
143
 
214
144
  promise = promise.then do |response|
215
145
  # Defining deserialization method.
216
146
  deserialize_method = lambda do |parsed_response|
217
- result_mapper = RedisResource.mapper()
218
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
219
147
  end
220
148
 
221
149
  # Waiting for response.
@@ -226,54 +154,47 @@ module Azure::ARM::Redis
226
154
  end
227
155
 
228
156
  #
229
- # Update an existing Redis cache
157
+ # Gets a Redis cache (resource description).
230
158
  #
231
159
  # @param resource_group_name [String] The name of the resource group.
232
- # @param name [String] The name of the redis cache.
233
- # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
234
- # redis operation.
160
+ # @param name [String] The name of the Redis cache.
235
161
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
162
  # will be added to the HTTP request.
237
163
  #
238
164
  # @return [RedisResource] operation results.
239
165
  #
240
- def begin_update(resource_group_name, name, parameters, custom_headers = nil)
241
- response = begin_update_async(resource_group_name, name, parameters, custom_headers).value!
166
+ def get(resource_group_name, name, custom_headers = nil)
167
+ response = get_async(resource_group_name, name, custom_headers).value!
242
168
  response.body unless response.nil?
243
169
  end
244
170
 
245
171
  #
246
- # Update an existing Redis cache
172
+ # Gets a Redis cache (resource description).
247
173
  #
248
174
  # @param resource_group_name [String] The name of the resource group.
249
- # @param name [String] The name of the redis cache.
250
- # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
251
- # redis operation.
175
+ # @param name [String] The name of the Redis cache.
252
176
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
177
  # will be added to the HTTP request.
254
178
  #
255
179
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
256
180
  #
257
- def begin_update_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
258
- begin_update_async(resource_group_name, name, parameters, custom_headers).value!
181
+ def get_with_http_info(resource_group_name, name, custom_headers = nil)
182
+ get_async(resource_group_name, name, custom_headers).value!
259
183
  end
260
184
 
261
185
  #
262
- # Update an existing Redis cache
186
+ # Gets a Redis cache (resource description).
263
187
  #
264
188
  # @param resource_group_name [String] The name of the resource group.
265
- # @param name [String] The name of the redis cache.
266
- # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
267
- # redis operation.
189
+ # @param name [String] The name of the Redis cache.
268
190
  # @param [Hash{String => String}] A hash of custom headers that will be added
269
191
  # to the HTTP request.
270
192
  #
271
193
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
272
194
  #
273
- def begin_update_async(resource_group_name, name, parameters, custom_headers = nil)
195
+ def get_async(resource_group_name, name, custom_headers = nil)
274
196
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
275
197
  fail ArgumentError, 'name is nil' if name.nil?
276
- fail ArgumentError, 'parameters is nil' if parameters.nil?
277
198
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
278
199
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
279
200
 
@@ -283,14 +204,6 @@ module Azure::ARM::Redis
283
204
  # Set Headers
284
205
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
285
206
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
286
-
287
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
288
-
289
- # Serialize Request
290
- request_mapper = RedisUpdateParameters.mapper()
291
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
292
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
293
-
294
207
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
295
208
 
296
209
  request_url = @base_url || @client.base_url
@@ -299,11 +212,10 @@ module Azure::ARM::Redis
299
212
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
300
213
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
301
214
  query_params: {'api-version' => @client.api_version},
302
- body: request_content,
303
215
  headers: request_headers.merge(custom_headers || {}),
304
216
  base_url: request_url
305
217
  }
306
- promise = @client.make_request_async(:patch, path_template, options)
218
+ promise = @client.make_request_async(:get, path_template, options)
307
219
 
308
220
  promise = promise.then do |result|
309
221
  http_response = result.response
@@ -333,84 +245,126 @@ module Azure::ARM::Redis
333
245
  end
334
246
 
335
247
  #
336
- # Deletes a redis cache. This operation takes a while to complete.
248
+ # Lists all Redis caches in a resource group.
337
249
  #
338
250
  # @param resource_group_name [String] The name of the resource group.
339
- # @param name [String] The name of the redis cache.
340
251
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
341
252
  # will be added to the HTTP request.
342
253
  #
343
- def delete(resource_group_name, name, custom_headers = nil)
344
- response = delete_async(resource_group_name, name, custom_headers).value!
345
- nil
254
+ # @return [Array<RedisResource>] operation results.
255
+ #
256
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
257
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
258
+ first_page.get_all_items
346
259
  end
347
260
 
261
+ #
262
+ # Lists all Redis caches in a resource group.
348
263
  #
349
264
  # @param resource_group_name [String] The name of the resource group.
350
- # @param name [String] The name of the redis cache.
351
265
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
266
  # will be added to the HTTP request.
353
267
  #
354
- # @return [Concurrent::Promise] promise which provides async access to http
355
- # response.
268
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
356
269
  #
357
- def delete_async(resource_group_name, name, custom_headers = nil)
358
- # Send request
359
- promise = begin_delete_async(resource_group_name, name, custom_headers)
270
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
271
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
272
+ end
360
273
 
361
- promise = promise.then do |response|
362
- # Defining deserialization method.
363
- deserialize_method = lambda do |parsed_response|
274
+ #
275
+ # Lists all Redis caches in a resource group.
276
+ #
277
+ # @param resource_group_name [String] The name of the resource group.
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
284
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
285
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
286
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
287
+
288
+
289
+ request_headers = {}
290
+
291
+ # Set Headers
292
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
293
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
294
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/'
295
+
296
+ request_url = @base_url || @client.base_url
297
+
298
+ options = {
299
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
300
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
301
+ query_params: {'api-version' => @client.api_version},
302
+ headers: request_headers.merge(custom_headers || {}),
303
+ base_url: request_url
304
+ }
305
+ promise = @client.make_request_async(:get, path_template, options)
306
+
307
+ promise = promise.then do |result|
308
+ http_response = result.response
309
+ status_code = http_response.status
310
+ response_content = http_response.body
311
+ unless status_code == 200
312
+ error_model = JSON.load(response_content)
313
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
364
314
  end
365
315
 
366
- # Waiting for response.
367
- @client.get_long_running_operation_result(response, deserialize_method)
316
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
317
+ # Deserialize Response
318
+ if status_code == 200
319
+ begin
320
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
321
+ result_mapper = RedisListResult.mapper()
322
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
323
+ rescue Exception => e
324
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
325
+ end
326
+ end
327
+
328
+ result
368
329
  end
369
330
 
370
- promise
331
+ promise.execute
371
332
  end
372
333
 
373
334
  #
374
- # Deletes a redis cache. This operation takes a while to complete.
335
+ # Gets all Redis caches in the specified subscription.
375
336
  #
376
- # @param resource_group_name [String] The name of the resource group.
377
- # @param name [String] The name of the redis cache.
378
337
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
379
338
  # will be added to the HTTP request.
380
339
  #
340
+ # @return [Array<RedisResource>] operation results.
381
341
  #
382
- def begin_delete(resource_group_name, name, custom_headers = nil)
383
- response = begin_delete_async(resource_group_name, name, custom_headers).value!
384
- nil
342
+ def list(custom_headers = nil)
343
+ first_page = list_as_lazy(custom_headers)
344
+ first_page.get_all_items
385
345
  end
386
346
 
387
347
  #
388
- # Deletes a redis cache. This operation takes a while to complete.
348
+ # Gets all Redis caches in the specified subscription.
389
349
  #
390
- # @param resource_group_name [String] The name of the resource group.
391
- # @param name [String] The name of the redis cache.
392
350
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
393
351
  # will be added to the HTTP request.
394
352
  #
395
353
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
396
354
  #
397
- def begin_delete_with_http_info(resource_group_name, name, custom_headers = nil)
398
- begin_delete_async(resource_group_name, name, custom_headers).value!
355
+ def list_with_http_info(custom_headers = nil)
356
+ list_async(custom_headers).value!
399
357
  end
400
358
 
401
359
  #
402
- # Deletes a redis cache. This operation takes a while to complete.
360
+ # Gets all Redis caches in the specified subscription.
403
361
  #
404
- # @param resource_group_name [String] The name of the resource group.
405
- # @param name [String] The name of the redis cache.
406
362
  # @param [Hash{String => String}] A hash of custom headers that will be added
407
363
  # to the HTTP request.
408
364
  #
409
365
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
410
366
  #
411
- def begin_delete_async(resource_group_name, name, custom_headers = nil)
412
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
413
- fail ArgumentError, 'name is nil' if name.nil?
367
+ def list_async(custom_headers = nil)
414
368
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
415
369
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
416
370
 
@@ -420,29 +374,39 @@ module Azure::ARM::Redis
420
374
  # Set Headers
421
375
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
422
376
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
423
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
377
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/'
424
378
 
425
379
  request_url = @base_url || @client.base_url
426
380
 
427
381
  options = {
428
382
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
429
- path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
383
+ path_params: {'subscriptionId' => @client.subscription_id},
430
384
  query_params: {'api-version' => @client.api_version},
431
385
  headers: request_headers.merge(custom_headers || {}),
432
386
  base_url: request_url
433
387
  }
434
- promise = @client.make_request_async(:delete, path_template, options)
388
+ promise = @client.make_request_async(:get, path_template, options)
435
389
 
436
390
  promise = promise.then do |result|
437
391
  http_response = result.response
438
392
  status_code = http_response.status
439
393
  response_content = http_response.body
440
- unless status_code == 200 || status_code == 204
394
+ unless status_code == 200
441
395
  error_model = JSON.load(response_content)
442
396
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
443
397
  end
444
398
 
445
399
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
400
+ # Deserialize Response
401
+ if status_code == 200
402
+ begin
403
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
404
+ result_mapper = RedisListResult.mapper()
405
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
406
+ rescue Exception => e
407
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
408
+ end
409
+ end
446
410
 
447
411
  result
448
412
  end
@@ -451,45 +415,48 @@ module Azure::ARM::Redis
451
415
  end
452
416
 
453
417
  #
454
- # Gets a redis cache (resource description).
418
+ # Retrieve a Redis cache's access keys. This operation requires write
419
+ # permission to the cache resource.
455
420
  #
456
421
  # @param resource_group_name [String] The name of the resource group.
457
- # @param name [String] The name of the redis cache.
422
+ # @param name [String] The name of the Redis cache.
458
423
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
459
424
  # will be added to the HTTP request.
460
425
  #
461
- # @return [RedisResource] operation results.
426
+ # @return [RedisAccessKeys] operation results.
462
427
  #
463
- def get(resource_group_name, name, custom_headers = nil)
464
- response = get_async(resource_group_name, name, custom_headers).value!
428
+ def list_keys(resource_group_name, name, custom_headers = nil)
429
+ response = list_keys_async(resource_group_name, name, custom_headers).value!
465
430
  response.body unless response.nil?
466
431
  end
467
432
 
468
433
  #
469
- # Gets a redis cache (resource description).
434
+ # Retrieve a Redis cache's access keys. This operation requires write
435
+ # permission to the cache resource.
470
436
  #
471
437
  # @param resource_group_name [String] The name of the resource group.
472
- # @param name [String] The name of the redis cache.
438
+ # @param name [String] The name of the Redis cache.
473
439
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
474
440
  # will be added to the HTTP request.
475
441
  #
476
442
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
477
443
  #
478
- def get_with_http_info(resource_group_name, name, custom_headers = nil)
479
- get_async(resource_group_name, name, custom_headers).value!
444
+ def list_keys_with_http_info(resource_group_name, name, custom_headers = nil)
445
+ list_keys_async(resource_group_name, name, custom_headers).value!
480
446
  end
481
447
 
482
448
  #
483
- # Gets a redis cache (resource description).
449
+ # Retrieve a Redis cache's access keys. This operation requires write
450
+ # permission to the cache resource.
484
451
  #
485
452
  # @param resource_group_name [String] The name of the resource group.
486
- # @param name [String] The name of the redis cache.
453
+ # @param name [String] The name of the Redis cache.
487
454
  # @param [Hash{String => String}] A hash of custom headers that will be added
488
455
  # to the HTTP request.
489
456
  #
490
457
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
491
458
  #
492
- def get_async(resource_group_name, name, custom_headers = nil)
459
+ def list_keys_async(resource_group_name, name, custom_headers = nil)
493
460
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
494
461
  fail ArgumentError, 'name is nil' if name.nil?
495
462
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -501,7 +468,7 @@ module Azure::ARM::Redis
501
468
  # Set Headers
502
469
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
503
470
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
504
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
471
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'
505
472
 
506
473
  request_url = @base_url || @client.base_url
507
474
 
@@ -512,7 +479,7 @@ module Azure::ARM::Redis
512
479
  headers: request_headers.merge(custom_headers || {}),
513
480
  base_url: request_url
514
481
  }
515
- promise = @client.make_request_async(:get, path_template, options)
482
+ promise = @client.make_request_async(:post, path_template, options)
516
483
 
517
484
  promise = promise.then do |result|
518
485
  http_response = result.response
@@ -528,7 +495,7 @@ module Azure::ARM::Redis
528
495
  if status_code == 200
529
496
  begin
530
497
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
531
- result_mapper = RedisResource.mapper()
498
+ result_mapper = RedisAccessKeys.mapper()
532
499
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
533
500
  rescue Exception => e
534
501
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -542,63 +509,57 @@ module Azure::ARM::Redis
542
509
  end
543
510
 
544
511
  #
545
- # Gets all redis caches in a resource group.
546
- #
547
- # @param resource_group_name [String] The name of the resource group.
548
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
549
- # will be added to the HTTP request.
550
- #
551
- # @return [RedisListResult] which provide lazy access to pages of the response.
552
- #
553
- def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
554
- response = list_by_resource_group_async(resource_group_name, custom_headers).value!
555
- unless response.nil?
556
- page = response.body
557
- page.next_method = Proc.new do |next_page_link|
558
- list_by_resource_group_next_async(next_page_link, custom_headers)
559
- end
560
- page
561
- end
562
- end
563
-
564
- #
565
- # Gets all redis caches in a resource group.
512
+ # Regenerate Redis cache's access keys. This operation requires write
513
+ # permission to the cache resource.
566
514
  #
567
515
  # @param resource_group_name [String] The name of the resource group.
516
+ # @param name [String] The name of the Redis cache.
517
+ # @param parameters [RedisRegenerateKeyParameters] Specifies which key to
518
+ # regenerate.
568
519
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
569
520
  # will be added to the HTTP request.
570
521
  #
571
- # @return [Array<RedisResource>] operation results.
522
+ # @return [RedisAccessKeys] operation results.
572
523
  #
573
- def list_by_resource_group(resource_group_name, custom_headers = nil)
574
- first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
575
- first_page.get_all_items
524
+ def regenerate_key(resource_group_name, name, parameters, custom_headers = nil)
525
+ response = regenerate_key_async(resource_group_name, name, parameters, custom_headers).value!
526
+ response.body unless response.nil?
576
527
  end
577
528
 
578
529
  #
579
- # Gets all redis caches in a resource group.
530
+ # Regenerate Redis cache's access keys. This operation requires write
531
+ # permission to the cache resource.
580
532
  #
581
533
  # @param resource_group_name [String] The name of the resource group.
534
+ # @param name [String] The name of the Redis cache.
535
+ # @param parameters [RedisRegenerateKeyParameters] Specifies which key to
536
+ # regenerate.
582
537
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
583
538
  # will be added to the HTTP request.
584
539
  #
585
540
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
586
541
  #
587
- def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
588
- list_by_resource_group_async(resource_group_name, custom_headers).value!
542
+ def regenerate_key_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
543
+ regenerate_key_async(resource_group_name, name, parameters, custom_headers).value!
589
544
  end
590
545
 
591
546
  #
592
- # Gets all redis caches in a resource group.
547
+ # Regenerate Redis cache's access keys. This operation requires write
548
+ # permission to the cache resource.
593
549
  #
594
550
  # @param resource_group_name [String] The name of the resource group.
551
+ # @param name [String] The name of the Redis cache.
552
+ # @param parameters [RedisRegenerateKeyParameters] Specifies which key to
553
+ # regenerate.
595
554
  # @param [Hash{String => String}] A hash of custom headers that will be added
596
555
  # to the HTTP request.
597
556
  #
598
557
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
599
558
  #
600
- def list_by_resource_group_async(resource_group_name, custom_headers = nil)
559
+ def regenerate_key_async(resource_group_name, name, parameters, custom_headers = nil)
601
560
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
561
+ fail ArgumentError, 'name is nil' if name.nil?
562
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
602
563
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
603
564
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
604
565
 
@@ -608,18 +569,27 @@ module Azure::ARM::Redis
608
569
  # Set Headers
609
570
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
610
571
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
611
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/'
572
+
573
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
574
+
575
+ # Serialize Request
576
+ request_mapper = RedisRegenerateKeyParameters.mapper()
577
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
578
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
579
+
580
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'
612
581
 
613
582
  request_url = @base_url || @client.base_url
614
583
 
615
584
  options = {
616
585
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
617
- path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
586
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
618
587
  query_params: {'api-version' => @client.api_version},
588
+ body: request_content,
619
589
  headers: request_headers.merge(custom_headers || {}),
620
590
  base_url: request_url
621
591
  }
622
- promise = @client.make_request_async(:get, path_template, options)
592
+ promise = @client.make_request_async(:post, path_template, options)
623
593
 
624
594
  promise = promise.then do |result|
625
595
  http_response = result.response
@@ -635,7 +605,7 @@ module Azure::ARM::Redis
635
605
  if status_code == 200
636
606
  begin
637
607
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
638
- result_mapper = RedisListResult.mapper()
608
+ result_mapper = RedisAccessKeys.mapper()
639
609
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
640
610
  rescue Exception => e
641
611
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -649,58 +619,56 @@ module Azure::ARM::Redis
649
619
  end
650
620
 
651
621
  #
652
- # Gets all redis caches in the specified subscription.
653
- #
654
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
655
- # will be added to the HTTP request.
656
- #
657
- # @return [RedisListResult] which provide lazy access to pages of the response.
658
- #
659
- def list_as_lazy(custom_headers = nil)
660
- response = list_async(custom_headers).value!
661
- unless response.nil?
662
- page = response.body
663
- page.next_method = Proc.new do |next_page_link|
664
- list_next_async(next_page_link, custom_headers)
665
- end
666
- page
667
- end
668
- end
669
-
670
- #
671
- # Gets all redis caches in the specified subscription.
622
+ # Reboot specified Redis node(s). This operation requires write permission to
623
+ # the cache resource. There can be potential data loss.
672
624
  #
625
+ # @param resource_group_name [String] The name of the resource group.
626
+ # @param name [String] The name of the Redis cache.
627
+ # @param parameters [RedisRebootParameters] Specifies which Redis node(s) to
628
+ # reboot.
673
629
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
674
630
  # will be added to the HTTP request.
675
631
  #
676
- # @return [Array<RedisResource>] operation results.
677
632
  #
678
- def list(custom_headers = nil)
679
- first_page = list_as_lazy(custom_headers)
680
- first_page.get_all_items
633
+ def force_reboot(resource_group_name, name, parameters, custom_headers = nil)
634
+ response = force_reboot_async(resource_group_name, name, parameters, custom_headers).value!
635
+ nil
681
636
  end
682
637
 
683
638
  #
684
- # Gets all redis caches in the specified subscription.
639
+ # Reboot specified Redis node(s). This operation requires write permission to
640
+ # the cache resource. There can be potential data loss.
685
641
  #
642
+ # @param resource_group_name [String] The name of the resource group.
643
+ # @param name [String] The name of the Redis cache.
644
+ # @param parameters [RedisRebootParameters] Specifies which Redis node(s) to
645
+ # reboot.
686
646
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
687
647
  # will be added to the HTTP request.
688
648
  #
689
649
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
690
650
  #
691
- def list_with_http_info(custom_headers = nil)
692
- list_async(custom_headers).value!
651
+ def force_reboot_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
652
+ force_reboot_async(resource_group_name, name, parameters, custom_headers).value!
693
653
  end
694
654
 
695
655
  #
696
- # Gets all redis caches in the specified subscription.
656
+ # Reboot specified Redis node(s). This operation requires write permission to
657
+ # the cache resource. There can be potential data loss.
697
658
  #
659
+ # @param resource_group_name [String] The name of the resource group.
660
+ # @param name [String] The name of the Redis cache.
661
+ # @param parameters [RedisRebootParameters] Specifies which Redis node(s) to
662
+ # reboot.
698
663
  # @param [Hash{String => String}] A hash of custom headers that will be added
699
664
  # to the HTTP request.
700
665
  #
701
666
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
702
667
  #
703
- def list_async(custom_headers = nil)
668
+ def force_reboot_async(resource_group_name, name, parameters, custom_headers = nil)
669
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
670
+ fail ArgumentError, 'name is nil' if name.nil?
671
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
704
672
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
705
673
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
706
674
 
@@ -710,91 +678,181 @@ module Azure::ARM::Redis
710
678
  # Set Headers
711
679
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
712
680
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
713
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/'
681
+
682
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
683
+
684
+ # Serialize Request
685
+ request_mapper = RedisRebootParameters.mapper()
686
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
687
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
688
+
689
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'
714
690
 
715
691
  request_url = @base_url || @client.base_url
716
692
 
717
693
  options = {
718
694
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
719
- path_params: {'subscriptionId' => @client.subscription_id},
695
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
720
696
  query_params: {'api-version' => @client.api_version},
697
+ body: request_content,
721
698
  headers: request_headers.merge(custom_headers || {}),
722
699
  base_url: request_url
723
700
  }
724
- promise = @client.make_request_async(:get, path_template, options)
701
+ promise = @client.make_request_async(:post, path_template, options)
702
+
703
+ promise = promise.then do |result|
704
+ http_response = result.response
705
+ status_code = http_response.status
706
+ response_content = http_response.body
707
+ unless status_code == 200 || status_code == 204
708
+ error_model = JSON.load(response_content)
709
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
710
+ end
711
+
712
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
713
+
714
+ result
715
+ end
716
+
717
+ promise.execute
718
+ end
719
+
720
+ #
721
+ # Import data into Redis cache.
722
+ #
723
+ # @param resource_group_name [String] The name of the resource group.
724
+ # @param name [String] The name of the Redis cache.
725
+ # @param parameters [ImportRDBParameters] Parameters for Redis import
726
+ # operation.
727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
+ # will be added to the HTTP request.
729
+ #
730
+ def import_data(resource_group_name, name, parameters, custom_headers = nil)
731
+ response = import_data_async(resource_group_name, name, parameters, custom_headers).value!
732
+ nil
733
+ end
734
+
735
+ #
736
+ # @param resource_group_name [String] The name of the resource group.
737
+ # @param name [String] The name of the Redis cache.
738
+ # @param parameters [ImportRDBParameters] Parameters for Redis import
739
+ # operation.
740
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
741
+ # will be added to the HTTP request.
742
+ #
743
+ # @return [Concurrent::Promise] promise which provides async access to http
744
+ # response.
745
+ #
746
+ def import_data_async(resource_group_name, name, parameters, custom_headers = nil)
747
+ # Send request
748
+ promise = begin_import_data_async(resource_group_name, name, parameters, custom_headers)
749
+
750
+ promise = promise.then do |response|
751
+ # Defining deserialization method.
752
+ deserialize_method = lambda do |parsed_response|
753
+ end
754
+
755
+ # Waiting for response.
756
+ @client.get_long_running_operation_result(response, deserialize_method)
757
+ end
758
+
759
+ promise
760
+ end
761
+
762
+ #
763
+ # Import data into Redis cache.
764
+ #
765
+ # @param resource_group_name [String] The name of the resource group.
766
+ # @param name [String] The name of the Redis cache.
767
+ # @param parameters [ExportRDBParameters] Parameters for Redis export
768
+ # operation.
769
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
770
+ # will be added to the HTTP request.
771
+ #
772
+ def export_data(resource_group_name, name, parameters, custom_headers = nil)
773
+ response = export_data_async(resource_group_name, name, parameters, custom_headers).value!
774
+ nil
775
+ end
725
776
 
726
- promise = promise.then do |result|
727
- http_response = result.response
728
- status_code = http_response.status
729
- response_content = http_response.body
730
- unless status_code == 200
731
- error_model = JSON.load(response_content)
732
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
733
- end
777
+ #
778
+ # @param resource_group_name [String] The name of the resource group.
779
+ # @param name [String] The name of the Redis cache.
780
+ # @param parameters [ExportRDBParameters] Parameters for Redis export
781
+ # operation.
782
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
783
+ # will be added to the HTTP request.
784
+ #
785
+ # @return [Concurrent::Promise] promise which provides async access to http
786
+ # response.
787
+ #
788
+ def export_data_async(resource_group_name, name, parameters, custom_headers = nil)
789
+ # Send request
790
+ promise = begin_export_data_async(resource_group_name, name, parameters, custom_headers)
734
791
 
735
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
736
- # Deserialize Response
737
- if status_code == 200
738
- begin
739
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
740
- result_mapper = RedisListResult.mapper()
741
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
742
- rescue Exception => e
743
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
744
- end
792
+ promise = promise.then do |response|
793
+ # Defining deserialization method.
794
+ deserialize_method = lambda do |parsed_response|
745
795
  end
746
796
 
747
- result
797
+ # Waiting for response.
798
+ @client.get_long_running_operation_result(response, deserialize_method)
748
799
  end
749
800
 
750
- promise.execute
801
+ promise
751
802
  end
752
803
 
753
804
  #
754
- # Retrieve a redis cache's access keys. This operation requires write
755
- # permission to the cache resource.
805
+ # Create or replace (overwrite/recreate, with potential downtime) an existing
806
+ # Redis cache.
756
807
  #
757
808
  # @param resource_group_name [String] The name of the resource group.
758
- # @param name [String] The name of the redis cache.
809
+ # @param name [String] The name of the Redis cache.
810
+ # @param parameters [RedisCreateParameters] Parameters supplied to the Create
811
+ # Redis operation.
759
812
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
760
813
  # will be added to the HTTP request.
761
814
  #
762
- # @return [RedisAccessKeys] operation results.
815
+ # @return [RedisResource] operation results.
763
816
  #
764
- def list_keys(resource_group_name, name, custom_headers = nil)
765
- response = list_keys_async(resource_group_name, name, custom_headers).value!
817
+ def begin_create(resource_group_name, name, parameters, custom_headers = nil)
818
+ response = begin_create_async(resource_group_name, name, parameters, custom_headers).value!
766
819
  response.body unless response.nil?
767
820
  end
768
821
 
769
822
  #
770
- # Retrieve a redis cache's access keys. This operation requires write
771
- # permission to the cache resource.
823
+ # Create or replace (overwrite/recreate, with potential downtime) an existing
824
+ # Redis cache.
772
825
  #
773
826
  # @param resource_group_name [String] The name of the resource group.
774
- # @param name [String] The name of the redis cache.
827
+ # @param name [String] The name of the Redis cache.
828
+ # @param parameters [RedisCreateParameters] Parameters supplied to the Create
829
+ # Redis operation.
775
830
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
776
831
  # will be added to the HTTP request.
777
832
  #
778
833
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
779
834
  #
780
- def list_keys_with_http_info(resource_group_name, name, custom_headers = nil)
781
- list_keys_async(resource_group_name, name, custom_headers).value!
835
+ def begin_create_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
836
+ begin_create_async(resource_group_name, name, parameters, custom_headers).value!
782
837
  end
783
838
 
784
839
  #
785
- # Retrieve a redis cache's access keys. This operation requires write
786
- # permission to the cache resource.
840
+ # Create or replace (overwrite/recreate, with potential downtime) an existing
841
+ # Redis cache.
787
842
  #
788
843
  # @param resource_group_name [String] The name of the resource group.
789
- # @param name [String] The name of the redis cache.
844
+ # @param name [String] The name of the Redis cache.
845
+ # @param parameters [RedisCreateParameters] Parameters supplied to the Create
846
+ # Redis operation.
790
847
  # @param [Hash{String => String}] A hash of custom headers that will be added
791
848
  # to the HTTP request.
792
849
  #
793
850
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
794
851
  #
795
- def list_keys_async(resource_group_name, name, custom_headers = nil)
852
+ def begin_create_async(resource_group_name, name, parameters, custom_headers = nil)
796
853
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
797
854
  fail ArgumentError, 'name is nil' if name.nil?
855
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
798
856
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
799
857
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
800
858
 
@@ -804,7 +862,15 @@ module Azure::ARM::Redis
804
862
  # Set Headers
805
863
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
806
864
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
807
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'
865
+
866
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
867
+
868
+ # Serialize Request
869
+ request_mapper = RedisCreateParameters.mapper()
870
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
871
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
872
+
873
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
808
874
 
809
875
  request_url = @base_url || @client.base_url
810
876
 
@@ -812,26 +878,37 @@ module Azure::ARM::Redis
812
878
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
813
879
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
814
880
  query_params: {'api-version' => @client.api_version},
881
+ body: request_content,
815
882
  headers: request_headers.merge(custom_headers || {}),
816
883
  base_url: request_url
817
884
  }
818
- promise = @client.make_request_async(:post, path_template, options)
885
+ promise = @client.make_request_async(:put, path_template, options)
819
886
 
820
887
  promise = promise.then do |result|
821
888
  http_response = result.response
822
889
  status_code = http_response.status
823
890
  response_content = http_response.body
824
- unless status_code == 200
891
+ unless status_code == 201 || status_code == 200
825
892
  error_model = JSON.load(response_content)
826
893
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
827
894
  end
828
895
 
829
896
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
830
897
  # Deserialize Response
898
+ if status_code == 201
899
+ begin
900
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
901
+ result_mapper = RedisResource.mapper()
902
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
903
+ rescue Exception => e
904
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
905
+ end
906
+ end
907
+ # Deserialize Response
831
908
  if status_code == 200
832
909
  begin
833
910
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
834
- result_mapper = RedisAccessKeys.mapper()
911
+ result_mapper = RedisResource.mapper()
835
912
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
836
913
  rescue Exception => e
837
914
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -845,54 +922,51 @@ module Azure::ARM::Redis
845
922
  end
846
923
 
847
924
  #
848
- # Regenerate redis cache's access keys. This operation requires write
849
- # permission to the cache resource.
925
+ # Update an existing Redis cache.
850
926
  #
851
927
  # @param resource_group_name [String] The name of the resource group.
852
- # @param name [String] The name of the redis cache.
853
- # @param parameters [RedisRegenerateKeyParameters] Specifies which key to
854
- # reset.
928
+ # @param name [String] The name of the Redis cache.
929
+ # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
930
+ # Redis operation.
855
931
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
856
932
  # will be added to the HTTP request.
857
933
  #
858
- # @return [RedisAccessKeys] operation results.
934
+ # @return [RedisResource] operation results.
859
935
  #
860
- def regenerate_key(resource_group_name, name, parameters, custom_headers = nil)
861
- response = regenerate_key_async(resource_group_name, name, parameters, custom_headers).value!
936
+ def begin_update(resource_group_name, name, parameters, custom_headers = nil)
937
+ response = begin_update_async(resource_group_name, name, parameters, custom_headers).value!
862
938
  response.body unless response.nil?
863
939
  end
864
940
 
865
941
  #
866
- # Regenerate redis cache's access keys. This operation requires write
867
- # permission to the cache resource.
942
+ # Update an existing Redis cache.
868
943
  #
869
944
  # @param resource_group_name [String] The name of the resource group.
870
- # @param name [String] The name of the redis cache.
871
- # @param parameters [RedisRegenerateKeyParameters] Specifies which key to
872
- # reset.
945
+ # @param name [String] The name of the Redis cache.
946
+ # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
947
+ # Redis operation.
873
948
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
874
949
  # will be added to the HTTP request.
875
950
  #
876
951
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
877
952
  #
878
- def regenerate_key_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
879
- regenerate_key_async(resource_group_name, name, parameters, custom_headers).value!
953
+ def begin_update_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
954
+ begin_update_async(resource_group_name, name, parameters, custom_headers).value!
880
955
  end
881
956
 
882
957
  #
883
- # Regenerate redis cache's access keys. This operation requires write
884
- # permission to the cache resource.
958
+ # Update an existing Redis cache.
885
959
  #
886
960
  # @param resource_group_name [String] The name of the resource group.
887
- # @param name [String] The name of the redis cache.
888
- # @param parameters [RedisRegenerateKeyParameters] Specifies which key to
889
- # reset.
961
+ # @param name [String] The name of the Redis cache.
962
+ # @param parameters [RedisUpdateParameters] Parameters supplied to the Update
963
+ # Redis operation.
890
964
  # @param [Hash{String => String}] A hash of custom headers that will be added
891
965
  # to the HTTP request.
892
966
  #
893
967
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
894
968
  #
895
- def regenerate_key_async(resource_group_name, name, parameters, custom_headers = nil)
969
+ def begin_update_async(resource_group_name, name, parameters, custom_headers = nil)
896
970
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
897
971
  fail ArgumentError, 'name is nil' if name.nil?
898
972
  fail ArgumentError, 'parameters is nil' if parameters.nil?
@@ -909,11 +983,11 @@ module Azure::ARM::Redis
909
983
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
910
984
 
911
985
  # Serialize Request
912
- request_mapper = RedisRegenerateKeyParameters.mapper()
986
+ request_mapper = RedisUpdateParameters.mapper()
913
987
  request_content = @client.serialize(request_mapper, parameters, 'parameters')
914
988
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
915
989
 
916
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'
990
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
917
991
 
918
992
  request_url = @base_url || @client.base_url
919
993
 
@@ -925,7 +999,7 @@ module Azure::ARM::Redis
925
999
  headers: request_headers.merge(custom_headers || {}),
926
1000
  base_url: request_url
927
1001
  }
928
- promise = @client.make_request_async(:post, path_template, options)
1002
+ promise = @client.make_request_async(:patch, path_template, options)
929
1003
 
930
1004
  promise = promise.then do |result|
931
1005
  http_response = result.response
@@ -941,7 +1015,7 @@ module Azure::ARM::Redis
941
1015
  if status_code == 200
942
1016
  begin
943
1017
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
944
- result_mapper = RedisAccessKeys.mapper()
1018
+ result_mapper = RedisResource.mapper()
945
1019
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
946
1020
  rescue Exception => e
947
1021
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -955,56 +1029,46 @@ module Azure::ARM::Redis
955
1029
  end
956
1030
 
957
1031
  #
958
- # Reboot specified redis node(s). This operation requires write permission to
959
- # the cache resource. There can be potential data loss.
1032
+ # Deletes a Redis cache.
960
1033
  #
961
1034
  # @param resource_group_name [String] The name of the resource group.
962
- # @param name [String] The name of the redis cache.
963
- # @param parameters [RedisRebootParameters] Specifies which redis node(s) to
964
- # reboot.
1035
+ # @param name [String] The name of the Redis cache.
965
1036
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
966
1037
  # will be added to the HTTP request.
967
1038
  #
968
1039
  #
969
- def force_reboot(resource_group_name, name, parameters, custom_headers = nil)
970
- response = force_reboot_async(resource_group_name, name, parameters, custom_headers).value!
1040
+ def begin_delete(resource_group_name, name, custom_headers = nil)
1041
+ response = begin_delete_async(resource_group_name, name, custom_headers).value!
971
1042
  nil
972
1043
  end
973
1044
 
974
1045
  #
975
- # Reboot specified redis node(s). This operation requires write permission to
976
- # the cache resource. There can be potential data loss.
1046
+ # Deletes a Redis cache.
977
1047
  #
978
1048
  # @param resource_group_name [String] The name of the resource group.
979
- # @param name [String] The name of the redis cache.
980
- # @param parameters [RedisRebootParameters] Specifies which redis node(s) to
981
- # reboot.
1049
+ # @param name [String] The name of the Redis cache.
982
1050
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
983
1051
  # will be added to the HTTP request.
984
1052
  #
985
1053
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
986
1054
  #
987
- def force_reboot_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
988
- force_reboot_async(resource_group_name, name, parameters, custom_headers).value!
1055
+ def begin_delete_with_http_info(resource_group_name, name, custom_headers = nil)
1056
+ begin_delete_async(resource_group_name, name, custom_headers).value!
989
1057
  end
990
1058
 
991
1059
  #
992
- # Reboot specified redis node(s). This operation requires write permission to
993
- # the cache resource. There can be potential data loss.
1060
+ # Deletes a Redis cache.
994
1061
  #
995
1062
  # @param resource_group_name [String] The name of the resource group.
996
- # @param name [String] The name of the redis cache.
997
- # @param parameters [RedisRebootParameters] Specifies which redis node(s) to
998
- # reboot.
1063
+ # @param name [String] The name of the Redis cache.
999
1064
  # @param [Hash{String => String}] A hash of custom headers that will be added
1000
1065
  # to the HTTP request.
1001
1066
  #
1002
1067
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1003
1068
  #
1004
- def force_reboot_async(resource_group_name, name, parameters, custom_headers = nil)
1069
+ def begin_delete_async(resource_group_name, name, custom_headers = nil)
1005
1070
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1006
1071
  fail ArgumentError, 'name is nil' if name.nil?
1007
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1008
1072
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1009
1073
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1010
1074
 
@@ -1014,15 +1078,7 @@ module Azure::ARM::Redis
1014
1078
  # Set Headers
1015
1079
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1016
1080
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1017
-
1018
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1019
-
1020
- # Serialize Request
1021
- request_mapper = RedisRebootParameters.mapper()
1022
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
1023
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1024
-
1025
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'
1081
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
1026
1082
 
1027
1083
  request_url = @base_url || @client.base_url
1028
1084
 
@@ -1030,11 +1086,10 @@ module Azure::ARM::Redis
1030
1086
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1031
1087
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1032
1088
  query_params: {'api-version' => @client.api_version},
1033
- body: request_content,
1034
1089
  headers: request_headers.merge(custom_headers || {}),
1035
1090
  base_url: request_url
1036
1091
  }
1037
- promise = @client.make_request_async(:post, path_template, options)
1092
+ promise = @client.make_request_async(:delete, path_template, options)
1038
1093
 
1039
1094
  promise = promise.then do |result|
1040
1095
  http_response = result.response
@@ -1054,53 +1109,11 @@ module Azure::ARM::Redis
1054
1109
  end
1055
1110
 
1056
1111
  #
1057
- # Import data into redis cache.
1058
- #
1059
- # @param resource_group_name [String] The name of the resource group.
1060
- # @param name [String] The name of the redis cache.
1061
- # @param parameters [ImportRDBParameters] Parameters for redis import
1062
- # operation.
1063
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1064
- # will be added to the HTTP request.
1065
- #
1066
- def import_data(resource_group_name, name, parameters, custom_headers = nil)
1067
- response = import_data_async(resource_group_name, name, parameters, custom_headers).value!
1068
- nil
1069
- end
1070
-
1071
- #
1072
- # @param resource_group_name [String] The name of the resource group.
1073
- # @param name [String] The name of the redis cache.
1074
- # @param parameters [ImportRDBParameters] Parameters for redis import
1075
- # operation.
1076
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1077
- # will be added to the HTTP request.
1078
- #
1079
- # @return [Concurrent::Promise] promise which provides async access to http
1080
- # response.
1081
- #
1082
- def import_data_async(resource_group_name, name, parameters, custom_headers = nil)
1083
- # Send request
1084
- promise = begin_import_data_async(resource_group_name, name, parameters, custom_headers)
1085
-
1086
- promise = promise.then do |response|
1087
- # Defining deserialization method.
1088
- deserialize_method = lambda do |parsed_response|
1089
- end
1090
-
1091
- # Waiting for response.
1092
- @client.get_long_running_operation_result(response, deserialize_method)
1093
- end
1094
-
1095
- promise
1096
- end
1097
-
1098
- #
1099
- # Import data into redis cache.
1112
+ # Import data into Redis cache.
1100
1113
  #
1101
1114
  # @param resource_group_name [String] The name of the resource group.
1102
- # @param name [String] The name of the redis cache.
1103
- # @param parameters [ImportRDBParameters] Parameters for redis import
1115
+ # @param name [String] The name of the Redis cache.
1116
+ # @param parameters [ImportRDBParameters] Parameters for Redis import
1104
1117
  # operation.
1105
1118
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1106
1119
  # will be added to the HTTP request.
@@ -1112,11 +1125,11 @@ module Azure::ARM::Redis
1112
1125
  end
1113
1126
 
1114
1127
  #
1115
- # Import data into redis cache.
1128
+ # Import data into Redis cache.
1116
1129
  #
1117
1130
  # @param resource_group_name [String] The name of the resource group.
1118
- # @param name [String] The name of the redis cache.
1119
- # @param parameters [ImportRDBParameters] Parameters for redis import
1131
+ # @param name [String] The name of the Redis cache.
1132
+ # @param parameters [ImportRDBParameters] Parameters for Redis import
1120
1133
  # operation.
1121
1134
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1122
1135
  # will be added to the HTTP request.
@@ -1128,11 +1141,11 @@ module Azure::ARM::Redis
1128
1141
  end
1129
1142
 
1130
1143
  #
1131
- # Import data into redis cache.
1144
+ # Import data into Redis cache.
1132
1145
  #
1133
1146
  # @param resource_group_name [String] The name of the resource group.
1134
- # @param name [String] The name of the redis cache.
1135
- # @param parameters [ImportRDBParameters] Parameters for redis import
1147
+ # @param name [String] The name of the Redis cache.
1148
+ # @param parameters [ImportRDBParameters] Parameters for Redis import
1136
1149
  # operation.
1137
1150
  # @param [Hash{String => String}] A hash of custom headers that will be added
1138
1151
  # to the HTTP request.
@@ -1192,53 +1205,11 @@ module Azure::ARM::Redis
1192
1205
  end
1193
1206
 
1194
1207
  #
1195
- # Import data into redis cache.
1196
- #
1197
- # @param resource_group_name [String] The name of the resource group.
1198
- # @param name [String] The name of the redis cache.
1199
- # @param parameters [ExportRDBParameters] Parameters for redis export
1200
- # operation.
1201
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1202
- # will be added to the HTTP request.
1203
- #
1204
- def export_data(resource_group_name, name, parameters, custom_headers = nil)
1205
- response = export_data_async(resource_group_name, name, parameters, custom_headers).value!
1206
- nil
1207
- end
1208
-
1209
- #
1210
- # @param resource_group_name [String] The name of the resource group.
1211
- # @param name [String] The name of the redis cache.
1212
- # @param parameters [ExportRDBParameters] Parameters for redis export
1213
- # operation.
1214
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1215
- # will be added to the HTTP request.
1216
- #
1217
- # @return [Concurrent::Promise] promise which provides async access to http
1218
- # response.
1219
- #
1220
- def export_data_async(resource_group_name, name, parameters, custom_headers = nil)
1221
- # Send request
1222
- promise = begin_export_data_async(resource_group_name, name, parameters, custom_headers)
1223
-
1224
- promise = promise.then do |response|
1225
- # Defining deserialization method.
1226
- deserialize_method = lambda do |parsed_response|
1227
- end
1228
-
1229
- # Waiting for response.
1230
- @client.get_long_running_operation_result(response, deserialize_method)
1231
- end
1232
-
1233
- promise
1234
- end
1235
-
1236
- #
1237
- # Import data into redis cache.
1208
+ # Import data into Redis cache.
1238
1209
  #
1239
1210
  # @param resource_group_name [String] The name of the resource group.
1240
- # @param name [String] The name of the redis cache.
1241
- # @param parameters [ExportRDBParameters] Parameters for redis export
1211
+ # @param name [String] The name of the Redis cache.
1212
+ # @param parameters [ExportRDBParameters] Parameters for Redis export
1242
1213
  # operation.
1243
1214
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1244
1215
  # will be added to the HTTP request.
@@ -1250,11 +1221,11 @@ module Azure::ARM::Redis
1250
1221
  end
1251
1222
 
1252
1223
  #
1253
- # Import data into redis cache.
1224
+ # Import data into Redis cache.
1254
1225
  #
1255
1226
  # @param resource_group_name [String] The name of the resource group.
1256
- # @param name [String] The name of the redis cache.
1257
- # @param parameters [ExportRDBParameters] Parameters for redis export
1227
+ # @param name [String] The name of the Redis cache.
1228
+ # @param parameters [ExportRDBParameters] Parameters for Redis export
1258
1229
  # operation.
1259
1230
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1260
1231
  # will be added to the HTTP request.
@@ -1266,11 +1237,11 @@ module Azure::ARM::Redis
1266
1237
  end
1267
1238
 
1268
1239
  #
1269
- # Import data into redis cache.
1240
+ # Import data into Redis cache.
1270
1241
  #
1271
1242
  # @param resource_group_name [String] The name of the resource group.
1272
- # @param name [String] The name of the redis cache.
1273
- # @param parameters [ExportRDBParameters] Parameters for redis export
1243
+ # @param name [String] The name of the Redis cache.
1244
+ # @param parameters [ExportRDBParameters] Parameters for Redis export
1274
1245
  # operation.
1275
1246
  # @param [Hash{String => String}] A hash of custom headers that will be added
1276
1247
  # to the HTTP request.
@@ -1330,10 +1301,10 @@ module Azure::ARM::Redis
1330
1301
  end
1331
1302
 
1332
1303
  #
1333
- # Gets all redis caches in a resource group.
1304
+ # Lists all Redis caches in a resource group.
1334
1305
  #
1335
- # @param next_page_link [String] The NextLink from the previous successful
1336
- # call to List operation.
1306
+ # @param next_page_link [String] The NextLink from the previous successful call
1307
+ # to List operation.
1337
1308
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1338
1309
  # will be added to the HTTP request.
1339
1310
  #
@@ -1345,10 +1316,10 @@ module Azure::ARM::Redis
1345
1316
  end
1346
1317
 
1347
1318
  #
1348
- # Gets all redis caches in a resource group.
1319
+ # Lists all Redis caches in a resource group.
1349
1320
  #
1350
- # @param next_page_link [String] The NextLink from the previous successful
1351
- # call to List operation.
1321
+ # @param next_page_link [String] The NextLink from the previous successful call
1322
+ # to List operation.
1352
1323
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1353
1324
  # will be added to the HTTP request.
1354
1325
  #
@@ -1359,10 +1330,10 @@ module Azure::ARM::Redis
1359
1330
  end
1360
1331
 
1361
1332
  #
1362
- # Gets all redis caches in a resource group.
1333
+ # Lists all Redis caches in a resource group.
1363
1334
  #
1364
- # @param next_page_link [String] The NextLink from the previous successful
1365
- # call to List operation.
1335
+ # @param next_page_link [String] The NextLink from the previous successful call
1336
+ # to List operation.
1366
1337
  # @param [Hash{String => String}] A hash of custom headers that will be added
1367
1338
  # to the HTTP request.
1368
1339
  #
@@ -1417,10 +1388,10 @@ module Azure::ARM::Redis
1417
1388
  end
1418
1389
 
1419
1390
  #
1420
- # Gets all redis caches in the specified subscription.
1391
+ # Gets all Redis caches in the specified subscription.
1421
1392
  #
1422
- # @param next_page_link [String] The NextLink from the previous successful
1423
- # call to List operation.
1393
+ # @param next_page_link [String] The NextLink from the previous successful call
1394
+ # to List operation.
1424
1395
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1425
1396
  # will be added to the HTTP request.
1426
1397
  #
@@ -1432,10 +1403,10 @@ module Azure::ARM::Redis
1432
1403
  end
1433
1404
 
1434
1405
  #
1435
- # Gets all redis caches in the specified subscription.
1406
+ # Gets all Redis caches in the specified subscription.
1436
1407
  #
1437
- # @param next_page_link [String] The NextLink from the previous successful
1438
- # call to List operation.
1408
+ # @param next_page_link [String] The NextLink from the previous successful call
1409
+ # to List operation.
1439
1410
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1440
1411
  # will be added to the HTTP request.
1441
1412
  #
@@ -1446,10 +1417,10 @@ module Azure::ARM::Redis
1446
1417
  end
1447
1418
 
1448
1419
  #
1449
- # Gets all redis caches in the specified subscription.
1420
+ # Gets all Redis caches in the specified subscription.
1450
1421
  #
1451
- # @param next_page_link [String] The NextLink from the previous successful
1452
- # call to List operation.
1422
+ # @param next_page_link [String] The NextLink from the previous successful call
1423
+ # to List operation.
1453
1424
  # @param [Hash{String => String}] A hash of custom headers that will be added
1454
1425
  # to the HTTP request.
1455
1426
  #
@@ -1503,5 +1474,44 @@ module Azure::ARM::Redis
1503
1474
  promise.execute
1504
1475
  end
1505
1476
 
1477
+ #
1478
+ # Lists all Redis caches in a resource group.
1479
+ #
1480
+ # @param resource_group_name [String] The name of the resource group.
1481
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1482
+ # will be added to the HTTP request.
1483
+ #
1484
+ # @return [RedisListResult] which provide lazy access to pages of the response.
1485
+ #
1486
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
1487
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
1488
+ unless response.nil?
1489
+ page = response.body
1490
+ page.next_method = Proc.new do |next_page_link|
1491
+ list_by_resource_group_next_async(next_page_link, custom_headers)
1492
+ end
1493
+ page
1494
+ end
1495
+ end
1496
+
1497
+ #
1498
+ # Gets all Redis caches in the specified subscription.
1499
+ #
1500
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1501
+ # will be added to the HTTP request.
1502
+ #
1503
+ # @return [RedisListResult] which provide lazy access to pages of the response.
1504
+ #
1505
+ def list_as_lazy(custom_headers = nil)
1506
+ response = list_async(custom_headers).value!
1507
+ unless response.nil?
1508
+ page = response.body
1509
+ page.next_method = Proc.new do |next_page_link|
1510
+ list_next_async(next_page_link, custom_headers)
1511
+ end
1512
+ page
1513
+ end
1514
+ end
1515
+
1506
1516
  end
1507
1517
  end