azure_mgmt_mysql 0.17.1 → 0.17.2
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 +4 -4
- data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb +1 -1
- data/lib/2017-12-01/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb +1 -1
- data/lib/2018-06-01/generated/azure_mgmt_mysql.rb +52 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/advisors.rb +349 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/location_based_recommended_action_sessions_operation_status.rb +124 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/location_based_recommended_action_sessions_result.rb +256 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/advisor.rb +73 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/advisors_result_list.rb +100 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/azure_entity_resource.rb +75 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/error_additional_info.rb +59 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/error_response.rb +113 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_endpoint_connection.rb +100 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_endpoint_connection_list_result.rb +100 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_endpoint_property.rb +47 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_link_resource.rb +76 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_link_resource_list_result.rb +100 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_link_resource_properties.rb +68 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/private_link_service_connection_state_property.rb +72 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/proxy_resource.rb +63 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/recommendation_action.rb +158 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/recommendation_actions_result_list.rb +101 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/recommended_action_sessions_operation_status.rb +68 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/resource.rb +83 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/tags_object.rb +54 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/models/tracked_resource.rb +92 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/module_definition.rb +9 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb +351 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/private_endpoint_connections.rb +832 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/private_link_resources.rb +349 -0
- data/lib/2018-06-01/generated/azure_mgmt_mysql/recommended_actions.rb +362 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql.rb +38 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/azure_entity_resource.rb +75 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/error_additional_info.rb +59 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/error_response.rb +113 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/proxy_resource.rb +63 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/resource.rb +83 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/server_key.rb +111 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/server_key_list_result.rb +100 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/server_upgrade_parameters.rb +47 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/models/tracked_resource.rb +92 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/module_definition.rb +9 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb +135 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/server_keys.rb +666 -0
- data/lib/2020-01-01/generated/azure_mgmt_mysql/servers.rb +439 -0
- data/lib/azure_mgmt_mysql.rb +3 -1
- data/lib/profiles/latest/modules/mysql_profile_module.rb +122 -12
- data/lib/version.rb +1 -1
- metadata +44 -2
@@ -0,0 +1,439 @@
|
|
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::Mysql::Mgmt::V2020_01_01
|
7
|
+
#
|
8
|
+
# The Microsoft Azure management API provides create, read, update, and
|
9
|
+
# delete functionality for Azure MySQL resources including servers,
|
10
|
+
# databases, firewall rules, VNET rules, security alert policies, log files,
|
11
|
+
# encryption keys, active directory administrator and configurations.
|
12
|
+
#
|
13
|
+
class Servers
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the Servers class.
|
18
|
+
# @param client service class for accessing basic functionality.
|
19
|
+
#
|
20
|
+
def initialize(client)
|
21
|
+
@client = client
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [MySQLManagementClient] reference to the MySQLManagementClient
|
25
|
+
attr_reader :client
|
26
|
+
|
27
|
+
#
|
28
|
+
# Starts a stopped server.
|
29
|
+
#
|
30
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
31
|
+
# is case insensitive.
|
32
|
+
# @param server_name [String] The name of the server.
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
34
|
+
# will be added to the HTTP request.
|
35
|
+
#
|
36
|
+
def start(resource_group_name, server_name, custom_headers:nil)
|
37
|
+
response = start_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
43
|
+
# is case insensitive.
|
44
|
+
# @param server_name [String] The name of the server.
|
45
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
46
|
+
# will be added to the HTTP request.
|
47
|
+
#
|
48
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
49
|
+
# response.
|
50
|
+
#
|
51
|
+
def start_async(resource_group_name, server_name, custom_headers:nil)
|
52
|
+
# Send request
|
53
|
+
promise = begin_start_async(resource_group_name, server_name, custom_headers:custom_headers)
|
54
|
+
|
55
|
+
promise = promise.then do |response|
|
56
|
+
# Defining deserialization method.
|
57
|
+
deserialize_method = lambda do |parsed_response|
|
58
|
+
end
|
59
|
+
|
60
|
+
# Waiting for response.
|
61
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
62
|
+
end
|
63
|
+
|
64
|
+
promise
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# Stops a running server.
|
69
|
+
#
|
70
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
71
|
+
# is case insensitive.
|
72
|
+
# @param server_name [String] The name of the server.
|
73
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
74
|
+
# will be added to the HTTP request.
|
75
|
+
#
|
76
|
+
def stop(resource_group_name, server_name, custom_headers:nil)
|
77
|
+
response = stop_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
78
|
+
nil
|
79
|
+
end
|
80
|
+
|
81
|
+
#
|
82
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
83
|
+
# is case insensitive.
|
84
|
+
# @param server_name [String] The name of the server.
|
85
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
86
|
+
# will be added to the HTTP request.
|
87
|
+
#
|
88
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
89
|
+
# response.
|
90
|
+
#
|
91
|
+
def stop_async(resource_group_name, server_name, custom_headers:nil)
|
92
|
+
# Send request
|
93
|
+
promise = begin_stop_async(resource_group_name, server_name, custom_headers:custom_headers)
|
94
|
+
|
95
|
+
promise = promise.then do |response|
|
96
|
+
# Defining deserialization method.
|
97
|
+
deserialize_method = lambda do |parsed_response|
|
98
|
+
end
|
99
|
+
|
100
|
+
# Waiting for response.
|
101
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
102
|
+
end
|
103
|
+
|
104
|
+
promise
|
105
|
+
end
|
106
|
+
|
107
|
+
#
|
108
|
+
# Upgrade server version.
|
109
|
+
#
|
110
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
111
|
+
# is case insensitive.
|
112
|
+
# @param server_name [String] The name of the server.
|
113
|
+
# @param parameters [ServerUpgradeParameters] The required parameters for
|
114
|
+
# updating a server.
|
115
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
116
|
+
# will be added to the HTTP request.
|
117
|
+
#
|
118
|
+
def upgrade(resource_group_name, server_name, parameters, custom_headers:nil)
|
119
|
+
response = upgrade_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
|
120
|
+
nil
|
121
|
+
end
|
122
|
+
|
123
|
+
#
|
124
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
125
|
+
# is case insensitive.
|
126
|
+
# @param server_name [String] The name of the server.
|
127
|
+
# @param parameters [ServerUpgradeParameters] The required parameters for
|
128
|
+
# updating a server.
|
129
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
130
|
+
# will be added to the HTTP request.
|
131
|
+
#
|
132
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
133
|
+
# response.
|
134
|
+
#
|
135
|
+
def upgrade_async(resource_group_name, server_name, parameters, custom_headers:nil)
|
136
|
+
# Send request
|
137
|
+
promise = begin_upgrade_async(resource_group_name, server_name, parameters, custom_headers:custom_headers)
|
138
|
+
|
139
|
+
promise = promise.then do |response|
|
140
|
+
# Defining deserialization method.
|
141
|
+
deserialize_method = lambda do |parsed_response|
|
142
|
+
end
|
143
|
+
|
144
|
+
# Waiting for response.
|
145
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
146
|
+
end
|
147
|
+
|
148
|
+
promise
|
149
|
+
end
|
150
|
+
|
151
|
+
#
|
152
|
+
# Starts a stopped server.
|
153
|
+
#
|
154
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
155
|
+
# is case insensitive.
|
156
|
+
# @param server_name [String] The name of the server.
|
157
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
158
|
+
# will be added to the HTTP request.
|
159
|
+
#
|
160
|
+
#
|
161
|
+
def begin_start(resource_group_name, server_name, custom_headers:nil)
|
162
|
+
response = begin_start_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
163
|
+
nil
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# Starts a stopped server.
|
168
|
+
#
|
169
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
170
|
+
# is case insensitive.
|
171
|
+
# @param server_name [String] The name of the server.
|
172
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
173
|
+
# will be added to the HTTP request.
|
174
|
+
#
|
175
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
176
|
+
#
|
177
|
+
def begin_start_with_http_info(resource_group_name, server_name, custom_headers:nil)
|
178
|
+
begin_start_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
179
|
+
end
|
180
|
+
|
181
|
+
#
|
182
|
+
# Starts a stopped server.
|
183
|
+
#
|
184
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
185
|
+
# is case insensitive.
|
186
|
+
# @param server_name [String] The name of the server.
|
187
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
188
|
+
# to the HTTP request.
|
189
|
+
#
|
190
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
191
|
+
#
|
192
|
+
def begin_start_async(resource_group_name, server_name, custom_headers:nil)
|
193
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
194
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
195
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
196
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
197
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
198
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
199
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
200
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
201
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
202
|
+
|
203
|
+
|
204
|
+
request_headers = {}
|
205
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
206
|
+
|
207
|
+
# Set Headers
|
208
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
209
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
210
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/start'
|
211
|
+
|
212
|
+
request_url = @base_url || @client.base_url
|
213
|
+
|
214
|
+
options = {
|
215
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
216
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
|
217
|
+
query_params: {'api-version' => @client.api_version},
|
218
|
+
headers: request_headers.merge(custom_headers || {}),
|
219
|
+
base_url: request_url
|
220
|
+
}
|
221
|
+
promise = @client.make_request_async(:post, path_template, options)
|
222
|
+
|
223
|
+
promise = promise.then do |result|
|
224
|
+
http_response = result.response
|
225
|
+
status_code = http_response.status
|
226
|
+
response_content = http_response.body
|
227
|
+
unless status_code == 200 || status_code == 202
|
228
|
+
error_model = JSON.load(response_content)
|
229
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
230
|
+
end
|
231
|
+
|
232
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
233
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
234
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
235
|
+
|
236
|
+
result
|
237
|
+
end
|
238
|
+
|
239
|
+
promise.execute
|
240
|
+
end
|
241
|
+
|
242
|
+
#
|
243
|
+
# Stops a running server.
|
244
|
+
#
|
245
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
246
|
+
# is case insensitive.
|
247
|
+
# @param server_name [String] The name of the server.
|
248
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
249
|
+
# will be added to the HTTP request.
|
250
|
+
#
|
251
|
+
#
|
252
|
+
def begin_stop(resource_group_name, server_name, custom_headers:nil)
|
253
|
+
response = begin_stop_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
254
|
+
nil
|
255
|
+
end
|
256
|
+
|
257
|
+
#
|
258
|
+
# Stops a running server.
|
259
|
+
#
|
260
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
261
|
+
# is case insensitive.
|
262
|
+
# @param server_name [String] The name of the server.
|
263
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
264
|
+
# will be added to the HTTP request.
|
265
|
+
#
|
266
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
267
|
+
#
|
268
|
+
def begin_stop_with_http_info(resource_group_name, server_name, custom_headers:nil)
|
269
|
+
begin_stop_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# Stops a running server.
|
274
|
+
#
|
275
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
276
|
+
# is case insensitive.
|
277
|
+
# @param server_name [String] The name of the server.
|
278
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
279
|
+
# to the HTTP request.
|
280
|
+
#
|
281
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
282
|
+
#
|
283
|
+
def begin_stop_async(resource_group_name, server_name, custom_headers:nil)
|
284
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
285
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
286
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
287
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
288
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
289
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
290
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
291
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
292
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
293
|
+
|
294
|
+
|
295
|
+
request_headers = {}
|
296
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
297
|
+
|
298
|
+
# Set Headers
|
299
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
300
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
301
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/stop'
|
302
|
+
|
303
|
+
request_url = @base_url || @client.base_url
|
304
|
+
|
305
|
+
options = {
|
306
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
307
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
|
308
|
+
query_params: {'api-version' => @client.api_version},
|
309
|
+
headers: request_headers.merge(custom_headers || {}),
|
310
|
+
base_url: request_url
|
311
|
+
}
|
312
|
+
promise = @client.make_request_async(:post, path_template, options)
|
313
|
+
|
314
|
+
promise = promise.then do |result|
|
315
|
+
http_response = result.response
|
316
|
+
status_code = http_response.status
|
317
|
+
response_content = http_response.body
|
318
|
+
unless status_code == 200 || status_code == 202
|
319
|
+
error_model = JSON.load(response_content)
|
320
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
321
|
+
end
|
322
|
+
|
323
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
324
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
325
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
326
|
+
|
327
|
+
result
|
328
|
+
end
|
329
|
+
|
330
|
+
promise.execute
|
331
|
+
end
|
332
|
+
|
333
|
+
#
|
334
|
+
# Upgrade server version.
|
335
|
+
#
|
336
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
337
|
+
# is case insensitive.
|
338
|
+
# @param server_name [String] The name of the server.
|
339
|
+
# @param parameters [ServerUpgradeParameters] The required parameters for
|
340
|
+
# updating a server.
|
341
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
342
|
+
# will be added to the HTTP request.
|
343
|
+
#
|
344
|
+
#
|
345
|
+
def begin_upgrade(resource_group_name, server_name, parameters, custom_headers:nil)
|
346
|
+
response = begin_upgrade_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
|
347
|
+
nil
|
348
|
+
end
|
349
|
+
|
350
|
+
#
|
351
|
+
# Upgrade server version.
|
352
|
+
#
|
353
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
354
|
+
# is case insensitive.
|
355
|
+
# @param server_name [String] The name of the server.
|
356
|
+
# @param parameters [ServerUpgradeParameters] The required parameters for
|
357
|
+
# updating a server.
|
358
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
359
|
+
# will be added to the HTTP request.
|
360
|
+
#
|
361
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
362
|
+
#
|
363
|
+
def begin_upgrade_with_http_info(resource_group_name, server_name, parameters, custom_headers:nil)
|
364
|
+
begin_upgrade_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
|
365
|
+
end
|
366
|
+
|
367
|
+
#
|
368
|
+
# Upgrade server version.
|
369
|
+
#
|
370
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
371
|
+
# is case insensitive.
|
372
|
+
# @param server_name [String] The name of the server.
|
373
|
+
# @param parameters [ServerUpgradeParameters] The required parameters for
|
374
|
+
# updating a server.
|
375
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
376
|
+
# to the HTTP request.
|
377
|
+
#
|
378
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
379
|
+
#
|
380
|
+
def begin_upgrade_async(resource_group_name, server_name, parameters, custom_headers:nil)
|
381
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
382
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
383
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
384
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
385
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
386
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
387
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
388
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
389
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
390
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
391
|
+
|
392
|
+
|
393
|
+
request_headers = {}
|
394
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
395
|
+
|
396
|
+
# Set Headers
|
397
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
398
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
399
|
+
|
400
|
+
# Serialize Request
|
401
|
+
request_mapper = Azure::Mysql::Mgmt::V2020_01_01::Models::ServerUpgradeParameters.mapper()
|
402
|
+
request_content = @client.serialize(request_mapper, parameters)
|
403
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
404
|
+
|
405
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/upgrade'
|
406
|
+
|
407
|
+
request_url = @base_url || @client.base_url
|
408
|
+
|
409
|
+
options = {
|
410
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
411
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
|
412
|
+
query_params: {'api-version' => @client.api_version},
|
413
|
+
body: request_content,
|
414
|
+
headers: request_headers.merge(custom_headers || {}),
|
415
|
+
base_url: request_url
|
416
|
+
}
|
417
|
+
promise = @client.make_request_async(:post, path_template, options)
|
418
|
+
|
419
|
+
promise = promise.then do |result|
|
420
|
+
http_response = result.response
|
421
|
+
status_code = http_response.status
|
422
|
+
response_content = http_response.body
|
423
|
+
unless status_code == 200 || status_code == 202
|
424
|
+
error_model = JSON.load(response_content)
|
425
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
426
|
+
end
|
427
|
+
|
428
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
429
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
430
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
431
|
+
|
432
|
+
result
|
433
|
+
end
|
434
|
+
|
435
|
+
promise.execute
|
436
|
+
end
|
437
|
+
|
438
|
+
end
|
439
|
+
end
|
data/lib/azure_mgmt_mysql.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
3
|
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
4
|
|
5
|
-
require '
|
5
|
+
require '2018-06-01/generated/azure_mgmt_mysql'
|
6
|
+
require '2020-01-01/generated/azure_mgmt_mysql'
|
6
7
|
require '2017-12-01/generated/azure_mgmt_mysql'
|
8
|
+
require '2017-12-01-preview/generated/azure_mgmt_mysql'
|
7
9
|
require 'profiles/latest/mysql_latest_profile_client'
|
@@ -6,7 +6,6 @@ require 'azure_mgmt_mysql'
|
|
6
6
|
|
7
7
|
module Azure::Mysql::Profiles::Latest
|
8
8
|
module Mgmt
|
9
|
-
Servers = Azure::Mysql::Mgmt::V2017_12_01::Servers
|
10
9
|
Replicas = Azure::Mysql::Mgmt::V2017_12_01::Replicas
|
11
10
|
FirewallRules = Azure::Mysql::Mgmt::V2017_12_01::FirewallRules
|
12
11
|
VirtualNetworkRules = Azure::Mysql::Mgmt::V2017_12_01::VirtualNetworkRules
|
@@ -17,13 +16,20 @@ module Azure::Mysql::Profiles::Latest
|
|
17
16
|
CheckNameAvailability = Azure::Mysql::Mgmt::V2017_12_01::CheckNameAvailability
|
18
17
|
ServerSecurityAlertPolicies = Azure::Mysql::Mgmt::V2017_12_01::ServerSecurityAlertPolicies
|
19
18
|
Operations = Azure::Mysql::Mgmt::V2017_12_01::Operations
|
19
|
+
Advisors = Azure::Mysql::Mgmt::V2018_06_01::Advisors
|
20
|
+
RecommendedActions = Azure::Mysql::Mgmt::V2018_06_01::RecommendedActions
|
21
|
+
LocationBasedRecommendedActionSessionsOperationStatus = Azure::Mysql::Mgmt::V2018_06_01::LocationBasedRecommendedActionSessionsOperationStatus
|
22
|
+
LocationBasedRecommendedActionSessionsResult = Azure::Mysql::Mgmt::V2018_06_01::LocationBasedRecommendedActionSessionsResult
|
23
|
+
PrivateEndpointConnections = Azure::Mysql::Mgmt::V2018_06_01::PrivateEndpointConnections
|
24
|
+
PrivateLinkResources = Azure::Mysql::Mgmt::V2018_06_01::PrivateLinkResources
|
25
|
+
ServerKeys = Azure::Mysql::Mgmt::V2020_01_01::ServerKeys
|
26
|
+
Servers = Azure::Mysql::Mgmt::V2020_01_01::Servers
|
20
27
|
|
21
28
|
module Models
|
22
29
|
VirtualNetworkRuleListResult = Azure::Mysql::Mgmt::V2017_12_01::Models::VirtualNetworkRuleListResult
|
23
30
|
FirewallRuleListResult = Azure::Mysql::Mgmt::V2017_12_01::Models::FirewallRuleListResult
|
24
31
|
NameAvailabilityRequest = Azure::Mysql::Mgmt::V2017_12_01::Models::NameAvailabilityRequest
|
25
32
|
StorageProfile = Azure::Mysql::Mgmt::V2017_12_01::Models::StorageProfile
|
26
|
-
ProxyResource = Azure::Mysql::Mgmt::V2017_12_01::Models::ProxyResource
|
27
33
|
NameAvailability = Azure::Mysql::Mgmt::V2017_12_01::Models::NameAvailability
|
28
34
|
PerformanceTierListResult = Azure::Mysql::Mgmt::V2017_12_01::Models::PerformanceTierListResult
|
29
35
|
Operation = Azure::Mysql::Mgmt::V2017_12_01::Models::Operation
|
@@ -39,7 +45,6 @@ module Azure::Mysql::Profiles::Latest
|
|
39
45
|
ConfigurationListResult = Azure::Mysql::Mgmt::V2017_12_01::Models::ConfigurationListResult
|
40
46
|
ServerListResult = Azure::Mysql::Mgmt::V2017_12_01::Models::ServerListResult
|
41
47
|
OperationDisplay = Azure::Mysql::Mgmt::V2017_12_01::Models::OperationDisplay
|
42
|
-
TrackedResource = Azure::Mysql::Mgmt::V2017_12_01::Models::TrackedResource
|
43
48
|
ServerPropertiesForDefaultCreate = Azure::Mysql::Mgmt::V2017_12_01::Models::ServerPropertiesForDefaultCreate
|
44
49
|
ServerPropertiesForRestore = Azure::Mysql::Mgmt::V2017_12_01::Models::ServerPropertiesForRestore
|
45
50
|
ServerPropertiesForGeoRestore = Azure::Mysql::Mgmt::V2017_12_01::Models::ServerPropertiesForGeoRestore
|
@@ -60,13 +65,35 @@ module Azure::Mysql::Profiles::Latest
|
|
60
65
|
VirtualNetworkRuleState = Azure::Mysql::Mgmt::V2017_12_01::Models::VirtualNetworkRuleState
|
61
66
|
OperationOrigin = Azure::Mysql::Mgmt::V2017_12_01::Models::OperationOrigin
|
62
67
|
ServerSecurityAlertPolicyState = Azure::Mysql::Mgmt::V2017_12_01::Models::ServerSecurityAlertPolicyState
|
68
|
+
PrivateEndpointProperty = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateEndpointProperty
|
69
|
+
PrivateLinkServiceConnectionStateProperty = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkServiceConnectionStateProperty
|
70
|
+
AdvisorsResultList = Azure::Mysql::Mgmt::V2018_06_01::Models::AdvisorsResultList
|
71
|
+
RecommendedActionSessionsOperationStatus = Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendedActionSessionsOperationStatus
|
72
|
+
TagsObject = Azure::Mysql::Mgmt::V2018_06_01::Models::TagsObject
|
73
|
+
PrivateLinkResourceProperties = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkResourceProperties
|
74
|
+
PrivateLinkResourceListResult = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkResourceListResult
|
75
|
+
RecommendationActionsResultList = Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendationActionsResultList
|
76
|
+
PrivateEndpointConnectionListResult = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateEndpointConnectionListResult
|
77
|
+
Advisor = Azure::Mysql::Mgmt::V2018_06_01::Models::Advisor
|
78
|
+
RecommendationAction = Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendationAction
|
79
|
+
PrivateEndpointConnection = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateEndpointConnection
|
80
|
+
PrivateLinkResource = Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkResource
|
81
|
+
ErrorResponse = Azure::Mysql::Mgmt::V2020_01_01::Models::ErrorResponse
|
82
|
+
ServerKeyListResult = Azure::Mysql::Mgmt::V2020_01_01::Models::ServerKeyListResult
|
83
|
+
Resource = Azure::Mysql::Mgmt::V2020_01_01::Models::Resource
|
84
|
+
ErrorAdditionalInfo = Azure::Mysql::Mgmt::V2020_01_01::Models::ErrorAdditionalInfo
|
85
|
+
ServerUpgradeParameters = Azure::Mysql::Mgmt::V2020_01_01::Models::ServerUpgradeParameters
|
86
|
+
ServerKey = Azure::Mysql::Mgmt::V2020_01_01::Models::ServerKey
|
87
|
+
TrackedResource = Azure::Mysql::Mgmt::V2020_01_01::Models::TrackedResource
|
88
|
+
AzureEntityResource = Azure::Mysql::Mgmt::V2020_01_01::Models::AzureEntityResource
|
89
|
+
ProxyResource = Azure::Mysql::Mgmt::V2020_01_01::Models::ProxyResource
|
63
90
|
end
|
64
91
|
|
65
92
|
#
|
66
93
|
# MysqlManagementClass
|
67
94
|
#
|
68
95
|
class MysqlManagementClass
|
69
|
-
attr_reader :
|
96
|
+
attr_reader :replicas, :firewall_rules, :virtual_network_rules, :databases, :configurations, :log_files, :location_based_performance_tier, :check_name_availability, :server_security_alert_policies, :operations, :advisors, :recommended_actions, :location_based_recommended_action_sessions_operation_status, :location_based_recommended_action_sessions_result, :private_endpoint_connections, :private_link_resources, :server_keys, :servers, :configurable, :base_url, :options, :model_classes
|
70
97
|
|
71
98
|
def initialize(options = {})
|
72
99
|
if options.is_a?(Hash) && options.length == 0
|
@@ -86,7 +113,6 @@ module Azure::Mysql::Profiles::Latest
|
|
86
113
|
@client_0.subscription_id = configurable.subscription_id
|
87
114
|
end
|
88
115
|
add_telemetry(@client_0)
|
89
|
-
@servers = @client_0.servers
|
90
116
|
@replicas = @client_0.replicas
|
91
117
|
@firewall_rules = @client_0.firewall_rules
|
92
118
|
@virtual_network_rules = @client_0.virtual_network_rules
|
@@ -98,6 +124,26 @@ module Azure::Mysql::Profiles::Latest
|
|
98
124
|
@server_security_alert_policies = @client_0.server_security_alert_policies
|
99
125
|
@operations = @client_0.operations
|
100
126
|
|
127
|
+
@client_1 = Azure::Mysql::Mgmt::V2018_06_01::MySQLManagementClient.new(configurable.credentials, base_url, options)
|
128
|
+
if(@client_1.respond_to?(:subscription_id))
|
129
|
+
@client_1.subscription_id = configurable.subscription_id
|
130
|
+
end
|
131
|
+
add_telemetry(@client_1)
|
132
|
+
@advisors = @client_1.advisors
|
133
|
+
@recommended_actions = @client_1.recommended_actions
|
134
|
+
@location_based_recommended_action_sessions_operation_status = @client_1.location_based_recommended_action_sessions_operation_status
|
135
|
+
@location_based_recommended_action_sessions_result = @client_1.location_based_recommended_action_sessions_result
|
136
|
+
@private_endpoint_connections = @client_1.private_endpoint_connections
|
137
|
+
@private_link_resources = @client_1.private_link_resources
|
138
|
+
|
139
|
+
@client_2 = Azure::Mysql::Mgmt::V2020_01_01::MySQLManagementClient.new(configurable.credentials, base_url, options)
|
140
|
+
if(@client_2.respond_to?(:subscription_id))
|
141
|
+
@client_2.subscription_id = configurable.subscription_id
|
142
|
+
end
|
143
|
+
add_telemetry(@client_2)
|
144
|
+
@server_keys = @client_2.server_keys
|
145
|
+
@servers = @client_2.servers
|
146
|
+
|
101
147
|
@model_classes = ModelClasses.new
|
102
148
|
end
|
103
149
|
|
@@ -107,7 +153,11 @@ module Azure::Mysql::Profiles::Latest
|
|
107
153
|
end
|
108
154
|
|
109
155
|
def method_missing(method, *args)
|
110
|
-
if @
|
156
|
+
if @client_2.respond_to?method
|
157
|
+
@client_2.send(method, *args)
|
158
|
+
elsif @client_1.respond_to?method
|
159
|
+
@client_1.send(method, *args)
|
160
|
+
elsif @client_0.respond_to?method
|
111
161
|
@client_0.send(method, *args)
|
112
162
|
else
|
113
163
|
super
|
@@ -129,9 +179,6 @@ module Azure::Mysql::Profiles::Latest
|
|
129
179
|
def storage_profile
|
130
180
|
Azure::Mysql::Mgmt::V2017_12_01::Models::StorageProfile
|
131
181
|
end
|
132
|
-
def proxy_resource
|
133
|
-
Azure::Mysql::Mgmt::V2017_12_01::Models::ProxyResource
|
134
|
-
end
|
135
182
|
def name_availability
|
136
183
|
Azure::Mysql::Mgmt::V2017_12_01::Models::NameAvailability
|
137
184
|
end
|
@@ -177,9 +224,6 @@ module Azure::Mysql::Profiles::Latest
|
|
177
224
|
def operation_display
|
178
225
|
Azure::Mysql::Mgmt::V2017_12_01::Models::OperationDisplay
|
179
226
|
end
|
180
|
-
def tracked_resource
|
181
|
-
Azure::Mysql::Mgmt::V2017_12_01::Models::TrackedResource
|
182
|
-
end
|
183
227
|
def server_properties_for_default_create
|
184
228
|
Azure::Mysql::Mgmt::V2017_12_01::Models::ServerPropertiesForDefaultCreate
|
185
229
|
end
|
@@ -240,6 +284,72 @@ module Azure::Mysql::Profiles::Latest
|
|
240
284
|
def server_security_alert_policy_state
|
241
285
|
Azure::Mysql::Mgmt::V2017_12_01::Models::ServerSecurityAlertPolicyState
|
242
286
|
end
|
287
|
+
def private_endpoint_property
|
288
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateEndpointProperty
|
289
|
+
end
|
290
|
+
def private_link_service_connection_state_property
|
291
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkServiceConnectionStateProperty
|
292
|
+
end
|
293
|
+
def advisors_result_list
|
294
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::AdvisorsResultList
|
295
|
+
end
|
296
|
+
def recommended_action_sessions_operation_status
|
297
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendedActionSessionsOperationStatus
|
298
|
+
end
|
299
|
+
def tags_object
|
300
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::TagsObject
|
301
|
+
end
|
302
|
+
def private_link_resource_properties
|
303
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkResourceProperties
|
304
|
+
end
|
305
|
+
def private_link_resource_list_result
|
306
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkResourceListResult
|
307
|
+
end
|
308
|
+
def recommendation_actions_result_list
|
309
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendationActionsResultList
|
310
|
+
end
|
311
|
+
def private_endpoint_connection_list_result
|
312
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateEndpointConnectionListResult
|
313
|
+
end
|
314
|
+
def advisor
|
315
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::Advisor
|
316
|
+
end
|
317
|
+
def recommendation_action
|
318
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendationAction
|
319
|
+
end
|
320
|
+
def private_endpoint_connection
|
321
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateEndpointConnection
|
322
|
+
end
|
323
|
+
def private_link_resource
|
324
|
+
Azure::Mysql::Mgmt::V2018_06_01::Models::PrivateLinkResource
|
325
|
+
end
|
326
|
+
def error_response
|
327
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::ErrorResponse
|
328
|
+
end
|
329
|
+
def server_key_list_result
|
330
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::ServerKeyListResult
|
331
|
+
end
|
332
|
+
def resource
|
333
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::Resource
|
334
|
+
end
|
335
|
+
def error_additional_info
|
336
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::ErrorAdditionalInfo
|
337
|
+
end
|
338
|
+
def server_upgrade_parameters
|
339
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::ServerUpgradeParameters
|
340
|
+
end
|
341
|
+
def server_key
|
342
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::ServerKey
|
343
|
+
end
|
344
|
+
def tracked_resource
|
345
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::TrackedResource
|
346
|
+
end
|
347
|
+
def azure_entity_resource
|
348
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::AzureEntityResource
|
349
|
+
end
|
350
|
+
def proxy_resource
|
351
|
+
Azure::Mysql::Mgmt::V2020_01_01::Models::ProxyResource
|
352
|
+
end
|
243
353
|
end
|
244
354
|
end
|
245
355
|
end
|