azure_mgmt_sql 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -235,7 +235,7 @@ module Azure::ARM::SQL
|
|
235
235
|
# @param server_name [String] The name of the server containing the failover
|
236
236
|
# group.
|
237
237
|
# @param failover_group_name [String] The name of the failover group.
|
238
|
-
# @param parameters [
|
238
|
+
# @param parameters [FailoverGroupUpdate] The failover group parameters.
|
239
239
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
240
240
|
# will be added to the HTTP request.
|
241
241
|
#
|
@@ -253,7 +253,7 @@ module Azure::ARM::SQL
|
|
253
253
|
# @param server_name [String] The name of the server containing the failover
|
254
254
|
# group.
|
255
255
|
# @param failover_group_name [String] The name of the failover group.
|
256
|
-
# @param parameters [
|
256
|
+
# @param parameters [FailoverGroupUpdate] The failover group parameters.
|
257
257
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
258
258
|
# will be added to the HTTP request.
|
259
259
|
#
|
@@ -708,7 +708,7 @@ module Azure::ARM::SQL
|
|
708
708
|
# @param server_name [String] The name of the server containing the failover
|
709
709
|
# group.
|
710
710
|
# @param failover_group_name [String] The name of the failover group.
|
711
|
-
# @param parameters [
|
711
|
+
# @param parameters [FailoverGroupUpdate] The failover group parameters.
|
712
712
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
713
713
|
# will be added to the HTTP request.
|
714
714
|
#
|
@@ -728,7 +728,7 @@ module Azure::ARM::SQL
|
|
728
728
|
# @param server_name [String] The name of the server containing the failover
|
729
729
|
# group.
|
730
730
|
# @param failover_group_name [String] The name of the failover group.
|
731
|
-
# @param parameters [
|
731
|
+
# @param parameters [FailoverGroupUpdate] The failover group parameters.
|
732
732
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
733
733
|
# will be added to the HTTP request.
|
734
734
|
#
|
@@ -747,7 +747,7 @@ module Azure::ARM::SQL
|
|
747
747
|
# @param server_name [String] The name of the server containing the failover
|
748
748
|
# group.
|
749
749
|
# @param failover_group_name [String] The name of the failover group.
|
750
|
-
# @param parameters [
|
750
|
+
# @param parameters [FailoverGroupUpdate] The failover group parameters.
|
751
751
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
752
752
|
# to the HTTP request.
|
753
753
|
#
|
@@ -771,7 +771,7 @@ module Azure::ARM::SQL
|
|
771
771
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
772
772
|
|
773
773
|
# Serialize Request
|
774
|
-
request_mapper = Azure::ARM::SQL::Models::
|
774
|
+
request_mapper = Azure::ARM::SQL::Models::FailoverGroupUpdate.mapper()
|
775
775
|
request_content = @client.serialize(request_mapper, parameters)
|
776
776
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
777
777
|
|
@@ -0,0 +1,359 @@
|
|
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 GeoBackupPolicies
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the GeoBackupPolicies 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
|
+
# Updates a database geo backup policy.
|
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 the database.
|
35
|
+
# @param parameters [GeoBackupPolicy] The required parameters for creating or
|
36
|
+
# updating the geo backup policy.
|
37
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
38
|
+
# will be added to the HTTP request.
|
39
|
+
#
|
40
|
+
# @return [GeoBackupPolicy] operation results.
|
41
|
+
#
|
42
|
+
def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
|
43
|
+
response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
|
44
|
+
response.body unless response.nil?
|
45
|
+
end
|
46
|
+
|
47
|
+
#
|
48
|
+
# Updates a database geo backup policy.
|
49
|
+
#
|
50
|
+
# @param resource_group_name [String] The name of the resource group that
|
51
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
52
|
+
# Manager API or the portal.
|
53
|
+
# @param server_name [String] The name of the server.
|
54
|
+
# @param database_name [String] The name of the database.
|
55
|
+
# @param parameters [GeoBackupPolicy] The required parameters for creating or
|
56
|
+
# updating the geo backup policy.
|
57
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
58
|
+
# will be added to the HTTP request.
|
59
|
+
#
|
60
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
61
|
+
#
|
62
|
+
def create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
|
63
|
+
create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
|
64
|
+
end
|
65
|
+
|
66
|
+
#
|
67
|
+
# Updates a database geo backup policy.
|
68
|
+
#
|
69
|
+
# @param resource_group_name [String] The name of the resource group that
|
70
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
71
|
+
# Manager API or the portal.
|
72
|
+
# @param server_name [String] The name of the server.
|
73
|
+
# @param database_name [String] The name of the database.
|
74
|
+
# @param parameters [GeoBackupPolicy] The required parameters for creating or
|
75
|
+
# updating the geo backup policy.
|
76
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
77
|
+
# to the HTTP request.
|
78
|
+
#
|
79
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
80
|
+
#
|
81
|
+
def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
|
82
|
+
api_version = '2014-04-01'
|
83
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
84
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
85
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
86
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
87
|
+
geo_backup_policy_name = 'Default'
|
88
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
89
|
+
|
90
|
+
|
91
|
+
request_headers = {}
|
92
|
+
|
93
|
+
# Set Headers
|
94
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
95
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
96
|
+
|
97
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
98
|
+
|
99
|
+
# Serialize Request
|
100
|
+
request_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
|
101
|
+
request_content = @client.serialize(request_mapper, parameters)
|
102
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
103
|
+
|
104
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}'
|
105
|
+
|
106
|
+
request_url = @base_url || @client.base_url
|
107
|
+
|
108
|
+
options = {
|
109
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
110
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'geoBackupPolicyName' => geo_backup_policy_name},
|
111
|
+
query_params: {'api-version' => api_version},
|
112
|
+
body: request_content,
|
113
|
+
headers: request_headers.merge(custom_headers || {}),
|
114
|
+
base_url: request_url
|
115
|
+
}
|
116
|
+
promise = @client.make_request_async(:put, path_template, options)
|
117
|
+
|
118
|
+
promise = promise.then do |result|
|
119
|
+
http_response = result.response
|
120
|
+
status_code = http_response.status
|
121
|
+
response_content = http_response.body
|
122
|
+
unless status_code == 201 || status_code == 200
|
123
|
+
error_model = JSON.load(response_content)
|
124
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
125
|
+
end
|
126
|
+
|
127
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
128
|
+
# Deserialize Response
|
129
|
+
if status_code == 201
|
130
|
+
begin
|
131
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
132
|
+
result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
|
133
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
134
|
+
rescue Exception => e
|
135
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
# Deserialize Response
|
139
|
+
if status_code == 200
|
140
|
+
begin
|
141
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
142
|
+
result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
|
143
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
144
|
+
rescue Exception => e
|
145
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
result
|
150
|
+
end
|
151
|
+
|
152
|
+
promise.execute
|
153
|
+
end
|
154
|
+
|
155
|
+
#
|
156
|
+
# Gets a geo backup policy.
|
157
|
+
#
|
158
|
+
# @param resource_group_name [String] The name of the resource group that
|
159
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
160
|
+
# Manager API or the portal.
|
161
|
+
# @param server_name [String] The name of the server.
|
162
|
+
# @param database_name [String] The name of the database.
|
163
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
164
|
+
# will be added to the HTTP request.
|
165
|
+
#
|
166
|
+
# @return [GeoBackupPolicy] operation results.
|
167
|
+
#
|
168
|
+
def get(resource_group_name, server_name, database_name, custom_headers = nil)
|
169
|
+
response = get_async(resource_group_name, server_name, database_name, custom_headers).value!
|
170
|
+
response.body unless response.nil?
|
171
|
+
end
|
172
|
+
|
173
|
+
#
|
174
|
+
# Gets a geo backup policy.
|
175
|
+
#
|
176
|
+
# @param resource_group_name [String] The name of the resource group that
|
177
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
178
|
+
# Manager API or the portal.
|
179
|
+
# @param server_name [String] The name of the server.
|
180
|
+
# @param database_name [String] The name of the database.
|
181
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
182
|
+
# will be added to the HTTP request.
|
183
|
+
#
|
184
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
185
|
+
#
|
186
|
+
def get_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
|
187
|
+
get_async(resource_group_name, server_name, database_name, custom_headers).value!
|
188
|
+
end
|
189
|
+
|
190
|
+
#
|
191
|
+
# Gets a geo backup policy.
|
192
|
+
#
|
193
|
+
# @param resource_group_name [String] The name of the resource group that
|
194
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
195
|
+
# Manager API or the portal.
|
196
|
+
# @param server_name [String] The name of the server.
|
197
|
+
# @param database_name [String] The name of the database.
|
198
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
199
|
+
# to the HTTP request.
|
200
|
+
#
|
201
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
202
|
+
#
|
203
|
+
def get_async(resource_group_name, server_name, database_name, custom_headers = nil)
|
204
|
+
api_version = '2014-04-01'
|
205
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
206
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
207
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
208
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
209
|
+
geo_backup_policy_name = 'Default'
|
210
|
+
|
211
|
+
|
212
|
+
request_headers = {}
|
213
|
+
|
214
|
+
# Set Headers
|
215
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
216
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
217
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}'
|
218
|
+
|
219
|
+
request_url = @base_url || @client.base_url
|
220
|
+
|
221
|
+
options = {
|
222
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
223
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'geoBackupPolicyName' => geo_backup_policy_name},
|
224
|
+
query_params: {'api-version' => api_version},
|
225
|
+
headers: request_headers.merge(custom_headers || {}),
|
226
|
+
base_url: request_url
|
227
|
+
}
|
228
|
+
promise = @client.make_request_async(:get, path_template, options)
|
229
|
+
|
230
|
+
promise = promise.then do |result|
|
231
|
+
http_response = result.response
|
232
|
+
status_code = http_response.status
|
233
|
+
response_content = http_response.body
|
234
|
+
unless status_code == 200
|
235
|
+
error_model = JSON.load(response_content)
|
236
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
237
|
+
end
|
238
|
+
|
239
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
240
|
+
# Deserialize Response
|
241
|
+
if status_code == 200
|
242
|
+
begin
|
243
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
244
|
+
result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
|
245
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
246
|
+
rescue Exception => e
|
247
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
result
|
252
|
+
end
|
253
|
+
|
254
|
+
promise.execute
|
255
|
+
end
|
256
|
+
|
257
|
+
#
|
258
|
+
# Returns a list of geo backup policies.
|
259
|
+
#
|
260
|
+
# @param resource_group_name [String] The name of the resource group that
|
261
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
262
|
+
# Manager API or the portal.
|
263
|
+
# @param server_name [String] The name of the server.
|
264
|
+
# @param database_name [String] The name of the database.
|
265
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
266
|
+
# will be added to the HTTP request.
|
267
|
+
#
|
268
|
+
# @return [GeoBackupPolicyListResult] operation results.
|
269
|
+
#
|
270
|
+
def list_by_database(resource_group_name, server_name, database_name, custom_headers = nil)
|
271
|
+
response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
|
272
|
+
response.body unless response.nil?
|
273
|
+
end
|
274
|
+
|
275
|
+
#
|
276
|
+
# Returns a list of geo backup policies.
|
277
|
+
#
|
278
|
+
# @param resource_group_name [String] The name of the resource group that
|
279
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
280
|
+
# Manager API or the portal.
|
281
|
+
# @param server_name [String] The name of the server.
|
282
|
+
# @param database_name [String] The name of the database.
|
283
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
284
|
+
# will be added to the HTTP request.
|
285
|
+
#
|
286
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
287
|
+
#
|
288
|
+
def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
|
289
|
+
list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
|
290
|
+
end
|
291
|
+
|
292
|
+
#
|
293
|
+
# Returns a list of geo backup policies.
|
294
|
+
#
|
295
|
+
# @param resource_group_name [String] The name of the resource group that
|
296
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
297
|
+
# Manager API or the portal.
|
298
|
+
# @param server_name [String] The name of the server.
|
299
|
+
# @param database_name [String] The name of the database.
|
300
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
301
|
+
# to the HTTP request.
|
302
|
+
#
|
303
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
304
|
+
#
|
305
|
+
def list_by_database_async(resource_group_name, server_name, database_name, custom_headers = nil)
|
306
|
+
api_version = '2014-04-01'
|
307
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
308
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
309
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
310
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
311
|
+
|
312
|
+
|
313
|
+
request_headers = {}
|
314
|
+
|
315
|
+
# Set Headers
|
316
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
317
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
318
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies'
|
319
|
+
|
320
|
+
request_url = @base_url || @client.base_url
|
321
|
+
|
322
|
+
options = {
|
323
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
324
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
|
325
|
+
query_params: {'api-version' => api_version},
|
326
|
+
headers: request_headers.merge(custom_headers || {}),
|
327
|
+
base_url: request_url
|
328
|
+
}
|
329
|
+
promise = @client.make_request_async(:get, path_template, options)
|
330
|
+
|
331
|
+
promise = promise.then do |result|
|
332
|
+
http_response = result.response
|
333
|
+
status_code = http_response.status
|
334
|
+
response_content = http_response.body
|
335
|
+
unless status_code == 200
|
336
|
+
error_model = JSON.load(response_content)
|
337
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
338
|
+
end
|
339
|
+
|
340
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
341
|
+
# Deserialize Response
|
342
|
+
if status_code == 200
|
343
|
+
begin
|
344
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
345
|
+
result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicyListResult.mapper()
|
346
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
347
|
+
rescue Exception => e
|
348
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
result
|
353
|
+
end
|
354
|
+
|
355
|
+
promise.execute
|
356
|
+
end
|
357
|
+
|
358
|
+
end
|
359
|
+
end
|
@@ -8,11 +8,14 @@ module Azure::ARM::SQL
|
|
8
8
|
#
|
9
9
|
# The database usages.
|
10
10
|
#
|
11
|
-
class DatabaseUsage
|
11
|
+
class DatabaseUsage
|
12
12
|
|
13
13
|
include MsRestAzure
|
14
14
|
|
15
15
|
include MsRest::JSONable
|
16
|
+
# @return [String] The name of the usage metric.
|
17
|
+
attr_accessor :name
|
18
|
+
|
16
19
|
# @return [String] The name of the resource.
|
17
20
|
attr_accessor :resource_name
|
18
21
|
|
@@ -53,14 +56,6 @@ module Azure::ARM::SQL
|
|
53
56
|
name: 'String'
|
54
57
|
}
|
55
58
|
},
|
56
|
-
id: {
|
57
|
-
required: false,
|
58
|
-
read_only: true,
|
59
|
-
serialized_name: 'id',
|
60
|
-
type: {
|
61
|
-
name: 'String'
|
62
|
-
}
|
63
|
-
},
|
64
59
|
resource_name: {
|
65
60
|
required: false,
|
66
61
|
read_only: true,
|
@@ -13,9 +13,8 @@ module Azure::ARM::SQL
|
|
13
13
|
include MsRestAzure
|
14
14
|
|
15
15
|
include MsRest::JSONable
|
16
|
-
# @return [
|
17
|
-
# the Azure portal experience.
|
18
|
-
# 'azurekeyvault', 'servicemanaged'
|
16
|
+
# @return [String] Kind of encryption protector. This is metadata used
|
17
|
+
# for the Azure portal experience.
|
19
18
|
attr_accessor :kind
|
20
19
|
|
21
20
|
# @return [String] Resource location.
|
@@ -106,7 +105,7 @@ module Azure::ARM::SQL
|
|
106
105
|
}
|
107
106
|
},
|
108
107
|
server_key_type: {
|
109
|
-
required:
|
108
|
+
required: true,
|
110
109
|
serialized_name: 'properties.serverKeyType',
|
111
110
|
type: {
|
112
111
|
name: 'String'
|