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