azure_mgmt_redis 0.14.0 → 0.15.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.rb +43 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/reboot_type.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_access_keys.rb +56 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_create_or_update_parameters.rb +194 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/redis_key_type.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_list_keys_result.rb +56 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_list_result.rb +94 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_properties.rb +149 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +58 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +46 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_resource.rb +234 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/redis_resource_with_access_key.rb +245 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/resource.rb +95 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/models/sku.rb +68 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/sku_family.rb +1 -1
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/models/sku_name.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/redis.rb +1002 -0
- data/lib/2015-08-01/generated/azure_mgmt_redis/redis_management_client.rb +131 -0
- data/lib/{generated → 2015-08-01/generated}/azure_mgmt_redis/version.rb +2 -2
- data/lib/2016-04-01/generated/azure_mgmt_redis.rb +56 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/firewall_rules.rb +225 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/day_of_week.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/export_rdbparameters.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/import_rdbparameters.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/operation.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/operation_display.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/operation_list_result.rb +97 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/reboot_type.rb +17 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_access_keys.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_create_parameters.rb +177 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_firewall_rule.rb +89 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb +95 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_force_reboot_response.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_key_type.rb +16 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_list_result.rb +94 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_patch_schedule.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_reboot_parameters.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/redis_resource.rb +245 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/redis_update_parameters.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/resource.rb +94 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/schedule_entry.rb +1 -1
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/models/sku.rb +1 -1
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/sku_family.rb +16 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/models/sku_name.rb +17 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/operations.rb +3 -3
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/patch_schedules.rb +5 -5
- data/lib/{generated → 2016-04-01/generated}/azure_mgmt_redis/redis.rb +19 -19
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis_firewall_rule_operations.rb +325 -0
- data/lib/2016-04-01/generated/azure_mgmt_redis/redis_management_client.rb +147 -0
- data/lib/{generated/azure_mgmt_redis/module_definition.rb → 2016-04-01/generated/azure_mgmt_redis/version.rb} +3 -3
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis.rb +40 -40
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/firewall_rules.rb +7 -7
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/day_of_week.rb +23 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/export_rdbparameters.rb +64 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/import_rdbparameters.rb +61 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/operation.rb +55 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/operation_display.rb +75 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/operation_list_result.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/proxy_resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/reboot_type.rb +17 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_access_keys.rb +58 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_create_parameters.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_firewall_rule.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_firewall_rule_list_result.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_force_reboot_response.rb +45 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_key_type.rb +16 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_create_parameters.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_list.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_with_properties.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_linked_server_with_properties_list.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_list_result.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_patch_schedule.rb +97 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_reboot_parameters.rb +57 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_regenerate_key_parameters.rb +46 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/redis_resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/redis_update_parameters.rb +149 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/replication_role.rb +1 -1
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/schedule_entry.rb +68 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/sku.rb +69 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/sku_family.rb +16 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/models/sku_name.rb +17 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/models/tracked_resource.rb +1 -1
- data/lib/2017-02-01/generated/azure_mgmt_redis/module_definition.rb +9 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/operations.rb +220 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/patch_schedules.rb +316 -0
- data/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb +1481 -0
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/redis_linked_server_operations.rb +7 -7
- data/lib/{generated → 2017-02-01/generated}/azure_mgmt_redis/redis_management_client.rb +3 -3
- data/lib/2017-02-01/generated/azure_mgmt_redis/version.rb +8 -0
- data/lib/azure_mgmt_redis.rb +4 -1
- data/lib/module_definition.rb +9 -0
- data/lib/profiles/common/configurable.rb +73 -0
- data/lib/profiles/common/default.rb +68 -0
- data/lib/profiles/latest/modules/redis_profile_module.rb +178 -0
- data/lib/profiles/latest/redis_latest_profile_client.rb +33 -0
- data/lib/profiles/latest/redis_module_definition.rb +9 -0
- data/lib/version.rb +7 -0
- metadata +103 -43
@@ -0,0 +1,245 @@
|
|
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::V2015_08_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# A Redis item in CreateOrUpdate Operation response.
|
10
|
+
#
|
11
|
+
class RedisResourceWithAccessKey < Resource
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] RedisVersion parameter has been deprecated. As such,
|
16
|
+
# it is no longer necessary to provide this parameter and any value
|
17
|
+
# specified is ignored.
|
18
|
+
attr_accessor :redis_version
|
19
|
+
|
20
|
+
# @return [Sku] What SKU of Redis cache to deploy.
|
21
|
+
attr_accessor :sku
|
22
|
+
|
23
|
+
# @return [Hash{String => String}] All Redis Settings. Few possible keys:
|
24
|
+
# rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value
|
25
|
+
# etc.
|
26
|
+
attr_accessor :redis_configuration
|
27
|
+
|
28
|
+
# @return [Boolean] If the value is true, then the non-SLL Redis server
|
29
|
+
# port (6379) will be enabled.
|
30
|
+
attr_accessor :enable_non_ssl_port
|
31
|
+
|
32
|
+
# @return [Hash{String => String}] tenantSettings
|
33
|
+
attr_accessor :tenant_settings
|
34
|
+
|
35
|
+
# @return [Integer] The number of shards to be created on a Premium
|
36
|
+
# Cluster Cache.
|
37
|
+
attr_accessor :shard_count
|
38
|
+
|
39
|
+
# @return [String] The exact ARM resource ID of the virtual network to
|
40
|
+
# deploy the Redis cache in. Example format:
|
41
|
+
# /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
|
42
|
+
attr_accessor :virtual_network
|
43
|
+
|
44
|
+
# @return [String] Required when deploying a Redis cache inside an
|
45
|
+
# existing Azure Virtual Network.
|
46
|
+
attr_accessor :subnet
|
47
|
+
|
48
|
+
# @return [String] Required when deploying a Redis cache inside an
|
49
|
+
# existing Azure Virtual Network.
|
50
|
+
attr_accessor :static_ip
|
51
|
+
|
52
|
+
# @return [String] Redis instance provisioning status.
|
53
|
+
attr_accessor :provisioning_state
|
54
|
+
|
55
|
+
# @return [String] Redis host name.
|
56
|
+
attr_accessor :host_name
|
57
|
+
|
58
|
+
# @return [Integer] Redis non-SSL port.
|
59
|
+
attr_accessor :port
|
60
|
+
|
61
|
+
# @return [Integer] Redis SSL port.
|
62
|
+
attr_accessor :ssl_port
|
63
|
+
|
64
|
+
# @return [RedisAccessKeys] Redis cache access keys.
|
65
|
+
attr_accessor :access_keys
|
66
|
+
|
67
|
+
|
68
|
+
#
|
69
|
+
# Mapper for RedisResourceWithAccessKey class as Ruby Hash.
|
70
|
+
# This will be used for serialization/deserialization.
|
71
|
+
#
|
72
|
+
def self.mapper()
|
73
|
+
{
|
74
|
+
required: false,
|
75
|
+
serialized_name: 'RedisResourceWithAccessKey',
|
76
|
+
type: {
|
77
|
+
name: 'Composite',
|
78
|
+
class_name: 'RedisResourceWithAccessKey',
|
79
|
+
model_properties: {
|
80
|
+
id: {
|
81
|
+
required: false,
|
82
|
+
read_only: true,
|
83
|
+
serialized_name: 'id',
|
84
|
+
type: {
|
85
|
+
name: 'String'
|
86
|
+
}
|
87
|
+
},
|
88
|
+
name: {
|
89
|
+
required: false,
|
90
|
+
read_only: true,
|
91
|
+
serialized_name: 'name',
|
92
|
+
type: {
|
93
|
+
name: 'String'
|
94
|
+
}
|
95
|
+
},
|
96
|
+
type: {
|
97
|
+
required: false,
|
98
|
+
read_only: true,
|
99
|
+
serialized_name: 'type',
|
100
|
+
type: {
|
101
|
+
name: 'String'
|
102
|
+
}
|
103
|
+
},
|
104
|
+
location: {
|
105
|
+
required: true,
|
106
|
+
serialized_name: 'location',
|
107
|
+
type: {
|
108
|
+
name: 'String'
|
109
|
+
}
|
110
|
+
},
|
111
|
+
tags: {
|
112
|
+
required: false,
|
113
|
+
serialized_name: 'tags',
|
114
|
+
type: {
|
115
|
+
name: 'Dictionary',
|
116
|
+
value: {
|
117
|
+
required: false,
|
118
|
+
serialized_name: 'StringElementType',
|
119
|
+
type: {
|
120
|
+
name: 'String'
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
},
|
125
|
+
redis_version: {
|
126
|
+
required: false,
|
127
|
+
serialized_name: 'properties.redisVersion',
|
128
|
+
type: {
|
129
|
+
name: 'String'
|
130
|
+
}
|
131
|
+
},
|
132
|
+
sku: {
|
133
|
+
required: true,
|
134
|
+
serialized_name: 'properties.sku',
|
135
|
+
type: {
|
136
|
+
name: 'Composite',
|
137
|
+
class_name: 'Sku'
|
138
|
+
}
|
139
|
+
},
|
140
|
+
redis_configuration: {
|
141
|
+
required: false,
|
142
|
+
serialized_name: 'properties.redisConfiguration',
|
143
|
+
type: {
|
144
|
+
name: 'Dictionary',
|
145
|
+
value: {
|
146
|
+
required: false,
|
147
|
+
serialized_name: 'StringElementType',
|
148
|
+
type: {
|
149
|
+
name: 'String'
|
150
|
+
}
|
151
|
+
}
|
152
|
+
}
|
153
|
+
},
|
154
|
+
enable_non_ssl_port: {
|
155
|
+
required: false,
|
156
|
+
serialized_name: 'properties.enableNonSslPort',
|
157
|
+
type: {
|
158
|
+
name: 'Boolean'
|
159
|
+
}
|
160
|
+
},
|
161
|
+
tenant_settings: {
|
162
|
+
required: false,
|
163
|
+
serialized_name: 'properties.tenantSettings',
|
164
|
+
type: {
|
165
|
+
name: 'Dictionary',
|
166
|
+
value: {
|
167
|
+
required: false,
|
168
|
+
serialized_name: 'StringElementType',
|
169
|
+
type: {
|
170
|
+
name: 'String'
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
},
|
175
|
+
shard_count: {
|
176
|
+
required: false,
|
177
|
+
serialized_name: 'properties.shardCount',
|
178
|
+
type: {
|
179
|
+
name: 'Number'
|
180
|
+
}
|
181
|
+
},
|
182
|
+
virtual_network: {
|
183
|
+
required: false,
|
184
|
+
serialized_name: 'properties.virtualNetwork',
|
185
|
+
type: {
|
186
|
+
name: 'String'
|
187
|
+
}
|
188
|
+
},
|
189
|
+
subnet: {
|
190
|
+
required: false,
|
191
|
+
serialized_name: 'properties.subnet',
|
192
|
+
type: {
|
193
|
+
name: 'String'
|
194
|
+
}
|
195
|
+
},
|
196
|
+
static_ip: {
|
197
|
+
required: false,
|
198
|
+
serialized_name: 'properties.staticIP',
|
199
|
+
type: {
|
200
|
+
name: 'String'
|
201
|
+
}
|
202
|
+
},
|
203
|
+
provisioning_state: {
|
204
|
+
required: false,
|
205
|
+
serialized_name: 'properties.provisioningState',
|
206
|
+
type: {
|
207
|
+
name: 'String'
|
208
|
+
}
|
209
|
+
},
|
210
|
+
host_name: {
|
211
|
+
required: false,
|
212
|
+
serialized_name: 'properties.hostName',
|
213
|
+
type: {
|
214
|
+
name: 'String'
|
215
|
+
}
|
216
|
+
},
|
217
|
+
port: {
|
218
|
+
required: false,
|
219
|
+
serialized_name: 'properties.port',
|
220
|
+
type: {
|
221
|
+
name: 'Number'
|
222
|
+
}
|
223
|
+
},
|
224
|
+
ssl_port: {
|
225
|
+
required: false,
|
226
|
+
serialized_name: 'properties.sslPort',
|
227
|
+
type: {
|
228
|
+
name: 'Number'
|
229
|
+
}
|
230
|
+
},
|
231
|
+
access_keys: {
|
232
|
+
required: false,
|
233
|
+
serialized_name: 'properties.accessKeys',
|
234
|
+
type: {
|
235
|
+
name: 'Composite',
|
236
|
+
class_name: 'RedisAccessKeys'
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,95 @@
|
|
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::V2015_08_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
class Resource
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
# @return [String] Resource ID.
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# @return [String] Resource name.
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
# @return [String] Resource type.
|
23
|
+
attr_accessor :type
|
24
|
+
|
25
|
+
# @return [String] Resource location.
|
26
|
+
attr_accessor :location
|
27
|
+
|
28
|
+
# @return [Hash{String => String}] Resource tags.
|
29
|
+
attr_accessor :tags
|
30
|
+
|
31
|
+
|
32
|
+
#
|
33
|
+
# Mapper for Resource class as Ruby Hash.
|
34
|
+
# This will be used for serialization/deserialization.
|
35
|
+
#
|
36
|
+
def self.mapper()
|
37
|
+
{
|
38
|
+
required: false,
|
39
|
+
serialized_name: 'Resource',
|
40
|
+
type: {
|
41
|
+
name: 'Composite',
|
42
|
+
class_name: 'Resource',
|
43
|
+
model_properties: {
|
44
|
+
id: {
|
45
|
+
required: false,
|
46
|
+
read_only: true,
|
47
|
+
serialized_name: 'id',
|
48
|
+
type: {
|
49
|
+
name: 'String'
|
50
|
+
}
|
51
|
+
},
|
52
|
+
name: {
|
53
|
+
required: false,
|
54
|
+
read_only: true,
|
55
|
+
serialized_name: 'name',
|
56
|
+
type: {
|
57
|
+
name: 'String'
|
58
|
+
}
|
59
|
+
},
|
60
|
+
type: {
|
61
|
+
required: false,
|
62
|
+
read_only: true,
|
63
|
+
serialized_name: 'type',
|
64
|
+
type: {
|
65
|
+
name: 'String'
|
66
|
+
}
|
67
|
+
},
|
68
|
+
location: {
|
69
|
+
required: true,
|
70
|
+
serialized_name: 'location',
|
71
|
+
type: {
|
72
|
+
name: 'String'
|
73
|
+
}
|
74
|
+
},
|
75
|
+
tags: {
|
76
|
+
required: false,
|
77
|
+
serialized_name: 'tags',
|
78
|
+
type: {
|
79
|
+
name: 'Dictionary',
|
80
|
+
value: {
|
81
|
+
required: false,
|
82
|
+
serialized_name: 'StringElementType',
|
83
|
+
type: {
|
84
|
+
name: 'String'
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,68 @@
|
|
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::V2015_08_01
|
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). Possible
|
21
|
+
# values include: 'C', 'P'
|
22
|
+
attr_accessor :family
|
23
|
+
|
24
|
+
# @return [Integer] What size of Redis cache to deploy. Valid values: for
|
25
|
+
# 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
|
@@ -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::V2015_08_01 end
|
@@ -0,0 +1,1002 @@
|
|
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::V2015_08_01
|
7
|
+
#
|
8
|
+
# REST API for Azure Redis Cache Service.
|
9
|
+
#
|
10
|
+
class Redis
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Redis 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 a Redis cache, or replace (overwrite/recreate, with potential
|
26
|
+
# downtime) an existing 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 [RedisCreateOrUpdateParameters] Parameters supplied to the
|
31
|
+
# CreateOrUpdate Redis operation.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [RedisResourceWithAccessKey] 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 a Redis cache, or replace (overwrite/recreate, with potential
|
44
|
+
# downtime) an existing cache.
|
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 [RedisCreateOrUpdateParameters] Parameters supplied to the
|
49
|
+
# CreateOrUpdate Redis operation.
|
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).value!
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Create a Redis cache, or replace (overwrite/recreate, with potential
|
61
|
+
# downtime) an existing cache.
|
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 [RedisCreateOrUpdateParameters] Parameters supplied to the
|
66
|
+
# CreateOrUpdate Redis operation.
|
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
|
+
|
82
|
+
# Set Headers
|
83
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
84
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
85
|
+
|
86
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
87
|
+
|
88
|
+
# Serialize Request
|
89
|
+
request_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisCreateOrUpdateParameters.mapper()
|
90
|
+
request_content = @client.serialize(request_mapper, parameters)
|
91
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
92
|
+
|
93
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
|
94
|
+
|
95
|
+
request_url = @base_url || @client.base_url
|
96
|
+
|
97
|
+
options = {
|
98
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
99
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
100
|
+
query_params: {'api-version' => @client.api_version},
|
101
|
+
body: request_content,
|
102
|
+
headers: request_headers.merge(custom_headers || {}),
|
103
|
+
base_url: request_url
|
104
|
+
}
|
105
|
+
promise = @client.make_request_async(:put, path_template, options)
|
106
|
+
|
107
|
+
promise = promise.then do |result|
|
108
|
+
http_response = result.response
|
109
|
+
status_code = http_response.status
|
110
|
+
response_content = http_response.body
|
111
|
+
unless status_code == 201 || status_code == 200
|
112
|
+
error_model = JSON.load(response_content)
|
113
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
114
|
+
end
|
115
|
+
|
116
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
117
|
+
# Deserialize Response
|
118
|
+
if status_code == 201
|
119
|
+
begin
|
120
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
121
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisResourceWithAccessKey.mapper()
|
122
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
123
|
+
rescue Exception => e
|
124
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
# Deserialize Response
|
128
|
+
if status_code == 200
|
129
|
+
begin
|
130
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
131
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisResourceWithAccessKey.mapper()
|
132
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
133
|
+
rescue Exception => e
|
134
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
result
|
139
|
+
end
|
140
|
+
|
141
|
+
promise.execute
|
142
|
+
end
|
143
|
+
|
144
|
+
#
|
145
|
+
# Deletes a Redis cache.
|
146
|
+
#
|
147
|
+
# @param resource_group_name [String] The name of the resource group.
|
148
|
+
# @param name [String] The name of the Redis cache.
|
149
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
150
|
+
# will be added to the HTTP request.
|
151
|
+
#
|
152
|
+
#
|
153
|
+
def delete(resource_group_name, name, custom_headers = nil)
|
154
|
+
response = delete_async(resource_group_name, name, custom_headers).value!
|
155
|
+
nil
|
156
|
+
end
|
157
|
+
|
158
|
+
#
|
159
|
+
# Deletes a Redis cache.
|
160
|
+
#
|
161
|
+
# @param resource_group_name [String] The name of the resource group.
|
162
|
+
# @param name [String] The name of the Redis cache.
|
163
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
164
|
+
# will be added to the HTTP request.
|
165
|
+
#
|
166
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
167
|
+
#
|
168
|
+
def delete_with_http_info(resource_group_name, name, custom_headers = nil)
|
169
|
+
delete_async(resource_group_name, name, custom_headers).value!
|
170
|
+
end
|
171
|
+
|
172
|
+
#
|
173
|
+
# Deletes a Redis cache.
|
174
|
+
#
|
175
|
+
# @param resource_group_name [String] The name of the resource group.
|
176
|
+
# @param name [String] The name of the Redis cache.
|
177
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
178
|
+
# to the HTTP request.
|
179
|
+
#
|
180
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
181
|
+
#
|
182
|
+
def delete_async(resource_group_name, name, custom_headers = nil)
|
183
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
184
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
185
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
186
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
187
|
+
|
188
|
+
|
189
|
+
request_headers = {}
|
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}'
|
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 == 202 || status_code == 404
|
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 a Redis cache (resource description).
|
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 [RedisResource] operation results.
|
233
|
+
#
|
234
|
+
def get(resource_group_name, name, custom_headers = nil)
|
235
|
+
response = get_async(resource_group_name, name, custom_headers).value!
|
236
|
+
response.body unless response.nil?
|
237
|
+
end
|
238
|
+
|
239
|
+
#
|
240
|
+
# Gets a Redis cache (resource description).
|
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).value!
|
251
|
+
end
|
252
|
+
|
253
|
+
#
|
254
|
+
# Gets a Redis cache (resource description).
|
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
|
+
|
272
|
+
# Set Headers
|
273
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
274
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
275
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'
|
276
|
+
|
277
|
+
request_url = @base_url || @client.base_url
|
278
|
+
|
279
|
+
options = {
|
280
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
281
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
282
|
+
query_params: {'api-version' => @client.api_version},
|
283
|
+
headers: request_headers.merge(custom_headers || {}),
|
284
|
+
base_url: request_url
|
285
|
+
}
|
286
|
+
promise = @client.make_request_async(:get, path_template, options)
|
287
|
+
|
288
|
+
promise = promise.then do |result|
|
289
|
+
http_response = result.response
|
290
|
+
status_code = http_response.status
|
291
|
+
response_content = http_response.body
|
292
|
+
unless status_code == 200
|
293
|
+
error_model = JSON.load(response_content)
|
294
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
295
|
+
end
|
296
|
+
|
297
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
298
|
+
# Deserialize Response
|
299
|
+
if status_code == 200
|
300
|
+
begin
|
301
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
302
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisResource.mapper()
|
303
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
304
|
+
rescue Exception => e
|
305
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
result
|
310
|
+
end
|
311
|
+
|
312
|
+
promise.execute
|
313
|
+
end
|
314
|
+
|
315
|
+
#
|
316
|
+
# Gets all Redis caches in a resource group.
|
317
|
+
#
|
318
|
+
# @param resource_group_name [String] The name of the resource group.
|
319
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
320
|
+
# will be added to the HTTP request.
|
321
|
+
#
|
322
|
+
# @return [Array<RedisResource>] operation results.
|
323
|
+
#
|
324
|
+
def list_by_resource_group(resource_group_name, custom_headers = nil)
|
325
|
+
first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
|
326
|
+
first_page.get_all_items
|
327
|
+
end
|
328
|
+
|
329
|
+
#
|
330
|
+
# Gets all Redis caches in a resource group.
|
331
|
+
#
|
332
|
+
# @param resource_group_name [String] The name of the resource group.
|
333
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
334
|
+
# will be added to the HTTP request.
|
335
|
+
#
|
336
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
337
|
+
#
|
338
|
+
def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
|
339
|
+
list_by_resource_group_async(resource_group_name, custom_headers).value!
|
340
|
+
end
|
341
|
+
|
342
|
+
#
|
343
|
+
# Gets all Redis caches in a resource group.
|
344
|
+
#
|
345
|
+
# @param resource_group_name [String] The name of the resource group.
|
346
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
347
|
+
# to the HTTP request.
|
348
|
+
#
|
349
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
350
|
+
#
|
351
|
+
def list_by_resource_group_async(resource_group_name, custom_headers = nil)
|
352
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
353
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
354
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
355
|
+
|
356
|
+
|
357
|
+
request_headers = {}
|
358
|
+
|
359
|
+
# Set Headers
|
360
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
361
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
362
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/'
|
363
|
+
|
364
|
+
request_url = @base_url || @client.base_url
|
365
|
+
|
366
|
+
options = {
|
367
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
368
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
369
|
+
query_params: {'api-version' => @client.api_version},
|
370
|
+
headers: request_headers.merge(custom_headers || {}),
|
371
|
+
base_url: request_url
|
372
|
+
}
|
373
|
+
promise = @client.make_request_async(:get, path_template, options)
|
374
|
+
|
375
|
+
promise = promise.then do |result|
|
376
|
+
http_response = result.response
|
377
|
+
status_code = http_response.status
|
378
|
+
response_content = http_response.body
|
379
|
+
unless status_code == 200
|
380
|
+
error_model = JSON.load(response_content)
|
381
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
382
|
+
end
|
383
|
+
|
384
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
385
|
+
# Deserialize Response
|
386
|
+
if status_code == 200
|
387
|
+
begin
|
388
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
389
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisListResult.mapper()
|
390
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
391
|
+
rescue Exception => e
|
392
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
result
|
397
|
+
end
|
398
|
+
|
399
|
+
promise.execute
|
400
|
+
end
|
401
|
+
|
402
|
+
#
|
403
|
+
# Gets all Redis caches in the specified subscription.
|
404
|
+
#
|
405
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
406
|
+
# will be added to the HTTP request.
|
407
|
+
#
|
408
|
+
# @return [Array<RedisResource>] operation results.
|
409
|
+
#
|
410
|
+
def list(custom_headers = nil)
|
411
|
+
first_page = list_as_lazy(custom_headers)
|
412
|
+
first_page.get_all_items
|
413
|
+
end
|
414
|
+
|
415
|
+
#
|
416
|
+
# Gets all Redis caches in the specified subscription.
|
417
|
+
#
|
418
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
419
|
+
# will be added to the HTTP request.
|
420
|
+
#
|
421
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
422
|
+
#
|
423
|
+
def list_with_http_info(custom_headers = nil)
|
424
|
+
list_async(custom_headers).value!
|
425
|
+
end
|
426
|
+
|
427
|
+
#
|
428
|
+
# Gets all Redis caches in the specified subscription.
|
429
|
+
#
|
430
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
431
|
+
# to the HTTP request.
|
432
|
+
#
|
433
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
434
|
+
#
|
435
|
+
def list_async(custom_headers = nil)
|
436
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
437
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
438
|
+
|
439
|
+
|
440
|
+
request_headers = {}
|
441
|
+
|
442
|
+
# Set Headers
|
443
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
444
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
445
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/'
|
446
|
+
|
447
|
+
request_url = @base_url || @client.base_url
|
448
|
+
|
449
|
+
options = {
|
450
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
451
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
452
|
+
query_params: {'api-version' => @client.api_version},
|
453
|
+
headers: request_headers.merge(custom_headers || {}),
|
454
|
+
base_url: request_url
|
455
|
+
}
|
456
|
+
promise = @client.make_request_async(:get, path_template, options)
|
457
|
+
|
458
|
+
promise = promise.then do |result|
|
459
|
+
http_response = result.response
|
460
|
+
status_code = http_response.status
|
461
|
+
response_content = http_response.body
|
462
|
+
unless status_code == 200
|
463
|
+
error_model = JSON.load(response_content)
|
464
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
465
|
+
end
|
466
|
+
|
467
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
468
|
+
# Deserialize Response
|
469
|
+
if status_code == 200
|
470
|
+
begin
|
471
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
472
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisListResult.mapper()
|
473
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
474
|
+
rescue Exception => e
|
475
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
476
|
+
end
|
477
|
+
end
|
478
|
+
|
479
|
+
result
|
480
|
+
end
|
481
|
+
|
482
|
+
promise.execute
|
483
|
+
end
|
484
|
+
|
485
|
+
#
|
486
|
+
# Retrieve a Redis cache's access keys. This operation requires write
|
487
|
+
# permission to the cache resource.
|
488
|
+
#
|
489
|
+
# @param resource_group_name [String] The name of the resource group.
|
490
|
+
# @param name [String] The name of the Redis cache.
|
491
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
492
|
+
# will be added to the HTTP request.
|
493
|
+
#
|
494
|
+
# @return [RedisListKeysResult] operation results.
|
495
|
+
#
|
496
|
+
def list_keys(resource_group_name, name, custom_headers = nil)
|
497
|
+
response = list_keys_async(resource_group_name, name, custom_headers).value!
|
498
|
+
response.body unless response.nil?
|
499
|
+
end
|
500
|
+
|
501
|
+
#
|
502
|
+
# Retrieve a Redis cache's access keys. This operation requires write
|
503
|
+
# permission to the cache resource.
|
504
|
+
#
|
505
|
+
# @param resource_group_name [String] The name of the resource group.
|
506
|
+
# @param name [String] The name of the Redis cache.
|
507
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
508
|
+
# will be added to the HTTP request.
|
509
|
+
#
|
510
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
511
|
+
#
|
512
|
+
def list_keys_with_http_info(resource_group_name, name, custom_headers = nil)
|
513
|
+
list_keys_async(resource_group_name, name, custom_headers).value!
|
514
|
+
end
|
515
|
+
|
516
|
+
#
|
517
|
+
# Retrieve a Redis cache's access keys. This operation requires write
|
518
|
+
# permission to the cache resource.
|
519
|
+
#
|
520
|
+
# @param resource_group_name [String] The name of the resource group.
|
521
|
+
# @param name [String] The name of the Redis cache.
|
522
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
523
|
+
# to the HTTP request.
|
524
|
+
#
|
525
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
526
|
+
#
|
527
|
+
def list_keys_async(resource_group_name, name, custom_headers = nil)
|
528
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
529
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
530
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
531
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
532
|
+
|
533
|
+
|
534
|
+
request_headers = {}
|
535
|
+
|
536
|
+
# Set Headers
|
537
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
538
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
539
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'
|
540
|
+
|
541
|
+
request_url = @base_url || @client.base_url
|
542
|
+
|
543
|
+
options = {
|
544
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
545
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
546
|
+
query_params: {'api-version' => @client.api_version},
|
547
|
+
headers: request_headers.merge(custom_headers || {}),
|
548
|
+
base_url: request_url
|
549
|
+
}
|
550
|
+
promise = @client.make_request_async(:post, path_template, options)
|
551
|
+
|
552
|
+
promise = promise.then do |result|
|
553
|
+
http_response = result.response
|
554
|
+
status_code = http_response.status
|
555
|
+
response_content = http_response.body
|
556
|
+
unless status_code == 200
|
557
|
+
error_model = JSON.load(response_content)
|
558
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
559
|
+
end
|
560
|
+
|
561
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
562
|
+
# Deserialize Response
|
563
|
+
if status_code == 200
|
564
|
+
begin
|
565
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
566
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisListKeysResult.mapper()
|
567
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
568
|
+
rescue Exception => e
|
569
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
570
|
+
end
|
571
|
+
end
|
572
|
+
|
573
|
+
result
|
574
|
+
end
|
575
|
+
|
576
|
+
promise.execute
|
577
|
+
end
|
578
|
+
|
579
|
+
#
|
580
|
+
# Regenerate the access keys for a Redis cache. This operation requires write
|
581
|
+
# permission to the cache resource.
|
582
|
+
#
|
583
|
+
# @param resource_group_name [String] The name of the resource group.
|
584
|
+
# @param name [String] The name of the Redis cache.
|
585
|
+
# @param parameters [RedisRegenerateKeyParameters] Specifies which key to
|
586
|
+
# reset.
|
587
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
588
|
+
# will be added to the HTTP request.
|
589
|
+
#
|
590
|
+
# @return [RedisListKeysResult] operation results.
|
591
|
+
#
|
592
|
+
def regenerate_key(resource_group_name, name, parameters, custom_headers = nil)
|
593
|
+
response = regenerate_key_async(resource_group_name, name, parameters, custom_headers).value!
|
594
|
+
response.body unless response.nil?
|
595
|
+
end
|
596
|
+
|
597
|
+
#
|
598
|
+
# Regenerate the access keys for a Redis cache. This operation requires write
|
599
|
+
# permission to the cache resource.
|
600
|
+
#
|
601
|
+
# @param resource_group_name [String] The name of the resource group.
|
602
|
+
# @param name [String] The name of the Redis cache.
|
603
|
+
# @param parameters [RedisRegenerateKeyParameters] Specifies which key to
|
604
|
+
# reset.
|
605
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
606
|
+
# will be added to the HTTP request.
|
607
|
+
#
|
608
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
609
|
+
#
|
610
|
+
def regenerate_key_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
|
611
|
+
regenerate_key_async(resource_group_name, name, parameters, custom_headers).value!
|
612
|
+
end
|
613
|
+
|
614
|
+
#
|
615
|
+
# Regenerate the access keys for a Redis cache. This operation requires write
|
616
|
+
# permission to the cache resource.
|
617
|
+
#
|
618
|
+
# @param resource_group_name [String] The name of the resource group.
|
619
|
+
# @param name [String] The name of the Redis cache.
|
620
|
+
# @param parameters [RedisRegenerateKeyParameters] Specifies which key to
|
621
|
+
# reset.
|
622
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
623
|
+
# to the HTTP request.
|
624
|
+
#
|
625
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
626
|
+
#
|
627
|
+
def regenerate_key_async(resource_group_name, name, parameters, custom_headers = nil)
|
628
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
629
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
630
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
631
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
632
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
633
|
+
|
634
|
+
|
635
|
+
request_headers = {}
|
636
|
+
|
637
|
+
# Set Headers
|
638
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
639
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
640
|
+
|
641
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
642
|
+
|
643
|
+
# Serialize Request
|
644
|
+
request_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisRegenerateKeyParameters.mapper()
|
645
|
+
request_content = @client.serialize(request_mapper, parameters)
|
646
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
647
|
+
|
648
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'
|
649
|
+
|
650
|
+
request_url = @base_url || @client.base_url
|
651
|
+
|
652
|
+
options = {
|
653
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
654
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
655
|
+
query_params: {'api-version' => @client.api_version},
|
656
|
+
body: request_content,
|
657
|
+
headers: request_headers.merge(custom_headers || {}),
|
658
|
+
base_url: request_url
|
659
|
+
}
|
660
|
+
promise = @client.make_request_async(:post, path_template, options)
|
661
|
+
|
662
|
+
promise = promise.then do |result|
|
663
|
+
http_response = result.response
|
664
|
+
status_code = http_response.status
|
665
|
+
response_content = http_response.body
|
666
|
+
unless status_code == 200
|
667
|
+
error_model = JSON.load(response_content)
|
668
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
669
|
+
end
|
670
|
+
|
671
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
672
|
+
# Deserialize Response
|
673
|
+
if status_code == 200
|
674
|
+
begin
|
675
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
676
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisListKeysResult.mapper()
|
677
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
678
|
+
rescue Exception => e
|
679
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
680
|
+
end
|
681
|
+
end
|
682
|
+
|
683
|
+
result
|
684
|
+
end
|
685
|
+
|
686
|
+
promise.execute
|
687
|
+
end
|
688
|
+
|
689
|
+
#
|
690
|
+
# Reboot specified Redis node(s). This operation requires write permission to
|
691
|
+
# the cache resource. There can be potential data loss.
|
692
|
+
#
|
693
|
+
# @param resource_group_name [String] The name of the resource group.
|
694
|
+
# @param name [String] The name of the Redis cache.
|
695
|
+
# @param parameters [RedisRebootParameters] Specifies which Redis node(s) to
|
696
|
+
# reboot.
|
697
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
698
|
+
# will be added to the HTTP request.
|
699
|
+
#
|
700
|
+
#
|
701
|
+
def force_reboot(resource_group_name, name, parameters, custom_headers = nil)
|
702
|
+
response = force_reboot_async(resource_group_name, name, parameters, custom_headers).value!
|
703
|
+
nil
|
704
|
+
end
|
705
|
+
|
706
|
+
#
|
707
|
+
# Reboot specified Redis node(s). This operation requires write permission to
|
708
|
+
# the cache resource. There can be potential data loss.
|
709
|
+
#
|
710
|
+
# @param resource_group_name [String] The name of the resource group.
|
711
|
+
# @param name [String] The name of the Redis cache.
|
712
|
+
# @param parameters [RedisRebootParameters] Specifies which Redis node(s) to
|
713
|
+
# reboot.
|
714
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
715
|
+
# will be added to the HTTP request.
|
716
|
+
#
|
717
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
718
|
+
#
|
719
|
+
def force_reboot_with_http_info(resource_group_name, name, parameters, custom_headers = nil)
|
720
|
+
force_reboot_async(resource_group_name, name, parameters, custom_headers).value!
|
721
|
+
end
|
722
|
+
|
723
|
+
#
|
724
|
+
# Reboot specified Redis node(s). This operation requires write permission to
|
725
|
+
# the cache resource. There can be potential data loss.
|
726
|
+
#
|
727
|
+
# @param resource_group_name [String] The name of the resource group.
|
728
|
+
# @param name [String] The name of the Redis cache.
|
729
|
+
# @param parameters [RedisRebootParameters] Specifies which Redis node(s) to
|
730
|
+
# reboot.
|
731
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
732
|
+
# to the HTTP request.
|
733
|
+
#
|
734
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
735
|
+
#
|
736
|
+
def force_reboot_async(resource_group_name, name, parameters, custom_headers = nil)
|
737
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
738
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
739
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
740
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
741
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
742
|
+
|
743
|
+
|
744
|
+
request_headers = {}
|
745
|
+
|
746
|
+
# Set Headers
|
747
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
748
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
749
|
+
|
750
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
751
|
+
|
752
|
+
# Serialize Request
|
753
|
+
request_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisRebootParameters.mapper()
|
754
|
+
request_content = @client.serialize(request_mapper, parameters)
|
755
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
756
|
+
|
757
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'
|
758
|
+
|
759
|
+
request_url = @base_url || @client.base_url
|
760
|
+
|
761
|
+
options = {
|
762
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
763
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
764
|
+
query_params: {'api-version' => @client.api_version},
|
765
|
+
body: request_content,
|
766
|
+
headers: request_headers.merge(custom_headers || {}),
|
767
|
+
base_url: request_url
|
768
|
+
}
|
769
|
+
promise = @client.make_request_async(:post, path_template, options)
|
770
|
+
|
771
|
+
promise = promise.then do |result|
|
772
|
+
http_response = result.response
|
773
|
+
status_code = http_response.status
|
774
|
+
response_content = http_response.body
|
775
|
+
unless status_code == 200 || status_code == 202 || status_code == 404
|
776
|
+
error_model = JSON.load(response_content)
|
777
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
778
|
+
end
|
779
|
+
|
780
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
781
|
+
|
782
|
+
result
|
783
|
+
end
|
784
|
+
|
785
|
+
promise.execute
|
786
|
+
end
|
787
|
+
|
788
|
+
#
|
789
|
+
# Gets all Redis caches in a resource group.
|
790
|
+
#
|
791
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
792
|
+
# to List operation.
|
793
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
794
|
+
# will be added to the HTTP request.
|
795
|
+
#
|
796
|
+
# @return [RedisListResult] operation results.
|
797
|
+
#
|
798
|
+
def list_by_resource_group_next(next_page_link, custom_headers = nil)
|
799
|
+
response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
|
800
|
+
response.body unless response.nil?
|
801
|
+
end
|
802
|
+
|
803
|
+
#
|
804
|
+
# Gets all Redis caches in a resource group.
|
805
|
+
#
|
806
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
807
|
+
# to List operation.
|
808
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
809
|
+
# will be added to the HTTP request.
|
810
|
+
#
|
811
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
812
|
+
#
|
813
|
+
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
|
814
|
+
list_by_resource_group_next_async(next_page_link, custom_headers).value!
|
815
|
+
end
|
816
|
+
|
817
|
+
#
|
818
|
+
# Gets all Redis caches in a resource group.
|
819
|
+
#
|
820
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
821
|
+
# to List operation.
|
822
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
823
|
+
# to the HTTP request.
|
824
|
+
#
|
825
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
826
|
+
#
|
827
|
+
def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
|
828
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
829
|
+
|
830
|
+
|
831
|
+
request_headers = {}
|
832
|
+
|
833
|
+
# Set Headers
|
834
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
835
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
836
|
+
path_template = '{nextLink}'
|
837
|
+
|
838
|
+
request_url = @base_url || @client.base_url
|
839
|
+
|
840
|
+
options = {
|
841
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
842
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
843
|
+
headers: request_headers.merge(custom_headers || {}),
|
844
|
+
base_url: request_url
|
845
|
+
}
|
846
|
+
promise = @client.make_request_async(:get, path_template, options)
|
847
|
+
|
848
|
+
promise = promise.then do |result|
|
849
|
+
http_response = result.response
|
850
|
+
status_code = http_response.status
|
851
|
+
response_content = http_response.body
|
852
|
+
unless status_code == 200
|
853
|
+
error_model = JSON.load(response_content)
|
854
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
855
|
+
end
|
856
|
+
|
857
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
858
|
+
# Deserialize Response
|
859
|
+
if status_code == 200
|
860
|
+
begin
|
861
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
862
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisListResult.mapper()
|
863
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
864
|
+
rescue Exception => e
|
865
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
866
|
+
end
|
867
|
+
end
|
868
|
+
|
869
|
+
result
|
870
|
+
end
|
871
|
+
|
872
|
+
promise.execute
|
873
|
+
end
|
874
|
+
|
875
|
+
#
|
876
|
+
# Gets all Redis caches in the specified subscription.
|
877
|
+
#
|
878
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
879
|
+
# to List operation.
|
880
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
881
|
+
# will be added to the HTTP request.
|
882
|
+
#
|
883
|
+
# @return [RedisListResult] operation results.
|
884
|
+
#
|
885
|
+
def list_next(next_page_link, custom_headers = nil)
|
886
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
887
|
+
response.body unless response.nil?
|
888
|
+
end
|
889
|
+
|
890
|
+
#
|
891
|
+
# Gets all Redis caches in the specified subscription.
|
892
|
+
#
|
893
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
894
|
+
# to List operation.
|
895
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
896
|
+
# will be added to the HTTP request.
|
897
|
+
#
|
898
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
899
|
+
#
|
900
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
901
|
+
list_next_async(next_page_link, custom_headers).value!
|
902
|
+
end
|
903
|
+
|
904
|
+
#
|
905
|
+
# Gets all Redis caches in the specified subscription.
|
906
|
+
#
|
907
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
908
|
+
# to List operation.
|
909
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
910
|
+
# to the HTTP request.
|
911
|
+
#
|
912
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
913
|
+
#
|
914
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
915
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
916
|
+
|
917
|
+
|
918
|
+
request_headers = {}
|
919
|
+
|
920
|
+
# Set Headers
|
921
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
922
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
923
|
+
path_template = '{nextLink}'
|
924
|
+
|
925
|
+
request_url = @base_url || @client.base_url
|
926
|
+
|
927
|
+
options = {
|
928
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
929
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
930
|
+
headers: request_headers.merge(custom_headers || {}),
|
931
|
+
base_url: request_url
|
932
|
+
}
|
933
|
+
promise = @client.make_request_async(:get, path_template, options)
|
934
|
+
|
935
|
+
promise = promise.then do |result|
|
936
|
+
http_response = result.response
|
937
|
+
status_code = http_response.status
|
938
|
+
response_content = http_response.body
|
939
|
+
unless status_code == 200
|
940
|
+
error_model = JSON.load(response_content)
|
941
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
942
|
+
end
|
943
|
+
|
944
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
945
|
+
# Deserialize Response
|
946
|
+
if status_code == 200
|
947
|
+
begin
|
948
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
949
|
+
result_mapper = Azure::Redis::Mgmt::V2015_08_01::Models::RedisListResult.mapper()
|
950
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
951
|
+
rescue Exception => e
|
952
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
953
|
+
end
|
954
|
+
end
|
955
|
+
|
956
|
+
result
|
957
|
+
end
|
958
|
+
|
959
|
+
promise.execute
|
960
|
+
end
|
961
|
+
|
962
|
+
#
|
963
|
+
# Gets all Redis caches in a resource group.
|
964
|
+
#
|
965
|
+
# @param resource_group_name [String] The name of the resource group.
|
966
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
967
|
+
# will be added to the HTTP request.
|
968
|
+
#
|
969
|
+
# @return [RedisListResult] which provide lazy access to pages of the response.
|
970
|
+
#
|
971
|
+
def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
|
972
|
+
response = list_by_resource_group_async(resource_group_name, custom_headers).value!
|
973
|
+
unless response.nil?
|
974
|
+
page = response.body
|
975
|
+
page.next_method = Proc.new do |next_page_link|
|
976
|
+
list_by_resource_group_next_async(next_page_link, custom_headers)
|
977
|
+
end
|
978
|
+
page
|
979
|
+
end
|
980
|
+
end
|
981
|
+
|
982
|
+
#
|
983
|
+
# Gets all Redis caches in the specified subscription.
|
984
|
+
#
|
985
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
986
|
+
# will be added to the HTTP request.
|
987
|
+
#
|
988
|
+
# @return [RedisListResult] which provide lazy access to pages of the response.
|
989
|
+
#
|
990
|
+
def list_as_lazy(custom_headers = nil)
|
991
|
+
response = list_async(custom_headers).value!
|
992
|
+
unless response.nil?
|
993
|
+
page = response.body
|
994
|
+
page.next_method = Proc.new do |next_page_link|
|
995
|
+
list_next_async(next_page_link, custom_headers)
|
996
|
+
end
|
997
|
+
page
|
998
|
+
end
|
999
|
+
end
|
1000
|
+
|
1001
|
+
end
|
1002
|
+
end
|