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
@@ -0,0 +1,67 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Redis
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
class ScheduleEntry
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [DayOfWeek] Day of week when cache can be patched. Possible
|
16
|
+
# values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
|
17
|
+
# 'Friday', 'Saturday', 'Sunday'
|
18
|
+
attr_accessor :day_of_week
|
19
|
+
|
20
|
+
# @return [Integer] Start hour after which cache patching can start.
|
21
|
+
attr_accessor :start_hour_utc
|
22
|
+
|
23
|
+
# @return [Duration] ISO8601 timespan specifying how much time cache
|
24
|
+
# patching can take.
|
25
|
+
attr_accessor :maintenance_window
|
26
|
+
|
27
|
+
|
28
|
+
#
|
29
|
+
# Mapper for ScheduleEntry class as Ruby Hash.
|
30
|
+
# This will be used for serialization/deserialization.
|
31
|
+
#
|
32
|
+
def self.mapper()
|
33
|
+
{
|
34
|
+
required: false,
|
35
|
+
serialized_name: 'ScheduleEntry',
|
36
|
+
type: {
|
37
|
+
name: 'Composite',
|
38
|
+
class_name: 'ScheduleEntry',
|
39
|
+
model_properties: {
|
40
|
+
day_of_week: {
|
41
|
+
required: true,
|
42
|
+
serialized_name: 'dayOfWeek',
|
43
|
+
type: {
|
44
|
+
name: 'String'
|
45
|
+
}
|
46
|
+
},
|
47
|
+
start_hour_utc: {
|
48
|
+
required: true,
|
49
|
+
serialized_name: 'startHourUtc',
|
50
|
+
type: {
|
51
|
+
name: 'Number'
|
52
|
+
}
|
53
|
+
},
|
54
|
+
maintenance_window: {
|
55
|
+
required: false,
|
56
|
+
serialized_name: 'maintenanceWindow',
|
57
|
+
type: {
|
58
|
+
name: 'TimeSpan'
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Redis
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Sku parameters supplied to the create redis operation.
|
10
|
+
#
|
11
|
+
class Sku
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [SkuName] What type of redis cache to deploy. Valid values:
|
16
|
+
# (Basic, Standard, Premium). Possible values include: 'Basic',
|
17
|
+
# 'Standard', 'Premium'
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# @return [SkuFamily] Which family to use. Valid values: (C, P).
|
21
|
+
# Possible values include: 'C', 'P'
|
22
|
+
attr_accessor :family
|
23
|
+
|
24
|
+
# @return [Integer] What size of redis cache to deploy. Valid values:
|
25
|
+
# for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4)
|
26
|
+
attr_accessor :capacity
|
27
|
+
|
28
|
+
|
29
|
+
#
|
30
|
+
# Mapper for Sku class as Ruby Hash.
|
31
|
+
# This will be used for serialization/deserialization.
|
32
|
+
#
|
33
|
+
def self.mapper()
|
34
|
+
{
|
35
|
+
required: false,
|
36
|
+
serialized_name: 'Sku',
|
37
|
+
type: {
|
38
|
+
name: 'Composite',
|
39
|
+
class_name: 'Sku',
|
40
|
+
model_properties: {
|
41
|
+
name: {
|
42
|
+
required: true,
|
43
|
+
serialized_name: 'name',
|
44
|
+
type: {
|
45
|
+
name: 'String'
|
46
|
+
}
|
47
|
+
},
|
48
|
+
family: {
|
49
|
+
required: true,
|
50
|
+
serialized_name: 'family',
|
51
|
+
type: {
|
52
|
+
name: 'String'
|
53
|
+
}
|
54
|
+
},
|
55
|
+
capacity: {
|
56
|
+
required: true,
|
57
|
+
serialized_name: 'capacity',
|
58
|
+
type: {
|
59
|
+
name: 'Number'
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,313 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Redis
|
7
|
+
#
|
8
|
+
# REST API for Azure Redis Cache Service
|
9
|
+
#
|
10
|
+
class PatchSchedules
|
11
|
+
include Azure::ARM::Redis::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the PatchSchedules class.
|
16
|
+
# @param client service class for accessing basic functionality.
|
17
|
+
#
|
18
|
+
def initialize(client)
|
19
|
+
@client = client
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return reference to the RedisManagementClient
|
23
|
+
attr_reader :client
|
24
|
+
|
25
|
+
#
|
26
|
+
# Create or replace the patching schedule for redis cache.
|
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 [RedisPatchSchedulesRequest] Parameters to set patch
|
31
|
+
# schedules 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 [RedisPatchSchedulesResponse] 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).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Create or replace the patching schedule for redis cache.
|
44
|
+
#
|
45
|
+
# @param resource_group_name [String] The name of the resource group.
|
46
|
+
# @param name [String] The name of the redis cache.
|
47
|
+
# @param parameters [RedisPatchSchedulesRequest] Parameters to set patch
|
48
|
+
# schedules for redis cache.
|
49
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
50
|
+
# will be added to the HTTP request.
|
51
|
+
#
|
52
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
53
|
+
#
|
54
|
+
def create_or_update_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
|
55
|
+
create_or_update_async(resource_group_name, name, parameters, custom_headers).value!
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Create or replace the patching schedule for redis cache.
|
60
|
+
#
|
61
|
+
# @param resource_group_name [String] The name of the resource group.
|
62
|
+
# @param name [String] The name of the redis cache.
|
63
|
+
# @param parameters [RedisPatchSchedulesRequest] Parameters to set patch
|
64
|
+
# schedules for redis cache.
|
65
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
66
|
+
# to the HTTP request.
|
67
|
+
#
|
68
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
69
|
+
#
|
70
|
+
def create_or_update_async(resource_group_name, name, parameters, custom_headers = nil)
|
71
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
72
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
73
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
74
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
75
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
76
|
+
|
77
|
+
|
78
|
+
request_headers = {}
|
79
|
+
|
80
|
+
# Set Headers
|
81
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
82
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
83
|
+
|
84
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
85
|
+
|
86
|
+
# Serialize Request
|
87
|
+
request_mapper = RedisPatchSchedulesRequest.mapper()
|
88
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
89
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
90
|
+
|
91
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
|
92
|
+
options = {
|
93
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
94
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
95
|
+
query_params: {'api-version' => @client.api_version},
|
96
|
+
body: request_content,
|
97
|
+
headers: request_headers.merge(custom_headers || {})
|
98
|
+
}
|
99
|
+
|
100
|
+
request_url = @base_url || @client.base_url
|
101
|
+
|
102
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
|
103
|
+
promise = request.run_promise do |req|
|
104
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
105
|
+
end
|
106
|
+
|
107
|
+
promise = promise.then do |http_response|
|
108
|
+
status_code = http_response.status
|
109
|
+
response_content = http_response.body
|
110
|
+
unless status_code == 200
|
111
|
+
error_model = JSON.load(response_content)
|
112
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Create Result
|
116
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
117
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
118
|
+
# Deserialize Response
|
119
|
+
if status_code == 200
|
120
|
+
begin
|
121
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
122
|
+
result_mapper = RedisPatchSchedulesResponse.mapper()
|
123
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
124
|
+
rescue Exception => e
|
125
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
result
|
130
|
+
end
|
131
|
+
|
132
|
+
promise.execute
|
133
|
+
end
|
134
|
+
|
135
|
+
#
|
136
|
+
# Deletes the patching schedule for redis cache.
|
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 custom_headers [Hash{String => String}] A hash of custom headers that
|
141
|
+
# will be added to the HTTP request.
|
142
|
+
#
|
143
|
+
#
|
144
|
+
def delete(resource_group_name, name, custom_headers = nil)
|
145
|
+
response = delete_async(resource_group_name, name, custom_headers).value!
|
146
|
+
nil
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# Deletes the patching schedule for redis cache.
|
151
|
+
#
|
152
|
+
# @param resource_group_name [String] The name of the resource group.
|
153
|
+
# @param name [String] The name of the redis cache.
|
154
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
155
|
+
# will be added to the HTTP request.
|
156
|
+
#
|
157
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
158
|
+
#
|
159
|
+
def delete_with_http_info(resource_group_name, name, custom_headers = nil)
|
160
|
+
delete_async(resource_group_name, name, custom_headers).value!
|
161
|
+
end
|
162
|
+
|
163
|
+
#
|
164
|
+
# Deletes the patching schedule for redis cache.
|
165
|
+
#
|
166
|
+
# @param resource_group_name [String] The name of the resource group.
|
167
|
+
# @param name [String] The name of the redis cache.
|
168
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
169
|
+
# to the HTTP request.
|
170
|
+
#
|
171
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
172
|
+
#
|
173
|
+
def delete_async(resource_group_name, name, custom_headers = nil)
|
174
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
175
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
176
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
177
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
178
|
+
|
179
|
+
|
180
|
+
request_headers = {}
|
181
|
+
|
182
|
+
# Set Headers
|
183
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
184
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
185
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
|
186
|
+
options = {
|
187
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
188
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
189
|
+
query_params: {'api-version' => @client.api_version},
|
190
|
+
headers: request_headers.merge(custom_headers || {})
|
191
|
+
}
|
192
|
+
|
193
|
+
request_url = @base_url || @client.base_url
|
194
|
+
|
195
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
|
196
|
+
promise = request.run_promise do |req|
|
197
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
198
|
+
end
|
199
|
+
|
200
|
+
promise = promise.then do |http_response|
|
201
|
+
status_code = http_response.status
|
202
|
+
response_content = http_response.body
|
203
|
+
unless status_code == 200
|
204
|
+
error_model = JSON.load(response_content)
|
205
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
206
|
+
end
|
207
|
+
|
208
|
+
# Create Result
|
209
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
210
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
211
|
+
|
212
|
+
result
|
213
|
+
end
|
214
|
+
|
215
|
+
promise.execute
|
216
|
+
end
|
217
|
+
|
218
|
+
#
|
219
|
+
# Gets the patching schedule for redis cache.
|
220
|
+
#
|
221
|
+
# @param resource_group_name [String] The name of the resource group.
|
222
|
+
# @param name [String] The name of the redis cache.
|
223
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
224
|
+
# will be added to the HTTP request.
|
225
|
+
#
|
226
|
+
# @return [RedisPatchSchedulesResponse] operation results.
|
227
|
+
#
|
228
|
+
def get(resource_group_name, name, custom_headers = nil)
|
229
|
+
response = get_async(resource_group_name, name, custom_headers).value!
|
230
|
+
response.body unless response.nil?
|
231
|
+
end
|
232
|
+
|
233
|
+
#
|
234
|
+
# Gets the patching schedule for redis cache.
|
235
|
+
#
|
236
|
+
# @param resource_group_name [String] The name of the resource group.
|
237
|
+
# @param name [String] The name of the redis cache.
|
238
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
239
|
+
# will be added to the HTTP request.
|
240
|
+
#
|
241
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
242
|
+
#
|
243
|
+
def get_with_http_info(resource_group_name, name, custom_headers = nil)
|
244
|
+
get_async(resource_group_name, name, custom_headers).value!
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# Gets the patching schedule for redis cache.
|
249
|
+
#
|
250
|
+
# @param resource_group_name [String] The name of the resource group.
|
251
|
+
# @param name [String] The name of the redis cache.
|
252
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
253
|
+
# to the HTTP request.
|
254
|
+
#
|
255
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
256
|
+
#
|
257
|
+
def get_async(resource_group_name, name, custom_headers = nil)
|
258
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
259
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
260
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
261
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
262
|
+
|
263
|
+
|
264
|
+
request_headers = {}
|
265
|
+
|
266
|
+
# Set Headers
|
267
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
268
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
269
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
|
270
|
+
options = {
|
271
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
272
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
273
|
+
query_params: {'api-version' => @client.api_version},
|
274
|
+
headers: request_headers.merge(custom_headers || {})
|
275
|
+
}
|
276
|
+
|
277
|
+
request_url = @base_url || @client.base_url
|
278
|
+
|
279
|
+
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
280
|
+
promise = request.run_promise do |req|
|
281
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
282
|
+
end
|
283
|
+
|
284
|
+
promise = promise.then do |http_response|
|
285
|
+
status_code = http_response.status
|
286
|
+
response_content = http_response.body
|
287
|
+
unless status_code == 200
|
288
|
+
error_model = JSON.load(response_content)
|
289
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
290
|
+
end
|
291
|
+
|
292
|
+
# Create Result
|
293
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
294
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
295
|
+
# Deserialize Response
|
296
|
+
if status_code == 200
|
297
|
+
begin
|
298
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
299
|
+
result_mapper = RedisPatchSchedulesResponse.mapper()
|
300
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
301
|
+
rescue Exception => e
|
302
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
result
|
307
|
+
end
|
308
|
+
|
309
|
+
promise.execute
|
310
|
+
end
|
311
|
+
|
312
|
+
end
|
313
|
+
end
|