azure_mgmt_redis 0.15.2 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2015-08-01/generated/azure_mgmt_redis/redis.rb +66 -62
- data/lib/2015-08-01/generated/azure_mgmt_redis/redis_management_client.rb +4 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/firewall_rules.rb +15 -13
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/operations.rb +15 -13
- data/lib/2016-04-01/generated/azure_mgmt_redis/patch_schedules.rb +18 -17
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis.rb +100 -99
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis_firewall_rule_operations.rb +18 -17
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis_management_client.rb +4 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/firewall_rules.rb +33 -30
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/operations.rb +15 -13
- data/lib/2017-02-01/generated/azure_mgmt_redis/patch_schedules.rb +18 -17
- data/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb +100 -99
- data/lib/2017-02-01/generated/azure_mgmt_redis/redis_linked_server_operations.rb +28 -26
- data/lib/2017-02-01/generated/azure_mgmt_redis/redis_management_client.rb +4 -1
- data/lib/2017-10-01/generated/azure_mgmt_redis.rb +64 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/firewall_rules.rb +528 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/linked_server.rb +594 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/day_of_week.rb +23 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/export_rdbparameters.rb +68 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/import_rdbparameters.rb +65 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/operation.rb +58 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/operation_display.rb +80 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/operation_list_result.rb +102 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/proxy_resource.rb +63 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/reboot_type.rb +17 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_access_keys.rb +61 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_create_parameters.rb +192 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule.rb +85 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule_create_parameters.rb +57 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb +100 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_force_reboot_response.rb +47 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_key_type.rb +16 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server.rb +47 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_create_parameters.rb +70 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_with_properties.rb +110 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_linked_server_with_properties_list.rb +100 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_list_result.rb +99 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_patch_schedule.rb +83 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +60 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +48 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_resource.rb +309 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +130 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/replication_role.rb +16 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/resource.rb +71 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/schedule_entry.rb +72 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/sku.rb +73 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/sku_family.rb +16 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/sku_name.rb +17 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/models/tracked_resource.rb +92 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/operations.rb +222 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/patch_schedules.rb +317 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/redis.rb +1482 -0
- data/lib/2017-10-01/generated/azure_mgmt_redis/redis_management_client.rb +148 -0
- data/lib/azure_mgmt_redis.rb +1 -0
- data/lib/profiles/latest/modules/redis_profile_module.rb +166 -147
- data/lib/profiles/latest/redis_latest_profile_client.rb +28 -9
- data/lib/profiles/latest/redis_module_definition.rb +0 -1
- data/lib/version.rb +1 -1
- metadata +43 -3
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure end
|
7
|
+
module Azure::Redis end
|
8
|
+
module Azure::Redis::Mgmt end
|
9
|
+
module Azure::Redis::Mgmt::V2017_10_01 end
|
@@ -0,0 +1,222 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Redis::Mgmt::V2017_10_01
|
7
|
+
#
|
8
|
+
# REST API for Azure Redis Cache Service.
|
9
|
+
#
|
10
|
+
class Operations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Operations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [RedisManagementClient] reference to the RedisManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
26
|
+
# provider.
|
27
|
+
#
|
28
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
29
|
+
# will be added to the HTTP request.
|
30
|
+
#
|
31
|
+
# @return [Array<Operation>] operation results.
|
32
|
+
#
|
33
|
+
def list(custom_headers:nil)
|
34
|
+
first_page = list_as_lazy(custom_headers:custom_headers)
|
35
|
+
first_page.get_all_items
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
40
|
+
# provider.
|
41
|
+
#
|
42
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
43
|
+
# will be added to the HTTP request.
|
44
|
+
#
|
45
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
46
|
+
#
|
47
|
+
def list_with_http_info(custom_headers:nil)
|
48
|
+
list_async(custom_headers:custom_headers).value!
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
53
|
+
# provider.
|
54
|
+
#
|
55
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
56
|
+
# to the HTTP request.
|
57
|
+
#
|
58
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
59
|
+
#
|
60
|
+
def list_async(custom_headers:nil)
|
61
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
62
|
+
|
63
|
+
|
64
|
+
request_headers = {}
|
65
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
66
|
+
|
67
|
+
# Set Headers
|
68
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
69
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
70
|
+
path_template = 'providers/Microsoft.Cache/operations'
|
71
|
+
|
72
|
+
request_url = @base_url || @client.base_url
|
73
|
+
|
74
|
+
options = {
|
75
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
76
|
+
query_params: {'api-version' => @client.api_version},
|
77
|
+
headers: request_headers.merge(custom_headers || {}),
|
78
|
+
base_url: request_url
|
79
|
+
}
|
80
|
+
promise = @client.make_request_async(:get, path_template, options)
|
81
|
+
|
82
|
+
promise = promise.then do |result|
|
83
|
+
http_response = result.response
|
84
|
+
status_code = http_response.status
|
85
|
+
response_content = http_response.body
|
86
|
+
unless status_code == 200
|
87
|
+
error_model = JSON.load(response_content)
|
88
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
89
|
+
end
|
90
|
+
|
91
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
92
|
+
# Deserialize Response
|
93
|
+
if status_code == 200
|
94
|
+
begin
|
95
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
96
|
+
result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::OperationListResult.mapper()
|
97
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
98
|
+
rescue Exception => e
|
99
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
result
|
104
|
+
end
|
105
|
+
|
106
|
+
promise.execute
|
107
|
+
end
|
108
|
+
|
109
|
+
#
|
110
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
111
|
+
# provider.
|
112
|
+
#
|
113
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
114
|
+
# to List operation.
|
115
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
116
|
+
# will be added to the HTTP request.
|
117
|
+
#
|
118
|
+
# @return [OperationListResult] operation results.
|
119
|
+
#
|
120
|
+
def list_next(next_page_link, custom_headers:nil)
|
121
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
122
|
+
response.body unless response.nil?
|
123
|
+
end
|
124
|
+
|
125
|
+
#
|
126
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
127
|
+
# provider.
|
128
|
+
#
|
129
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
130
|
+
# to List operation.
|
131
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
132
|
+
# will be added to the HTTP request.
|
133
|
+
#
|
134
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
135
|
+
#
|
136
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
137
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
138
|
+
end
|
139
|
+
|
140
|
+
#
|
141
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
142
|
+
# provider.
|
143
|
+
#
|
144
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
145
|
+
# to List operation.
|
146
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
147
|
+
# to the HTTP request.
|
148
|
+
#
|
149
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
150
|
+
#
|
151
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
152
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
153
|
+
|
154
|
+
|
155
|
+
request_headers = {}
|
156
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
157
|
+
|
158
|
+
# Set Headers
|
159
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
160
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
161
|
+
path_template = '{nextLink}'
|
162
|
+
|
163
|
+
request_url = @base_url || @client.base_url
|
164
|
+
|
165
|
+
options = {
|
166
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
167
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
168
|
+
headers: request_headers.merge(custom_headers || {}),
|
169
|
+
base_url: request_url
|
170
|
+
}
|
171
|
+
promise = @client.make_request_async(:get, path_template, options)
|
172
|
+
|
173
|
+
promise = promise.then do |result|
|
174
|
+
http_response = result.response
|
175
|
+
status_code = http_response.status
|
176
|
+
response_content = http_response.body
|
177
|
+
unless status_code == 200
|
178
|
+
error_model = JSON.load(response_content)
|
179
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
180
|
+
end
|
181
|
+
|
182
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
183
|
+
# Deserialize Response
|
184
|
+
if status_code == 200
|
185
|
+
begin
|
186
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
187
|
+
result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::OperationListResult.mapper()
|
188
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
189
|
+
rescue Exception => e
|
190
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
result
|
195
|
+
end
|
196
|
+
|
197
|
+
promise.execute
|
198
|
+
end
|
199
|
+
|
200
|
+
#
|
201
|
+
# Lists all of the available REST API operations of the Microsoft.Cache
|
202
|
+
# provider.
|
203
|
+
#
|
204
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
205
|
+
# will be added to the HTTP request.
|
206
|
+
#
|
207
|
+
# @return [OperationListResult] which provide lazy access to pages of the
|
208
|
+
# response.
|
209
|
+
#
|
210
|
+
def list_as_lazy(custom_headers:nil)
|
211
|
+
response = list_async(custom_headers:custom_headers).value!
|
212
|
+
unless response.nil?
|
213
|
+
page = response.body
|
214
|
+
page.next_method = Proc.new do |next_page_link|
|
215
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
216
|
+
end
|
217
|
+
page
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
end
|
@@ -0,0 +1,317 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Redis::Mgmt::V2017_10_01
|
7
|
+
#
|
8
|
+
# REST API for Azure Redis Cache Service.
|
9
|
+
#
|
10
|
+
class PatchSchedules
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the PatchSchedules class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [RedisManagementClient] reference to the RedisManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Create or replace the patching schedule for Redis cache (requires Premium
|
26
|
+
# SKU).
|
27
|
+
#
|
28
|
+
# @param resource_group_name [String] The name of the resource group.
|
29
|
+
# @param name [String] The name of the Redis cache.
|
30
|
+
# @param parameters [RedisPatchSchedule] Parameters to set the patching
|
31
|
+
# schedule for Redis cache.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [RedisPatchSchedule] operation results.
|
36
|
+
#
|
37
|
+
def create_or_update(resource_group_name, name, parameters, custom_headers:nil)
|
38
|
+
response = create_or_update_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Create or replace the patching schedule for Redis cache (requires Premium
|
44
|
+
# SKU).
|
45
|
+
#
|
46
|
+
# @param resource_group_name [String] The name of the resource group.
|
47
|
+
# @param name [String] The name of the Redis cache.
|
48
|
+
# @param parameters [RedisPatchSchedule] Parameters to set the patching
|
49
|
+
# schedule for Redis cache.
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
51
|
+
# will be added to the HTTP request.
|
52
|
+
#
|
53
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
54
|
+
#
|
55
|
+
def create_or_update_with_http_info(resource_group_name, name, parameters, custom_headers:nil)
|
56
|
+
create_or_update_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Create or replace the patching schedule for Redis cache (requires Premium
|
61
|
+
# SKU).
|
62
|
+
#
|
63
|
+
# @param resource_group_name [String] The name of the resource group.
|
64
|
+
# @param name [String] The name of the Redis cache.
|
65
|
+
# @param parameters [RedisPatchSchedule] Parameters to set the patching
|
66
|
+
# schedule for Redis cache.
|
67
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
68
|
+
# to the HTTP request.
|
69
|
+
#
|
70
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
71
|
+
#
|
72
|
+
def create_or_update_async(resource_group_name, name, parameters, custom_headers:nil)
|
73
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
74
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
75
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
76
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
77
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
78
|
+
|
79
|
+
|
80
|
+
request_headers = {}
|
81
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
82
|
+
|
83
|
+
# Set Headers
|
84
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
85
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
86
|
+
|
87
|
+
# Serialize Request
|
88
|
+
request_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisPatchSchedule.mapper()
|
89
|
+
request_content = @client.serialize(request_mapper, parameters)
|
90
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
91
|
+
|
92
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
|
93
|
+
|
94
|
+
request_url = @base_url || @client.base_url
|
95
|
+
|
96
|
+
options = {
|
97
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
98
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
99
|
+
query_params: {'api-version' => @client.api_version},
|
100
|
+
body: request_content,
|
101
|
+
headers: request_headers.merge(custom_headers || {}),
|
102
|
+
base_url: request_url
|
103
|
+
}
|
104
|
+
promise = @client.make_request_async(:put, path_template, options)
|
105
|
+
|
106
|
+
promise = promise.then do |result|
|
107
|
+
http_response = result.response
|
108
|
+
status_code = http_response.status
|
109
|
+
response_content = http_response.body
|
110
|
+
unless status_code == 200 || status_code == 201
|
111
|
+
error_model = JSON.load(response_content)
|
112
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
113
|
+
end
|
114
|
+
|
115
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
116
|
+
# Deserialize Response
|
117
|
+
if status_code == 200
|
118
|
+
begin
|
119
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
120
|
+
result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisPatchSchedule.mapper()
|
121
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
122
|
+
rescue Exception => e
|
123
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
# Deserialize Response
|
127
|
+
if status_code == 201
|
128
|
+
begin
|
129
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
130
|
+
result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisPatchSchedule.mapper()
|
131
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
132
|
+
rescue Exception => e
|
133
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
result
|
138
|
+
end
|
139
|
+
|
140
|
+
promise.execute
|
141
|
+
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# Deletes the patching schedule of a redis cache (requires Premium SKU).
|
145
|
+
#
|
146
|
+
# @param resource_group_name [String] The name of the resource group.
|
147
|
+
# @param name [String] The name of the redis cache.
|
148
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
149
|
+
# will be added to the HTTP request.
|
150
|
+
#
|
151
|
+
#
|
152
|
+
def delete(resource_group_name, name, custom_headers:nil)
|
153
|
+
response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
|
154
|
+
nil
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Deletes the patching schedule of a redis cache (requires Premium SKU).
|
159
|
+
#
|
160
|
+
# @param resource_group_name [String] The name of the resource group.
|
161
|
+
# @param name [String] The name of the redis cache.
|
162
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
163
|
+
# will be added to the HTTP request.
|
164
|
+
#
|
165
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
166
|
+
#
|
167
|
+
def delete_with_http_info(resource_group_name, name, custom_headers:nil)
|
168
|
+
delete_async(resource_group_name, name, custom_headers:custom_headers).value!
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# Deletes the patching schedule of a redis cache (requires Premium SKU).
|
173
|
+
#
|
174
|
+
# @param resource_group_name [String] The name of the resource group.
|
175
|
+
# @param name [String] The name of the redis cache.
|
176
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
177
|
+
# to the HTTP request.
|
178
|
+
#
|
179
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
180
|
+
#
|
181
|
+
def delete_async(resource_group_name, name, custom_headers:nil)
|
182
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
183
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
184
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
185
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
186
|
+
|
187
|
+
|
188
|
+
request_headers = {}
|
189
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
190
|
+
|
191
|
+
# Set Headers
|
192
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
193
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
194
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
|
195
|
+
|
196
|
+
request_url = @base_url || @client.base_url
|
197
|
+
|
198
|
+
options = {
|
199
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
200
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
201
|
+
query_params: {'api-version' => @client.api_version},
|
202
|
+
headers: request_headers.merge(custom_headers || {}),
|
203
|
+
base_url: request_url
|
204
|
+
}
|
205
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
206
|
+
|
207
|
+
promise = promise.then do |result|
|
208
|
+
http_response = result.response
|
209
|
+
status_code = http_response.status
|
210
|
+
response_content = http_response.body
|
211
|
+
unless status_code == 200 || status_code == 204
|
212
|
+
error_model = JSON.load(response_content)
|
213
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
214
|
+
end
|
215
|
+
|
216
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
217
|
+
|
218
|
+
result
|
219
|
+
end
|
220
|
+
|
221
|
+
promise.execute
|
222
|
+
end
|
223
|
+
|
224
|
+
#
|
225
|
+
# Gets the patching schedule of a redis cache (requires Premium SKU).
|
226
|
+
#
|
227
|
+
# @param resource_group_name [String] The name of the resource group.
|
228
|
+
# @param name [String] The name of the redis cache.
|
229
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
230
|
+
# will be added to the HTTP request.
|
231
|
+
#
|
232
|
+
# @return [RedisPatchSchedule] operation results.
|
233
|
+
#
|
234
|
+
def get(resource_group_name, name, custom_headers:nil)
|
235
|
+
response = get_async(resource_group_name, name, custom_headers:custom_headers).value!
|
236
|
+
response.body unless response.nil?
|
237
|
+
end
|
238
|
+
|
239
|
+
#
|
240
|
+
# Gets the patching schedule of a redis cache (requires Premium SKU).
|
241
|
+
#
|
242
|
+
# @param resource_group_name [String] The name of the resource group.
|
243
|
+
# @param name [String] The name of the redis cache.
|
244
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
245
|
+
# will be added to the HTTP request.
|
246
|
+
#
|
247
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
248
|
+
#
|
249
|
+
def get_with_http_info(resource_group_name, name, custom_headers:nil)
|
250
|
+
get_async(resource_group_name, name, custom_headers:custom_headers).value!
|
251
|
+
end
|
252
|
+
|
253
|
+
#
|
254
|
+
# Gets the patching schedule of a redis cache (requires Premium SKU).
|
255
|
+
#
|
256
|
+
# @param resource_group_name [String] The name of the resource group.
|
257
|
+
# @param name [String] The name of the redis cache.
|
258
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
259
|
+
# to the HTTP request.
|
260
|
+
#
|
261
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
262
|
+
#
|
263
|
+
def get_async(resource_group_name, name, custom_headers:nil)
|
264
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
265
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
266
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
267
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
268
|
+
|
269
|
+
|
270
|
+
request_headers = {}
|
271
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
272
|
+
|
273
|
+
# Set Headers
|
274
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
275
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
276
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
|
277
|
+
|
278
|
+
request_url = @base_url || @client.base_url
|
279
|
+
|
280
|
+
options = {
|
281
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
282
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
283
|
+
query_params: {'api-version' => @client.api_version},
|
284
|
+
headers: request_headers.merge(custom_headers || {}),
|
285
|
+
base_url: request_url
|
286
|
+
}
|
287
|
+
promise = @client.make_request_async(:get, path_template, options)
|
288
|
+
|
289
|
+
promise = promise.then do |result|
|
290
|
+
http_response = result.response
|
291
|
+
status_code = http_response.status
|
292
|
+
response_content = http_response.body
|
293
|
+
unless status_code == 200
|
294
|
+
error_model = JSON.load(response_content)
|
295
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
296
|
+
end
|
297
|
+
|
298
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
299
|
+
# Deserialize Response
|
300
|
+
if status_code == 200
|
301
|
+
begin
|
302
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
303
|
+
result_mapper = Azure::Redis::Mgmt::V2017_10_01::Models::RedisPatchSchedule.mapper()
|
304
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
305
|
+
rescue Exception => e
|
306
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
result
|
311
|
+
end
|
312
|
+
|
313
|
+
promise.execute
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|
317
|
+
end
|