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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_sql.rb +95 -46
  3. data/lib/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +310 -0
  4. data/lib/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +300 -0
  5. data/lib/generated/azure_mgmt_sql/data_masking_policies.rb +248 -0
  6. data/lib/generated/azure_mgmt_sql/data_masking_rules.rb +262 -0
  7. data/lib/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +264 -0
  8. data/lib/generated/azure_mgmt_sql/database_threat_detection_policies.rb +264 -0
  9. data/lib/generated/azure_mgmt_sql/database_usages.rb +129 -0
  10. data/lib/generated/azure_mgmt_sql/databases.rb +357 -2825
  11. data/lib/generated/azure_mgmt_sql/elastic_pool_activities.rb +132 -0
  12. data/lib/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +129 -0
  13. data/lib/generated/azure_mgmt_sql/elastic_pools.rb +0 -417
  14. data/lib/generated/azure_mgmt_sql/encryption_protectors.rb +498 -0
  15. data/lib/generated/azure_mgmt_sql/failover_groups.rb +6 -6
  16. data/lib/generated/azure_mgmt_sql/geo_backup_policies.rb +359 -0
  17. data/lib/generated/azure_mgmt_sql/models/database_usage.rb +4 -9
  18. data/lib/generated/azure_mgmt_sql/models/encryption_protector.rb +3 -4
  19. data/lib/generated/azure_mgmt_sql/models/failover_group.rb +2 -2
  20. data/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb +6 -4
  21. data/lib/generated/azure_mgmt_sql/models/failover_group_update.rb +93 -0
  22. data/lib/generated/azure_mgmt_sql/models/firewall_rule.rb +11 -14
  23. data/lib/generated/azure_mgmt_sql/models/metric_value.rb +1 -17
  24. data/lib/generated/azure_mgmt_sql/models/operation.rb +36 -3
  25. data/lib/generated/azure_mgmt_sql/models/operation_display.rb +20 -5
  26. data/lib/generated/azure_mgmt_sql/models/operation_list_result.rb +36 -6
  27. data/lib/generated/azure_mgmt_sql/models/operation_origin.rb +16 -0
  28. data/lib/generated/azure_mgmt_sql/models/partner_info.rb +1 -1
  29. data/lib/generated/azure_mgmt_sql/models/replication_link.rb +9 -12
  30. data/lib/generated/azure_mgmt_sql/models/server_azure_adadministrator.rb +11 -3
  31. data/lib/generated/azure_mgmt_sql/models/server_key.rb +3 -4
  32. data/lib/generated/azure_mgmt_sql/models/service_objective.rb +11 -3
  33. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +11 -3
  34. data/lib/generated/azure_mgmt_sql/models/sync_agent.rb +137 -0
  35. data/lib/generated/azure_mgmt_sql/models/{sql_sub_resource.rb → sync_agent_key_properties.rb} +9 -20
  36. data/lib/generated/azure_mgmt_sql/models/sync_agent_linked_database.rb +126 -0
  37. data/lib/generated/azure_mgmt_sql/models/sync_agent_linked_database_list_result.rb +96 -0
  38. data/lib/generated/azure_mgmt_sql/models/sync_agent_list_result.rb +96 -0
  39. data/lib/generated/azure_mgmt_sql/models/sync_agent_state.rb +17 -0
  40. data/lib/generated/azure_mgmt_sql/models/sync_conflict_resolution_policy.rb +16 -0
  41. data/lib/generated/azure_mgmt_sql/models/sync_database_id_list_result.rb +96 -0
  42. data/lib/generated/azure_mgmt_sql/models/{sub_resource.rb → sync_database_id_properties.rb} +7 -15
  43. data/lib/generated/azure_mgmt_sql/models/sync_direction.rb +17 -0
  44. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_properties.rb +66 -0
  45. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_properties_list_result.rb +96 -0
  46. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_table.rb +99 -0
  47. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_table_column.rb +112 -0
  48. data/lib/generated/azure_mgmt_sql/models/sync_group.rb +145 -0
  49. data/lib/generated/azure_mgmt_sql/models/sync_group_list_result.rb +96 -0
  50. data/lib/generated/azure_mgmt_sql/models/sync_group_log_list_result.rb +96 -0
  51. data/lib/generated/azure_mgmt_sql/models/sync_group_log_properties.rb +102 -0
  52. data/lib/generated/azure_mgmt_sql/models/sync_group_log_type.rb +18 -0
  53. data/lib/generated/azure_mgmt_sql/models/sync_group_schema.rb +64 -0
  54. data/lib/generated/azure_mgmt_sql/models/sync_group_schema_table.rb +64 -0
  55. data/lib/generated/azure_mgmt_sql/models/sync_group_schema_table_column.rb +65 -0
  56. data/lib/generated/azure_mgmt_sql/models/sync_group_state.rb +19 -0
  57. data/lib/generated/azure_mgmt_sql/models/sync_member.rb +160 -0
  58. data/lib/generated/azure_mgmt_sql/models/sync_member_db_type.rb +16 -0
  59. data/lib/generated/azure_mgmt_sql/models/sync_member_list_result.rb +96 -0
  60. data/lib/generated/azure_mgmt_sql/models/sync_member_state.rb +32 -0
  61. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +22 -3
  62. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +22 -3
  63. data/lib/generated/azure_mgmt_sql/models/virtual_network_rule.rb +2 -2
  64. data/lib/generated/azure_mgmt_sql/operations.rb +111 -4
  65. data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +3 -215
  66. data/lib/generated/azure_mgmt_sql/replication_links.rb +629 -0
  67. data/lib/generated/azure_mgmt_sql/restore_points.rb +132 -0
  68. data/lib/generated/azure_mgmt_sql/server_azure_adadministrators.rb +5 -5
  69. data/lib/generated/azure_mgmt_sql/server_connection_policies.rb +250 -0
  70. data/lib/generated/azure_mgmt_sql/server_keys.rb +10 -10
  71. data/lib/generated/azure_mgmt_sql/server_usages.rb +125 -0
  72. data/lib/generated/azure_mgmt_sql/servers.rb +161 -1423
  73. data/lib/generated/azure_mgmt_sql/service_objectives.rb +229 -0
  74. data/lib/generated/azure_mgmt_sql/service_tier_advisors.rb +234 -0
  75. data/lib/generated/azure_mgmt_sql/sql_management_client.rb +100 -9
  76. data/lib/generated/azure_mgmt_sql/sync_agents.rb +983 -0
  77. data/lib/generated/azure_mgmt_sql/sync_groups.rb +1863 -0
  78. data/lib/generated/azure_mgmt_sql/sync_members.rb +1290 -0
  79. data/lib/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +133 -0
  80. data/lib/generated/azure_mgmt_sql/transparent_data_encryptions.rb +264 -0
  81. data/lib/generated/azure_mgmt_sql/version.rb +1 -1
  82. metadata +55 -6
@@ -0,0 +1,264 @@
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 DatabaseThreatDetectionPolicies
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the DatabaseThreatDetectionPolicies 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's threat detection 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 for which database
35
+ # Threat Detection policy is defined.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [DatabaseSecurityAlertPolicy] operation results.
40
+ #
41
+ def get(resource_group_name, server_name, database_name, custom_headers = nil)
42
+ response = get_async(resource_group_name, server_name, database_name, custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Gets a database's threat detection policy.
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 the database for which database
54
+ # Threat Detection policy is defined.
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, custom_headers = nil)
61
+ get_async(resource_group_name, server_name, database_name, custom_headers).value!
62
+ end
63
+
64
+ #
65
+ # Gets a database's threat detection policy.
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 the database for which database
72
+ # Threat Detection policy is defined.
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, custom_headers = nil)
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
82
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
83
+ security_alert_policy_name = 'default'
84
+ api_version = '2014-04-01'
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}/securityAlertPolicies/{securityAlertPolicyName}'
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,'securityAlertPolicyName' => security_alert_policy_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::DatabaseSecurityAlertPolicy.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
+ # Creates or updates a database's threat detection policy.
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 the database for which database
140
+ # Threat Detection policy is defined.
141
+ # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection
142
+ # policy.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [DatabaseSecurityAlertPolicy] operation results.
147
+ #
148
+ def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
149
+ response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
150
+ response.body unless response.nil?
151
+ end
152
+
153
+ #
154
+ # Creates or updates a database's threat detection policy.
155
+ #
156
+ # @param resource_group_name [String] The name of the resource group that
157
+ # contains the resource. You can obtain this value from the Azure Resource
158
+ # Manager API or the portal.
159
+ # @param server_name [String] The name of the server.
160
+ # @param database_name [String] The name of the database for which database
161
+ # Threat Detection policy is defined.
162
+ # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection
163
+ # policy.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
168
+ #
169
+ def create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
170
+ create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
171
+ end
172
+
173
+ #
174
+ # Creates or updates a database's threat detection 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 for which database
181
+ # Threat Detection policy is defined.
182
+ # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection
183
+ # policy.
184
+ # @param [Hash{String => String}] A hash of custom headers that will be added
185
+ # to the HTTP request.
186
+ #
187
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
188
+ #
189
+ def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
190
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
191
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
192
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
193
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
194
+ security_alert_policy_name = 'default'
195
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
196
+ api_version = '2014-04-01'
197
+
198
+
199
+ request_headers = {}
200
+
201
+ # Set Headers
202
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
203
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
204
+
205
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
206
+
207
+ # Serialize Request
208
+ request_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
209
+ request_content = @client.serialize(request_mapper, parameters)
210
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
211
+
212
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'
213
+
214
+ request_url = @base_url || @client.base_url
215
+
216
+ options = {
217
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
218
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'securityAlertPolicyName' => security_alert_policy_name},
219
+ query_params: {'api-version' => api_version},
220
+ body: request_content,
221
+ headers: request_headers.merge(custom_headers || {}),
222
+ base_url: request_url
223
+ }
224
+ promise = @client.make_request_async(:put, path_template, options)
225
+
226
+ promise = promise.then do |result|
227
+ http_response = result.response
228
+ status_code = http_response.status
229
+ response_content = http_response.body
230
+ unless status_code == 200 || status_code == 201
231
+ error_model = JSON.load(response_content)
232
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
233
+ end
234
+
235
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
236
+ # Deserialize Response
237
+ if status_code == 200
238
+ begin
239
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
240
+ result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
241
+ result.body = @client.deserialize(result_mapper, parsed_response)
242
+ rescue Exception => e
243
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
244
+ end
245
+ end
246
+ # Deserialize Response
247
+ if status_code == 201
248
+ begin
249
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
250
+ result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
251
+ result.body = @client.deserialize(result_mapper, parsed_response)
252
+ rescue Exception => e
253
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
254
+ end
255
+ end
256
+
257
+ result
258
+ end
259
+
260
+ promise.execute
261
+ end
262
+
263
+ end
264
+ end
@@ -0,0 +1,129 @@
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 DatabaseUsages
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the DatabaseUsages 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
+ # Returns database usages.
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 custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [DatabaseUsageListResult] operation results.
39
+ #
40
+ def list_by_database(resource_group_name, server_name, database_name, custom_headers = nil)
41
+ response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Returns database usages.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group that
49
+ # contains the resource. You can obtain this value from the Azure Resource
50
+ # Manager API or the portal.
51
+ # @param server_name [String] The name of the server.
52
+ # @param database_name [String] The name of the database.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
+ #
58
+ def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
59
+ list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
60
+ end
61
+
62
+ #
63
+ # Returns database usages.
64
+ #
65
+ # @param resource_group_name [String] The name of the resource group that
66
+ # contains the resource. You can obtain this value from the Azure Resource
67
+ # Manager API or the portal.
68
+ # @param server_name [String] The name of the server.
69
+ # @param database_name [String] The name of the database.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def list_by_database_async(resource_group_name, server_name, database_name, custom_headers = nil)
76
+ api_version = '2014-04-01'
77
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
78
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
80
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
81
+
82
+
83
+ request_headers = {}
84
+
85
+ # Set Headers
86
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
95
+ query_params: {'api-version' => api_version},
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:get, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 200
106
+ error_model = JSON.load(response_content)
107
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::ARM::SQL::Models::DatabaseUsageListResult.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ end
129
+ end
@@ -25,124 +25,73 @@ module Azure::ARM::SQL
25
25
  attr_reader :client
26
26
 
27
27
  #
28
- # Returns a database backup long term retention policy
28
+ # Imports a bacpac into a new database.
29
29
  #
30
30
  # @param resource_group_name [String] The name of the resource group that
31
31
  # contains the resource. You can obtain this value from the Azure Resource
32
32
  # Manager API or the portal.
33
33
  # @param server_name [String] The name of the server.
34
- # @param database_name [String] The name of the database.
34
+ # @param parameters [ImportRequest] The required parameters for importing a
35
+ # Bacpac into a database.
35
36
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
37
  # will be added to the HTTP request.
37
38
  #
38
- # @return [BackupLongTermRetentionPolicy] operation results.
39
+ # @return [ImportExportResponse] operation results.
39
40
  #
40
- def get_backup_long_term_retention_policy(resource_group_name, server_name, database_name, custom_headers = nil)
41
- response = get_backup_long_term_retention_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
41
+ def import(resource_group_name, server_name, parameters, custom_headers = nil)
42
+ response = import_async(resource_group_name, server_name, parameters, custom_headers).value!
42
43
  response.body unless response.nil?
43
44
  end
44
45
 
45
- #
46
- # Returns a database backup long term retention policy
47
46
  #
48
47
  # @param resource_group_name [String] The name of the resource group that
49
48
  # contains the resource. You can obtain this value from the Azure Resource
50
49
  # Manager API or the portal.
51
50
  # @param server_name [String] The name of the server.
52
- # @param database_name [String] The name of the database.
51
+ # @param parameters [ImportRequest] The required parameters for importing a
52
+ # Bacpac into a database.
53
53
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
54
  # will be added to the HTTP request.
55
55
  #
56
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
- #
58
- def get_backup_long_term_retention_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
59
- get_backup_long_term_retention_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
60
- end
61
-
62
- #
63
- # Returns a database backup long term retention policy
64
- #
65
- # @param resource_group_name [String] The name of the resource group that
66
- # contains the resource. You can obtain this value from the Azure Resource
67
- # Manager API or the portal.
68
- # @param server_name [String] The name of the server.
69
- # @param database_name [String] The name of the database.
70
- # @param [Hash{String => String}] A hash of custom headers that will be added
71
- # to the HTTP request.
72
- #
73
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ # @return [Concurrent::Promise] promise which provides async access to http
57
+ # response.
74
58
  #
75
- def get_backup_long_term_retention_policy_async(resource_group_name, server_name, database_name, custom_headers = nil)
76
- api_version = '2014-04-01'
77
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
78
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
- fail ArgumentError, 'server_name is nil' if server_name.nil?
80
- fail ArgumentError, 'database_name is nil' if database_name.nil?
81
- backup_long_term_retention_policy_name = 'Default'
82
-
83
-
84
- request_headers = {}
85
-
86
- # Set Headers
87
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}'
90
-
91
- request_url = @base_url || @client.base_url
92
-
93
- options = {
94
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'backupLongTermRetentionPolicyName' => backup_long_term_retention_policy_name},
96
- query_params: {'api-version' => api_version},
97
- headers: request_headers.merge(custom_headers || {}),
98
- base_url: request_url
99
- }
100
- promise = @client.make_request_async(:get, path_template, options)
101
-
102
- promise = promise.then do |result|
103
- http_response = result.response
104
- status_code = http_response.status
105
- response_content = http_response.body
106
- unless status_code == 200
107
- error_model = JSON.load(response_content)
108
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
- end
59
+ def import_async(resource_group_name, server_name, parameters, custom_headers = nil)
60
+ # Send request
61
+ promise = begin_import_async(resource_group_name, server_name, parameters, custom_headers)
110
62
 
111
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
- # Deserialize Response
113
- if status_code == 200
114
- begin
115
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionPolicy.mapper()
117
- result.body = @client.deserialize(result_mapper, parsed_response)
118
- rescue Exception => e
119
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
- end
63
+ promise = promise.then do |response|
64
+ # Defining deserialization method.
65
+ deserialize_method = lambda do |parsed_response|
66
+ result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper()
67
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
121
68
  end
122
69
 
123
- result
70
+ # Waiting for response.
71
+ @client.get_long_running_operation_result(response, deserialize_method)
124
72
  end
125
73
 
126
- promise.execute
74
+ promise
127
75
  end
128
76
 
129
77
  #
130
- # Creates or updates a database backup long term retention policy
78
+ # Creates an import operation that imports a bacpac into an existing database.
79
+ # The existing database must be empty.
131
80
  #
132
81
  # @param resource_group_name [String] The name of the resource group that
133
82
  # contains the resource. You can obtain this value from the Azure Resource
134
83
  # Manager API or the portal.
135
84
  # @param server_name [String] The name of the server.
136
- # @param database_name [String] The name of the database
137
- # @param parameters [BackupLongTermRetentionPolicy] The required parameters to
138
- # update a backup long term retention policy
85
+ # @param database_name [String] The name of the database to import into
86
+ # @param parameters [ImportExtensionRequest] The required parameters for
87
+ # importing a Bacpac into a database.
139
88
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
89
  # will be added to the HTTP request.
141
90
  #
142
- # @return [BackupLongTermRetentionPolicy] operation results.
91
+ # @return [ImportExportResponse] operation results.
143
92
  #
144
- def create_or_update_long_term_retention_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
145
- response = create_or_update_long_term_retention_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
93
+ def create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
94
+ response = create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
146
95
  response.body unless response.nil?
147
96
  end
148
97
 
@@ -151,23 +100,23 @@ module Azure::ARM::SQL
151
100
  # contains the resource. You can obtain this value from the Azure Resource
152
101
  # Manager API or the portal.
153
102
  # @param server_name [String] The name of the server.
154
- # @param database_name [String] The name of the database
155
- # @param parameters [BackupLongTermRetentionPolicy] The required parameters to
156
- # update a backup long term retention policy
103
+ # @param database_name [String] The name of the database to import into
104
+ # @param parameters [ImportExtensionRequest] The required parameters for
105
+ # importing a Bacpac into a database.
157
106
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
107
  # will be added to the HTTP request.
159
108
  #
160
109
  # @return [Concurrent::Promise] promise which provides async access to http
161
110
  # response.
162
111
  #
163
- def create_or_update_long_term_retention_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
112
+ def create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
164
113
  # Send request
165
- promise = begin_create_or_update_long_term_retention_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers)
114
+ promise = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers)
166
115
 
167
116
  promise = promise.then do |response|
168
117
  # Defining deserialization method.
169
118
  deserialize_method = lambda do |parsed_response|
170
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionPolicy.mapper()
119
+ result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper()
171
120
  parsed_response = @client.deserialize(result_mapper, parsed_response)
172
121
  end
173
122
 
@@ -179,167 +128,118 @@ module Azure::ARM::SQL
179
128
  end
180
129
 
181
130
  #
182
- # Gets a list of database restore points.
131
+ # Exports a database to a bacpac.
183
132
  #
184
133
  # @param resource_group_name [String] The name of the resource group that
185
134
  # contains the resource. You can obtain this value from the Azure Resource
186
135
  # Manager API or the portal.
187
136
  # @param server_name [String] The name of the server.
188
- # @param database_name [String] The name of the database to get available
189
- # restore points.
137
+ # @param database_name [String] The name of the database to be exported.
138
+ # @param parameters [ExportRequest] The required parameters for exporting a
139
+ # database.
190
140
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
141
  # will be added to the HTTP request.
192
142
  #
193
- # @return [RestorePointListResult] operation results.
143
+ # @return [ImportExportResponse] operation results.
194
144
  #
195
- def list_restore_points(resource_group_name, server_name, database_name, custom_headers = nil)
196
- response = list_restore_points_async(resource_group_name, server_name, database_name, custom_headers).value!
145
+ def export(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
146
+ response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
197
147
  response.body unless response.nil?
198
148
  end
199
149
 
200
- #
201
- # Gets a list of database restore points.
202
150
  #
203
151
  # @param resource_group_name [String] The name of the resource group that
204
152
  # contains the resource. You can obtain this value from the Azure Resource
205
153
  # Manager API or the portal.
206
154
  # @param server_name [String] The name of the server.
207
- # @param database_name [String] The name of the database to get available
208
- # restore points.
155
+ # @param database_name [String] The name of the database to be exported.
156
+ # @param parameters [ExportRequest] The required parameters for exporting a
157
+ # database.
209
158
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
210
159
  # will be added to the HTTP request.
211
160
  #
212
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
213
- #
214
- def list_restore_points_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
215
- list_restore_points_async(resource_group_name, server_name, database_name, custom_headers).value!
216
- end
217
-
218
- #
219
- # Gets a list of database restore points.
220
- #
221
- # @param resource_group_name [String] The name of the resource group that
222
- # contains the resource. You can obtain this value from the Azure Resource
223
- # Manager API or the portal.
224
- # @param server_name [String] The name of the server.
225
- # @param database_name [String] The name of the database to get available
226
- # restore points.
227
- # @param [Hash{String => String}] A hash of custom headers that will be added
228
- # to the HTTP request.
229
- #
230
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
+ # @return [Concurrent::Promise] promise which provides async access to http
162
+ # response.
231
163
  #
232
- def list_restore_points_async(resource_group_name, server_name, database_name, custom_headers = nil)
233
- api_version = '2014-04-01'
234
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
235
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
236
- fail ArgumentError, 'server_name is nil' if server_name.nil?
237
- fail ArgumentError, 'database_name is nil' if database_name.nil?
238
-
239
-
240
- request_headers = {}
241
-
242
- # Set Headers
243
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
244
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
245
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'
246
-
247
- request_url = @base_url || @client.base_url
248
-
249
- options = {
250
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
251
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
252
- query_params: {'api-version' => api_version},
253
- headers: request_headers.merge(custom_headers || {}),
254
- base_url: request_url
255
- }
256
- promise = @client.make_request_async(:get, path_template, options)
257
-
258
- promise = promise.then do |result|
259
- http_response = result.response
260
- status_code = http_response.status
261
- response_content = http_response.body
262
- unless status_code == 200
263
- error_model = JSON.load(response_content)
264
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
265
- end
164
+ def export_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
165
+ # Send request
166
+ promise = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers)
266
167
 
267
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
268
- # Deserialize Response
269
- if status_code == 200
270
- begin
271
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
272
- result_mapper = Azure::ARM::SQL::Models::RestorePointListResult.mapper()
273
- result.body = @client.deserialize(result_mapper, parsed_response)
274
- rescue Exception => e
275
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
276
- end
168
+ promise = promise.then do |response|
169
+ # Defining deserialization method.
170
+ deserialize_method = lambda do |parsed_response|
171
+ result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper()
172
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
277
173
  end
278
174
 
279
- result
175
+ # Waiting for response.
176
+ @client.get_long_running_operation_result(response, deserialize_method)
280
177
  end
281
178
 
282
- promise.execute
179
+ promise
283
180
  end
284
181
 
285
182
  #
286
- # Gets a database's threat detection policy.
183
+ # Returns database metrics.
287
184
  #
288
185
  # @param resource_group_name [String] The name of the resource group that
289
186
  # contains the resource. You can obtain this value from the Azure Resource
290
187
  # Manager API or the portal.
291
188
  # @param server_name [String] The name of the server.
292
- # @param database_name [String] The name of the database for which database
293
- # Threat Detection policy is defined.
189
+ # @param database_name [String] The name of the database.
190
+ # @param filter [String] An OData filter expression that describes a subset of
191
+ # metrics to return.
294
192
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
295
193
  # will be added to the HTTP request.
296
194
  #
297
- # @return [DatabaseSecurityAlertPolicy] operation results.
195
+ # @return [MetricListResult] operation results.
298
196
  #
299
- def get_threat_detection_policy(resource_group_name, server_name, database_name, custom_headers = nil)
300
- response = get_threat_detection_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
197
+ def list_metrics(resource_group_name, server_name, database_name, filter, custom_headers = nil)
198
+ response = list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers).value!
301
199
  response.body unless response.nil?
302
200
  end
303
201
 
304
202
  #
305
- # Gets a database's threat detection policy.
203
+ # Returns database metrics.
306
204
  #
307
205
  # @param resource_group_name [String] The name of the resource group that
308
206
  # contains the resource. You can obtain this value from the Azure Resource
309
207
  # Manager API or the portal.
310
208
  # @param server_name [String] The name of the server.
311
- # @param database_name [String] The name of the database for which database
312
- # Threat Detection policy is defined.
209
+ # @param database_name [String] The name of the database.
210
+ # @param filter [String] An OData filter expression that describes a subset of
211
+ # metrics to return.
313
212
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
314
213
  # will be added to the HTTP request.
315
214
  #
316
215
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
317
216
  #
318
- def get_threat_detection_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
319
- get_threat_detection_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
217
+ def list_metrics_with_http_info(resource_group_name, server_name, database_name, filter, custom_headers = nil)
218
+ list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers).value!
320
219
  end
321
220
 
322
221
  #
323
- # Gets a database's threat detection policy.
222
+ # Returns database metrics.
324
223
  #
325
224
  # @param resource_group_name [String] The name of the resource group that
326
225
  # contains the resource. You can obtain this value from the Azure Resource
327
226
  # Manager API or the portal.
328
227
  # @param server_name [String] The name of the server.
329
- # @param database_name [String] The name of the database for which database
330
- # Threat Detection policy is defined.
228
+ # @param database_name [String] The name of the database.
229
+ # @param filter [String] An OData filter expression that describes a subset of
230
+ # metrics to return.
331
231
  # @param [Hash{String => String}] A hash of custom headers that will be added
332
232
  # to the HTTP request.
333
233
  #
334
234
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
335
235
  #
336
- def get_threat_detection_policy_async(resource_group_name, server_name, database_name, custom_headers = nil)
236
+ def list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers = nil)
237
+ api_version = '2014-04-01'
337
238
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
338
239
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
339
240
  fail ArgumentError, 'server_name is nil' if server_name.nil?
340
241
  fail ArgumentError, 'database_name is nil' if database_name.nil?
341
- security_alert_policy_name = 'default'
342
- api_version = '2014-04-01'
242
+ fail ArgumentError, 'filter is nil' if filter.nil?
343
243
 
344
244
 
345
245
  request_headers = {}
@@ -347,14 +247,14 @@ module Azure::ARM::SQL
347
247
  # Set Headers
348
248
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
349
249
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
350
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'
250
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'
351
251
 
352
252
  request_url = @base_url || @client.base_url
353
253
 
354
254
  options = {
355
255
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
356
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'securityAlertPolicyName' => security_alert_policy_name},
357
- query_params: {'api-version' => api_version},
256
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
257
+ query_params: {'api-version' => api_version,'$filter' => filter},
358
258
  headers: request_headers.merge(custom_headers || {}),
359
259
  base_url: request_url
360
260
  }
@@ -374,7 +274,7 @@ module Azure::ARM::SQL
374
274
  if status_code == 200
375
275
  begin
376
276
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
377
- result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
277
+ result_mapper = Azure::ARM::SQL::Models::MetricListResult.mapper()
378
278
  result.body = @client.deserialize(result_mapper, parsed_response)
379
279
  rescue Exception => e
380
280
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -388,70 +288,59 @@ module Azure::ARM::SQL
388
288
  end
389
289
 
390
290
  #
391
- # Creates or updates a database's threat detection policy.
291
+ # Returns database metric definitions.
392
292
  #
393
293
  # @param resource_group_name [String] The name of the resource group that
394
294
  # contains the resource. You can obtain this value from the Azure Resource
395
295
  # Manager API or the portal.
396
296
  # @param server_name [String] The name of the server.
397
- # @param database_name [String] The name of the database for which database
398
- # Threat Detection policy is defined.
399
- # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection
400
- # policy.
297
+ # @param database_name [String] The name of the database.
401
298
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
402
299
  # will be added to the HTTP request.
403
300
  #
404
- # @return [DatabaseSecurityAlertPolicy] operation results.
301
+ # @return [MetricDefinitionListResult] operation results.
405
302
  #
406
- def create_or_update_threat_detection_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
407
- response = create_or_update_threat_detection_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
303
+ def list_metric_definitions(resource_group_name, server_name, database_name, custom_headers = nil)
304
+ response = list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers).value!
408
305
  response.body unless response.nil?
409
306
  end
410
307
 
411
308
  #
412
- # Creates or updates a database's threat detection policy.
309
+ # Returns database metric definitions.
413
310
  #
414
311
  # @param resource_group_name [String] The name of the resource group that
415
312
  # contains the resource. You can obtain this value from the Azure Resource
416
313
  # Manager API or the portal.
417
314
  # @param server_name [String] The name of the server.
418
- # @param database_name [String] The name of the database for which database
419
- # Threat Detection policy is defined.
420
- # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection
421
- # policy.
315
+ # @param database_name [String] The name of the database.
422
316
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
317
  # will be added to the HTTP request.
424
318
  #
425
319
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
320
  #
427
- def create_or_update_threat_detection_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
428
- create_or_update_threat_detection_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
321
+ def list_metric_definitions_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
322
+ list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers).value!
429
323
  end
430
324
 
431
325
  #
432
- # Creates or updates a database's threat detection policy.
326
+ # Returns database metric definitions.
433
327
  #
434
328
  # @param resource_group_name [String] The name of the resource group that
435
329
  # contains the resource. You can obtain this value from the Azure Resource
436
330
  # Manager API or the portal.
437
331
  # @param server_name [String] The name of the server.
438
- # @param database_name [String] The name of the database for which database
439
- # Threat Detection policy is defined.
440
- # @param parameters [DatabaseSecurityAlertPolicy] The database Threat Detection
441
- # policy.
332
+ # @param database_name [String] The name of the database.
442
333
  # @param [Hash{String => String}] A hash of custom headers that will be added
443
334
  # to the HTTP request.
444
335
  #
445
336
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
446
337
  #
447
- def create_or_update_threat_detection_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
338
+ def list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers = nil)
339
+ api_version = '2014-04-01'
448
340
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
449
341
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
450
342
  fail ArgumentError, 'server_name is nil' if server_name.nil?
451
343
  fail ArgumentError, 'database_name is nil' if database_name.nil?
452
- security_alert_policy_name = 'default'
453
- fail ArgumentError, 'parameters is nil' if parameters.nil?
454
- api_version = '2014-04-01'
455
344
 
456
345
 
457
346
  request_headers = {}
@@ -459,33 +348,24 @@ module Azure::ARM::SQL
459
348
  # Set Headers
460
349
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
461
350
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
462
-
463
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
464
-
465
- # Serialize Request
466
- request_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
467
- request_content = @client.serialize(request_mapper, parameters)
468
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
469
-
470
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'
351
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'
471
352
 
472
353
  request_url = @base_url || @client.base_url
473
354
 
474
355
  options = {
475
356
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
476
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'securityAlertPolicyName' => security_alert_policy_name},
357
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
477
358
  query_params: {'api-version' => api_version},
478
- body: request_content,
479
359
  headers: request_headers.merge(custom_headers || {}),
480
360
  base_url: request_url
481
361
  }
482
- promise = @client.make_request_async(:put, path_template, options)
362
+ promise = @client.make_request_async(:get, path_template, options)
483
363
 
484
364
  promise = promise.then do |result|
485
365
  http_response = result.response
486
366
  status_code = http_response.status
487
367
  response_content = http_response.body
488
- unless status_code == 200 || status_code == 201
368
+ unless status_code == 200
489
369
  error_model = JSON.load(response_content)
490
370
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
491
371
  end
@@ -495,17 +375,7 @@ module Azure::ARM::SQL
495
375
  if status_code == 200
496
376
  begin
497
377
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
498
- result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
499
- result.body = @client.deserialize(result_mapper, parsed_response)
500
- rescue Exception => e
501
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
502
- end
503
- end
504
- # Deserialize Response
505
- if status_code == 201
506
- begin
507
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
508
- result_mapper = Azure::ARM::SQL::Models::DatabaseSecurityAlertPolicy.mapper()
378
+ result_mapper = Azure::ARM::SQL::Models::MetricDefinitionListResult.mapper()
509
379
  result.body = @client.deserialize(result_mapper, parsed_response)
510
380
  rescue Exception => e
511
381
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -519,2332 +389,252 @@ module Azure::ARM::SQL
519
389
  end
520
390
 
521
391
  #
522
- # Creates or updates a database data masking policy
392
+ # Pauses a data warehouse.
523
393
  #
524
394
  # @param resource_group_name [String] The name of the resource group that
525
395
  # contains the resource. You can obtain this value from the Azure Resource
526
396
  # Manager API or the portal.
527
397
  # @param server_name [String] The name of the server.
528
- # @param database_name [String] The name of the database.
529
- # @param parameters [DataMaskingPolicy] Parameters for creating or updating a
530
- # data masking policy.
398
+ # @param database_name [String] The name of the data warehouse to pause.
531
399
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
532
400
  # will be added to the HTTP request.
533
401
  #
534
- # @return [DataMaskingPolicy] operation results.
535
- #
536
- def create_or_update_data_masking_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
537
- response = create_or_update_data_masking_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
538
- response.body unless response.nil?
402
+ def pause(resource_group_name, server_name, database_name, custom_headers = nil)
403
+ response = pause_async(resource_group_name, server_name, database_name, custom_headers).value!
404
+ nil
539
405
  end
540
406
 
541
- #
542
- # Creates or updates a database data masking policy
543
407
  #
544
408
  # @param resource_group_name [String] The name of the resource group that
545
409
  # contains the resource. You can obtain this value from the Azure Resource
546
410
  # Manager API or the portal.
547
411
  # @param server_name [String] The name of the server.
548
- # @param database_name [String] The name of the database.
549
- # @param parameters [DataMaskingPolicy] Parameters for creating or updating a
550
- # data masking policy.
412
+ # @param database_name [String] The name of the data warehouse to pause.
551
413
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
414
  # will be added to the HTTP request.
553
415
  #
554
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
416
+ # @return [Concurrent::Promise] promise which provides async access to http
417
+ # response.
555
418
  #
556
- def create_or_update_data_masking_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
557
- create_or_update_data_masking_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
558
- end
559
-
560
- #
561
- # Creates or updates a database data masking policy
562
- #
563
- # @param resource_group_name [String] The name of the resource group that
564
- # contains the resource. You can obtain this value from the Azure Resource
565
- # Manager API or the portal.
566
- # @param server_name [String] The name of the server.
567
- # @param database_name [String] The name of the database.
568
- # @param parameters [DataMaskingPolicy] Parameters for creating or updating a
569
- # data masking policy.
570
- # @param [Hash{String => String}] A hash of custom headers that will be added
571
- # to the HTTP request.
572
- #
573
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
574
- #
575
- def create_or_update_data_masking_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
576
- api_version = '2014-04-01'
577
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
578
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
579
- fail ArgumentError, 'server_name is nil' if server_name.nil?
580
- fail ArgumentError, 'database_name is nil' if database_name.nil?
581
- data_masking_policy_name = 'Default'
582
- fail ArgumentError, 'parameters is nil' if parameters.nil?
583
-
584
-
585
- request_headers = {}
586
-
587
- # Set Headers
588
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
589
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
590
-
591
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
592
-
593
- # Serialize Request
594
- request_mapper = Azure::ARM::SQL::Models::DataMaskingPolicy.mapper()
595
- request_content = @client.serialize(request_mapper, parameters)
596
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
597
-
598
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}'
599
-
600
- request_url = @base_url || @client.base_url
601
-
602
- options = {
603
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
604
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'dataMaskingPolicyName' => data_masking_policy_name},
605
- query_params: {'api-version' => api_version},
606
- body: request_content,
607
- headers: request_headers.merge(custom_headers || {}),
608
- base_url: request_url
609
- }
610
- promise = @client.make_request_async(:put, path_template, options)
611
-
612
- promise = promise.then do |result|
613
- http_response = result.response
614
- status_code = http_response.status
615
- response_content = http_response.body
616
- unless status_code == 200
617
- error_model = JSON.load(response_content)
618
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
619
- end
620
-
621
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
622
- # Deserialize Response
623
- if status_code == 200
624
- begin
625
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
626
- result_mapper = Azure::ARM::SQL::Models::DataMaskingPolicy.mapper()
627
- result.body = @client.deserialize(result_mapper, parsed_response)
628
- rescue Exception => e
629
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
630
- end
631
- end
632
-
633
- result
634
- end
635
-
636
- promise.execute
637
- end
638
-
639
- #
640
- # Gets a database data masking policy.
641
- #
642
- # @param resource_group_name [String] The name of the resource group that
643
- # contains the resource. You can obtain this value from the Azure Resource
644
- # Manager API or the portal.
645
- # @param server_name [String] The name of the server.
646
- # @param database_name [String] The name of the database.
647
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
648
- # will be added to the HTTP request.
649
- #
650
- # @return [DataMaskingPolicy] operation results.
651
- #
652
- def get_data_masking_policy(resource_group_name, server_name, database_name, custom_headers = nil)
653
- response = get_data_masking_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
654
- response.body unless response.nil?
655
- end
656
-
657
- #
658
- # Gets a database data masking policy.
659
- #
660
- # @param resource_group_name [String] The name of the resource group that
661
- # contains the resource. You can obtain this value from the Azure Resource
662
- # Manager API or the portal.
663
- # @param server_name [String] The name of the server.
664
- # @param database_name [String] The name of the database.
665
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
666
- # will be added to the HTTP request.
667
- #
668
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
669
- #
670
- def get_data_masking_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
671
- get_data_masking_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
672
- end
673
-
674
- #
675
- # Gets a database data masking policy.
676
- #
677
- # @param resource_group_name [String] The name of the resource group that
678
- # contains the resource. You can obtain this value from the Azure Resource
679
- # Manager API or the portal.
680
- # @param server_name [String] The name of the server.
681
- # @param database_name [String] The name of the database.
682
- # @param [Hash{String => String}] A hash of custom headers that will be added
683
- # to the HTTP request.
684
- #
685
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
686
- #
687
- def get_data_masking_policy_async(resource_group_name, server_name, database_name, custom_headers = nil)
688
- api_version = '2014-04-01'
689
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
690
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
691
- fail ArgumentError, 'server_name is nil' if server_name.nil?
692
- fail ArgumentError, 'database_name is nil' if database_name.nil?
693
- data_masking_policy_name = 'Default'
694
-
695
-
696
- request_headers = {}
697
-
698
- # Set Headers
699
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
700
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
701
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}'
702
-
703
- request_url = @base_url || @client.base_url
704
-
705
- options = {
706
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
707
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'dataMaskingPolicyName' => data_masking_policy_name},
708
- query_params: {'api-version' => api_version},
709
- headers: request_headers.merge(custom_headers || {}),
710
- base_url: request_url
711
- }
712
- promise = @client.make_request_async(:get, path_template, options)
713
-
714
- promise = promise.then do |result|
715
- http_response = result.response
716
- status_code = http_response.status
717
- response_content = http_response.body
718
- unless status_code == 200
719
- error_model = JSON.load(response_content)
720
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
721
- end
722
-
723
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
724
- # Deserialize Response
725
- if status_code == 200
726
- begin
727
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
728
- result_mapper = Azure::ARM::SQL::Models::DataMaskingPolicy.mapper()
729
- result.body = @client.deserialize(result_mapper, parsed_response)
730
- rescue Exception => e
731
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
732
- end
733
- end
734
-
735
- result
736
- end
737
-
738
- promise.execute
739
- end
740
-
741
- #
742
- # Creates or updates a database data masking rule.
743
- #
744
- # @param resource_group_name [String] The name of the resource group that
745
- # contains the resource. You can obtain this value from the Azure Resource
746
- # Manager API or the portal.
747
- # @param server_name [String] The name of the server.
748
- # @param database_name [String] The name of the database.
749
- # @param data_masking_rule_name [String] The name of the data masking rule.
750
- # @param parameters [DataMaskingRule] The required parameters for creating or
751
- # updating a data masking rule.
752
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
753
- # will be added to the HTTP request.
754
- #
755
- # @return [DataMaskingRule] operation results.
756
- #
757
- def create_or_update_data_masking_rule(resource_group_name, server_name, database_name, data_masking_rule_name, parameters, custom_headers = nil)
758
- response = create_or_update_data_masking_rule_async(resource_group_name, server_name, database_name, data_masking_rule_name, parameters, custom_headers).value!
759
- response.body unless response.nil?
760
- end
761
-
762
- #
763
- # Creates or updates a database data masking rule.
764
- #
765
- # @param resource_group_name [String] The name of the resource group that
766
- # contains the resource. You can obtain this value from the Azure Resource
767
- # Manager API or the portal.
768
- # @param server_name [String] The name of the server.
769
- # @param database_name [String] The name of the database.
770
- # @param data_masking_rule_name [String] The name of the data masking rule.
771
- # @param parameters [DataMaskingRule] The required parameters for creating or
772
- # updating a data masking rule.
773
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
774
- # will be added to the HTTP request.
775
- #
776
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
777
- #
778
- def create_or_update_data_masking_rule_with_http_info(resource_group_name, server_name, database_name, data_masking_rule_name, parameters, custom_headers = nil)
779
- create_or_update_data_masking_rule_async(resource_group_name, server_name, database_name, data_masking_rule_name, parameters, custom_headers).value!
780
- end
781
-
782
- #
783
- # Creates or updates a database data masking rule.
784
- #
785
- # @param resource_group_name [String] The name of the resource group that
786
- # contains the resource. You can obtain this value from the Azure Resource
787
- # Manager API or the portal.
788
- # @param server_name [String] The name of the server.
789
- # @param database_name [String] The name of the database.
790
- # @param data_masking_rule_name [String] The name of the data masking rule.
791
- # @param parameters [DataMaskingRule] The required parameters for creating or
792
- # updating a data masking rule.
793
- # @param [Hash{String => String}] A hash of custom headers that will be added
794
- # to the HTTP request.
795
- #
796
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
797
- #
798
- def create_or_update_data_masking_rule_async(resource_group_name, server_name, database_name, data_masking_rule_name, parameters, custom_headers = nil)
799
- api_version = '2014-04-01'
800
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
801
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
802
- fail ArgumentError, 'server_name is nil' if server_name.nil?
803
- fail ArgumentError, 'database_name is nil' if database_name.nil?
804
- data_masking_policy_name = 'Default'
805
- fail ArgumentError, 'data_masking_rule_name is nil' if data_masking_rule_name.nil?
806
- fail ArgumentError, 'parameters is nil' if parameters.nil?
807
-
808
-
809
- request_headers = {}
810
-
811
- # Set Headers
812
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
813
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
814
-
815
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
816
-
817
- # Serialize Request
818
- request_mapper = Azure::ARM::SQL::Models::DataMaskingRule.mapper()
819
- request_content = @client.serialize(request_mapper, parameters)
820
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
821
-
822
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}'
823
-
824
- request_url = @base_url || @client.base_url
825
-
826
- options = {
827
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
828
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'dataMaskingPolicyName' => data_masking_policy_name,'dataMaskingRuleName' => data_masking_rule_name},
829
- query_params: {'api-version' => api_version},
830
- body: request_content,
831
- headers: request_headers.merge(custom_headers || {}),
832
- base_url: request_url
833
- }
834
- promise = @client.make_request_async(:put, path_template, options)
835
-
836
- promise = promise.then do |result|
837
- http_response = result.response
838
- status_code = http_response.status
839
- response_content = http_response.body
840
- unless status_code == 200 || status_code == 201
841
- error_model = JSON.load(response_content)
842
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
843
- end
844
-
845
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
846
- # Deserialize Response
847
- if status_code == 200
848
- begin
849
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
850
- result_mapper = Azure::ARM::SQL::Models::DataMaskingRule.mapper()
851
- result.body = @client.deserialize(result_mapper, parsed_response)
852
- rescue Exception => e
853
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
854
- end
855
- end
856
- # Deserialize Response
857
- if status_code == 201
858
- begin
859
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
860
- result_mapper = Azure::ARM::SQL::Models::DataMaskingRule.mapper()
861
- result.body = @client.deserialize(result_mapper, parsed_response)
862
- rescue Exception => e
863
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
864
- end
865
- end
866
-
867
- result
868
- end
869
-
870
- promise.execute
871
- end
872
-
873
- #
874
- # Gets a list of database data masking rules.
875
- #
876
- # @param resource_group_name [String] The name of the resource group that
877
- # contains the resource. You can obtain this value from the Azure Resource
878
- # Manager API or the portal.
879
- # @param server_name [String] The name of the server.
880
- # @param database_name [String] The name of the database.
881
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
882
- # will be added to the HTTP request.
883
- #
884
- # @return [DataMaskingRuleListResult] operation results.
885
- #
886
- def list_data_masking_rules(resource_group_name, server_name, database_name, custom_headers = nil)
887
- response = list_data_masking_rules_async(resource_group_name, server_name, database_name, custom_headers).value!
888
- response.body unless response.nil?
889
- end
890
-
891
- #
892
- # Gets a list of database data masking rules.
893
- #
894
- # @param resource_group_name [String] The name of the resource group that
895
- # contains the resource. You can obtain this value from the Azure Resource
896
- # Manager API or the portal.
897
- # @param server_name [String] The name of the server.
898
- # @param database_name [String] The name of the database.
899
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
900
- # will be added to the HTTP request.
901
- #
902
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
903
- #
904
- def list_data_masking_rules_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
905
- list_data_masking_rules_async(resource_group_name, server_name, database_name, custom_headers).value!
906
- end
907
-
908
- #
909
- # Gets a list of database data masking rules.
910
- #
911
- # @param resource_group_name [String] The name of the resource group that
912
- # contains the resource. You can obtain this value from the Azure Resource
913
- # Manager API or the portal.
914
- # @param server_name [String] The name of the server.
915
- # @param database_name [String] The name of the database.
916
- # @param [Hash{String => String}] A hash of custom headers that will be added
917
- # to the HTTP request.
918
- #
919
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
920
- #
921
- def list_data_masking_rules_async(resource_group_name, server_name, database_name, custom_headers = nil)
922
- api_version = '2014-04-01'
923
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
924
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
925
- fail ArgumentError, 'server_name is nil' if server_name.nil?
926
- fail ArgumentError, 'database_name is nil' if database_name.nil?
927
- data_masking_policy_name = 'Default'
928
-
929
-
930
- request_headers = {}
931
-
932
- # Set Headers
933
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
934
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
935
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules'
936
-
937
- request_url = @base_url || @client.base_url
938
-
939
- options = {
940
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
941
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'dataMaskingPolicyName' => data_masking_policy_name},
942
- query_params: {'api-version' => api_version},
943
- headers: request_headers.merge(custom_headers || {}),
944
- base_url: request_url
945
- }
946
- promise = @client.make_request_async(:get, path_template, options)
947
-
948
- promise = promise.then do |result|
949
- http_response = result.response
950
- status_code = http_response.status
951
- response_content = http_response.body
952
- unless status_code == 200
953
- error_model = JSON.load(response_content)
954
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
955
- end
956
-
957
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
958
- # Deserialize Response
959
- if status_code == 200
960
- begin
961
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
962
- result_mapper = Azure::ARM::SQL::Models::DataMaskingRuleListResult.mapper()
963
- result.body = @client.deserialize(result_mapper, parsed_response)
964
- rescue Exception => e
965
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
966
- end
967
- end
968
-
969
- result
970
- end
971
-
972
- promise.execute
973
- end
974
-
975
- #
976
- # Updates a database geo backup policy.
977
- #
978
- # @param resource_group_name [String] The name of the resource group that
979
- # contains the resource. You can obtain this value from the Azure Resource
980
- # Manager API or the portal.
981
- # @param server_name [String] The name of the server.
982
- # @param database_name [String] The name of the database.
983
- # @param parameters [GeoBackupPolicy] The required parameters for creating or
984
- # updating the geo backup policy.
985
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
986
- # will be added to the HTTP request.
987
- #
988
- # @return [GeoBackupPolicy] operation results.
989
- #
990
- def create_or_update_geo_backup_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
991
- response = create_or_update_geo_backup_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
992
- response.body unless response.nil?
993
- end
994
-
995
- #
996
- # Updates a database geo backup policy.
997
- #
998
- # @param resource_group_name [String] The name of the resource group that
999
- # contains the resource. You can obtain this value from the Azure Resource
1000
- # Manager API or the portal.
1001
- # @param server_name [String] The name of the server.
1002
- # @param database_name [String] The name of the database.
1003
- # @param parameters [GeoBackupPolicy] The required parameters for creating or
1004
- # updating the geo backup policy.
1005
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1006
- # will be added to the HTTP request.
1007
- #
1008
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1009
- #
1010
- def create_or_update_geo_backup_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1011
- create_or_update_geo_backup_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1012
- end
1013
-
1014
- #
1015
- # Updates a database geo backup policy.
1016
- #
1017
- # @param resource_group_name [String] The name of the resource group that
1018
- # contains the resource. You can obtain this value from the Azure Resource
1019
- # Manager API or the portal.
1020
- # @param server_name [String] The name of the server.
1021
- # @param database_name [String] The name of the database.
1022
- # @param parameters [GeoBackupPolicy] The required parameters for creating or
1023
- # updating the geo backup policy.
1024
- # @param [Hash{String => String}] A hash of custom headers that will be added
1025
- # to the HTTP request.
1026
- #
1027
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1028
- #
1029
- def create_or_update_geo_backup_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1030
- api_version = '2014-04-01'
1031
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1032
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1033
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1034
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1035
- geo_backup_policy_name = 'Default'
1036
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1037
-
1038
-
1039
- request_headers = {}
1040
-
1041
- # Set Headers
1042
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1043
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1044
-
1045
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1046
-
1047
- # Serialize Request
1048
- request_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
1049
- request_content = @client.serialize(request_mapper, parameters)
1050
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1051
-
1052
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}'
1053
-
1054
- request_url = @base_url || @client.base_url
1055
-
1056
- options = {
1057
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1058
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'geoBackupPolicyName' => geo_backup_policy_name},
1059
- query_params: {'api-version' => api_version},
1060
- body: request_content,
1061
- headers: request_headers.merge(custom_headers || {}),
1062
- base_url: request_url
1063
- }
1064
- promise = @client.make_request_async(:put, path_template, options)
1065
-
1066
- promise = promise.then do |result|
1067
- http_response = result.response
1068
- status_code = http_response.status
1069
- response_content = http_response.body
1070
- unless status_code == 201 || status_code == 200
1071
- error_model = JSON.load(response_content)
1072
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1073
- end
1074
-
1075
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1076
- # Deserialize Response
1077
- if status_code == 201
1078
- begin
1079
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1080
- result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
1081
- result.body = @client.deserialize(result_mapper, parsed_response)
1082
- rescue Exception => e
1083
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1084
- end
1085
- end
1086
- # Deserialize Response
1087
- if status_code == 200
1088
- begin
1089
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1090
- result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
1091
- result.body = @client.deserialize(result_mapper, parsed_response)
1092
- rescue Exception => e
1093
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1094
- end
1095
- end
1096
-
1097
- result
1098
- end
1099
-
1100
- promise.execute
1101
- end
1102
-
1103
- #
1104
- # Gets a geo backup policy.
1105
- #
1106
- # @param resource_group_name [String] The name of the resource group that
1107
- # contains the resource. You can obtain this value from the Azure Resource
1108
- # Manager API or the portal.
1109
- # @param server_name [String] The name of the server.
1110
- # @param database_name [String] The name of the database.
1111
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1112
- # will be added to the HTTP request.
1113
- #
1114
- # @return [GeoBackupPolicy] operation results.
1115
- #
1116
- def get_geo_backup_policy(resource_group_name, server_name, database_name, custom_headers = nil)
1117
- response = get_geo_backup_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
1118
- response.body unless response.nil?
1119
- end
1120
-
1121
- #
1122
- # Gets a geo backup policy.
1123
- #
1124
- # @param resource_group_name [String] The name of the resource group that
1125
- # contains the resource. You can obtain this value from the Azure Resource
1126
- # Manager API or the portal.
1127
- # @param server_name [String] The name of the server.
1128
- # @param database_name [String] The name of the database.
1129
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1130
- # will be added to the HTTP request.
1131
- #
1132
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1133
- #
1134
- def get_geo_backup_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
1135
- get_geo_backup_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
1136
- end
1137
-
1138
- #
1139
- # Gets a geo backup policy.
1140
- #
1141
- # @param resource_group_name [String] The name of the resource group that
1142
- # contains the resource. You can obtain this value from the Azure Resource
1143
- # Manager API or the portal.
1144
- # @param server_name [String] The name of the server.
1145
- # @param database_name [String] The name of the database.
1146
- # @param [Hash{String => String}] A hash of custom headers that will be added
1147
- # to the HTTP request.
1148
- #
1149
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1150
- #
1151
- def get_geo_backup_policy_async(resource_group_name, server_name, database_name, custom_headers = nil)
1152
- api_version = '2014-04-01'
1153
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1154
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1155
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1156
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1157
- geo_backup_policy_name = 'Default'
1158
-
1159
-
1160
- request_headers = {}
1161
-
1162
- # Set Headers
1163
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1164
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1165
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}'
1166
-
1167
- request_url = @base_url || @client.base_url
1168
-
1169
- options = {
1170
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1171
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'geoBackupPolicyName' => geo_backup_policy_name},
1172
- query_params: {'api-version' => api_version},
1173
- headers: request_headers.merge(custom_headers || {}),
1174
- base_url: request_url
1175
- }
1176
- promise = @client.make_request_async(:get, path_template, options)
1177
-
1178
- promise = promise.then do |result|
1179
- http_response = result.response
1180
- status_code = http_response.status
1181
- response_content = http_response.body
1182
- unless status_code == 200
1183
- error_model = JSON.load(response_content)
1184
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1185
- end
1186
-
1187
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1188
- # Deserialize Response
1189
- if status_code == 200
1190
- begin
1191
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1192
- result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicy.mapper()
1193
- result.body = @client.deserialize(result_mapper, parsed_response)
1194
- rescue Exception => e
1195
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1196
- end
1197
- end
1198
-
1199
- result
1200
- end
1201
-
1202
- promise.execute
1203
- end
1204
-
1205
- #
1206
- # Returns a list of geo backup policies.
1207
- #
1208
- # @param resource_group_name [String] The name of the resource group that
1209
- # contains the resource. You can obtain this value from the Azure Resource
1210
- # Manager API or the portal.
1211
- # @param server_name [String] The name of the server.
1212
- # @param database_name [String] The name of the database.
1213
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1214
- # will be added to the HTTP request.
1215
- #
1216
- # @return [GeoBackupPolicyListResult] operation results.
1217
- #
1218
- def list_geo_backup_policies(resource_group_name, server_name, database_name, custom_headers = nil)
1219
- response = list_geo_backup_policies_async(resource_group_name, server_name, database_name, custom_headers).value!
1220
- response.body unless response.nil?
1221
- end
1222
-
1223
- #
1224
- # Returns a list of geo backup policies.
1225
- #
1226
- # @param resource_group_name [String] The name of the resource group that
1227
- # contains the resource. You can obtain this value from the Azure Resource
1228
- # Manager API or the portal.
1229
- # @param server_name [String] The name of the server.
1230
- # @param database_name [String] The name of the database.
1231
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1232
- # will be added to the HTTP request.
1233
- #
1234
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1235
- #
1236
- def list_geo_backup_policies_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
1237
- list_geo_backup_policies_async(resource_group_name, server_name, database_name, custom_headers).value!
1238
- end
1239
-
1240
- #
1241
- # Returns a list of geo backup policies.
1242
- #
1243
- # @param resource_group_name [String] The name of the resource group that
1244
- # contains the resource. You can obtain this value from the Azure Resource
1245
- # Manager API or the portal.
1246
- # @param server_name [String] The name of the server.
1247
- # @param database_name [String] The name of the database.
1248
- # @param [Hash{String => String}] A hash of custom headers that will be added
1249
- # to the HTTP request.
1250
- #
1251
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1252
- #
1253
- def list_geo_backup_policies_async(resource_group_name, server_name, database_name, custom_headers = nil)
1254
- api_version = '2014-04-01'
1255
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1256
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1257
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1258
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1259
-
1260
-
1261
- request_headers = {}
1262
-
1263
- # Set Headers
1264
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1265
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1266
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies'
1267
-
1268
- request_url = @base_url || @client.base_url
1269
-
1270
- options = {
1271
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1272
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1273
- query_params: {'api-version' => api_version},
1274
- headers: request_headers.merge(custom_headers || {}),
1275
- base_url: request_url
1276
- }
1277
- promise = @client.make_request_async(:get, path_template, options)
1278
-
1279
- promise = promise.then do |result|
1280
- http_response = result.response
1281
- status_code = http_response.status
1282
- response_content = http_response.body
1283
- unless status_code == 200
1284
- error_model = JSON.load(response_content)
1285
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1286
- end
1287
-
1288
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1289
- # Deserialize Response
1290
- if status_code == 200
1291
- begin
1292
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1293
- result_mapper = Azure::ARM::SQL::Models::GeoBackupPolicyListResult.mapper()
1294
- result.body = @client.deserialize(result_mapper, parsed_response)
1295
- rescue Exception => e
1296
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1297
- end
1298
- end
1299
-
1300
- result
1301
- end
1302
-
1303
- promise.execute
1304
- end
1305
-
1306
- #
1307
- # Imports a bacpac into a new database.
1308
- #
1309
- # @param resource_group_name [String] The name of the resource group that
1310
- # contains the resource. You can obtain this value from the Azure Resource
1311
- # Manager API or the portal.
1312
- # @param server_name [String] The name of the server.
1313
- # @param parameters [ImportRequest] The required parameters for importing a
1314
- # Bacpac into a database.
1315
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1316
- # will be added to the HTTP request.
1317
- #
1318
- # @return [ImportExportResponse] operation results.
1319
- #
1320
- def import(resource_group_name, server_name, parameters, custom_headers = nil)
1321
- response = import_async(resource_group_name, server_name, parameters, custom_headers).value!
1322
- response.body unless response.nil?
1323
- end
1324
-
1325
- #
1326
- # @param resource_group_name [String] The name of the resource group that
1327
- # contains the resource. You can obtain this value from the Azure Resource
1328
- # Manager API or the portal.
1329
- # @param server_name [String] The name of the server.
1330
- # @param parameters [ImportRequest] The required parameters for importing a
1331
- # Bacpac into a database.
1332
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1333
- # will be added to the HTTP request.
1334
- #
1335
- # @return [Concurrent::Promise] promise which provides async access to http
1336
- # response.
1337
- #
1338
- def import_async(resource_group_name, server_name, parameters, custom_headers = nil)
1339
- # Send request
1340
- promise = begin_import_async(resource_group_name, server_name, parameters, custom_headers)
1341
-
1342
- promise = promise.then do |response|
1343
- # Defining deserialization method.
1344
- deserialize_method = lambda do |parsed_response|
1345
- result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper()
1346
- parsed_response = @client.deserialize(result_mapper, parsed_response)
1347
- end
1348
-
1349
- # Waiting for response.
1350
- @client.get_long_running_operation_result(response, deserialize_method)
1351
- end
1352
-
1353
- promise
1354
- end
1355
-
1356
- #
1357
- # Creates an import operation that imports a bacpac into an existing database.
1358
- # The existing database must be empty.
1359
- #
1360
- # @param resource_group_name [String] The name of the resource group that
1361
- # contains the resource. You can obtain this value from the Azure Resource
1362
- # Manager API or the portal.
1363
- # @param server_name [String] The name of the server.
1364
- # @param database_name [String] The name of the database to import into
1365
- # @param parameters [ImportExtensionRequest] The required parameters for
1366
- # importing a Bacpac into a database.
1367
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1368
- # will be added to the HTTP request.
1369
- #
1370
- # @return [ImportExportResponse] operation results.
1371
- #
1372
- def create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1373
- response = create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1374
- response.body unless response.nil?
1375
- end
1376
-
1377
- #
1378
- # @param resource_group_name [String] The name of the resource group that
1379
- # contains the resource. You can obtain this value from the Azure Resource
1380
- # Manager API or the portal.
1381
- # @param server_name [String] The name of the server.
1382
- # @param database_name [String] The name of the database to import into
1383
- # @param parameters [ImportExtensionRequest] The required parameters for
1384
- # importing a Bacpac into a database.
1385
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1386
- # will be added to the HTTP request.
1387
- #
1388
- # @return [Concurrent::Promise] promise which provides async access to http
1389
- # response.
1390
- #
1391
- def create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1392
- # Send request
1393
- promise = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers)
1394
-
1395
- promise = promise.then do |response|
1396
- # Defining deserialization method.
1397
- deserialize_method = lambda do |parsed_response|
1398
- result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper()
1399
- parsed_response = @client.deserialize(result_mapper, parsed_response)
1400
- end
1401
-
1402
- # Waiting for response.
1403
- @client.get_long_running_operation_result(response, deserialize_method)
1404
- end
1405
-
1406
- promise
1407
- end
1408
-
1409
- #
1410
- # Exports a database to a bacpac.
1411
- #
1412
- # @param resource_group_name [String] The name of the resource group that
1413
- # contains the resource. You can obtain this value from the Azure Resource
1414
- # Manager API or the portal.
1415
- # @param server_name [String] The name of the server.
1416
- # @param database_name [String] The name of the database to be exported.
1417
- # @param parameters [ExportRequest] The required parameters for exporting a
1418
- # database.
1419
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1420
- # will be added to the HTTP request.
1421
- #
1422
- # @return [ImportExportResponse] operation results.
1423
- #
1424
- def export(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1425
- response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1426
- response.body unless response.nil?
1427
- end
1428
-
1429
- #
1430
- # @param resource_group_name [String] The name of the resource group that
1431
- # contains the resource. You can obtain this value from the Azure Resource
1432
- # Manager API or the portal.
1433
- # @param server_name [String] The name of the server.
1434
- # @param database_name [String] The name of the database to be exported.
1435
- # @param parameters [ExportRequest] The required parameters for exporting a
1436
- # database.
1437
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1438
- # will be added to the HTTP request.
1439
- #
1440
- # @return [Concurrent::Promise] promise which provides async access to http
1441
- # response.
1442
- #
1443
- def export_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1444
- # Send request
1445
- promise = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers)
1446
-
1447
- promise = promise.then do |response|
1448
- # Defining deserialization method.
1449
- deserialize_method = lambda do |parsed_response|
1450
- result_mapper = Azure::ARM::SQL::Models::ImportExportResponse.mapper()
1451
- parsed_response = @client.deserialize(result_mapper, parsed_response)
1452
- end
1453
-
1454
- # Waiting for response.
1455
- @client.get_long_running_operation_result(response, deserialize_method)
1456
- end
1457
-
1458
- promise
1459
- end
1460
-
1461
- #
1462
- # Returns database metrics.
1463
- #
1464
- # @param resource_group_name [String] The name of the resource group that
1465
- # contains the resource. You can obtain this value from the Azure Resource
1466
- # Manager API or the portal.
1467
- # @param server_name [String] The name of the server.
1468
- # @param database_name [String] The name of the database.
1469
- # @param filter [String] An OData filter expression that describes a subset of
1470
- # metrics to return.
1471
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1472
- # will be added to the HTTP request.
1473
- #
1474
- # @return [MetricListResult] operation results.
1475
- #
1476
- def list_metrics(resource_group_name, server_name, database_name, filter, custom_headers = nil)
1477
- response = list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers).value!
1478
- response.body unless response.nil?
1479
- end
1480
-
1481
- #
1482
- # Returns database metrics.
1483
- #
1484
- # @param resource_group_name [String] The name of the resource group that
1485
- # contains the resource. You can obtain this value from the Azure Resource
1486
- # Manager API or the portal.
1487
- # @param server_name [String] The name of the server.
1488
- # @param database_name [String] The name of the database.
1489
- # @param filter [String] An OData filter expression that describes a subset of
1490
- # metrics to return.
1491
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1492
- # will be added to the HTTP request.
1493
- #
1494
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1495
- #
1496
- def list_metrics_with_http_info(resource_group_name, server_name, database_name, filter, custom_headers = nil)
1497
- list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers).value!
1498
- end
1499
-
1500
- #
1501
- # Returns database metrics.
1502
- #
1503
- # @param resource_group_name [String] The name of the resource group that
1504
- # contains the resource. You can obtain this value from the Azure Resource
1505
- # Manager API or the portal.
1506
- # @param server_name [String] The name of the server.
1507
- # @param database_name [String] The name of the database.
1508
- # @param filter [String] An OData filter expression that describes a subset of
1509
- # metrics to return.
1510
- # @param [Hash{String => String}] A hash of custom headers that will be added
1511
- # to the HTTP request.
1512
- #
1513
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1514
- #
1515
- def list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers = nil)
1516
- api_version = '2014-04-01'
1517
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1518
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1519
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1520
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1521
- fail ArgumentError, 'filter is nil' if filter.nil?
1522
-
1523
-
1524
- request_headers = {}
1525
-
1526
- # Set Headers
1527
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1528
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1529
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'
1530
-
1531
- request_url = @base_url || @client.base_url
1532
-
1533
- options = {
1534
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1535
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1536
- query_params: {'api-version' => api_version,'$filter' => filter},
1537
- headers: request_headers.merge(custom_headers || {}),
1538
- base_url: request_url
1539
- }
1540
- promise = @client.make_request_async(:get, path_template, options)
1541
-
1542
- promise = promise.then do |result|
1543
- http_response = result.response
1544
- status_code = http_response.status
1545
- response_content = http_response.body
1546
- unless status_code == 200
1547
- error_model = JSON.load(response_content)
1548
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1549
- end
1550
-
1551
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1552
- # Deserialize Response
1553
- if status_code == 200
1554
- begin
1555
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1556
- result_mapper = Azure::ARM::SQL::Models::MetricListResult.mapper()
1557
- result.body = @client.deserialize(result_mapper, parsed_response)
1558
- rescue Exception => e
1559
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1560
- end
1561
- end
1562
-
1563
- result
1564
- end
1565
-
1566
- promise.execute
1567
- end
1568
-
1569
- #
1570
- # Returns database metric definitions.
1571
- #
1572
- # @param resource_group_name [String] The name of the resource group that
1573
- # contains the resource. You can obtain this value from the Azure Resource
1574
- # Manager API or the portal.
1575
- # @param server_name [String] The name of the server.
1576
- # @param database_name [String] The name of the database.
1577
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1578
- # will be added to the HTTP request.
1579
- #
1580
- # @return [MetricDefinitionListResult] operation results.
1581
- #
1582
- def list_metric_definitions(resource_group_name, server_name, database_name, custom_headers = nil)
1583
- response = list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers).value!
1584
- response.body unless response.nil?
1585
- end
1586
-
1587
- #
1588
- # Returns database metric definitions.
1589
- #
1590
- # @param resource_group_name [String] The name of the resource group that
1591
- # contains the resource. You can obtain this value from the Azure Resource
1592
- # Manager API or the portal.
1593
- # @param server_name [String] The name of the server.
1594
- # @param database_name [String] The name of the database.
1595
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1596
- # will be added to the HTTP request.
1597
- #
1598
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1599
- #
1600
- def list_metric_definitions_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
1601
- list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers).value!
1602
- end
1603
-
1604
- #
1605
- # Returns database metric definitions.
1606
- #
1607
- # @param resource_group_name [String] The name of the resource group that
1608
- # contains the resource. You can obtain this value from the Azure Resource
1609
- # Manager API or the portal.
1610
- # @param server_name [String] The name of the server.
1611
- # @param database_name [String] The name of the database.
1612
- # @param [Hash{String => String}] A hash of custom headers that will be added
1613
- # to the HTTP request.
1614
- #
1615
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1616
- #
1617
- def list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers = nil)
1618
- api_version = '2014-04-01'
1619
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1620
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1621
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1622
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1623
-
1624
-
1625
- request_headers = {}
1626
-
1627
- # Set Headers
1628
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1629
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1630
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'
1631
-
1632
- request_url = @base_url || @client.base_url
1633
-
1634
- options = {
1635
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1636
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1637
- query_params: {'api-version' => api_version},
1638
- headers: request_headers.merge(custom_headers || {}),
1639
- base_url: request_url
1640
- }
1641
- promise = @client.make_request_async(:get, path_template, options)
1642
-
1643
- promise = promise.then do |result|
1644
- http_response = result.response
1645
- status_code = http_response.status
1646
- response_content = http_response.body
1647
- unless status_code == 200
1648
- error_model = JSON.load(response_content)
1649
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1650
- end
1651
-
1652
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1653
- # Deserialize Response
1654
- if status_code == 200
1655
- begin
1656
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1657
- result_mapper = Azure::ARM::SQL::Models::MetricDefinitionListResult.mapper()
1658
- result.body = @client.deserialize(result_mapper, parsed_response)
1659
- rescue Exception => e
1660
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1661
- end
1662
- end
1663
-
1664
- result
1665
- end
1666
-
1667
- promise.execute
1668
- end
1669
-
1670
- #
1671
- # Deletes a database replication link. Cannot be done during failover.
1672
- #
1673
- # @param resource_group_name [String] The name of the resource group that
1674
- # contains the resource. You can obtain this value from the Azure Resource
1675
- # Manager API or the portal.
1676
- # @param server_name [String] The name of the server.
1677
- # @param database_name [String] The name of the database that has the
1678
- # replication link to be dropped.
1679
- # @param link_id [String] The ID of the replication link to be deleted.
1680
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1681
- # will be added to the HTTP request.
1682
- #
1683
- #
1684
- def delete_replication_link(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1685
- response = delete_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
1686
- nil
1687
- end
1688
-
1689
- #
1690
- # Deletes a database replication link. Cannot be done during failover.
1691
- #
1692
- # @param resource_group_name [String] The name of the resource group that
1693
- # contains the resource. You can obtain this value from the Azure Resource
1694
- # Manager API or the portal.
1695
- # @param server_name [String] The name of the server.
1696
- # @param database_name [String] The name of the database that has the
1697
- # replication link to be dropped.
1698
- # @param link_id [String] The ID of the replication link to be deleted.
1699
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1700
- # will be added to the HTTP request.
1701
- #
1702
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1703
- #
1704
- def delete_replication_link_with_http_info(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1705
- delete_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
1706
- end
1707
-
1708
- #
1709
- # Deletes a database replication link. Cannot be done during failover.
1710
- #
1711
- # @param resource_group_name [String] The name of the resource group that
1712
- # contains the resource. You can obtain this value from the Azure Resource
1713
- # Manager API or the portal.
1714
- # @param server_name [String] The name of the server.
1715
- # @param database_name [String] The name of the database that has the
1716
- # replication link to be dropped.
1717
- # @param link_id [String] The ID of the replication link to be deleted.
1718
- # @param [Hash{String => String}] A hash of custom headers that will be added
1719
- # to the HTTP request.
1720
- #
1721
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1722
- #
1723
- def delete_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1724
- api_version = '2014-04-01'
1725
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1726
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1727
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1728
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1729
- fail ArgumentError, 'link_id is nil' if link_id.nil?
1730
-
1731
-
1732
- request_headers = {}
1733
-
1734
- # Set Headers
1735
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1736
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1737
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'
1738
-
1739
- request_url = @base_url || @client.base_url
1740
-
1741
- options = {
1742
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1743
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'linkId' => link_id},
1744
- query_params: {'api-version' => api_version},
1745
- headers: request_headers.merge(custom_headers || {}),
1746
- base_url: request_url
1747
- }
1748
- promise = @client.make_request_async(:delete, path_template, options)
1749
-
1750
- promise = promise.then do |result|
1751
- http_response = result.response
1752
- status_code = http_response.status
1753
- response_content = http_response.body
1754
- unless status_code == 200 || status_code == 204
1755
- error_model = JSON.load(response_content)
1756
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1757
- end
1758
-
1759
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1760
-
1761
- result
1762
- end
1763
-
1764
- promise.execute
1765
- end
1766
-
1767
- #
1768
- # Gets a database replication link.
1769
- #
1770
- # @param resource_group_name [String] The name of the resource group that
1771
- # contains the resource. You can obtain this value from the Azure Resource
1772
- # Manager API or the portal.
1773
- # @param server_name [String] The name of the server.
1774
- # @param database_name [String] The name of the database to get the link for.
1775
- # @param link_id [String] The replication link ID to be retrieved.
1776
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1777
- # will be added to the HTTP request.
1778
- #
1779
- # @return [ReplicationLink] operation results.
1780
- #
1781
- def get_replication_link(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1782
- response = get_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
1783
- response.body unless response.nil?
1784
- end
1785
-
1786
- #
1787
- # Gets a database replication link.
1788
- #
1789
- # @param resource_group_name [String] The name of the resource group that
1790
- # contains the resource. You can obtain this value from the Azure Resource
1791
- # Manager API or the portal.
1792
- # @param server_name [String] The name of the server.
1793
- # @param database_name [String] The name of the database to get the link for.
1794
- # @param link_id [String] The replication link ID to be retrieved.
1795
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1796
- # will be added to the HTTP request.
1797
- #
1798
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1799
- #
1800
- def get_replication_link_with_http_info(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1801
- get_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
1802
- end
1803
-
1804
- #
1805
- # Gets a database replication link.
1806
- #
1807
- # @param resource_group_name [String] The name of the resource group that
1808
- # contains the resource. You can obtain this value from the Azure Resource
1809
- # Manager API or the portal.
1810
- # @param server_name [String] The name of the server.
1811
- # @param database_name [String] The name of the database to get the link for.
1812
- # @param link_id [String] The replication link ID to be retrieved.
1813
- # @param [Hash{String => String}] A hash of custom headers that will be added
1814
- # to the HTTP request.
1815
- #
1816
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1817
- #
1818
- def get_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1819
- api_version = '2014-04-01'
1820
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1821
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1822
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1823
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1824
- fail ArgumentError, 'link_id is nil' if link_id.nil?
1825
-
1826
-
1827
- request_headers = {}
1828
-
1829
- # Set Headers
1830
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1831
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1832
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'
1833
-
1834
- request_url = @base_url || @client.base_url
1835
-
1836
- options = {
1837
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1838
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'linkId' => link_id},
1839
- query_params: {'api-version' => api_version},
1840
- headers: request_headers.merge(custom_headers || {}),
1841
- base_url: request_url
1842
- }
1843
- promise = @client.make_request_async(:get, path_template, options)
1844
-
1845
- promise = promise.then do |result|
1846
- http_response = result.response
1847
- status_code = http_response.status
1848
- response_content = http_response.body
1849
- unless status_code == 200
1850
- error_model = JSON.load(response_content)
1851
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1852
- end
1853
-
1854
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1855
- # Deserialize Response
1856
- if status_code == 200
1857
- begin
1858
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1859
- result_mapper = Azure::ARM::SQL::Models::ReplicationLink.mapper()
1860
- result.body = @client.deserialize(result_mapper, parsed_response)
1861
- rescue Exception => e
1862
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1863
- end
1864
- end
1865
-
1866
- result
1867
- end
1868
-
1869
- promise.execute
1870
- end
1871
-
1872
- #
1873
- # Sets which replica database is primary by failing over from the current
1874
- # primary replica database.
1875
- #
1876
- # @param resource_group_name [String] The name of the resource group that
1877
- # contains the resource. You can obtain this value from the Azure Resource
1878
- # Manager API or the portal.
1879
- # @param server_name [String] The name of the server.
1880
- # @param database_name [String] The name of the database that has the
1881
- # replication link to be failed over.
1882
- # @param link_id [String] The ID of the replication link to be failed over.
1883
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1884
- # will be added to the HTTP request.
1885
- #
1886
- def failover_replication_link(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1887
- response = failover_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
1888
- nil
1889
- end
1890
-
1891
- #
1892
- # @param resource_group_name [String] The name of the resource group that
1893
- # contains the resource. You can obtain this value from the Azure Resource
1894
- # Manager API or the portal.
1895
- # @param server_name [String] The name of the server.
1896
- # @param database_name [String] The name of the database that has the
1897
- # replication link to be failed over.
1898
- # @param link_id [String] The ID of the replication link to be failed over.
1899
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1900
- # will be added to the HTTP request.
1901
- #
1902
- # @return [Concurrent::Promise] promise which provides async access to http
1903
- # response.
1904
- #
1905
- def failover_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1906
- # Send request
1907
- promise = begin_failover_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers)
1908
-
1909
- promise = promise.then do |response|
1910
- # Defining deserialization method.
1911
- deserialize_method = lambda do |parsed_response|
1912
- end
1913
-
1914
- # Waiting for response.
1915
- @client.get_long_running_operation_result(response, deserialize_method)
1916
- end
1917
-
1918
- promise
1919
- end
1920
-
1921
- #
1922
- # Sets which replica database is primary by failing over from the current
1923
- # primary replica database. This operation might result in data loss.
1924
- #
1925
- # @param resource_group_name [String] The name of the resource group that
1926
- # contains the resource. You can obtain this value from the Azure Resource
1927
- # Manager API or the portal.
1928
- # @param server_name [String] The name of the server.
1929
- # @param database_name [String] The name of the database that has the
1930
- # replication link to be failed over.
1931
- # @param link_id [String] The ID of the replication link to be failed over.
1932
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1933
- # will be added to the HTTP request.
1934
- #
1935
- def failover_replication_link_allow_data_loss(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1936
- response = failover_replication_link_allow_data_loss_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
1937
- nil
1938
- end
1939
-
1940
- #
1941
- # @param resource_group_name [String] The name of the resource group that
1942
- # contains the resource. You can obtain this value from the Azure Resource
1943
- # Manager API or the portal.
1944
- # @param server_name [String] The name of the server.
1945
- # @param database_name [String] The name of the database that has the
1946
- # replication link to be failed over.
1947
- # @param link_id [String] The ID of the replication link to be failed over.
1948
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1949
- # will be added to the HTTP request.
1950
- #
1951
- # @return [Concurrent::Promise] promise which provides async access to http
1952
- # response.
1953
- #
1954
- def failover_replication_link_allow_data_loss_async(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
1955
- # Send request
1956
- promise = begin_failover_replication_link_allow_data_loss_async(resource_group_name, server_name, database_name, link_id, custom_headers)
1957
-
1958
- promise = promise.then do |response|
1959
- # Defining deserialization method.
1960
- deserialize_method = lambda do |parsed_response|
1961
- end
1962
-
1963
- # Waiting for response.
1964
- @client.get_long_running_operation_result(response, deserialize_method)
1965
- end
1966
-
1967
- promise
1968
- end
1969
-
1970
- #
1971
- # Lists a database's replication links.
1972
- #
1973
- # @param resource_group_name [String] The name of the resource group that
1974
- # contains the resource. You can obtain this value from the Azure Resource
1975
- # Manager API or the portal.
1976
- # @param server_name [String] The name of the server.
1977
- # @param database_name [String] The name of the database to retrieve links for.
1978
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1979
- # will be added to the HTTP request.
1980
- #
1981
- # @return [ReplicationLinkListResult] operation results.
1982
- #
1983
- def list_replication_links(resource_group_name, server_name, database_name, custom_headers = nil)
1984
- response = list_replication_links_async(resource_group_name, server_name, database_name, custom_headers).value!
1985
- response.body unless response.nil?
1986
- end
1987
-
1988
- #
1989
- # Lists a database's replication links.
1990
- #
1991
- # @param resource_group_name [String] The name of the resource group that
1992
- # contains the resource. You can obtain this value from the Azure Resource
1993
- # Manager API or the portal.
1994
- # @param server_name [String] The name of the server.
1995
- # @param database_name [String] The name of the database to retrieve links for.
1996
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1997
- # will be added to the HTTP request.
1998
- #
1999
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2000
- #
2001
- def list_replication_links_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
2002
- list_replication_links_async(resource_group_name, server_name, database_name, custom_headers).value!
2003
- end
2004
-
2005
- #
2006
- # Lists a database's replication links.
2007
- #
2008
- # @param resource_group_name [String] The name of the resource group that
2009
- # contains the resource. You can obtain this value from the Azure Resource
2010
- # Manager API or the portal.
2011
- # @param server_name [String] The name of the server.
2012
- # @param database_name [String] The name of the database to retrieve links for.
2013
- # @param [Hash{String => String}] A hash of custom headers that will be added
2014
- # to the HTTP request.
2015
- #
2016
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2017
- #
2018
- def list_replication_links_async(resource_group_name, server_name, database_name, custom_headers = nil)
2019
- api_version = '2014-04-01'
2020
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2021
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2022
- fail ArgumentError, 'server_name is nil' if server_name.nil?
2023
- fail ArgumentError, 'database_name is nil' if database_name.nil?
2024
-
2025
-
2026
- request_headers = {}
2027
-
2028
- # Set Headers
2029
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2030
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2031
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks'
2032
-
2033
- request_url = @base_url || @client.base_url
2034
-
2035
- options = {
2036
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2037
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
2038
- query_params: {'api-version' => api_version},
2039
- headers: request_headers.merge(custom_headers || {}),
2040
- base_url: request_url
2041
- }
2042
- promise = @client.make_request_async(:get, path_template, options)
2043
-
2044
- promise = promise.then do |result|
2045
- http_response = result.response
2046
- status_code = http_response.status
2047
- response_content = http_response.body
2048
- unless status_code == 200
2049
- error_model = JSON.load(response_content)
2050
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2051
- end
2052
-
2053
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2054
- # Deserialize Response
2055
- if status_code == 200
2056
- begin
2057
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2058
- result_mapper = Azure::ARM::SQL::Models::ReplicationLinkListResult.mapper()
2059
- result.body = @client.deserialize(result_mapper, parsed_response)
2060
- rescue Exception => e
2061
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2062
- end
2063
- end
2064
-
2065
- result
2066
- end
2067
-
2068
- promise.execute
2069
- end
2070
-
2071
- #
2072
- # Pauses a data warehouse.
2073
- #
2074
- # @param resource_group_name [String] The name of the resource group that
2075
- # contains the resource. You can obtain this value from the Azure Resource
2076
- # Manager API or the portal.
2077
- # @param server_name [String] The name of the server.
2078
- # @param database_name [String] The name of the data warehouse to pause.
2079
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2080
- # will be added to the HTTP request.
2081
- #
2082
- def pause(resource_group_name, server_name, database_name, custom_headers = nil)
2083
- response = pause_async(resource_group_name, server_name, database_name, custom_headers).value!
2084
- nil
2085
- end
2086
-
2087
- #
2088
- # @param resource_group_name [String] The name of the resource group that
2089
- # contains the resource. You can obtain this value from the Azure Resource
2090
- # Manager API or the portal.
2091
- # @param server_name [String] The name of the server.
2092
- # @param database_name [String] The name of the data warehouse to pause.
2093
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2094
- # will be added to the HTTP request.
2095
- #
2096
- # @return [Concurrent::Promise] promise which provides async access to http
2097
- # response.
2098
- #
2099
- def pause_async(resource_group_name, server_name, database_name, custom_headers = nil)
2100
- # Send request
2101
- promise = begin_pause_async(resource_group_name, server_name, database_name, custom_headers)
2102
-
2103
- promise = promise.then do |response|
2104
- # Defining deserialization method.
2105
- deserialize_method = lambda do |parsed_response|
2106
- end
2107
-
2108
- # Waiting for response.
2109
- @client.get_long_running_operation_result(response, deserialize_method)
2110
- end
2111
-
2112
- promise
2113
- end
2114
-
2115
- #
2116
- # Resumes a data warehouse.
2117
- #
2118
- # @param resource_group_name [String] The name of the resource group that
2119
- # contains the resource. You can obtain this value from the Azure Resource
2120
- # Manager API or the portal.
2121
- # @param server_name [String] The name of the server.
2122
- # @param database_name [String] The name of the data warehouse to resume.
2123
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2124
- # will be added to the HTTP request.
2125
- #
2126
- def resume(resource_group_name, server_name, database_name, custom_headers = nil)
2127
- response = resume_async(resource_group_name, server_name, database_name, custom_headers).value!
2128
- nil
2129
- end
2130
-
2131
- #
2132
- # @param resource_group_name [String] The name of the resource group that
2133
- # contains the resource. You can obtain this value from the Azure Resource
2134
- # Manager API or the portal.
2135
- # @param server_name [String] The name of the server.
2136
- # @param database_name [String] The name of the data warehouse to resume.
2137
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2138
- # will be added to the HTTP request.
2139
- #
2140
- # @return [Concurrent::Promise] promise which provides async access to http
2141
- # response.
2142
- #
2143
- def resume_async(resource_group_name, server_name, database_name, custom_headers = nil)
2144
- # Send request
2145
- promise = begin_resume_async(resource_group_name, server_name, database_name, custom_headers)
2146
-
2147
- promise = promise.then do |response|
2148
- # Defining deserialization method.
2149
- deserialize_method = lambda do |parsed_response|
2150
- end
2151
-
2152
- # Waiting for response.
2153
- @client.get_long_running_operation_result(response, deserialize_method)
2154
- end
2155
-
2156
- promise
2157
- end
2158
-
2159
- #
2160
- # Creates a new database or updates an existing database.
2161
- #
2162
- # @param resource_group_name [String] The name of the resource group that
2163
- # contains the resource. You can obtain this value from the Azure Resource
2164
- # Manager API or the portal.
2165
- # @param server_name [String] The name of the server.
2166
- # @param database_name [String] The name of the database to be operated on
2167
- # (updated or created).
2168
- # @param parameters [Database] The required parameters for creating or updating
2169
- # a database.
2170
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2171
- # will be added to the HTTP request.
2172
- #
2173
- # @return [Database] operation results.
2174
- #
2175
- def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2176
- response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
2177
- response.body unless response.nil?
2178
- end
2179
-
2180
- #
2181
- # @param resource_group_name [String] The name of the resource group that
2182
- # contains the resource. You can obtain this value from the Azure Resource
2183
- # Manager API or the portal.
2184
- # @param server_name [String] The name of the server.
2185
- # @param database_name [String] The name of the database to be operated on
2186
- # (updated or created).
2187
- # @param parameters [Database] The required parameters for creating or updating
2188
- # a database.
2189
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2190
- # will be added to the HTTP request.
2191
- #
2192
- # @return [Concurrent::Promise] promise which provides async access to http
2193
- # response.
2194
- #
2195
- def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2196
- # Send request
2197
- promise = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers)
2198
-
2199
- promise = promise.then do |response|
2200
- # Defining deserialization method.
2201
- deserialize_method = lambda do |parsed_response|
2202
- result_mapper = Azure::ARM::SQL::Models::Database.mapper()
2203
- parsed_response = @client.deserialize(result_mapper, parsed_response)
2204
- end
2205
-
2206
- # Waiting for response.
2207
- @client.get_long_running_operation_result(response, deserialize_method)
2208
- end
2209
-
2210
- promise
2211
- end
2212
-
2213
- #
2214
- # Updates an existing database.
2215
- #
2216
- # @param resource_group_name [String] The name of the resource group that
2217
- # contains the resource. You can obtain this value from the Azure Resource
2218
- # Manager API or the portal.
2219
- # @param server_name [String] The name of the server.
2220
- # @param database_name [String] The name of the database to be updated.
2221
- # @param parameters [DatabaseUpdate] The required parameters for updating a
2222
- # database.
2223
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2224
- # will be added to the HTTP request.
2225
- #
2226
- # @return [Database] operation results.
2227
- #
2228
- def update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2229
- response = update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
2230
- response.body unless response.nil?
2231
- end
2232
-
2233
- #
2234
- # @param resource_group_name [String] The name of the resource group that
2235
- # contains the resource. You can obtain this value from the Azure Resource
2236
- # Manager API or the portal.
2237
- # @param server_name [String] The name of the server.
2238
- # @param database_name [String] The name of the database to be updated.
2239
- # @param parameters [DatabaseUpdate] The required parameters for updating a
2240
- # database.
2241
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2242
- # will be added to the HTTP request.
2243
- #
2244
- # @return [Concurrent::Promise] promise which provides async access to http
2245
- # response.
2246
- #
2247
- def update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2248
- # Send request
2249
- promise = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers)
2250
-
2251
- promise = promise.then do |response|
2252
- # Defining deserialization method.
2253
- deserialize_method = lambda do |parsed_response|
2254
- result_mapper = Azure::ARM::SQL::Models::Database.mapper()
2255
- parsed_response = @client.deserialize(result_mapper, parsed_response)
2256
- end
2257
-
2258
- # Waiting for response.
2259
- @client.get_long_running_operation_result(response, deserialize_method)
2260
- end
2261
-
2262
- promise
2263
- end
2264
-
2265
- #
2266
- # Deletes a database.
2267
- #
2268
- # @param resource_group_name [String] The name of the resource group that
2269
- # contains the resource. You can obtain this value from the Azure Resource
2270
- # Manager API or the portal.
2271
- # @param server_name [String] The name of the server.
2272
- # @param database_name [String] The name of the database to be deleted.
2273
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2274
- # will be added to the HTTP request.
2275
- #
2276
- #
2277
- def delete(resource_group_name, server_name, database_name, custom_headers = nil)
2278
- response = delete_async(resource_group_name, server_name, database_name, custom_headers).value!
2279
- nil
2280
- end
2281
-
2282
- #
2283
- # Deletes a database.
2284
- #
2285
- # @param resource_group_name [String] The name of the resource group that
2286
- # contains the resource. You can obtain this value from the Azure Resource
2287
- # Manager API or the portal.
2288
- # @param server_name [String] The name of the server.
2289
- # @param database_name [String] The name of the database to be deleted.
2290
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2291
- # will be added to the HTTP request.
2292
- #
2293
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2294
- #
2295
- def delete_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
2296
- delete_async(resource_group_name, server_name, database_name, custom_headers).value!
2297
- end
2298
-
2299
- #
2300
- # Deletes a database.
2301
- #
2302
- # @param resource_group_name [String] The name of the resource group that
2303
- # contains the resource. You can obtain this value from the Azure Resource
2304
- # Manager API or the portal.
2305
- # @param server_name [String] The name of the server.
2306
- # @param database_name [String] The name of the database to be deleted.
2307
- # @param [Hash{String => String}] A hash of custom headers that will be added
2308
- # to the HTTP request.
2309
- #
2310
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2311
- #
2312
- def delete_async(resource_group_name, server_name, database_name, custom_headers = nil)
2313
- api_version = '2014-04-01'
2314
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2315
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2316
- fail ArgumentError, 'server_name is nil' if server_name.nil?
2317
- fail ArgumentError, 'database_name is nil' if database_name.nil?
2318
-
2319
-
2320
- request_headers = {}
2321
-
2322
- # Set Headers
2323
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2324
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2325
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
2326
-
2327
- request_url = @base_url || @client.base_url
2328
-
2329
- options = {
2330
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2331
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
2332
- query_params: {'api-version' => api_version},
2333
- headers: request_headers.merge(custom_headers || {}),
2334
- base_url: request_url
2335
- }
2336
- promise = @client.make_request_async(:delete, path_template, options)
2337
-
2338
- promise = promise.then do |result|
2339
- http_response = result.response
2340
- status_code = http_response.status
2341
- response_content = http_response.body
2342
- unless status_code == 200 || status_code == 204
2343
- error_model = JSON.load(response_content)
2344
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2345
- end
2346
-
2347
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2348
-
2349
- result
2350
- end
2351
-
2352
- promise.execute
2353
- end
2354
-
2355
- #
2356
- # Gets a database.
2357
- #
2358
- # @param resource_group_name [String] The name of the resource group that
2359
- # contains the resource. You can obtain this value from the Azure Resource
2360
- # Manager API or the portal.
2361
- # @param server_name [String] The name of the server.
2362
- # @param database_name [String] The name of the database to be retrieved.
2363
- # @param expand [String] A comma separated list of child objects to expand in
2364
- # the response. Possible properties: serviceTierAdvisors,
2365
- # transparentDataEncryption.
2366
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2367
- # will be added to the HTTP request.
2368
- #
2369
- # @return [Database] operation results.
2370
- #
2371
- def get(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
2372
- response = get_async(resource_group_name, server_name, database_name, expand, custom_headers).value!
2373
- response.body unless response.nil?
2374
- end
2375
-
2376
- #
2377
- # Gets a database.
2378
- #
2379
- # @param resource_group_name [String] The name of the resource group that
2380
- # contains the resource. You can obtain this value from the Azure Resource
2381
- # Manager API or the portal.
2382
- # @param server_name [String] The name of the server.
2383
- # @param database_name [String] The name of the database to be retrieved.
2384
- # @param expand [String] A comma separated list of child objects to expand in
2385
- # the response. Possible properties: serviceTierAdvisors,
2386
- # transparentDataEncryption.
2387
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2388
- # will be added to the HTTP request.
2389
- #
2390
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2391
- #
2392
- def get_with_http_info(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
2393
- get_async(resource_group_name, server_name, database_name, expand, custom_headers).value!
2394
- end
2395
-
2396
- #
2397
- # Gets a database.
2398
- #
2399
- # @param resource_group_name [String] The name of the resource group that
2400
- # contains the resource. You can obtain this value from the Azure Resource
2401
- # Manager API or the portal.
2402
- # @param server_name [String] The name of the server.
2403
- # @param database_name [String] The name of the database to be retrieved.
2404
- # @param expand [String] A comma separated list of child objects to expand in
2405
- # the response. Possible properties: serviceTierAdvisors,
2406
- # transparentDataEncryption.
2407
- # @param [Hash{String => String}] A hash of custom headers that will be added
2408
- # to the HTTP request.
2409
- #
2410
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2411
- #
2412
- def get_async(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
2413
- api_version = '2014-04-01'
2414
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2415
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2416
- fail ArgumentError, 'server_name is nil' if server_name.nil?
2417
- fail ArgumentError, 'database_name is nil' if database_name.nil?
2418
-
2419
-
2420
- request_headers = {}
2421
-
2422
- # Set Headers
2423
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2424
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2425
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
2426
-
2427
- request_url = @base_url || @client.base_url
2428
-
2429
- options = {
2430
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2431
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
2432
- query_params: {'api-version' => api_version,'$expand' => expand},
2433
- headers: request_headers.merge(custom_headers || {}),
2434
- base_url: request_url
2435
- }
2436
- promise = @client.make_request_async(:get, path_template, options)
2437
-
2438
- promise = promise.then do |result|
2439
- http_response = result.response
2440
- status_code = http_response.status
2441
- response_content = http_response.body
2442
- unless status_code == 200
2443
- error_model = JSON.load(response_content)
2444
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2445
- end
2446
-
2447
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2448
- # Deserialize Response
2449
- if status_code == 200
2450
- begin
2451
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2452
- result_mapper = Azure::ARM::SQL::Models::Database.mapper()
2453
- result.body = @client.deserialize(result_mapper, parsed_response)
2454
- rescue Exception => e
2455
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2456
- end
2457
- end
2458
-
2459
- result
2460
- end
2461
-
2462
- promise.execute
2463
- end
2464
-
2465
- #
2466
- # Returns a list of databases in a server.
2467
- #
2468
- # @param resource_group_name [String] The name of the resource group that
2469
- # contains the resource. You can obtain this value from the Azure Resource
2470
- # Manager API or the portal.
2471
- # @param server_name [String] The name of the server.
2472
- # @param expand [String] A comma separated list of child objects to expand in
2473
- # the response. Possible properties: serviceTierAdvisors,
2474
- # transparentDataEncryption.
2475
- # @param filter [String] An OData filter expression that describes a subset of
2476
- # databases to return.
2477
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2478
- # will be added to the HTTP request.
2479
- #
2480
- # @return [DatabaseListResult] operation results.
2481
- #
2482
- def list_by_server(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
2483
- response = list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value!
2484
- response.body unless response.nil?
2485
- end
2486
-
2487
- #
2488
- # Returns a list of databases in a server.
2489
- #
2490
- # @param resource_group_name [String] The name of the resource group that
2491
- # contains the resource. You can obtain this value from the Azure Resource
2492
- # Manager API or the portal.
2493
- # @param server_name [String] The name of the server.
2494
- # @param expand [String] A comma separated list of child objects to expand in
2495
- # the response. Possible properties: serviceTierAdvisors,
2496
- # transparentDataEncryption.
2497
- # @param filter [String] An OData filter expression that describes a subset of
2498
- # databases to return.
2499
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2500
- # will be added to the HTTP request.
2501
- #
2502
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2503
- #
2504
- def list_by_server_with_http_info(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
2505
- list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value!
2506
- end
2507
-
2508
- #
2509
- # Returns a list of databases in a server.
2510
- #
2511
- # @param resource_group_name [String] The name of the resource group that
2512
- # contains the resource. You can obtain this value from the Azure Resource
2513
- # Manager API or the portal.
2514
- # @param server_name [String] The name of the server.
2515
- # @param expand [String] A comma separated list of child objects to expand in
2516
- # the response. Possible properties: serviceTierAdvisors,
2517
- # transparentDataEncryption.
2518
- # @param filter [String] An OData filter expression that describes a subset of
2519
- # databases to return.
2520
- # @param [Hash{String => String}] A hash of custom headers that will be added
2521
- # to the HTTP request.
2522
- #
2523
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2524
- #
2525
- def list_by_server_async(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
2526
- api_version = '2014-04-01'
2527
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2528
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2529
- fail ArgumentError, 'server_name is nil' if server_name.nil?
2530
-
2531
-
2532
- request_headers = {}
2533
-
2534
- # Set Headers
2535
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2536
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2537
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'
2538
-
2539
- request_url = @base_url || @client.base_url
2540
-
2541
- options = {
2542
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2543
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
2544
- query_params: {'api-version' => api_version,'$expand' => expand,'$filter' => filter},
2545
- headers: request_headers.merge(custom_headers || {}),
2546
- base_url: request_url
2547
- }
2548
- promise = @client.make_request_async(:get, path_template, options)
2549
-
2550
- promise = promise.then do |result|
2551
- http_response = result.response
2552
- status_code = http_response.status
2553
- response_content = http_response.body
2554
- unless status_code == 200
2555
- error_model = JSON.load(response_content)
2556
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2557
- end
419
+ def pause_async(resource_group_name, server_name, database_name, custom_headers = nil)
420
+ # Send request
421
+ promise = begin_pause_async(resource_group_name, server_name, database_name, custom_headers)
2558
422
 
2559
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2560
- # Deserialize Response
2561
- if status_code == 200
2562
- begin
2563
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2564
- result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper()
2565
- result.body = @client.deserialize(result_mapper, parsed_response)
2566
- rescue Exception => e
2567
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2568
- end
423
+ promise = promise.then do |response|
424
+ # Defining deserialization method.
425
+ deserialize_method = lambda do |parsed_response|
2569
426
  end
2570
427
 
2571
- result
428
+ # Waiting for response.
429
+ @client.get_long_running_operation_result(response, deserialize_method)
2572
430
  end
2573
431
 
2574
- promise.execute
432
+ promise
2575
433
  end
2576
434
 
2577
435
  #
2578
- # Gets a service tier advisor.
436
+ # Resumes a data warehouse.
2579
437
  #
2580
438
  # @param resource_group_name [String] The name of the resource group that
2581
439
  # contains the resource. You can obtain this value from the Azure Resource
2582
440
  # Manager API or the portal.
2583
441
  # @param server_name [String] The name of the server.
2584
- # @param database_name [String] The name of database.
2585
- # @param service_tier_advisor_name [String] The name of service tier advisor.
442
+ # @param database_name [String] The name of the data warehouse to resume.
2586
443
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2587
444
  # will be added to the HTTP request.
2588
445
  #
2589
- # @return [ServiceTierAdvisor] operation results.
2590
- #
2591
- def get_service_tier_advisor(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers = nil)
2592
- response = get_service_tier_advisor_async(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers).value!
2593
- response.body unless response.nil?
446
+ def resume(resource_group_name, server_name, database_name, custom_headers = nil)
447
+ response = resume_async(resource_group_name, server_name, database_name, custom_headers).value!
448
+ nil
2594
449
  end
2595
450
 
2596
- #
2597
- # Gets a service tier advisor.
2598
451
  #
2599
452
  # @param resource_group_name [String] The name of the resource group that
2600
453
  # contains the resource. You can obtain this value from the Azure Resource
2601
454
  # Manager API or the portal.
2602
455
  # @param server_name [String] The name of the server.
2603
- # @param database_name [String] The name of database.
2604
- # @param service_tier_advisor_name [String] The name of service tier advisor.
456
+ # @param database_name [String] The name of the data warehouse to resume.
2605
457
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2606
458
  # will be added to the HTTP request.
2607
459
  #
2608
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
460
+ # @return [Concurrent::Promise] promise which provides async access to http
461
+ # response.
2609
462
  #
2610
- def get_service_tier_advisor_with_http_info(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers = nil)
2611
- get_service_tier_advisor_async(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers).value!
463
+ def resume_async(resource_group_name, server_name, database_name, custom_headers = nil)
464
+ # Send request
465
+ promise = begin_resume_async(resource_group_name, server_name, database_name, custom_headers)
466
+
467
+ promise = promise.then do |response|
468
+ # Defining deserialization method.
469
+ deserialize_method = lambda do |parsed_response|
470
+ end
471
+
472
+ # Waiting for response.
473
+ @client.get_long_running_operation_result(response, deserialize_method)
474
+ end
475
+
476
+ promise
2612
477
  end
2613
478
 
2614
479
  #
2615
- # Gets a service tier advisor.
480
+ # Creates a new database or updates an existing database.
2616
481
  #
2617
482
  # @param resource_group_name [String] The name of the resource group that
2618
483
  # contains the resource. You can obtain this value from the Azure Resource
2619
484
  # Manager API or the portal.
2620
485
  # @param server_name [String] The name of the server.
2621
- # @param database_name [String] The name of database.
2622
- # @param service_tier_advisor_name [String] The name of service tier advisor.
2623
- # @param [Hash{String => String}] A hash of custom headers that will be added
2624
- # to the HTTP request.
486
+ # @param database_name [String] The name of the database to be operated on
487
+ # (updated or created).
488
+ # @param parameters [Database] The required parameters for creating or updating
489
+ # a database.
490
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
491
+ # will be added to the HTTP request.
2625
492
  #
2626
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
493
+ # @return [Database] operation results.
2627
494
  #
2628
- def get_service_tier_advisor_async(resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers = nil)
2629
- api_version = '2014-04-01'
2630
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2631
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2632
- fail ArgumentError, 'server_name is nil' if server_name.nil?
2633
- fail ArgumentError, 'database_name is nil' if database_name.nil?
2634
- fail ArgumentError, 'service_tier_advisor_name is nil' if service_tier_advisor_name.nil?
2635
-
2636
-
2637
- request_headers = {}
2638
-
2639
- # Set Headers
2640
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2641
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2642
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}'
2643
-
2644
- request_url = @base_url || @client.base_url
2645
-
2646
- options = {
2647
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2648
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'serviceTierAdvisorName' => service_tier_advisor_name},
2649
- query_params: {'api-version' => api_version},
2650
- headers: request_headers.merge(custom_headers || {}),
2651
- base_url: request_url
2652
- }
2653
- promise = @client.make_request_async(:get, path_template, options)
2654
-
2655
- promise = promise.then do |result|
2656
- http_response = result.response
2657
- status_code = http_response.status
2658
- response_content = http_response.body
2659
- unless status_code == 200
2660
- error_model = JSON.load(response_content)
2661
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2662
- end
2663
-
2664
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2665
- # Deserialize Response
2666
- if status_code == 200
2667
- begin
2668
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2669
- result_mapper = Azure::ARM::SQL::Models::ServiceTierAdvisor.mapper()
2670
- result.body = @client.deserialize(result_mapper, parsed_response)
2671
- rescue Exception => e
2672
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2673
- end
2674
- end
2675
-
2676
- result
2677
- end
2678
-
2679
- promise.execute
495
+ def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
496
+ response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
497
+ response.body unless response.nil?
2680
498
  end
2681
499
 
2682
- #
2683
- # Returns service tier advisors for specified database.
2684
500
  #
2685
501
  # @param resource_group_name [String] The name of the resource group that
2686
502
  # contains the resource. You can obtain this value from the Azure Resource
2687
503
  # Manager API or the portal.
2688
504
  # @param server_name [String] The name of the server.
2689
- # @param database_name [String] The name of database.
505
+ # @param database_name [String] The name of the database to be operated on
506
+ # (updated or created).
507
+ # @param parameters [Database] The required parameters for creating or updating
508
+ # a database.
2690
509
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2691
510
  # will be added to the HTTP request.
2692
511
  #
2693
- # @return [ServiceTierAdvisorListResult] operation results.
512
+ # @return [Concurrent::Promise] promise which provides async access to http
513
+ # response.
2694
514
  #
2695
- def list_service_tier_advisors(resource_group_name, server_name, database_name, custom_headers = nil)
2696
- response = list_service_tier_advisors_async(resource_group_name, server_name, database_name, custom_headers).value!
2697
- response.body unless response.nil?
515
+ def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
516
+ # Send request
517
+ promise = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers)
518
+
519
+ promise = promise.then do |response|
520
+ # Defining deserialization method.
521
+ deserialize_method = lambda do |parsed_response|
522
+ result_mapper = Azure::ARM::SQL::Models::Database.mapper()
523
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
524
+ end
525
+
526
+ # Waiting for response.
527
+ @client.get_long_running_operation_result(response, deserialize_method)
528
+ end
529
+
530
+ promise
2698
531
  end
2699
532
 
2700
533
  #
2701
- # Returns service tier advisors for specified database.
534
+ # Updates an existing database.
2702
535
  #
2703
536
  # @param resource_group_name [String] The name of the resource group that
2704
537
  # contains the resource. You can obtain this value from the Azure Resource
2705
538
  # Manager API or the portal.
2706
539
  # @param server_name [String] The name of the server.
2707
- # @param database_name [String] The name of database.
540
+ # @param database_name [String] The name of the database to be updated.
541
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
542
+ # database.
2708
543
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2709
544
  # will be added to the HTTP request.
2710
545
  #
2711
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
546
+ # @return [Database] operation results.
2712
547
  #
2713
- def list_service_tier_advisors_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
2714
- list_service_tier_advisors_async(resource_group_name, server_name, database_name, custom_headers).value!
548
+ def update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
549
+ response = update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
550
+ response.body unless response.nil?
2715
551
  end
2716
552
 
2717
- #
2718
- # Returns service tier advisors for specified database.
2719
553
  #
2720
554
  # @param resource_group_name [String] The name of the resource group that
2721
555
  # contains the resource. You can obtain this value from the Azure Resource
2722
556
  # Manager API or the portal.
2723
557
  # @param server_name [String] The name of the server.
2724
- # @param database_name [String] The name of database.
2725
- # @param [Hash{String => String}] A hash of custom headers that will be added
2726
- # to the HTTP request.
558
+ # @param database_name [String] The name of the database to be updated.
559
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
560
+ # database.
561
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
562
+ # will be added to the HTTP request.
2727
563
  #
2728
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
564
+ # @return [Concurrent::Promise] promise which provides async access to http
565
+ # response.
2729
566
  #
2730
- def list_service_tier_advisors_async(resource_group_name, server_name, database_name, custom_headers = nil)
2731
- api_version = '2014-04-01'
2732
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2733
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2734
- fail ArgumentError, 'server_name is nil' if server_name.nil?
2735
- fail ArgumentError, 'database_name is nil' if database_name.nil?
2736
-
2737
-
2738
- request_headers = {}
2739
-
2740
- # Set Headers
2741
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2742
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2743
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors'
2744
-
2745
- request_url = @base_url || @client.base_url
2746
-
2747
- options = {
2748
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2749
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
2750
- query_params: {'api-version' => api_version},
2751
- headers: request_headers.merge(custom_headers || {}),
2752
- base_url: request_url
2753
- }
2754
- promise = @client.make_request_async(:get, path_template, options)
2755
-
2756
- promise = promise.then do |result|
2757
- http_response = result.response
2758
- status_code = http_response.status
2759
- response_content = http_response.body
2760
- unless status_code == 200
2761
- error_model = JSON.load(response_content)
2762
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2763
- end
567
+ def update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
568
+ # Send request
569
+ promise = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers)
2764
570
 
2765
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2766
- # Deserialize Response
2767
- if status_code == 200
2768
- begin
2769
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2770
- result_mapper = Azure::ARM::SQL::Models::ServiceTierAdvisorListResult.mapper()
2771
- result.body = @client.deserialize(result_mapper, parsed_response)
2772
- rescue Exception => e
2773
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2774
- end
571
+ promise = promise.then do |response|
572
+ # Defining deserialization method.
573
+ deserialize_method = lambda do |parsed_response|
574
+ result_mapper = Azure::ARM::SQL::Models::Database.mapper()
575
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
2775
576
  end
2776
577
 
2777
- result
578
+ # Waiting for response.
579
+ @client.get_long_running_operation_result(response, deserialize_method)
2778
580
  end
2779
581
 
2780
- promise.execute
582
+ promise
2781
583
  end
2782
584
 
2783
585
  #
2784
- # Creates or updates a database's transparent data encryption configuration.
586
+ # Deletes a database.
2785
587
  #
2786
588
  # @param resource_group_name [String] The name of the resource group that
2787
589
  # contains the resource. You can obtain this value from the Azure Resource
2788
590
  # Manager API or the portal.
2789
591
  # @param server_name [String] The name of the server.
2790
- # @param database_name [String] The name of the database for which setting the
2791
- # transparent data encryption applies.
2792
- # @param parameters [TransparentDataEncryption] The required parameters for
2793
- # creating or updating transparent data encryption.
592
+ # @param database_name [String] The name of the database to be deleted.
2794
593
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2795
594
  # will be added to the HTTP request.
2796
595
  #
2797
- # @return [TransparentDataEncryption] operation results.
2798
596
  #
2799
- def create_or_update_transparent_data_encryption_configuration(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2800
- response = create_or_update_transparent_data_encryption_configuration_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
2801
- response.body unless response.nil?
597
+ def delete(resource_group_name, server_name, database_name, custom_headers = nil)
598
+ response = delete_async(resource_group_name, server_name, database_name, custom_headers).value!
599
+ nil
2802
600
  end
2803
601
 
2804
602
  #
2805
- # Creates or updates a database's transparent data encryption configuration.
603
+ # Deletes a database.
2806
604
  #
2807
605
  # @param resource_group_name [String] The name of the resource group that
2808
606
  # contains the resource. You can obtain this value from the Azure Resource
2809
607
  # Manager API or the portal.
2810
608
  # @param server_name [String] The name of the server.
2811
- # @param database_name [String] The name of the database for which setting the
2812
- # transparent data encryption applies.
2813
- # @param parameters [TransparentDataEncryption] The required parameters for
2814
- # creating or updating transparent data encryption.
609
+ # @param database_name [String] The name of the database to be deleted.
2815
610
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2816
611
  # will be added to the HTTP request.
2817
612
  #
2818
613
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2819
614
  #
2820
- def create_or_update_transparent_data_encryption_configuration_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2821
- create_or_update_transparent_data_encryption_configuration_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
615
+ def delete_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
616
+ delete_async(resource_group_name, server_name, database_name, custom_headers).value!
2822
617
  end
2823
618
 
2824
619
  #
2825
- # Creates or updates a database's transparent data encryption configuration.
620
+ # Deletes a database.
2826
621
  #
2827
622
  # @param resource_group_name [String] The name of the resource group that
2828
623
  # contains the resource. You can obtain this value from the Azure Resource
2829
624
  # Manager API or the portal.
2830
625
  # @param server_name [String] The name of the server.
2831
- # @param database_name [String] The name of the database for which setting the
2832
- # transparent data encryption applies.
2833
- # @param parameters [TransparentDataEncryption] The required parameters for
2834
- # creating or updating transparent data encryption.
626
+ # @param database_name [String] The name of the database to be deleted.
2835
627
  # @param [Hash{String => String}] A hash of custom headers that will be added
2836
628
  # to the HTTP request.
2837
629
  #
2838
630
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2839
631
  #
2840
- def create_or_update_transparent_data_encryption_configuration_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
632
+ def delete_async(resource_group_name, server_name, database_name, custom_headers = nil)
2841
633
  api_version = '2014-04-01'
2842
634
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2843
635
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2844
636
  fail ArgumentError, 'server_name is nil' if server_name.nil?
2845
637
  fail ArgumentError, 'database_name is nil' if database_name.nil?
2846
- transparent_data_encryption_name = 'current'
2847
- fail ArgumentError, 'parameters is nil' if parameters.nil?
2848
638
 
2849
639
 
2850
640
  request_headers = {}
@@ -2852,58 +642,29 @@ module Azure::ARM::SQL
2852
642
  # Set Headers
2853
643
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2854
644
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2855
-
2856
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
2857
-
2858
- # Serialize Request
2859
- request_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper()
2860
- request_content = @client.serialize(request_mapper, parameters)
2861
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2862
-
2863
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'
645
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
2864
646
 
2865
647
  request_url = @base_url || @client.base_url
2866
648
 
2867
649
  options = {
2868
650
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2869
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'transparentDataEncryptionName' => transparent_data_encryption_name},
651
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
2870
652
  query_params: {'api-version' => api_version},
2871
- body: request_content,
2872
653
  headers: request_headers.merge(custom_headers || {}),
2873
654
  base_url: request_url
2874
655
  }
2875
- promise = @client.make_request_async(:put, path_template, options)
656
+ promise = @client.make_request_async(:delete, path_template, options)
2876
657
 
2877
658
  promise = promise.then do |result|
2878
659
  http_response = result.response
2879
660
  status_code = http_response.status
2880
661
  response_content = http_response.body
2881
- unless status_code == 200 || status_code == 201
662
+ unless status_code == 200 || status_code == 204
2882
663
  error_model = JSON.load(response_content)
2883
664
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2884
665
  end
2885
666
 
2886
667
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2887
- # Deserialize Response
2888
- if status_code == 200
2889
- begin
2890
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2891
- result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper()
2892
- result.body = @client.deserialize(result_mapper, parsed_response)
2893
- rescue Exception => e
2894
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2895
- end
2896
- end
2897
- # Deserialize Response
2898
- if status_code == 201
2899
- begin
2900
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2901
- result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper()
2902
- result.body = @client.deserialize(result_mapper, parsed_response)
2903
- rescue Exception => e
2904
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2905
- end
2906
- end
2907
668
 
2908
669
  result
2909
670
  end
@@ -2912,63 +673,68 @@ module Azure::ARM::SQL
2912
673
  end
2913
674
 
2914
675
  #
2915
- # Gets a database's transparent data encryption configuration.
676
+ # Gets a database.
2916
677
  #
2917
678
  # @param resource_group_name [String] The name of the resource group that
2918
679
  # contains the resource. You can obtain this value from the Azure Resource
2919
680
  # Manager API or the portal.
2920
681
  # @param server_name [String] The name of the server.
2921
- # @param database_name [String] The name of the database for which the
2922
- # transparent data encryption applies.
682
+ # @param database_name [String] The name of the database to be retrieved.
683
+ # @param expand [String] A comma separated list of child objects to expand in
684
+ # the response. Possible properties: serviceTierAdvisors,
685
+ # transparentDataEncryption.
2923
686
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2924
687
  # will be added to the HTTP request.
2925
688
  #
2926
- # @return [TransparentDataEncryption] operation results.
689
+ # @return [Database] operation results.
2927
690
  #
2928
- def get_transparent_data_encryption_configuration(resource_group_name, server_name, database_name, custom_headers = nil)
2929
- response = get_transparent_data_encryption_configuration_async(resource_group_name, server_name, database_name, custom_headers).value!
691
+ def get(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
692
+ response = get_async(resource_group_name, server_name, database_name, expand, custom_headers).value!
2930
693
  response.body unless response.nil?
2931
694
  end
2932
695
 
2933
696
  #
2934
- # Gets a database's transparent data encryption configuration.
697
+ # Gets a database.
2935
698
  #
2936
699
  # @param resource_group_name [String] The name of the resource group that
2937
700
  # contains the resource. You can obtain this value from the Azure Resource
2938
701
  # Manager API or the portal.
2939
702
  # @param server_name [String] The name of the server.
2940
- # @param database_name [String] The name of the database for which the
2941
- # transparent data encryption applies.
703
+ # @param database_name [String] The name of the database to be retrieved.
704
+ # @param expand [String] A comma separated list of child objects to expand in
705
+ # the response. Possible properties: serviceTierAdvisors,
706
+ # transparentDataEncryption.
2942
707
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2943
708
  # will be added to the HTTP request.
2944
709
  #
2945
710
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2946
711
  #
2947
- def get_transparent_data_encryption_configuration_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
2948
- get_transparent_data_encryption_configuration_async(resource_group_name, server_name, database_name, custom_headers).value!
712
+ def get_with_http_info(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
713
+ get_async(resource_group_name, server_name, database_name, expand, custom_headers).value!
2949
714
  end
2950
715
 
2951
716
  #
2952
- # Gets a database's transparent data encryption configuration.
717
+ # Gets a database.
2953
718
  #
2954
719
  # @param resource_group_name [String] The name of the resource group that
2955
720
  # contains the resource. You can obtain this value from the Azure Resource
2956
721
  # Manager API or the portal.
2957
722
  # @param server_name [String] The name of the server.
2958
- # @param database_name [String] The name of the database for which the
2959
- # transparent data encryption applies.
723
+ # @param database_name [String] The name of the database to be retrieved.
724
+ # @param expand [String] A comma separated list of child objects to expand in
725
+ # the response. Possible properties: serviceTierAdvisors,
726
+ # transparentDataEncryption.
2960
727
  # @param [Hash{String => String}] A hash of custom headers that will be added
2961
728
  # to the HTTP request.
2962
729
  #
2963
730
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2964
731
  #
2965
- def get_transparent_data_encryption_configuration_async(resource_group_name, server_name, database_name, custom_headers = nil)
732
+ def get_async(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
2966
733
  api_version = '2014-04-01'
2967
734
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2968
735
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2969
736
  fail ArgumentError, 'server_name is nil' if server_name.nil?
2970
737
  fail ArgumentError, 'database_name is nil' if database_name.nil?
2971
- transparent_data_encryption_name = 'current'
2972
738
 
2973
739
 
2974
740
  request_headers = {}
@@ -2976,14 +742,14 @@ module Azure::ARM::SQL
2976
742
  # Set Headers
2977
743
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2978
744
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2979
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'
745
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
2980
746
 
2981
747
  request_url = @base_url || @client.base_url
2982
748
 
2983
749
  options = {
2984
750
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2985
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'transparentDataEncryptionName' => transparent_data_encryption_name},
2986
- query_params: {'api-version' => api_version},
751
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
752
+ query_params: {'api-version' => api_version,'$expand' => expand},
2987
753
  headers: request_headers.merge(custom_headers || {}),
2988
754
  base_url: request_url
2989
755
  }
@@ -3003,7 +769,7 @@ module Azure::ARM::SQL
3003
769
  if status_code == 200
3004
770
  begin
3005
771
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3006
- result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryption.mapper()
772
+ result_mapper = Azure::ARM::SQL::Models::Database.mapper()
3007
773
  result.body = @client.deserialize(result_mapper, parsed_response)
3008
774
  rescue Exception => e
3009
775
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3017,63 +783,70 @@ module Azure::ARM::SQL
3017
783
  end
3018
784
 
3019
785
  #
3020
- # Returns a database's transparent data encryption operation result.
786
+ # Returns a list of databases in a server.
3021
787
  #
3022
788
  # @param resource_group_name [String] The name of the resource group that
3023
789
  # contains the resource. You can obtain this value from the Azure Resource
3024
790
  # Manager API or the portal.
3025
791
  # @param server_name [String] The name of the server.
3026
- # @param database_name [String] The name of the database for which the
3027
- # transparent data encryption applies.
792
+ # @param expand [String] A comma separated list of child objects to expand in
793
+ # the response. Possible properties: serviceTierAdvisors,
794
+ # transparentDataEncryption.
795
+ # @param filter [String] An OData filter expression that describes a subset of
796
+ # databases to return.
3028
797
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3029
798
  # will be added to the HTTP request.
3030
799
  #
3031
- # @return [TransparentDataEncryptionActivityListResult] operation results.
800
+ # @return [DatabaseListResult] operation results.
3032
801
  #
3033
- def list_transparent_data_encryption_activity(resource_group_name, server_name, database_name, custom_headers = nil)
3034
- response = list_transparent_data_encryption_activity_async(resource_group_name, server_name, database_name, custom_headers).value!
802
+ def list_by_server(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
803
+ response = list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value!
3035
804
  response.body unless response.nil?
3036
805
  end
3037
806
 
3038
807
  #
3039
- # Returns a database's transparent data encryption operation result.
808
+ # Returns a list of databases in a server.
3040
809
  #
3041
810
  # @param resource_group_name [String] The name of the resource group that
3042
811
  # contains the resource. You can obtain this value from the Azure Resource
3043
812
  # Manager API or the portal.
3044
813
  # @param server_name [String] The name of the server.
3045
- # @param database_name [String] The name of the database for which the
3046
- # transparent data encryption applies.
814
+ # @param expand [String] A comma separated list of child objects to expand in
815
+ # the response. Possible properties: serviceTierAdvisors,
816
+ # transparentDataEncryption.
817
+ # @param filter [String] An OData filter expression that describes a subset of
818
+ # databases to return.
3047
819
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3048
820
  # will be added to the HTTP request.
3049
821
  #
3050
822
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3051
823
  #
3052
- def list_transparent_data_encryption_activity_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
3053
- list_transparent_data_encryption_activity_async(resource_group_name, server_name, database_name, custom_headers).value!
824
+ def list_by_server_with_http_info(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
825
+ list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value!
3054
826
  end
3055
827
 
3056
828
  #
3057
- # Returns a database's transparent data encryption operation result.
829
+ # Returns a list of databases in a server.
3058
830
  #
3059
831
  # @param resource_group_name [String] The name of the resource group that
3060
832
  # contains the resource. You can obtain this value from the Azure Resource
3061
833
  # Manager API or the portal.
3062
834
  # @param server_name [String] The name of the server.
3063
- # @param database_name [String] The name of the database for which the
3064
- # transparent data encryption applies.
835
+ # @param expand [String] A comma separated list of child objects to expand in
836
+ # the response. Possible properties: serviceTierAdvisors,
837
+ # transparentDataEncryption.
838
+ # @param filter [String] An OData filter expression that describes a subset of
839
+ # databases to return.
3065
840
  # @param [Hash{String => String}] A hash of custom headers that will be added
3066
841
  # to the HTTP request.
3067
842
  #
3068
843
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3069
844
  #
3070
- def list_transparent_data_encryption_activity_async(resource_group_name, server_name, database_name, custom_headers = nil)
845
+ def list_by_server_async(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
3071
846
  api_version = '2014-04-01'
3072
847
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3073
848
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3074
849
  fail ArgumentError, 'server_name is nil' if server_name.nil?
3075
- fail ArgumentError, 'database_name is nil' if database_name.nil?
3076
- transparent_data_encryption_name = 'current'
3077
850
 
3078
851
 
3079
852
  request_headers = {}
@@ -3081,14 +854,14 @@ module Azure::ARM::SQL
3081
854
  # Set Headers
3082
855
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3083
856
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3084
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults'
857
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'
3085
858
 
3086
859
  request_url = @base_url || @client.base_url
3087
860
 
3088
861
  options = {
3089
862
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3090
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'transparentDataEncryptionName' => transparent_data_encryption_name},
3091
- query_params: {'api-version' => api_version},
863
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
864
+ query_params: {'api-version' => api_version,'$expand' => expand,'$filter' => filter},
3092
865
  headers: request_headers.merge(custom_headers || {}),
3093
866
  base_url: request_url
3094
867
  }
@@ -3108,7 +881,7 @@ module Azure::ARM::SQL
3108
881
  if status_code == 200
3109
882
  begin
3110
883
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3111
- result_mapper = Azure::ARM::SQL::Models::TransparentDataEncryptionActivityListResult.mapper()
884
+ result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper()
3112
885
  result.body = @client.deserialize(result_mapper, parsed_response)
3113
886
  rescue Exception => e
3114
887
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3122,58 +895,65 @@ module Azure::ARM::SQL
3122
895
  end
3123
896
 
3124
897
  #
3125
- # Returns database usages.
898
+ # Gets a database inside of an elastic pool.
3126
899
  #
3127
900
  # @param resource_group_name [String] The name of the resource group that
3128
901
  # contains the resource. You can obtain this value from the Azure Resource
3129
902
  # Manager API or the portal.
3130
903
  # @param server_name [String] The name of the server.
3131
- # @param database_name [String] The name of the database.
904
+ # @param elastic_pool_name [String] The name of the elastic pool to be
905
+ # retrieved.
906
+ # @param database_name [String] The name of the database to be retrieved.
3132
907
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3133
908
  # will be added to the HTTP request.
3134
909
  #
3135
- # @return [DatabaseUsageListResult] operation results.
910
+ # @return [Database] operation results.
3136
911
  #
3137
- def list_usages(resource_group_name, server_name, database_name, custom_headers = nil)
3138
- response = list_usages_async(resource_group_name, server_name, database_name, custom_headers).value!
912
+ def get_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers = nil)
913
+ response = get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers).value!
3139
914
  response.body unless response.nil?
3140
915
  end
3141
916
 
3142
917
  #
3143
- # Returns database usages.
918
+ # Gets a database inside of an elastic pool.
3144
919
  #
3145
920
  # @param resource_group_name [String] The name of the resource group that
3146
921
  # contains the resource. You can obtain this value from the Azure Resource
3147
922
  # Manager API or the portal.
3148
923
  # @param server_name [String] The name of the server.
3149
- # @param database_name [String] The name of the database.
924
+ # @param elastic_pool_name [String] The name of the elastic pool to be
925
+ # retrieved.
926
+ # @param database_name [String] The name of the database to be retrieved.
3150
927
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3151
928
  # will be added to the HTTP request.
3152
929
  #
3153
930
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3154
931
  #
3155
- def list_usages_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
3156
- list_usages_async(resource_group_name, server_name, database_name, custom_headers).value!
932
+ def get_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers = nil)
933
+ get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers).value!
3157
934
  end
3158
935
 
3159
936
  #
3160
- # Returns database usages.
937
+ # Gets a database inside of an elastic pool.
3161
938
  #
3162
939
  # @param resource_group_name [String] The name of the resource group that
3163
940
  # contains the resource. You can obtain this value from the Azure Resource
3164
941
  # Manager API or the portal.
3165
942
  # @param server_name [String] The name of the server.
3166
- # @param database_name [String] The name of the database.
943
+ # @param elastic_pool_name [String] The name of the elastic pool to be
944
+ # retrieved.
945
+ # @param database_name [String] The name of the database to be retrieved.
3167
946
  # @param [Hash{String => String}] A hash of custom headers that will be added
3168
947
  # to the HTTP request.
3169
948
  #
3170
949
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3171
950
  #
3172
- def list_usages_async(resource_group_name, server_name, database_name, custom_headers = nil)
951
+ def get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers = nil)
3173
952
  api_version = '2014-04-01'
3174
953
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3175
954
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3176
955
  fail ArgumentError, 'server_name is nil' if server_name.nil?
956
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
3177
957
  fail ArgumentError, 'database_name is nil' if database_name.nil?
3178
958
 
3179
959
 
@@ -3182,13 +962,13 @@ module Azure::ARM::SQL
3182
962
  # Set Headers
3183
963
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3184
964
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3185
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages'
965
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'
3186
966
 
3187
967
  request_url = @base_url || @client.base_url
3188
968
 
3189
969
  options = {
3190
970
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3191
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
971
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name,'databaseName' => database_name},
3192
972
  query_params: {'api-version' => api_version},
3193
973
  headers: request_headers.merge(custom_headers || {}),
3194
974
  base_url: request_url
@@ -3209,7 +989,7 @@ module Azure::ARM::SQL
3209
989
  if status_code == 200
3210
990
  begin
3211
991
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3212
- result_mapper = Azure::ARM::SQL::Models::DatabaseUsageListResult.mapper()
992
+ result_mapper = Azure::ARM::SQL::Models::Database.mapper()
3213
993
  result.body = @client.deserialize(result_mapper, parsed_response)
3214
994
  rescue Exception => e
3215
995
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3223,63 +1003,62 @@ module Azure::ARM::SQL
3223
1003
  end
3224
1004
 
3225
1005
  #
3226
- # Gets a database's blob auditing policy.
1006
+ # Returns a list of databases in an elastic pool.
3227
1007
  #
3228
1008
  # @param resource_group_name [String] The name of the resource group that
3229
1009
  # contains the resource. You can obtain this value from the Azure Resource
3230
1010
  # Manager API or the portal.
3231
1011
  # @param server_name [String] The name of the server.
3232
- # @param database_name [String] The name of the database for which the blob
3233
- # audit policy is defined.
1012
+ # @param elastic_pool_name [String] The name of the elastic pool to be
1013
+ # retrieved.
3234
1014
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3235
1015
  # will be added to the HTTP request.
3236
1016
  #
3237
- # @return [DatabaseBlobAuditingPolicy] operation results.
1017
+ # @return [DatabaseListResult] operation results.
3238
1018
  #
3239
- def get_blob_auditing_policy(resource_group_name, server_name, database_name, custom_headers = nil)
3240
- response = get_blob_auditing_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
1019
+ def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
1020
+ response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
3241
1021
  response.body unless response.nil?
3242
1022
  end
3243
1023
 
3244
1024
  #
3245
- # Gets a database's blob auditing policy.
1025
+ # Returns a list of databases in an elastic pool.
3246
1026
  #
3247
1027
  # @param resource_group_name [String] The name of the resource group that
3248
1028
  # contains the resource. You can obtain this value from the Azure Resource
3249
1029
  # Manager API or the portal.
3250
1030
  # @param server_name [String] The name of the server.
3251
- # @param database_name [String] The name of the database for which the blob
3252
- # audit policy is defined.
1031
+ # @param elastic_pool_name [String] The name of the elastic pool to be
1032
+ # retrieved.
3253
1033
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3254
1034
  # will be added to the HTTP request.
3255
1035
  #
3256
1036
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3257
1037
  #
3258
- def get_blob_auditing_policy_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
3259
- get_blob_auditing_policy_async(resource_group_name, server_name, database_name, custom_headers).value!
1038
+ def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
1039
+ list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
3260
1040
  end
3261
1041
 
3262
1042
  #
3263
- # Gets a database's blob auditing policy.
1043
+ # Returns a list of databases in an elastic pool.
3264
1044
  #
3265
1045
  # @param resource_group_name [String] The name of the resource group that
3266
1046
  # contains the resource. You can obtain this value from the Azure Resource
3267
1047
  # Manager API or the portal.
3268
1048
  # @param server_name [String] The name of the server.
3269
- # @param database_name [String] The name of the database for which the blob
3270
- # audit policy is defined.
1049
+ # @param elastic_pool_name [String] The name of the elastic pool to be
1050
+ # retrieved.
3271
1051
  # @param [Hash{String => String}] A hash of custom headers that will be added
3272
1052
  # to the HTTP request.
3273
1053
  #
3274
1054
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3275
1055
  #
3276
- def get_blob_auditing_policy_async(resource_group_name, server_name, database_name, custom_headers = nil)
1056
+ def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
1057
+ api_version = '2014-04-01'
1058
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3277
1059
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3278
1060
  fail ArgumentError, 'server_name is nil' if server_name.nil?
3279
- fail ArgumentError, 'database_name is nil' if database_name.nil?
3280
- blob_auditing_policy_name = 'default'
3281
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3282
- api_version = '2015-05-01-preview'
1061
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
3283
1062
 
3284
1063
 
3285
1064
  request_headers = {}
@@ -3287,13 +1066,13 @@ module Azure::ARM::SQL
3287
1066
  # Set Headers
3288
1067
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3289
1068
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3290
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}'
1069
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'
3291
1070
 
3292
1071
  request_url = @base_url || @client.base_url
3293
1072
 
3294
1073
  options = {
3295
1074
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3296
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'blobAuditingPolicyName' => blob_auditing_policy_name,'subscriptionId' => @client.subscription_id},
1075
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
3297
1076
  query_params: {'api-version' => api_version},
3298
1077
  headers: request_headers.merge(custom_headers || {}),
3299
1078
  base_url: request_url
@@ -3314,7 +1093,7 @@ module Azure::ARM::SQL
3314
1093
  if status_code == 200
3315
1094
  begin
3316
1095
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3317
- result_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper()
1096
+ result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper()
3318
1097
  result.body = @client.deserialize(result_mapper, parsed_response)
3319
1098
  rescue Exception => e
3320
1099
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3328,70 +1107,66 @@ module Azure::ARM::SQL
3328
1107
  end
3329
1108
 
3330
1109
  #
3331
- # Creates or updates a database's blob auditing policy.
1110
+ # Gets a database inside of a recommented elastic pool.
3332
1111
  #
3333
1112
  # @param resource_group_name [String] The name of the resource group that
3334
1113
  # contains the resource. You can obtain this value from the Azure Resource
3335
1114
  # Manager API or the portal.
3336
1115
  # @param server_name [String] The name of the server.
3337
- # @param database_name [String] The name of the database for which the blob
3338
- # auditing policy will be defined.
3339
- # @param parameters [DatabaseBlobAuditingPolicy] The database blob auditing
3340
- # policy.
1116
+ # @param recommended_elastic_pool_name [String] The name of the elastic pool to
1117
+ # be retrieved.
1118
+ # @param database_name [String] The name of the database to be retrieved.
3341
1119
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3342
1120
  # will be added to the HTTP request.
3343
1121
  #
3344
- # @return [DatabaseBlobAuditingPolicy] operation results.
1122
+ # @return [Database] operation results.
3345
1123
  #
3346
- def create_or_update_blob_auditing_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
3347
- response = create_or_update_blob_auditing_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1124
+ def get_by_recommended_elastic_pool(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
1125
+ response = get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers).value!
3348
1126
  response.body unless response.nil?
3349
1127
  end
3350
1128
 
3351
1129
  #
3352
- # Creates or updates a database's blob auditing policy.
1130
+ # Gets a database inside of a recommented elastic pool.
3353
1131
  #
3354
1132
  # @param resource_group_name [String] The name of the resource group that
3355
1133
  # contains the resource. You can obtain this value from the Azure Resource
3356
1134
  # Manager API or the portal.
3357
1135
  # @param server_name [String] The name of the server.
3358
- # @param database_name [String] The name of the database for which the blob
3359
- # auditing policy will be defined.
3360
- # @param parameters [DatabaseBlobAuditingPolicy] The database blob auditing
3361
- # policy.
1136
+ # @param recommended_elastic_pool_name [String] The name of the elastic pool to
1137
+ # be retrieved.
1138
+ # @param database_name [String] The name of the database to be retrieved.
3362
1139
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3363
1140
  # will be added to the HTTP request.
3364
1141
  #
3365
1142
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3366
1143
  #
3367
- def create_or_update_blob_auditing_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
3368
- create_or_update_blob_auditing_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1144
+ def get_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
1145
+ get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers).value!
3369
1146
  end
3370
1147
 
3371
1148
  #
3372
- # Creates or updates a database's blob auditing policy.
1149
+ # Gets a database inside of a recommented elastic pool.
3373
1150
  #
3374
1151
  # @param resource_group_name [String] The name of the resource group that
3375
1152
  # contains the resource. You can obtain this value from the Azure Resource
3376
1153
  # Manager API or the portal.
3377
1154
  # @param server_name [String] The name of the server.
3378
- # @param database_name [String] The name of the database for which the blob
3379
- # auditing policy will be defined.
3380
- # @param parameters [DatabaseBlobAuditingPolicy] The database blob auditing
3381
- # policy.
1155
+ # @param recommended_elastic_pool_name [String] The name of the elastic pool to
1156
+ # be retrieved.
1157
+ # @param database_name [String] The name of the database to be retrieved.
3382
1158
  # @param [Hash{String => String}] A hash of custom headers that will be added
3383
1159
  # to the HTTP request.
3384
1160
  #
3385
1161
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3386
1162
  #
3387
- def create_or_update_blob_auditing_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1163
+ def get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
1164
+ api_version = '2014-04-01'
1165
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3388
1166
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3389
1167
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1168
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
3390
1169
  fail ArgumentError, 'database_name is nil' if database_name.nil?
3391
- blob_auditing_policy_name = 'default'
3392
- fail ArgumentError, 'parameters is nil' if parameters.nil?
3393
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3394
- api_version = '2015-05-01-preview'
3395
1170
 
3396
1171
 
3397
1172
  request_headers = {}
@@ -3399,33 +1174,24 @@ module Azure::ARM::SQL
3399
1174
  # Set Headers
3400
1175
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3401
1176
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3402
-
3403
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
3404
-
3405
- # Serialize Request
3406
- request_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper()
3407
- request_content = @client.serialize(request_mapper, parameters)
3408
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
3409
-
3410
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}'
1177
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'
3411
1178
 
3412
1179
  request_url = @base_url || @client.base_url
3413
1180
 
3414
1181
  options = {
3415
1182
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3416
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'blobAuditingPolicyName' => blob_auditing_policy_name,'subscriptionId' => @client.subscription_id},
1183
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name,'databaseName' => database_name},
3417
1184
  query_params: {'api-version' => api_version},
3418
- body: request_content,
3419
1185
  headers: request_headers.merge(custom_headers || {}),
3420
1186
  base_url: request_url
3421
1187
  }
3422
- promise = @client.make_request_async(:put, path_template, options)
1188
+ promise = @client.make_request_async(:get, path_template, options)
3423
1189
 
3424
1190
  promise = promise.then do |result|
3425
1191
  http_response = result.response
3426
1192
  status_code = http_response.status
3427
1193
  response_content = http_response.body
3428
- unless status_code == 200 || status_code == 201
1194
+ unless status_code == 200
3429
1195
  error_model = JSON.load(response_content)
3430
1196
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3431
1197
  end
@@ -3435,17 +1201,7 @@ module Azure::ARM::SQL
3435
1201
  if status_code == 200
3436
1202
  begin
3437
1203
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3438
- result_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper()
3439
- result.body = @client.deserialize(result_mapper, parsed_response)
3440
- rescue Exception => e
3441
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3442
- end
3443
- end
3444
- # Deserialize Response
3445
- if status_code == 201
3446
- begin
3447
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3448
- result_mapper = Azure::ARM::SQL::Models::DatabaseBlobAuditingPolicy.mapper()
1204
+ result_mapper = Azure::ARM::SQL::Models::Database.mapper()
3449
1205
  result.body = @client.deserialize(result_mapper, parsed_response)
3450
1206
  rescue Exception => e
3451
1207
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3459,67 +1215,62 @@ module Azure::ARM::SQL
3459
1215
  end
3460
1216
 
3461
1217
  #
3462
- # Creates or updates a database backup long term retention policy
1218
+ # Returns a list of databases inside a recommented elastic pool.
3463
1219
  #
3464
1220
  # @param resource_group_name [String] The name of the resource group that
3465
1221
  # contains the resource. You can obtain this value from the Azure Resource
3466
1222
  # Manager API or the portal.
3467
1223
  # @param server_name [String] The name of the server.
3468
- # @param database_name [String] The name of the database
3469
- # @param parameters [BackupLongTermRetentionPolicy] The required parameters to
3470
- # update a backup long term retention policy
1224
+ # @param recommended_elastic_pool_name [String] The name of the recommended
1225
+ # elastic pool to be retrieved.
3471
1226
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3472
1227
  # will be added to the HTTP request.
3473
1228
  #
3474
- # @return [BackupLongTermRetentionPolicy] operation results.
1229
+ # @return [DatabaseListResult] operation results.
3475
1230
  #
3476
- def begin_create_or_update_long_term_retention_policy(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
3477
- response = begin_create_or_update_long_term_retention_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1231
+ def list_by_recommended_elastic_pool(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
1232
+ response = list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
3478
1233
  response.body unless response.nil?
3479
1234
  end
3480
1235
 
3481
1236
  #
3482
- # Creates or updates a database backup long term retention policy
1237
+ # Returns a list of databases inside a recommented elastic pool.
3483
1238
  #
3484
1239
  # @param resource_group_name [String] The name of the resource group that
3485
1240
  # contains the resource. You can obtain this value from the Azure Resource
3486
1241
  # Manager API or the portal.
3487
1242
  # @param server_name [String] The name of the server.
3488
- # @param database_name [String] The name of the database
3489
- # @param parameters [BackupLongTermRetentionPolicy] The required parameters to
3490
- # update a backup long term retention policy
1243
+ # @param recommended_elastic_pool_name [String] The name of the recommended
1244
+ # elastic pool to be retrieved.
3491
1245
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
3492
1246
  # will be added to the HTTP request.
3493
1247
  #
3494
1248
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3495
1249
  #
3496
- def begin_create_or_update_long_term_retention_policy_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
3497
- begin_create_or_update_long_term_retention_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1250
+ def list_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
1251
+ list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
3498
1252
  end
3499
1253
 
3500
1254
  #
3501
- # Creates or updates a database backup long term retention policy
1255
+ # Returns a list of databases inside a recommented elastic pool.
3502
1256
  #
3503
1257
  # @param resource_group_name [String] The name of the resource group that
3504
1258
  # contains the resource. You can obtain this value from the Azure Resource
3505
1259
  # Manager API or the portal.
3506
1260
  # @param server_name [String] The name of the server.
3507
- # @param database_name [String] The name of the database
3508
- # @param parameters [BackupLongTermRetentionPolicy] The required parameters to
3509
- # update a backup long term retention policy
1261
+ # @param recommended_elastic_pool_name [String] The name of the recommended
1262
+ # elastic pool to be retrieved.
3510
1263
  # @param [Hash{String => String}] A hash of custom headers that will be added
3511
1264
  # to the HTTP request.
3512
1265
  #
3513
1266
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3514
1267
  #
3515
- def begin_create_or_update_long_term_retention_policy_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1268
+ def list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
3516
1269
  api_version = '2014-04-01'
3517
1270
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3518
1271
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3519
1272
  fail ArgumentError, 'server_name is nil' if server_name.nil?
3520
- fail ArgumentError, 'database_name is nil' if database_name.nil?
3521
- backup_long_term_retention_policy_name = 'Default'
3522
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1273
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
3523
1274
 
3524
1275
 
3525
1276
  request_headers = {}
@@ -3527,33 +1278,24 @@ module Azure::ARM::SQL
3527
1278
  # Set Headers
3528
1279
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3529
1280
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3530
-
3531
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
3532
-
3533
- # Serialize Request
3534
- request_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionPolicy.mapper()
3535
- request_content = @client.serialize(request_mapper, parameters)
3536
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
3537
-
3538
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}'
1281
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'
3539
1282
 
3540
1283
  request_url = @base_url || @client.base_url
3541
1284
 
3542
1285
  options = {
3543
1286
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3544
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'backupLongTermRetentionPolicyName' => backup_long_term_retention_policy_name},
1287
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name},
3545
1288
  query_params: {'api-version' => api_version},
3546
- body: request_content,
3547
1289
  headers: request_headers.merge(custom_headers || {}),
3548
1290
  base_url: request_url
3549
1291
  }
3550
- promise = @client.make_request_async(:put, path_template, options)
1292
+ promise = @client.make_request_async(:get, path_template, options)
3551
1293
 
3552
1294
  promise = promise.then do |result|
3553
1295
  http_response = result.response
3554
1296
  status_code = http_response.status
3555
1297
  response_content = http_response.body
3556
- unless status_code == 200 || status_code == 201 || status_code == 202
1298
+ unless status_code == 200
3557
1299
  error_model = JSON.load(response_content)
3558
1300
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3559
1301
  end
@@ -3563,17 +1305,7 @@ module Azure::ARM::SQL
3563
1305
  if status_code == 200
3564
1306
  begin
3565
1307
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3566
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionPolicy.mapper()
3567
- result.body = @client.deserialize(result_mapper, parsed_response)
3568
- rescue Exception => e
3569
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3570
- end
3571
- end
3572
- # Deserialize Response
3573
- if status_code == 201
3574
- begin
3575
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3576
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionPolicy.mapper()
1308
+ result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper()
3577
1309
  result.body = @client.deserialize(result_mapper, parsed_response)
3578
1310
  rescue Exception => e
3579
1311
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -3937,206 +1669,6 @@ module Azure::ARM::SQL
3937
1669
  promise.execute
3938
1670
  end
3939
1671
 
3940
- #
3941
- # Sets which replica database is primary by failing over from the current
3942
- # primary replica database.
3943
- #
3944
- # @param resource_group_name [String] The name of the resource group that
3945
- # contains the resource. You can obtain this value from the Azure Resource
3946
- # Manager API or the portal.
3947
- # @param server_name [String] The name of the server.
3948
- # @param database_name [String] The name of the database that has the
3949
- # replication link to be failed over.
3950
- # @param link_id [String] The ID of the replication link to be failed over.
3951
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
3952
- # will be added to the HTTP request.
3953
- #
3954
- #
3955
- def begin_failover_replication_link(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
3956
- response = begin_failover_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
3957
- nil
3958
- end
3959
-
3960
- #
3961
- # Sets which replica database is primary by failing over from the current
3962
- # primary replica database.
3963
- #
3964
- # @param resource_group_name [String] The name of the resource group that
3965
- # contains the resource. You can obtain this value from the Azure Resource
3966
- # Manager API or the portal.
3967
- # @param server_name [String] The name of the server.
3968
- # @param database_name [String] The name of the database that has the
3969
- # replication link to be failed over.
3970
- # @param link_id [String] The ID of the replication link to be failed over.
3971
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
3972
- # will be added to the HTTP request.
3973
- #
3974
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3975
- #
3976
- def begin_failover_replication_link_with_http_info(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
3977
- begin_failover_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
3978
- end
3979
-
3980
- #
3981
- # Sets which replica database is primary by failing over from the current
3982
- # primary replica database.
3983
- #
3984
- # @param resource_group_name [String] The name of the resource group that
3985
- # contains the resource. You can obtain this value from the Azure Resource
3986
- # Manager API or the portal.
3987
- # @param server_name [String] The name of the server.
3988
- # @param database_name [String] The name of the database that has the
3989
- # replication link to be failed over.
3990
- # @param link_id [String] The ID of the replication link to be failed over.
3991
- # @param [Hash{String => String}] A hash of custom headers that will be added
3992
- # to the HTTP request.
3993
- #
3994
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3995
- #
3996
- def begin_failover_replication_link_async(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
3997
- api_version = '2014-04-01'
3998
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3999
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
4000
- fail ArgumentError, 'server_name is nil' if server_name.nil?
4001
- fail ArgumentError, 'database_name is nil' if database_name.nil?
4002
- fail ArgumentError, 'link_id is nil' if link_id.nil?
4003
-
4004
-
4005
- request_headers = {}
4006
-
4007
- # Set Headers
4008
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
4009
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
4010
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover'
4011
-
4012
- request_url = @base_url || @client.base_url
4013
-
4014
- options = {
4015
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
4016
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'linkId' => link_id},
4017
- query_params: {'api-version' => api_version},
4018
- headers: request_headers.merge(custom_headers || {}),
4019
- base_url: request_url
4020
- }
4021
- promise = @client.make_request_async(:post, path_template, options)
4022
-
4023
- promise = promise.then do |result|
4024
- http_response = result.response
4025
- status_code = http_response.status
4026
- response_content = http_response.body
4027
- unless status_code == 204 || status_code == 202
4028
- error_model = JSON.load(response_content)
4029
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
4030
- end
4031
-
4032
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
4033
-
4034
- result
4035
- end
4036
-
4037
- promise.execute
4038
- end
4039
-
4040
- #
4041
- # Sets which replica database is primary by failing over from the current
4042
- # primary replica database. This operation might result in data loss.
4043
- #
4044
- # @param resource_group_name [String] The name of the resource group that
4045
- # contains the resource. You can obtain this value from the Azure Resource
4046
- # Manager API or the portal.
4047
- # @param server_name [String] The name of the server.
4048
- # @param database_name [String] The name of the database that has the
4049
- # replication link to be failed over.
4050
- # @param link_id [String] The ID of the replication link to be failed over.
4051
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
4052
- # will be added to the HTTP request.
4053
- #
4054
- #
4055
- def begin_failover_replication_link_allow_data_loss(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
4056
- response = begin_failover_replication_link_allow_data_loss_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
4057
- nil
4058
- end
4059
-
4060
- #
4061
- # Sets which replica database is primary by failing over from the current
4062
- # primary replica database. This operation might result in data loss.
4063
- #
4064
- # @param resource_group_name [String] The name of the resource group that
4065
- # contains the resource. You can obtain this value from the Azure Resource
4066
- # Manager API or the portal.
4067
- # @param server_name [String] The name of the server.
4068
- # @param database_name [String] The name of the database that has the
4069
- # replication link to be failed over.
4070
- # @param link_id [String] The ID of the replication link to be failed over.
4071
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
4072
- # will be added to the HTTP request.
4073
- #
4074
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
4075
- #
4076
- def begin_failover_replication_link_allow_data_loss_with_http_info(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
4077
- begin_failover_replication_link_allow_data_loss_async(resource_group_name, server_name, database_name, link_id, custom_headers).value!
4078
- end
4079
-
4080
- #
4081
- # Sets which replica database is primary by failing over from the current
4082
- # primary replica database. This operation might result in data loss.
4083
- #
4084
- # @param resource_group_name [String] The name of the resource group that
4085
- # contains the resource. You can obtain this value from the Azure Resource
4086
- # Manager API or the portal.
4087
- # @param server_name [String] The name of the server.
4088
- # @param database_name [String] The name of the database that has the
4089
- # replication link to be failed over.
4090
- # @param link_id [String] The ID of the replication link to be failed over.
4091
- # @param [Hash{String => String}] A hash of custom headers that will be added
4092
- # to the HTTP request.
4093
- #
4094
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
4095
- #
4096
- def begin_failover_replication_link_allow_data_loss_async(resource_group_name, server_name, database_name, link_id, custom_headers = nil)
4097
- api_version = '2014-04-01'
4098
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
4099
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
4100
- fail ArgumentError, 'server_name is nil' if server_name.nil?
4101
- fail ArgumentError, 'database_name is nil' if database_name.nil?
4102
- fail ArgumentError, 'link_id is nil' if link_id.nil?
4103
-
4104
-
4105
- request_headers = {}
4106
-
4107
- # Set Headers
4108
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
4109
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
4110
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss'
4111
-
4112
- request_url = @base_url || @client.base_url
4113
-
4114
- options = {
4115
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
4116
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'linkId' => link_id},
4117
- query_params: {'api-version' => api_version},
4118
- headers: request_headers.merge(custom_headers || {}),
4119
- base_url: request_url
4120
- }
4121
- promise = @client.make_request_async(:post, path_template, options)
4122
-
4123
- promise = promise.then do |result|
4124
- http_response = result.response
4125
- status_code = http_response.status
4126
- response_content = http_response.body
4127
- unless status_code == 204 || status_code == 202
4128
- error_model = JSON.load(response_content)
4129
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
4130
- end
4131
-
4132
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
4133
-
4134
- result
4135
- end
4136
-
4137
- promise.execute
4138
- end
4139
-
4140
1672
  #
4141
1673
  # Pauses a data warehouse.
4142
1674
  #