azure_mgmt_mysql 0.17.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a95d2d56b81b9c24ad4443ea3739000baa6bb4a5dc4aa866871b9bbb67556ac
|
4
|
+
data.tar.gz: adc35b2af64a9170754e90ceebfc0bd3534626466db396442be91a51430d9fe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae4a71db42bd056a2e76e02a11afc3943d05362a2922b667f7a87ce44a227415346d34e6204d1c852bdba76db23e7a0e201a654450bdaabd5a353ee0dd5ee9f
|
7
|
+
data.tar.gz: 7368942dc512f8ae71add603e895d112c7a104bd70a75986be4c688997946ee4ac022f25ca541bc0baafe310f02c7b44d795a0e62976fc8e8bb3f384bd13ccab
|
@@ -165,7 +165,7 @@ module Azure::Mysql::Mgmt::V2017_12_01_preview
|
|
165
165
|
#
|
166
166
|
def add_telemetry
|
167
167
|
sdk_information = 'azure_mgmt_mysql'
|
168
|
-
sdk_information = "#{sdk_information}/0.17.
|
168
|
+
sdk_information = "#{sdk_information}/0.17.2"
|
169
169
|
add_user_agent_information(sdk_information)
|
170
170
|
end
|
171
171
|
end
|
@@ -165,7 +165,7 @@ module Azure::Mysql::Mgmt::V2017_12_01
|
|
165
165
|
#
|
166
166
|
def add_telemetry
|
167
167
|
sdk_information = 'azure_mgmt_mysql'
|
168
|
-
sdk_information = "#{sdk_information}/0.17.
|
168
|
+
sdk_information = "#{sdk_information}/0.17.2"
|
169
169
|
add_user_agent_information(sdk_information)
|
170
170
|
end
|
171
171
|
end
|
@@ -0,0 +1,52 @@
|
|
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
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2018-06-01/generated/azure_mgmt_mysql/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::Mysql::Mgmt::V2018_06_01
|
23
|
+
autoload :Advisors, '2018-06-01/generated/azure_mgmt_mysql/advisors.rb'
|
24
|
+
autoload :RecommendedActions, '2018-06-01/generated/azure_mgmt_mysql/recommended_actions.rb'
|
25
|
+
autoload :LocationBasedRecommendedActionSessionsOperationStatus, '2018-06-01/generated/azure_mgmt_mysql/location_based_recommended_action_sessions_operation_status.rb'
|
26
|
+
autoload :LocationBasedRecommendedActionSessionsResult, '2018-06-01/generated/azure_mgmt_mysql/location_based_recommended_action_sessions_result.rb'
|
27
|
+
autoload :PrivateEndpointConnections, '2018-06-01/generated/azure_mgmt_mysql/private_endpoint_connections.rb'
|
28
|
+
autoload :PrivateLinkResources, '2018-06-01/generated/azure_mgmt_mysql/private_link_resources.rb'
|
29
|
+
autoload :MySQLManagementClient, '2018-06-01/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb'
|
30
|
+
|
31
|
+
module Models
|
32
|
+
autoload :PrivateEndpointProperty, '2018-06-01/generated/azure_mgmt_mysql/models/private_endpoint_property.rb'
|
33
|
+
autoload :PrivateLinkServiceConnectionStateProperty, '2018-06-01/generated/azure_mgmt_mysql/models/private_link_service_connection_state_property.rb'
|
34
|
+
autoload :AdvisorsResultList, '2018-06-01/generated/azure_mgmt_mysql/models/advisors_result_list.rb'
|
35
|
+
autoload :Resource, '2018-06-01/generated/azure_mgmt_mysql/models/resource.rb'
|
36
|
+
autoload :ErrorResponse, '2018-06-01/generated/azure_mgmt_mysql/models/error_response.rb'
|
37
|
+
autoload :RecommendedActionSessionsOperationStatus, '2018-06-01/generated/azure_mgmt_mysql/models/recommended_action_sessions_operation_status.rb'
|
38
|
+
autoload :ErrorAdditionalInfo, '2018-06-01/generated/azure_mgmt_mysql/models/error_additional_info.rb'
|
39
|
+
autoload :TagsObject, '2018-06-01/generated/azure_mgmt_mysql/models/tags_object.rb'
|
40
|
+
autoload :PrivateLinkResourceProperties, '2018-06-01/generated/azure_mgmt_mysql/models/private_link_resource_properties.rb'
|
41
|
+
autoload :PrivateLinkResourceListResult, '2018-06-01/generated/azure_mgmt_mysql/models/private_link_resource_list_result.rb'
|
42
|
+
autoload :RecommendationActionsResultList, '2018-06-01/generated/azure_mgmt_mysql/models/recommendation_actions_result_list.rb'
|
43
|
+
autoload :PrivateEndpointConnectionListResult, '2018-06-01/generated/azure_mgmt_mysql/models/private_endpoint_connection_list_result.rb'
|
44
|
+
autoload :ProxyResource, '2018-06-01/generated/azure_mgmt_mysql/models/proxy_resource.rb'
|
45
|
+
autoload :Advisor, '2018-06-01/generated/azure_mgmt_mysql/models/advisor.rb'
|
46
|
+
autoload :RecommendationAction, '2018-06-01/generated/azure_mgmt_mysql/models/recommendation_action.rb'
|
47
|
+
autoload :TrackedResource, '2018-06-01/generated/azure_mgmt_mysql/models/tracked_resource.rb'
|
48
|
+
autoload :AzureEntityResource, '2018-06-01/generated/azure_mgmt_mysql/models/azure_entity_resource.rb'
|
49
|
+
autoload :PrivateEndpointConnection, '2018-06-01/generated/azure_mgmt_mysql/models/private_endpoint_connection.rb'
|
50
|
+
autoload :PrivateLinkResource, '2018-06-01/generated/azure_mgmt_mysql/models/private_link_resource.rb'
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,349 @@
|
|
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::V2018_06_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
|
+
# and configurations with new business model.
|
12
|
+
#
|
13
|
+
class Advisors
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the Advisors 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
|
+
# Get a recommendation action advisor.
|
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 advisor_name [String] The advisor name for recommendation action.
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
# @return [Advisor] operation results.
|
38
|
+
#
|
39
|
+
def get(resource_group_name, server_name, advisor_name, custom_headers:nil)
|
40
|
+
response = get_async(resource_group_name, server_name, advisor_name, custom_headers:custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Get a recommendation action advisor.
|
46
|
+
#
|
47
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
48
|
+
# is case insensitive.
|
49
|
+
# @param server_name [String] The name of the server.
|
50
|
+
# @param advisor_name [String] The advisor name for recommendation action.
|
51
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
52
|
+
# will be added to the HTTP request.
|
53
|
+
#
|
54
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
55
|
+
#
|
56
|
+
def get_with_http_info(resource_group_name, server_name, advisor_name, custom_headers:nil)
|
57
|
+
get_async(resource_group_name, server_name, advisor_name, custom_headers:custom_headers).value!
|
58
|
+
end
|
59
|
+
|
60
|
+
#
|
61
|
+
# Get a recommendation action advisor.
|
62
|
+
#
|
63
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
64
|
+
# is case insensitive.
|
65
|
+
# @param server_name [String] The name of the server.
|
66
|
+
# @param advisor_name [String] The advisor name for recommendation action.
|
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 get_async(resource_group_name, server_name, advisor_name, custom_headers:nil)
|
73
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
74
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
75
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
76
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
77
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
78
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
79
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
80
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
81
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
82
|
+
fail ArgumentError, 'advisor_name is nil' if advisor_name.nil?
|
83
|
+
|
84
|
+
|
85
|
+
request_headers = {}
|
86
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
87
|
+
|
88
|
+
# Set Headers
|
89
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
90
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
91
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/advisors/{advisorName}'
|
92
|
+
|
93
|
+
request_url = @base_url || @client.base_url
|
94
|
+
|
95
|
+
options = {
|
96
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
97
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'advisorName' => advisor_name},
|
98
|
+
query_params: {'api-version' => @client.api_version},
|
99
|
+
headers: request_headers.merge(custom_headers || {}),
|
100
|
+
base_url: request_url
|
101
|
+
}
|
102
|
+
promise = @client.make_request_async(:get, path_template, options)
|
103
|
+
|
104
|
+
promise = promise.then do |result|
|
105
|
+
http_response = result.response
|
106
|
+
status_code = http_response.status
|
107
|
+
response_content = http_response.body
|
108
|
+
unless status_code == 200
|
109
|
+
error_model = JSON.load(response_content)
|
110
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
111
|
+
end
|
112
|
+
|
113
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
114
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
115
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
116
|
+
# Deserialize Response
|
117
|
+
if status_code == 200
|
118
|
+
begin
|
119
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
120
|
+
result_mapper = Azure::Mysql::Mgmt::V2018_06_01::Models::Advisor.mapper()
|
121
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
122
|
+
rescue Exception => e
|
123
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
result
|
128
|
+
end
|
129
|
+
|
130
|
+
promise.execute
|
131
|
+
end
|
132
|
+
|
133
|
+
#
|
134
|
+
# List recommendation action advisors.
|
135
|
+
#
|
136
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
137
|
+
# is case insensitive.
|
138
|
+
# @param server_name [String] The name of the server.
|
139
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
140
|
+
# will be added to the HTTP request.
|
141
|
+
#
|
142
|
+
# @return [Array<Advisor>] operation results.
|
143
|
+
#
|
144
|
+
def list_by_server(resource_group_name, server_name, custom_headers:nil)
|
145
|
+
first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers:custom_headers)
|
146
|
+
first_page.get_all_items
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# List recommendation action advisors.
|
151
|
+
#
|
152
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
153
|
+
# is case insensitive.
|
154
|
+
# @param server_name [String] The name of the server.
|
155
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
156
|
+
# will be added to the HTTP request.
|
157
|
+
#
|
158
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
159
|
+
#
|
160
|
+
def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
|
161
|
+
list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
162
|
+
end
|
163
|
+
|
164
|
+
#
|
165
|
+
# List recommendation action advisors.
|
166
|
+
#
|
167
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
168
|
+
# is case insensitive.
|
169
|
+
# @param server_name [String] The name of the server.
|
170
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
171
|
+
# to the HTTP request.
|
172
|
+
#
|
173
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
174
|
+
#
|
175
|
+
def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
|
176
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
177
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
178
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
179
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
180
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
181
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
182
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
183
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
184
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
185
|
+
|
186
|
+
|
187
|
+
request_headers = {}
|
188
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
189
|
+
|
190
|
+
# Set Headers
|
191
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
192
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
193
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/advisors'
|
194
|
+
|
195
|
+
request_url = @base_url || @client.base_url
|
196
|
+
|
197
|
+
options = {
|
198
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
199
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
|
200
|
+
query_params: {'api-version' => @client.api_version},
|
201
|
+
headers: request_headers.merge(custom_headers || {}),
|
202
|
+
base_url: request_url
|
203
|
+
}
|
204
|
+
promise = @client.make_request_async(:get, path_template, options)
|
205
|
+
|
206
|
+
promise = promise.then do |result|
|
207
|
+
http_response = result.response
|
208
|
+
status_code = http_response.status
|
209
|
+
response_content = http_response.body
|
210
|
+
unless status_code == 200
|
211
|
+
error_model = JSON.load(response_content)
|
212
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
213
|
+
end
|
214
|
+
|
215
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
216
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
217
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
218
|
+
# Deserialize Response
|
219
|
+
if status_code == 200
|
220
|
+
begin
|
221
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
222
|
+
result_mapper = Azure::Mysql::Mgmt::V2018_06_01::Models::AdvisorsResultList.mapper()
|
223
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
224
|
+
rescue Exception => e
|
225
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
result
|
230
|
+
end
|
231
|
+
|
232
|
+
promise.execute
|
233
|
+
end
|
234
|
+
|
235
|
+
#
|
236
|
+
# List recommendation action advisors.
|
237
|
+
#
|
238
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
239
|
+
# to List operation.
|
240
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
241
|
+
# will be added to the HTTP request.
|
242
|
+
#
|
243
|
+
# @return [AdvisorsResultList] operation results.
|
244
|
+
#
|
245
|
+
def list_by_server_next(next_page_link, custom_headers:nil)
|
246
|
+
response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
|
247
|
+
response.body unless response.nil?
|
248
|
+
end
|
249
|
+
|
250
|
+
#
|
251
|
+
# List recommendation action advisors.
|
252
|
+
#
|
253
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
254
|
+
# to List operation.
|
255
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
256
|
+
# will be added to the HTTP request.
|
257
|
+
#
|
258
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
259
|
+
#
|
260
|
+
def list_by_server_next_with_http_info(next_page_link, custom_headers:nil)
|
261
|
+
list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
|
262
|
+
end
|
263
|
+
|
264
|
+
#
|
265
|
+
# List recommendation action advisors.
|
266
|
+
#
|
267
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
268
|
+
# to List operation.
|
269
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
270
|
+
# to the HTTP request.
|
271
|
+
#
|
272
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
273
|
+
#
|
274
|
+
def list_by_server_next_async(next_page_link, custom_headers:nil)
|
275
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
276
|
+
|
277
|
+
|
278
|
+
request_headers = {}
|
279
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
280
|
+
|
281
|
+
# Set Headers
|
282
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
283
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
284
|
+
path_template = '{nextLink}'
|
285
|
+
|
286
|
+
request_url = @base_url || @client.base_url
|
287
|
+
|
288
|
+
options = {
|
289
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
290
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
291
|
+
headers: request_headers.merge(custom_headers || {}),
|
292
|
+
base_url: request_url
|
293
|
+
}
|
294
|
+
promise = @client.make_request_async(:get, path_template, options)
|
295
|
+
|
296
|
+
promise = promise.then do |result|
|
297
|
+
http_response = result.response
|
298
|
+
status_code = http_response.status
|
299
|
+
response_content = http_response.body
|
300
|
+
unless status_code == 200
|
301
|
+
error_model = JSON.load(response_content)
|
302
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
303
|
+
end
|
304
|
+
|
305
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
306
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
307
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
308
|
+
# Deserialize Response
|
309
|
+
if status_code == 200
|
310
|
+
begin
|
311
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
312
|
+
result_mapper = Azure::Mysql::Mgmt::V2018_06_01::Models::AdvisorsResultList.mapper()
|
313
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
314
|
+
rescue Exception => e
|
315
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
result
|
320
|
+
end
|
321
|
+
|
322
|
+
promise.execute
|
323
|
+
end
|
324
|
+
|
325
|
+
#
|
326
|
+
# List recommendation action advisors.
|
327
|
+
#
|
328
|
+
# @param resource_group_name [String] The name of the resource group. The name
|
329
|
+
# is case insensitive.
|
330
|
+
# @param server_name [String] The name of the server.
|
331
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
332
|
+
# will be added to the HTTP request.
|
333
|
+
#
|
334
|
+
# @return [AdvisorsResultList] which provide lazy access to pages of the
|
335
|
+
# response.
|
336
|
+
#
|
337
|
+
def list_by_server_as_lazy(resource_group_name, server_name, custom_headers:nil)
|
338
|
+
response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
339
|
+
unless response.nil?
|
340
|
+
page = response.body
|
341
|
+
page.next_method = Proc.new do |next_page_link|
|
342
|
+
list_by_server_next_async(next_page_link, custom_headers:custom_headers)
|
343
|
+
end
|
344
|
+
page
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
end
|
349
|
+
end
|
@@ -0,0 +1,124 @@
|
|
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::V2018_06_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
|
+
# and configurations with new business model.
|
12
|
+
#
|
13
|
+
class LocationBasedRecommendedActionSessionsOperationStatus
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the LocationBasedRecommendedActionSessionsOperationStatus 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
|
+
# Recommendation action session operation status.
|
29
|
+
#
|
30
|
+
# @param location_name [String] The name of the location.
|
31
|
+
# @param operation_id [String] The operation identifier.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [RecommendedActionSessionsOperationStatus] operation results.
|
36
|
+
#
|
37
|
+
def get(location_name, operation_id, custom_headers:nil)
|
38
|
+
response = get_async(location_name, operation_id, custom_headers:custom_headers).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Recommendation action session operation status.
|
44
|
+
#
|
45
|
+
# @param location_name [String] The name of the location.
|
46
|
+
# @param operation_id [String] The operation identifier.
|
47
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
48
|
+
# will be added to the HTTP request.
|
49
|
+
#
|
50
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
51
|
+
#
|
52
|
+
def get_with_http_info(location_name, operation_id, custom_headers:nil)
|
53
|
+
get_async(location_name, operation_id, custom_headers:custom_headers).value!
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Recommendation action session operation status.
|
58
|
+
#
|
59
|
+
# @param location_name [String] The name of the location.
|
60
|
+
# @param operation_id [String] The operation identifier.
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
62
|
+
# to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
65
|
+
#
|
66
|
+
def get_async(location_name, operation_id, custom_headers:nil)
|
67
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
68
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
69
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
70
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
71
|
+
fail ArgumentError, 'location_name is nil' if location_name.nil?
|
72
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
73
|
+
|
74
|
+
|
75
|
+
request_headers = {}
|
76
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
77
|
+
|
78
|
+
# Set Headers
|
79
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
80
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
81
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/recommendedActionSessionsAzureAsyncOperation/{operationId}'
|
82
|
+
|
83
|
+
request_url = @base_url || @client.base_url
|
84
|
+
|
85
|
+
options = {
|
86
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
87
|
+
path_params: {'subscriptionId' => @client.subscription_id,'locationName' => location_name,'operationId' => operation_id},
|
88
|
+
query_params: {'api-version' => @client.api_version},
|
89
|
+
headers: request_headers.merge(custom_headers || {}),
|
90
|
+
base_url: request_url
|
91
|
+
}
|
92
|
+
promise = @client.make_request_async(:get, path_template, options)
|
93
|
+
|
94
|
+
promise = promise.then do |result|
|
95
|
+
http_response = result.response
|
96
|
+
status_code = http_response.status
|
97
|
+
response_content = http_response.body
|
98
|
+
unless status_code == 200
|
99
|
+
error_model = JSON.load(response_content)
|
100
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
101
|
+
end
|
102
|
+
|
103
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
104
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
105
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
106
|
+
# Deserialize Response
|
107
|
+
if status_code == 200
|
108
|
+
begin
|
109
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
110
|
+
result_mapper = Azure::Mysql::Mgmt::V2018_06_01::Models::RecommendedActionSessionsOperationStatus.mapper()
|
111
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
112
|
+
rescue Exception => e
|
113
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
promise.execute
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|