azure_mgmt_redis 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/azure_mgmt_redis.gemspec +4 -5
- data/lib/azure_mgmt_redis.rb +3 -42
- data/lib/generated/azure_mgmt_redis.rb +49 -0
- data/lib/generated/azure_mgmt_redis/models/day_of_week.rb +21 -0
- data/lib/generated/azure_mgmt_redis/models/export_rdbparameters.rb +64 -0
- data/lib/generated/azure_mgmt_redis/models/import_rdbparameters.rb +61 -0
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/models/reboot_type.rb +0 -0
- data/lib/generated/azure_mgmt_redis/models/redis_access_keys.rb +56 -0
- data/lib/generated/azure_mgmt_redis/models/redis_create_or_update_parameters.rb +189 -0
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/models/redis_key_type.rb +0 -0
- data/lib/generated/azure_mgmt_redis/models/redis_list_keys_result.rb +56 -0
- data/lib/generated/azure_mgmt_redis/models/redis_list_result.rb +93 -0
- data/lib/generated/azure_mgmt_redis/models/redis_patch_schedules_request.rb +52 -0
- data/lib/generated/azure_mgmt_redis/models/redis_patch_schedules_response.rb +95 -0
- data/lib/generated/azure_mgmt_redis/models/redis_properties.rb +144 -0
- data/lib/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +57 -0
- data/lib/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +46 -0
- data/lib/generated/azure_mgmt_redis/models/redis_resource.rb +229 -0
- data/lib/generated/azure_mgmt_redis/models/redis_resource_with_access_key.rb +240 -0
- data/lib/generated/azure_mgmt_redis/models/schedule_entry.rb +67 -0
- data/lib/generated/azure_mgmt_redis/models/sku.rb +68 -0
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/models/sku_family.rb +0 -0
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/models/sku_name.rb +0 -0
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/module_definition.rb +0 -0
- data/lib/generated/azure_mgmt_redis/patch_schedules.rb +313 -0
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/redis.rb +385 -63
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/redis_management_client.rb +8 -4
- data/lib/{azure_mgmt_redis → generated/azure_mgmt_redis}/version.rb +1 -1
- metadata +47 -62
- data/lib/azure_mgmt_redis/models/redis_access_keys.rb +0 -67
- data/lib/azure_mgmt_redis/models/redis_create_or_update_parameters.rb +0 -93
- data/lib/azure_mgmt_redis/models/redis_list_keys_result.rb +0 -67
- data/lib/azure_mgmt_redis/models/redis_list_result.rb +0 -85
- data/lib/azure_mgmt_redis/models/redis_properties.rb +0 -148
- data/lib/azure_mgmt_redis/models/redis_readable_properties.rb +0 -146
- data/lib/azure_mgmt_redis/models/redis_readable_properties_with_access_key.rb +0 -149
- data/lib/azure_mgmt_redis/models/redis_reboot_parameters.rb +0 -73
- data/lib/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +0 -61
- data/lib/azure_mgmt_redis/models/redis_resource.rb +0 -92
- data/lib/azure_mgmt_redis/models/redis_resource_with_access_key.rb +0 -92
- data/lib/azure_mgmt_redis/models/sku.rb +0 -89
@@ -5,8 +5,7 @@
|
|
5
5
|
|
6
6
|
module Azure::ARM::Redis
|
7
7
|
#
|
8
|
-
#
|
9
|
-
# Service
|
8
|
+
# REST API for Azure Redis Cache Service
|
10
9
|
#
|
11
10
|
class Redis
|
12
11
|
include Azure::ARM::Redis::Models
|
@@ -75,21 +74,23 @@ module Azure::ARM::Redis
|
|
75
74
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
76
75
|
fail ArgumentError, 'name is nil' if name.nil?
|
77
76
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
78
|
-
parameters.validate unless parameters.nil?
|
79
77
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
80
78
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
79
|
+
|
80
|
+
|
81
81
|
request_headers = {}
|
82
82
|
|
83
83
|
# Set Headers
|
84
84
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
85
85
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
86
86
|
|
87
|
-
# Serialize Request
|
88
87
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
request_content =
|
88
|
+
|
89
|
+
# Serialize Request
|
90
|
+
request_mapper = RedisCreateOrUpdateParameters.mapper()
|
91
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
92
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
93
|
+
|
93
94
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
|
94
95
|
options = {
|
95
96
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -121,10 +122,8 @@ module Azure::ARM::Redis
|
|
121
122
|
if status_code == 201
|
122
123
|
begin
|
123
124
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
124
|
-
|
125
|
-
|
126
|
-
end
|
127
|
-
result.body = parsed_response
|
125
|
+
result_mapper = RedisResourceWithAccessKey.mapper()
|
126
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
128
127
|
rescue Exception => e
|
129
128
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
130
129
|
end
|
@@ -133,10 +132,8 @@ module Azure::ARM::Redis
|
|
133
132
|
if status_code == 200
|
134
133
|
begin
|
135
134
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
136
|
-
|
137
|
-
|
138
|
-
end
|
139
|
-
result.body = parsed_response
|
135
|
+
result_mapper = RedisResourceWithAccessKey.mapper()
|
136
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
140
137
|
rescue Exception => e
|
141
138
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
142
139
|
end
|
@@ -191,6 +188,8 @@ module Azure::ARM::Redis
|
|
191
188
|
fail ArgumentError, 'name is nil' if name.nil?
|
192
189
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
193
190
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
191
|
+
|
192
|
+
|
194
193
|
request_headers = {}
|
195
194
|
|
196
195
|
# Set Headers
|
@@ -214,7 +213,7 @@ module Azure::ARM::Redis
|
|
214
213
|
promise = promise.then do |http_response|
|
215
214
|
status_code = http_response.status
|
216
215
|
response_content = http_response.body
|
217
|
-
unless status_code == 200 || status_code ==
|
216
|
+
unless status_code == 200 || status_code == 204
|
218
217
|
error_model = JSON.load(response_content)
|
219
218
|
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
220
219
|
end
|
@@ -273,6 +272,8 @@ module Azure::ARM::Redis
|
|
273
272
|
fail ArgumentError, 'name is nil' if name.nil?
|
274
273
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
275
274
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
275
|
+
|
276
|
+
|
276
277
|
request_headers = {}
|
277
278
|
|
278
279
|
# Set Headers
|
@@ -308,10 +309,8 @@ module Azure::ARM::Redis
|
|
308
309
|
if status_code == 200
|
309
310
|
begin
|
310
311
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
311
|
-
|
312
|
-
|
313
|
-
end
|
314
|
-
result.body = parsed_response
|
312
|
+
result_mapper = RedisResource.mapper()
|
313
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
315
314
|
rescue Exception => e
|
316
315
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
317
316
|
end
|
@@ -330,11 +329,31 @@ module Azure::ARM::Redis
|
|
330
329
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
331
330
|
# will be added to the HTTP request.
|
332
331
|
#
|
333
|
-
# @return [RedisListResult]
|
332
|
+
# @return [RedisListResult] which provide lazy access to pages of the response.
|
334
333
|
#
|
335
|
-
def
|
334
|
+
def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
|
336
335
|
response = list_by_resource_group_async(resource_group_name, custom_headers).value!
|
337
|
-
|
336
|
+
unless response.nil?
|
337
|
+
page = response.body
|
338
|
+
page.next_method = Proc.new do |next_link|
|
339
|
+
list_by_resource_group_next_async(next_link, custom_headers)
|
340
|
+
end
|
341
|
+
page
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
#
|
346
|
+
# Gets all redis caches in a resource group.
|
347
|
+
#
|
348
|
+
# @param resource_group_name [String] The name of the resource group.
|
349
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
350
|
+
# will be added to the HTTP request.
|
351
|
+
#
|
352
|
+
# @return [Array<RedisResource>] operation results.
|
353
|
+
#
|
354
|
+
def list_by_resource_group(resource_group_name, custom_headers = nil)
|
355
|
+
first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
|
356
|
+
first_page.get_all_items
|
338
357
|
end
|
339
358
|
|
340
359
|
#
|
@@ -363,6 +382,8 @@ module Azure::ARM::Redis
|
|
363
382
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
364
383
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
365
384
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
385
|
+
|
386
|
+
|
366
387
|
request_headers = {}
|
367
388
|
|
368
389
|
# Set Headers
|
@@ -398,10 +419,8 @@ module Azure::ARM::Redis
|
|
398
419
|
if status_code == 200
|
399
420
|
begin
|
400
421
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
401
|
-
|
402
|
-
|
403
|
-
end
|
404
|
-
result.body = parsed_response
|
422
|
+
result_mapper = RedisListResult.mapper()
|
423
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
405
424
|
rescue Exception => e
|
406
425
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
407
426
|
end
|
@@ -419,11 +438,30 @@ module Azure::ARM::Redis
|
|
419
438
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
420
439
|
# will be added to the HTTP request.
|
421
440
|
#
|
422
|
-
# @return [RedisListResult]
|
441
|
+
# @return [RedisListResult] which provide lazy access to pages of the response.
|
423
442
|
#
|
424
|
-
def
|
443
|
+
def list_as_lazy(custom_headers = nil)
|
425
444
|
response = list_async(custom_headers).value!
|
426
|
-
|
445
|
+
unless response.nil?
|
446
|
+
page = response.body
|
447
|
+
page.next_method = Proc.new do |next_link|
|
448
|
+
list_next_async(next_link, custom_headers)
|
449
|
+
end
|
450
|
+
page
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
#
|
455
|
+
# Gets all redis caches in the specified subscription.
|
456
|
+
#
|
457
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
458
|
+
# will be added to the HTTP request.
|
459
|
+
#
|
460
|
+
# @return [Array<RedisResource>] operation results.
|
461
|
+
#
|
462
|
+
def list(custom_headers = nil)
|
463
|
+
first_page = list_as_lazy(custom_headers)
|
464
|
+
first_page.get_all_items
|
427
465
|
end
|
428
466
|
|
429
467
|
#
|
@@ -449,6 +487,8 @@ module Azure::ARM::Redis
|
|
449
487
|
def list_async(custom_headers = nil)
|
450
488
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
451
489
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
490
|
+
|
491
|
+
|
452
492
|
request_headers = {}
|
453
493
|
|
454
494
|
# Set Headers
|
@@ -484,10 +524,8 @@ module Azure::ARM::Redis
|
|
484
524
|
if status_code == 200
|
485
525
|
begin
|
486
526
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
487
|
-
|
488
|
-
|
489
|
-
end
|
490
|
-
result.body = parsed_response
|
527
|
+
result_mapper = RedisListResult.mapper()
|
528
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
491
529
|
rescue Exception => e
|
492
530
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
493
531
|
end
|
@@ -546,6 +584,8 @@ module Azure::ARM::Redis
|
|
546
584
|
fail ArgumentError, 'name is nil' if name.nil?
|
547
585
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
548
586
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
587
|
+
|
588
|
+
|
549
589
|
request_headers = {}
|
550
590
|
|
551
591
|
# Set Headers
|
@@ -581,10 +621,8 @@ module Azure::ARM::Redis
|
|
581
621
|
if status_code == 200
|
582
622
|
begin
|
583
623
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
584
|
-
|
585
|
-
|
586
|
-
end
|
587
|
-
result.body = parsed_response
|
624
|
+
result_mapper = RedisListKeysResult.mapper()
|
625
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
588
626
|
rescue Exception => e
|
589
627
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
590
628
|
end
|
@@ -648,21 +686,23 @@ module Azure::ARM::Redis
|
|
648
686
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
649
687
|
fail ArgumentError, 'name is nil' if name.nil?
|
650
688
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
651
|
-
parameters.validate unless parameters.nil?
|
652
689
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
653
690
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
691
|
+
|
692
|
+
|
654
693
|
request_headers = {}
|
655
694
|
|
656
695
|
# Set Headers
|
657
696
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
658
697
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
659
698
|
|
660
|
-
# Serialize Request
|
661
699
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
request_content =
|
700
|
+
|
701
|
+
# Serialize Request
|
702
|
+
request_mapper = RedisRegenerateKeyParameters.mapper()
|
703
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
704
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
705
|
+
|
666
706
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'
|
667
707
|
options = {
|
668
708
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -694,10 +734,8 @@ module Azure::ARM::Redis
|
|
694
734
|
if status_code == 200
|
695
735
|
begin
|
696
736
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
697
|
-
|
698
|
-
|
699
|
-
end
|
700
|
-
result.body = parsed_response
|
737
|
+
result_mapper = RedisListKeysResult.mapper()
|
738
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
701
739
|
rescue Exception => e
|
702
740
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
703
741
|
end
|
@@ -760,22 +798,306 @@ module Azure::ARM::Redis
|
|
760
798
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
761
799
|
fail ArgumentError, 'name is nil' if name.nil?
|
762
800
|
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
763
|
-
parameters.validate unless parameters.nil?
|
764
801
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
765
802
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
803
|
+
|
804
|
+
|
766
805
|
request_headers = {}
|
767
806
|
|
768
807
|
# Set Headers
|
769
808
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
770
809
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
771
810
|
|
811
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
812
|
+
|
772
813
|
# Serialize Request
|
814
|
+
request_mapper = RedisRebootParameters.mapper()
|
815
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
816
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
817
|
+
|
818
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'
|
819
|
+
options = {
|
820
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
821
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
822
|
+
query_params: {'api-version' => @client.api_version},
|
823
|
+
body: request_content,
|
824
|
+
headers: request_headers.merge(custom_headers || {})
|
825
|
+
}
|
826
|
+
|
827
|
+
request_url = @base_url || @client.base_url
|
828
|
+
|
829
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
830
|
+
promise = request.run_promise do |req|
|
831
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
832
|
+
end
|
833
|
+
|
834
|
+
promise = promise.then do |http_response|
|
835
|
+
status_code = http_response.status
|
836
|
+
response_content = http_response.body
|
837
|
+
unless status_code == 200 || status_code == 204
|
838
|
+
error_model = JSON.load(response_content)
|
839
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
840
|
+
end
|
841
|
+
|
842
|
+
# Create Result
|
843
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
844
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
845
|
+
|
846
|
+
result
|
847
|
+
end
|
848
|
+
|
849
|
+
promise.execute
|
850
|
+
end
|
851
|
+
|
852
|
+
#
|
853
|
+
# Import data into redis cache.
|
854
|
+
#
|
855
|
+
# @param resource_group_name [String] The name of the resource group.
|
856
|
+
# @param name [String] The name of the redis cache.
|
857
|
+
# @param parameters [ImportRDBParameters] Parameters for redis import
|
858
|
+
# operation.
|
859
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
860
|
+
# will be added to the HTTP request.
|
861
|
+
#
|
862
|
+
def import(resource_group_name, name, parameters, custom_headers = nil)
|
863
|
+
response = import_async(resource_group_name, name, parameters, custom_headers).value!
|
864
|
+
nil
|
865
|
+
end
|
866
|
+
|
867
|
+
#
|
868
|
+
# @param resource_group_name [String] The name of the resource group.
|
869
|
+
# @param name [String] The name of the redis cache.
|
870
|
+
# @param parameters [ImportRDBParameters] Parameters for redis import
|
871
|
+
# operation.
|
872
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
873
|
+
# will be added to the HTTP request.
|
874
|
+
#
|
875
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
876
|
+
# response.
|
877
|
+
#
|
878
|
+
def import_async(resource_group_name, name, parameters, custom_headers = nil)
|
879
|
+
# Send request
|
880
|
+
promise = begin_import_async(resource_group_name, name, parameters, custom_headers)
|
881
|
+
|
882
|
+
promise = promise.then do |response|
|
883
|
+
# Defining deserialization method.
|
884
|
+
deserialize_method = lambda do |parsed_response|
|
885
|
+
end
|
886
|
+
|
887
|
+
# Waiting for response.
|
888
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
889
|
+
end
|
890
|
+
|
891
|
+
promise
|
892
|
+
end
|
893
|
+
|
894
|
+
#
|
895
|
+
# Import data into redis cache.
|
896
|
+
#
|
897
|
+
# @param resource_group_name [String] The name of the resource group.
|
898
|
+
# @param name [String] The name of the redis cache.
|
899
|
+
# @param parameters [ImportRDBParameters] Parameters for redis import
|
900
|
+
# operation.
|
901
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
902
|
+
# will be added to the HTTP request.
|
903
|
+
#
|
904
|
+
#
|
905
|
+
def begin_import(resource_group_name, name, parameters, custom_headers = nil)
|
906
|
+
response = begin_import_async(resource_group_name, name, parameters, custom_headers).value!
|
907
|
+
nil
|
908
|
+
end
|
909
|
+
|
910
|
+
#
|
911
|
+
# Import data into redis cache.
|
912
|
+
#
|
913
|
+
# @param resource_group_name [String] The name of the resource group.
|
914
|
+
# @param name [String] The name of the redis cache.
|
915
|
+
# @param parameters [ImportRDBParameters] Parameters for redis import
|
916
|
+
# operation.
|
917
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
918
|
+
# will be added to the HTTP request.
|
919
|
+
#
|
920
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
921
|
+
#
|
922
|
+
def begin_import_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
|
923
|
+
begin_import_async(resource_group_name, name, parameters, custom_headers).value!
|
924
|
+
end
|
925
|
+
|
926
|
+
#
|
927
|
+
# Import data into redis cache.
|
928
|
+
#
|
929
|
+
# @param resource_group_name [String] The name of the resource group.
|
930
|
+
# @param name [String] The name of the redis cache.
|
931
|
+
# @param parameters [ImportRDBParameters] Parameters for redis import
|
932
|
+
# operation.
|
933
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
934
|
+
# to the HTTP request.
|
935
|
+
#
|
936
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
937
|
+
#
|
938
|
+
def begin_import_async(resource_group_name, name, parameters, custom_headers = nil)
|
939
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
940
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
941
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
942
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
943
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
944
|
+
|
945
|
+
|
946
|
+
request_headers = {}
|
947
|
+
|
948
|
+
# Set Headers
|
949
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
950
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
951
|
+
|
773
952
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
774
|
-
|
775
|
-
|
953
|
+
|
954
|
+
# Serialize Request
|
955
|
+
request_mapper = ImportRDBParameters.mapper()
|
956
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
957
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
958
|
+
|
959
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import'
|
960
|
+
options = {
|
961
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
962
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
963
|
+
query_params: {'api-version' => @client.api_version},
|
964
|
+
body: request_content,
|
965
|
+
headers: request_headers.merge(custom_headers || {})
|
966
|
+
}
|
967
|
+
|
968
|
+
request_url = @base_url || @client.base_url
|
969
|
+
|
970
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
971
|
+
promise = request.run_promise do |req|
|
972
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
776
973
|
end
|
777
|
-
|
778
|
-
|
974
|
+
|
975
|
+
promise = promise.then do |http_response|
|
976
|
+
status_code = http_response.status
|
977
|
+
response_content = http_response.body
|
978
|
+
unless status_code == 202
|
979
|
+
error_model = JSON.load(response_content)
|
980
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
981
|
+
end
|
982
|
+
|
983
|
+
# Create Result
|
984
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
985
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
986
|
+
|
987
|
+
result
|
988
|
+
end
|
989
|
+
|
990
|
+
promise.execute
|
991
|
+
end
|
992
|
+
|
993
|
+
#
|
994
|
+
# Import data into redis cache.
|
995
|
+
#
|
996
|
+
# @param resource_group_name [String] The name of the resource group.
|
997
|
+
# @param name [String] The name of the redis cache.
|
998
|
+
# @param parameters [ExportRDBParameters] Parameters for redis export
|
999
|
+
# operation.
|
1000
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1001
|
+
# will be added to the HTTP request.
|
1002
|
+
#
|
1003
|
+
def export(resource_group_name, name, parameters, custom_headers = nil)
|
1004
|
+
response = export_async(resource_group_name, name, parameters, custom_headers).value!
|
1005
|
+
nil
|
1006
|
+
end
|
1007
|
+
|
1008
|
+
#
|
1009
|
+
# @param resource_group_name [String] The name of the resource group.
|
1010
|
+
# @param name [String] The name of the redis cache.
|
1011
|
+
# @param parameters [ExportRDBParameters] Parameters for redis export
|
1012
|
+
# operation.
|
1013
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1014
|
+
# will be added to the HTTP request.
|
1015
|
+
#
|
1016
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
1017
|
+
# response.
|
1018
|
+
#
|
1019
|
+
def export_async(resource_group_name, name, parameters, custom_headers = nil)
|
1020
|
+
# Send request
|
1021
|
+
promise = begin_export_async(resource_group_name, name, parameters, custom_headers)
|
1022
|
+
|
1023
|
+
promise = promise.then do |response|
|
1024
|
+
# Defining deserialization method.
|
1025
|
+
deserialize_method = lambda do |parsed_response|
|
1026
|
+
end
|
1027
|
+
|
1028
|
+
# Waiting for response.
|
1029
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
promise
|
1033
|
+
end
|
1034
|
+
|
1035
|
+
#
|
1036
|
+
# Import data into redis cache.
|
1037
|
+
#
|
1038
|
+
# @param resource_group_name [String] The name of the resource group.
|
1039
|
+
# @param name [String] The name of the redis cache.
|
1040
|
+
# @param parameters [ExportRDBParameters] Parameters for redis export
|
1041
|
+
# operation.
|
1042
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1043
|
+
# will be added to the HTTP request.
|
1044
|
+
#
|
1045
|
+
#
|
1046
|
+
def begin_export(resource_group_name, name, parameters, custom_headers = nil)
|
1047
|
+
response = begin_export_async(resource_group_name, name, parameters, custom_headers).value!
|
1048
|
+
nil
|
1049
|
+
end
|
1050
|
+
|
1051
|
+
#
|
1052
|
+
# Import data into redis cache.
|
1053
|
+
#
|
1054
|
+
# @param resource_group_name [String] The name of the resource group.
|
1055
|
+
# @param name [String] The name of the redis cache.
|
1056
|
+
# @param parameters [ExportRDBParameters] Parameters for redis export
|
1057
|
+
# operation.
|
1058
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1059
|
+
# will be added to the HTTP request.
|
1060
|
+
#
|
1061
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1062
|
+
#
|
1063
|
+
def begin_export_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
|
1064
|
+
begin_export_async(resource_group_name, name, parameters, custom_headers).value!
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
#
|
1068
|
+
# Import data into redis cache.
|
1069
|
+
#
|
1070
|
+
# @param resource_group_name [String] The name of the resource group.
|
1071
|
+
# @param name [String] The name of the redis cache.
|
1072
|
+
# @param parameters [ExportRDBParameters] Parameters for redis export
|
1073
|
+
# operation.
|
1074
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1075
|
+
# to the HTTP request.
|
1076
|
+
#
|
1077
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1078
|
+
#
|
1079
|
+
def begin_export_async(resource_group_name, name, parameters, custom_headers = nil)
|
1080
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1081
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
1082
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1083
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1084
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1085
|
+
|
1086
|
+
|
1087
|
+
request_headers = {}
|
1088
|
+
|
1089
|
+
# Set Headers
|
1090
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1091
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1092
|
+
|
1093
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1094
|
+
|
1095
|
+
# Serialize Request
|
1096
|
+
request_mapper = ExportRDBParameters.mapper()
|
1097
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1098
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1099
|
+
|
1100
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export'
|
779
1101
|
options = {
|
780
1102
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
781
1103
|
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
@@ -794,7 +1116,7 @@ module Azure::ARM::Redis
|
|
794
1116
|
promise = promise.then do |http_response|
|
795
1117
|
status_code = http_response.status
|
796
1118
|
response_content = http_response.body
|
797
|
-
unless status_code ==
|
1119
|
+
unless status_code == 202
|
798
1120
|
error_model = JSON.load(response_content)
|
799
1121
|
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
800
1122
|
end
|
@@ -850,6 +1172,8 @@ module Azure::ARM::Redis
|
|
850
1172
|
#
|
851
1173
|
def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
|
852
1174
|
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1175
|
+
|
1176
|
+
|
853
1177
|
request_headers = {}
|
854
1178
|
|
855
1179
|
# Set Headers
|
@@ -884,10 +1208,8 @@ module Azure::ARM::Redis
|
|
884
1208
|
if status_code == 200
|
885
1209
|
begin
|
886
1210
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
887
|
-
|
888
|
-
|
889
|
-
end
|
890
|
-
result.body = parsed_response
|
1211
|
+
result_mapper = RedisListResult.mapper()
|
1212
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
891
1213
|
rescue Exception => e
|
892
1214
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
893
1215
|
end
|
@@ -940,6 +1262,8 @@ module Azure::ARM::Redis
|
|
940
1262
|
#
|
941
1263
|
def list_next_async(next_page_link, custom_headers = nil)
|
942
1264
|
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1265
|
+
|
1266
|
+
|
943
1267
|
request_headers = {}
|
944
1268
|
|
945
1269
|
# Set Headers
|
@@ -974,10 +1298,8 @@ module Azure::ARM::Redis
|
|
974
1298
|
if status_code == 200
|
975
1299
|
begin
|
976
1300
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
977
|
-
|
978
|
-
|
979
|
-
end
|
980
|
-
result.body = parsed_response
|
1301
|
+
result_mapper = RedisListResult.mapper()
|
1302
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
981
1303
|
rescue Exception => e
|
982
1304
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
983
1305
|
end
|