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,300 @@
|
|
|
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 BackupLongTermRetentionVaults
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Creates and initializes a new instance of the BackupLongTermRetentionVaults 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 server backup long term retention vault
|
|
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 custom_headers [Hash{String => String}] A hash of custom headers that
|
|
35
|
+
# will be added to the HTTP request.
|
|
36
|
+
#
|
|
37
|
+
# @return [BackupLongTermRetentionVault] operation results.
|
|
38
|
+
#
|
|
39
|
+
def get(resource_group_name, server_name, custom_headers = nil)
|
|
40
|
+
response = get_async(resource_group_name, server_name, custom_headers).value!
|
|
41
|
+
response.body unless response.nil?
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#
|
|
45
|
+
# Gets a server backup long term retention vault
|
|
46
|
+
#
|
|
47
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
48
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
49
|
+
# Manager API or the portal.
|
|
50
|
+
# @param server_name [String] The name of the server.
|
|
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, custom_headers = nil)
|
|
57
|
+
get_async(resource_group_name, server_name, custom_headers).value!
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
#
|
|
61
|
+
# Gets a server backup long term retention vault
|
|
62
|
+
#
|
|
63
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
64
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
65
|
+
# Manager API or the portal.
|
|
66
|
+
# @param server_name [String] The name of the server.
|
|
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, custom_headers = nil)
|
|
73
|
+
api_version = '2014-04-01'
|
|
74
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
75
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
76
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
77
|
+
backup_long_term_retention_vault_name = 'RegisteredVault'
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
request_headers = {}
|
|
81
|
+
|
|
82
|
+
# Set Headers
|
|
83
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
84
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
85
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}'
|
|
86
|
+
|
|
87
|
+
request_url = @base_url || @client.base_url
|
|
88
|
+
|
|
89
|
+
options = {
|
|
90
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
91
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'backupLongTermRetentionVaultName' => backup_long_term_retention_vault_name},
|
|
92
|
+
query_params: {'api-version' => api_version},
|
|
93
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
94
|
+
base_url: request_url
|
|
95
|
+
}
|
|
96
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
97
|
+
|
|
98
|
+
promise = promise.then do |result|
|
|
99
|
+
http_response = result.response
|
|
100
|
+
status_code = http_response.status
|
|
101
|
+
response_content = http_response.body
|
|
102
|
+
unless status_code == 200
|
|
103
|
+
error_model = JSON.load(response_content)
|
|
104
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
108
|
+
# Deserialize Response
|
|
109
|
+
if status_code == 200
|
|
110
|
+
begin
|
|
111
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
112
|
+
result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
|
|
113
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
114
|
+
rescue Exception => e
|
|
115
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
result
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
promise.execute
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
#
|
|
126
|
+
# Updates a server backup long term retention vault
|
|
127
|
+
#
|
|
128
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
129
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
130
|
+
# Manager API or the portal.
|
|
131
|
+
# @param server_name [String] The name of the server.
|
|
132
|
+
# @param parameters [BackupLongTermRetentionVault] The required parameters to
|
|
133
|
+
# update a backup long term retention vault
|
|
134
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
135
|
+
# will be added to the HTTP request.
|
|
136
|
+
#
|
|
137
|
+
# @return [BackupLongTermRetentionVault] operation results.
|
|
138
|
+
#
|
|
139
|
+
def create_or_update(resource_group_name, server_name, parameters, custom_headers = nil)
|
|
140
|
+
response = create_or_update_async(resource_group_name, server_name, parameters, custom_headers).value!
|
|
141
|
+
response.body unless response.nil?
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
#
|
|
145
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
146
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
147
|
+
# Manager API or the portal.
|
|
148
|
+
# @param server_name [String] The name of the server.
|
|
149
|
+
# @param parameters [BackupLongTermRetentionVault] The required parameters to
|
|
150
|
+
# update a backup long term retention vault
|
|
151
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
152
|
+
# will be added to the HTTP request.
|
|
153
|
+
#
|
|
154
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
155
|
+
# response.
|
|
156
|
+
#
|
|
157
|
+
def create_or_update_async(resource_group_name, server_name, parameters, custom_headers = nil)
|
|
158
|
+
# Send request
|
|
159
|
+
promise = begin_create_or_update_async(resource_group_name, server_name, parameters, custom_headers)
|
|
160
|
+
|
|
161
|
+
promise = promise.then do |response|
|
|
162
|
+
# Defining deserialization method.
|
|
163
|
+
deserialize_method = lambda do |parsed_response|
|
|
164
|
+
result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
|
|
165
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Waiting for response.
|
|
169
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
promise
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
#
|
|
176
|
+
# Updates a server backup long term retention vault
|
|
177
|
+
#
|
|
178
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
179
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
180
|
+
# Manager API or the portal.
|
|
181
|
+
# @param server_name [String] The name of the server.
|
|
182
|
+
# @param parameters [BackupLongTermRetentionVault] The required parameters to
|
|
183
|
+
# update a backup long term retention vault
|
|
184
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
185
|
+
# will be added to the HTTP request.
|
|
186
|
+
#
|
|
187
|
+
# @return [BackupLongTermRetentionVault] operation results.
|
|
188
|
+
#
|
|
189
|
+
def begin_create_or_update(resource_group_name, server_name, parameters, custom_headers = nil)
|
|
190
|
+
response = begin_create_or_update_async(resource_group_name, server_name, parameters, custom_headers).value!
|
|
191
|
+
response.body unless response.nil?
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
#
|
|
195
|
+
# Updates a server backup long term retention vault
|
|
196
|
+
#
|
|
197
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
198
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
199
|
+
# Manager API or the portal.
|
|
200
|
+
# @param server_name [String] The name of the server.
|
|
201
|
+
# @param parameters [BackupLongTermRetentionVault] The required parameters to
|
|
202
|
+
# update a backup long term retention vault
|
|
203
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
204
|
+
# will be added to the HTTP request.
|
|
205
|
+
#
|
|
206
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
207
|
+
#
|
|
208
|
+
def begin_create_or_update_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil)
|
|
209
|
+
begin_create_or_update_async(resource_group_name, server_name, parameters, custom_headers).value!
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
#
|
|
213
|
+
# Updates a server backup long term retention vault
|
|
214
|
+
#
|
|
215
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
216
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
217
|
+
# Manager API or the portal.
|
|
218
|
+
# @param server_name [String] The name of the server.
|
|
219
|
+
# @param parameters [BackupLongTermRetentionVault] The required parameters to
|
|
220
|
+
# update a backup long term retention vault
|
|
221
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
222
|
+
# to the HTTP request.
|
|
223
|
+
#
|
|
224
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
225
|
+
#
|
|
226
|
+
def begin_create_or_update_async(resource_group_name, server_name, parameters, custom_headers = nil)
|
|
227
|
+
api_version = '2014-04-01'
|
|
228
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
229
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
230
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
231
|
+
backup_long_term_retention_vault_name = 'RegisteredVault'
|
|
232
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
request_headers = {}
|
|
236
|
+
|
|
237
|
+
# Set Headers
|
|
238
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
239
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
240
|
+
|
|
241
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
242
|
+
|
|
243
|
+
# Serialize Request
|
|
244
|
+
request_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
|
|
245
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
246
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
247
|
+
|
|
248
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}'
|
|
249
|
+
|
|
250
|
+
request_url = @base_url || @client.base_url
|
|
251
|
+
|
|
252
|
+
options = {
|
|
253
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
254
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'backupLongTermRetentionVaultName' => backup_long_term_retention_vault_name},
|
|
255
|
+
query_params: {'api-version' => api_version},
|
|
256
|
+
body: request_content,
|
|
257
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
258
|
+
base_url: request_url
|
|
259
|
+
}
|
|
260
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
261
|
+
|
|
262
|
+
promise = promise.then do |result|
|
|
263
|
+
http_response = result.response
|
|
264
|
+
status_code = http_response.status
|
|
265
|
+
response_content = http_response.body
|
|
266
|
+
unless status_code == 200 || status_code == 201 || status_code == 202
|
|
267
|
+
error_model = JSON.load(response_content)
|
|
268
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
272
|
+
# Deserialize Response
|
|
273
|
+
if status_code == 200
|
|
274
|
+
begin
|
|
275
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
276
|
+
result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
|
|
277
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
278
|
+
rescue Exception => e
|
|
279
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
# Deserialize Response
|
|
283
|
+
if status_code == 201
|
|
284
|
+
begin
|
|
285
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
286
|
+
result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
|
|
287
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
288
|
+
rescue Exception => e
|
|
289
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
result
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
promise.execute
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
end
|
|
300
|
+
end
|
|
@@ -0,0 +1,248 @@
|
|
|
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 DataMaskingPolicies
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Creates and initializes a new instance of the DataMaskingPolicies 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
|
+
# Creates or updates a database data masking 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 [DataMaskingPolicy] Parameters for creating or updating a
|
|
36
|
+
# data masking 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 [DataMaskingPolicy] 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
|
+
# Creates or updates a database data masking 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 [DataMaskingPolicy] Parameters for creating or updating a
|
|
56
|
+
# data masking 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
|
+
# Creates or updates a database data masking 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 [DataMaskingPolicy] Parameters for creating or updating a
|
|
75
|
+
# data masking 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
|
+
data_masking_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::DataMaskingPolicy.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}/dataMaskingPolicies/{dataMaskingPolicyName}'
|
|
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,'dataMaskingPolicyName' => data_masking_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 == 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 == 200
|
|
130
|
+
begin
|
|
131
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
132
|
+
result_mapper = Azure::ARM::SQL::Models::DataMaskingPolicy.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
|
+
|
|
139
|
+
result
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
promise.execute
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
#
|
|
146
|
+
# Gets a database data masking policy.
|
|
147
|
+
#
|
|
148
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
149
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
150
|
+
# Manager API or the portal.
|
|
151
|
+
# @param server_name [String] The name of the server.
|
|
152
|
+
# @param database_name [String] The name of the database.
|
|
153
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
154
|
+
# will be added to the HTTP request.
|
|
155
|
+
#
|
|
156
|
+
# @return [DataMaskingPolicy] operation results.
|
|
157
|
+
#
|
|
158
|
+
def get(resource_group_name, server_name, database_name, custom_headers = nil)
|
|
159
|
+
response = get_async(resource_group_name, server_name, database_name, custom_headers).value!
|
|
160
|
+
response.body unless response.nil?
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
#
|
|
164
|
+
# Gets a database data masking policy.
|
|
165
|
+
#
|
|
166
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
167
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
168
|
+
# Manager API or the portal.
|
|
169
|
+
# @param server_name [String] The name of the server.
|
|
170
|
+
# @param database_name [String] The name of the database.
|
|
171
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
172
|
+
# will be added to the HTTP request.
|
|
173
|
+
#
|
|
174
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
175
|
+
#
|
|
176
|
+
def get_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
|
|
177
|
+
get_async(resource_group_name, server_name, database_name, custom_headers).value!
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
#
|
|
181
|
+
# Gets a database data masking policy.
|
|
182
|
+
#
|
|
183
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
184
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
185
|
+
# Manager API or the portal.
|
|
186
|
+
# @param server_name [String] The name of the server.
|
|
187
|
+
# @param database_name [String] The name of the database.
|
|
188
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
189
|
+
# to the HTTP request.
|
|
190
|
+
#
|
|
191
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
192
|
+
#
|
|
193
|
+
def get_async(resource_group_name, server_name, database_name, custom_headers = nil)
|
|
194
|
+
api_version = '2014-04-01'
|
|
195
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
196
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
197
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
|
198
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
199
|
+
data_masking_policy_name = 'Default'
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
request_headers = {}
|
|
203
|
+
|
|
204
|
+
# Set Headers
|
|
205
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
206
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
207
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}'
|
|
208
|
+
|
|
209
|
+
request_url = @base_url || @client.base_url
|
|
210
|
+
|
|
211
|
+
options = {
|
|
212
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
213
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'dataMaskingPolicyName' => data_masking_policy_name},
|
|
214
|
+
query_params: {'api-version' => api_version},
|
|
215
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
216
|
+
base_url: request_url
|
|
217
|
+
}
|
|
218
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
219
|
+
|
|
220
|
+
promise = promise.then do |result|
|
|
221
|
+
http_response = result.response
|
|
222
|
+
status_code = http_response.status
|
|
223
|
+
response_content = http_response.body
|
|
224
|
+
unless status_code == 200
|
|
225
|
+
error_model = JSON.load(response_content)
|
|
226
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
230
|
+
# Deserialize Response
|
|
231
|
+
if status_code == 200
|
|
232
|
+
begin
|
|
233
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
234
|
+
result_mapper = Azure::ARM::SQL::Models::DataMaskingPolicy.mapper()
|
|
235
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
236
|
+
rescue Exception => e
|
|
237
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
result
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
promise.execute
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
248
|
+
end
|