azure_mgmt_sql 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_sql.rb +95 -46
- data/lib/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +310 -0
- data/lib/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +300 -0
- data/lib/generated/azure_mgmt_sql/data_masking_policies.rb +248 -0
- data/lib/generated/azure_mgmt_sql/data_masking_rules.rb +262 -0
- data/lib/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +264 -0
- data/lib/generated/azure_mgmt_sql/database_threat_detection_policies.rb +264 -0
- data/lib/generated/azure_mgmt_sql/database_usages.rb +129 -0
- data/lib/generated/azure_mgmt_sql/databases.rb +357 -2825
- data/lib/generated/azure_mgmt_sql/elastic_pool_activities.rb +132 -0
- data/lib/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +129 -0
- data/lib/generated/azure_mgmt_sql/elastic_pools.rb +0 -417
- data/lib/generated/azure_mgmt_sql/encryption_protectors.rb +498 -0
- data/lib/generated/azure_mgmt_sql/failover_groups.rb +6 -6
- data/lib/generated/azure_mgmt_sql/geo_backup_policies.rb +359 -0
- data/lib/generated/azure_mgmt_sql/models/database_usage.rb +4 -9
- data/lib/generated/azure_mgmt_sql/models/encryption_protector.rb +3 -4
- data/lib/generated/azure_mgmt_sql/models/failover_group.rb +2 -2
- data/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb +6 -4
- data/lib/generated/azure_mgmt_sql/models/failover_group_update.rb +93 -0
- data/lib/generated/azure_mgmt_sql/models/firewall_rule.rb +11 -14
- data/lib/generated/azure_mgmt_sql/models/metric_value.rb +1 -17
- data/lib/generated/azure_mgmt_sql/models/operation.rb +36 -3
- data/lib/generated/azure_mgmt_sql/models/operation_display.rb +20 -5
- data/lib/generated/azure_mgmt_sql/models/operation_list_result.rb +36 -6
- data/lib/generated/azure_mgmt_sql/models/operation_origin.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/partner_info.rb +1 -1
- data/lib/generated/azure_mgmt_sql/models/replication_link.rb +9 -12
- data/lib/generated/azure_mgmt_sql/models/server_azure_adadministrator.rb +11 -3
- data/lib/generated/azure_mgmt_sql/models/server_key.rb +3 -4
- data/lib/generated/azure_mgmt_sql/models/service_objective.rb +11 -3
- data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +11 -3
- data/lib/generated/azure_mgmt_sql/models/sync_agent.rb +137 -0
- data/lib/generated/azure_mgmt_sql/models/{sql_sub_resource.rb → sync_agent_key_properties.rb} +9 -20
- data/lib/generated/azure_mgmt_sql/models/sync_agent_linked_database.rb +126 -0
- data/lib/generated/azure_mgmt_sql/models/sync_agent_linked_database_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/sync_agent_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/sync_agent_state.rb +17 -0
- data/lib/generated/azure_mgmt_sql/models/sync_conflict_resolution_policy.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/sync_database_id_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/{sub_resource.rb → sync_database_id_properties.rb} +7 -15
- data/lib/generated/azure_mgmt_sql/models/sync_direction.rb +17 -0
- data/lib/generated/azure_mgmt_sql/models/sync_full_schema_properties.rb +66 -0
- data/lib/generated/azure_mgmt_sql/models/sync_full_schema_properties_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/sync_full_schema_table.rb +99 -0
- data/lib/generated/azure_mgmt_sql/models/sync_full_schema_table_column.rb +112 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group.rb +145 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_log_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_log_properties.rb +102 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_log_type.rb +18 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_schema.rb +64 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_schema_table.rb +64 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_schema_table_column.rb +65 -0
- data/lib/generated/azure_mgmt_sql/models/sync_group_state.rb +19 -0
- data/lib/generated/azure_mgmt_sql/models/sync_member.rb +160 -0
- data/lib/generated/azure_mgmt_sql/models/sync_member_db_type.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/sync_member_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/sync_member_state.rb +32 -0
- data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +22 -3
- data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +22 -3
- data/lib/generated/azure_mgmt_sql/models/virtual_network_rule.rb +2 -2
- data/lib/generated/azure_mgmt_sql/operations.rb +111 -4
- data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +3 -215
- data/lib/generated/azure_mgmt_sql/replication_links.rb +629 -0
- data/lib/generated/azure_mgmt_sql/restore_points.rb +132 -0
- data/lib/generated/azure_mgmt_sql/server_azure_adadministrators.rb +5 -5
- data/lib/generated/azure_mgmt_sql/server_connection_policies.rb +250 -0
- data/lib/generated/azure_mgmt_sql/server_keys.rb +10 -10
- data/lib/generated/azure_mgmt_sql/server_usages.rb +125 -0
- data/lib/generated/azure_mgmt_sql/servers.rb +161 -1423
- data/lib/generated/azure_mgmt_sql/service_objectives.rb +229 -0
- data/lib/generated/azure_mgmt_sql/service_tier_advisors.rb +234 -0
- data/lib/generated/azure_mgmt_sql/sql_management_client.rb +100 -9
- data/lib/generated/azure_mgmt_sql/sync_agents.rb +983 -0
- data/lib/generated/azure_mgmt_sql/sync_groups.rb +1863 -0
- data/lib/generated/azure_mgmt_sql/sync_members.rb +1290 -0
- data/lib/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +133 -0
- data/lib/generated/azure_mgmt_sql/transparent_data_encryptions.rb +264 -0
- data/lib/generated/azure_mgmt_sql/version.rb +1 -1
- metadata +55 -6
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
module Azure::ARM::SQL
|
|
7
|
+
#
|
|
8
|
+
# The Azure SQL Database management API provides a RESTful set of web
|
|
9
|
+
# services that interact with Azure SQL Database services to manage your
|
|
10
|
+
# databases. The API enables you to create, retrieve, update, and delete
|
|
11
|
+
# databases.
|
|
12
|
+
#
|
|
13
|
+
class ServiceObjectives
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Creates and initializes a new instance of the ServiceObjectives class.
|
|
18
|
+
# @param client service class for accessing basic functionality.
|
|
19
|
+
#
|
|
20
|
+
def initialize(client)
|
|
21
|
+
@client = client
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @return [SqlManagementClient] reference to the SqlManagementClient
|
|
25
|
+
attr_reader :client
|
|
26
|
+
|
|
27
|
+
#
|
|
28
|
+
# Gets a database service objective.
|
|
29
|
+
#
|
|
30
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
31
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
32
|
+
# Manager API or the portal.
|
|
33
|
+
# @param server_name [String] The name of the server.
|
|
34
|
+
# @param service_objective_name [String] The name of the service objective to
|
|
35
|
+
# retrieve.
|
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
37
|
+
# will be added to the HTTP request.
|
|
38
|
+
#
|
|
39
|
+
# @return [ServiceObjective] operation results.
|
|
40
|
+
#
|
|
41
|
+
def get(resource_group_name, server_name, service_objective_name, custom_headers = nil)
|
|
42
|
+
response = get_async(resource_group_name, server_name, service_objective_name, custom_headers).value!
|
|
43
|
+
response.body unless response.nil?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
#
|
|
47
|
+
# Gets a database service objective.
|
|
48
|
+
#
|
|
49
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
50
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
51
|
+
# Manager API or the portal.
|
|
52
|
+
# @param server_name [String] The name of the server.
|
|
53
|
+
# @param service_objective_name [String] The name of the service objective to
|
|
54
|
+
# retrieve.
|
|
55
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
56
|
+
# will be added to the HTTP request.
|
|
57
|
+
#
|
|
58
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
59
|
+
#
|
|
60
|
+
def get_with_http_info(resource_group_name, server_name, service_objective_name, custom_headers = nil)
|
|
61
|
+
get_async(resource_group_name, server_name, service_objective_name, custom_headers).value!
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
#
|
|
65
|
+
# Gets a database service objective.
|
|
66
|
+
#
|
|
67
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
68
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
69
|
+
# Manager API or the portal.
|
|
70
|
+
# @param server_name [String] The name of the server.
|
|
71
|
+
# @param service_objective_name [String] The name of the service objective to
|
|
72
|
+
# retrieve.
|
|
73
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
74
|
+
# to the HTTP request.
|
|
75
|
+
#
|
|
76
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
77
|
+
#
|
|
78
|
+
def get_async(resource_group_name, server_name, service_objective_name, custom_headers = nil)
|
|
79
|
+
api_version = '2014-04-01'
|
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
81
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
82
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
83
|
+
fail ArgumentError, 'service_objective_name is nil' if service_objective_name.nil?
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
request_headers = {}
|
|
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.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}'
|
|
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,'serviceObjectiveName' => service_objective_name},
|
|
98
|
+
query_params: {'api-version' => 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
|
+
# Deserialize Response
|
|
115
|
+
if status_code == 200
|
|
116
|
+
begin
|
|
117
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
118
|
+
result_mapper = Azure::ARM::SQL::Models::ServiceObjective.mapper()
|
|
119
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
120
|
+
rescue Exception => e
|
|
121
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
result
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
promise.execute
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
#
|
|
132
|
+
# Returns database service objectives.
|
|
133
|
+
#
|
|
134
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
135
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
136
|
+
# Manager API or the portal.
|
|
137
|
+
# @param server_name [String] The name of the server.
|
|
138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
139
|
+
# will be added to the HTTP request.
|
|
140
|
+
#
|
|
141
|
+
# @return [ServiceObjectiveListResult] operation results.
|
|
142
|
+
#
|
|
143
|
+
def list_by_server(resource_group_name, server_name, custom_headers = nil)
|
|
144
|
+
response = list_by_server_async(resource_group_name, server_name, custom_headers).value!
|
|
145
|
+
response.body unless response.nil?
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
#
|
|
149
|
+
# Returns database service objectives.
|
|
150
|
+
#
|
|
151
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
152
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
153
|
+
# Manager API or the portal.
|
|
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).value!
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
#
|
|
165
|
+
# Returns database service objectives.
|
|
166
|
+
#
|
|
167
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
168
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
169
|
+
# Manager API or the portal.
|
|
170
|
+
# @param server_name [String] The name of the server.
|
|
171
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
172
|
+
# to the HTTP request.
|
|
173
|
+
#
|
|
174
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
175
|
+
#
|
|
176
|
+
def list_by_server_async(resource_group_name, server_name, custom_headers = nil)
|
|
177
|
+
api_version = '2014-04-01'
|
|
178
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
179
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
180
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
request_headers = {}
|
|
184
|
+
|
|
185
|
+
# Set Headers
|
|
186
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
187
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
188
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives'
|
|
189
|
+
|
|
190
|
+
request_url = @base_url || @client.base_url
|
|
191
|
+
|
|
192
|
+
options = {
|
|
193
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
194
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
|
|
195
|
+
query_params: {'api-version' => api_version},
|
|
196
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
197
|
+
base_url: request_url
|
|
198
|
+
}
|
|
199
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
200
|
+
|
|
201
|
+
promise = promise.then do |result|
|
|
202
|
+
http_response = result.response
|
|
203
|
+
status_code = http_response.status
|
|
204
|
+
response_content = http_response.body
|
|
205
|
+
unless status_code == 200
|
|
206
|
+
error_model = JSON.load(response_content)
|
|
207
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
211
|
+
# Deserialize Response
|
|
212
|
+
if status_code == 200
|
|
213
|
+
begin
|
|
214
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
215
|
+
result_mapper = Azure::ARM::SQL::Models::ServiceObjectiveListResult.mapper()
|
|
216
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
217
|
+
rescue Exception => e
|
|
218
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
result
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
promise.execute
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
|
229
|
+
end
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
module Azure::ARM::SQL
|
|
7
|
+
#
|
|
8
|
+
# The Azure SQL Database management API provides a RESTful set of web
|
|
9
|
+
# services that interact with Azure SQL Database services to manage your
|
|
10
|
+
# databases. The API enables you to create, retrieve, update, and delete
|
|
11
|
+
# databases.
|
|
12
|
+
#
|
|
13
|
+
class ServiceTierAdvisors
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Creates and initializes a new instance of the ServiceTierAdvisors class.
|
|
18
|
+
# @param client service class for accessing basic functionality.
|
|
19
|
+
#
|
|
20
|
+
def initialize(client)
|
|
21
|
+
@client = client
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @return [SqlManagementClient] reference to the SqlManagementClient
|
|
25
|
+
attr_reader :client
|
|
26
|
+
|
|
27
|
+
#
|
|
28
|
+
# Gets a service tier advisor.
|
|
29
|
+
#
|
|
30
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
31
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
32
|
+
# Manager API or the portal.
|
|
33
|
+
# @param server_name [String] The name of the server.
|
|
34
|
+
# @param database_name [String] The name of database.
|
|
35
|
+
# @param service_tier_advisor_name [String] The name of service tier advisor.
|
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
37
|
+
# will be added to the HTTP request.
|
|
38
|
+
#
|
|
39
|
+
# @return [ServiceTierAdvisor] operation results.
|
|
40
|
+
#
|
|
41
|
+
def get(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers = nil)
|
|
42
|
+
response = get_async(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers).value!
|
|
43
|
+
response.body unless response.nil?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
#
|
|
47
|
+
# Gets a service tier advisor.
|
|
48
|
+
#
|
|
49
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
50
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
51
|
+
# Manager API or the portal.
|
|
52
|
+
# @param server_name [String] The name of the server.
|
|
53
|
+
# @param database_name [String] The name of database.
|
|
54
|
+
# @param service_tier_advisor_name [String] The name of service tier advisor.
|
|
55
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
56
|
+
# will be added to the HTTP request.
|
|
57
|
+
#
|
|
58
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
59
|
+
#
|
|
60
|
+
def get_with_http_info(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers = nil)
|
|
61
|
+
get_async(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers).value!
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
#
|
|
65
|
+
# Gets a service tier advisor.
|
|
66
|
+
#
|
|
67
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
68
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
69
|
+
# Manager API or the portal.
|
|
70
|
+
# @param server_name [String] The name of the server.
|
|
71
|
+
# @param database_name [String] The name of database.
|
|
72
|
+
# @param service_tier_advisor_name [String] The name of service tier advisor.
|
|
73
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
74
|
+
# to the HTTP request.
|
|
75
|
+
#
|
|
76
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
77
|
+
#
|
|
78
|
+
def get_async(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers = nil)
|
|
79
|
+
api_version = '2014-04-01'
|
|
80
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
81
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
82
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
83
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
84
|
+
fail ArgumentError, 'service_tier_advisor_name is nil' if service_tier_advisor_name.nil?
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
request_headers = {}
|
|
88
|
+
|
|
89
|
+
# Set Headers
|
|
90
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
91
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
92
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}'
|
|
93
|
+
|
|
94
|
+
request_url = @base_url || @client.base_url
|
|
95
|
+
|
|
96
|
+
options = {
|
|
97
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
98
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'serviceTierAdvisorName' => service_tier_advisor_name},
|
|
99
|
+
query_params: {'api-version' => api_version},
|
|
100
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
101
|
+
base_url: request_url
|
|
102
|
+
}
|
|
103
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
104
|
+
|
|
105
|
+
promise = promise.then do |result|
|
|
106
|
+
http_response = result.response
|
|
107
|
+
status_code = http_response.status
|
|
108
|
+
response_content = http_response.body
|
|
109
|
+
unless status_code == 200
|
|
110
|
+
error_model = JSON.load(response_content)
|
|
111
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
115
|
+
# Deserialize Response
|
|
116
|
+
if status_code == 200
|
|
117
|
+
begin
|
|
118
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
119
|
+
result_mapper = Azure::ARM::SQL::Models::ServiceTierAdvisor.mapper()
|
|
120
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
121
|
+
rescue Exception => e
|
|
122
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
result
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
promise.execute
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
#
|
|
133
|
+
# Returns service tier advisors for specified database.
|
|
134
|
+
#
|
|
135
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
136
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
137
|
+
# Manager API or the portal.
|
|
138
|
+
# @param server_name [String] The name of the server.
|
|
139
|
+
# @param database_name [String] The name of database.
|
|
140
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
141
|
+
# will be added to the HTTP request.
|
|
142
|
+
#
|
|
143
|
+
# @return [ServiceTierAdvisorListResult] operation results.
|
|
144
|
+
#
|
|
145
|
+
def list_by_database(resource_group_name, server_name, database_name, custom_headers = nil)
|
|
146
|
+
response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
|
|
147
|
+
response.body unless response.nil?
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
#
|
|
151
|
+
# Returns service tier advisors for specified database.
|
|
152
|
+
#
|
|
153
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
154
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
155
|
+
# Manager API or the portal.
|
|
156
|
+
# @param server_name [String] The name of the server.
|
|
157
|
+
# @param database_name [String] The name of database.
|
|
158
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
159
|
+
# will be added to the HTTP request.
|
|
160
|
+
#
|
|
161
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
162
|
+
#
|
|
163
|
+
def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
|
|
164
|
+
list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
#
|
|
168
|
+
# Returns service tier advisors for specified database.
|
|
169
|
+
#
|
|
170
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
171
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
172
|
+
# Manager API or the portal.
|
|
173
|
+
# @param server_name [String] The name of the server.
|
|
174
|
+
# @param database_name [String] The name of database.
|
|
175
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
176
|
+
# to the HTTP request.
|
|
177
|
+
#
|
|
178
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
179
|
+
#
|
|
180
|
+
def list_by_database_async(resource_group_name, server_name, database_name, custom_headers = nil)
|
|
181
|
+
api_version = '2014-04-01'
|
|
182
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
183
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
184
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
185
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
request_headers = {}
|
|
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.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors'
|
|
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,'databaseName' => database_name},
|
|
200
|
+
query_params: {'api-version' => 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
|
+
# Deserialize Response
|
|
217
|
+
if status_code == 200
|
|
218
|
+
begin
|
|
219
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
220
|
+
result_mapper = Azure::ARM::SQL::Models::ServiceTierAdvisorListResult.mapper()
|
|
221
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
222
|
+
rescue Exception => e
|
|
223
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
result
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
promise.execute
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
end
|
|
234
|
+
end
|