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,125 @@
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 ServerUsages
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the ServerUsages 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 server 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 custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [ServerUsageListResult] operation results.
38
+ #
39
+ def list_by_server(resource_group_name, server_name, custom_headers = nil)
40
+ response = list_by_server_async(resource_group_name, server_name, custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Returns server usages.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group that
48
+ # contains the resource. You can obtain this value from the Azure Resource
49
+ # Manager API or the portal.
50
+ # @param server_name [String] The name of the server.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
+ #
56
+ def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil)
57
+ list_by_server_async(resource_group_name, server_name, custom_headers).value!
58
+ end
59
+
60
+ #
61
+ # Returns server usages.
62
+ #
63
+ # @param resource_group_name [String] The name of the resource group that
64
+ # contains the resource. You can obtain this value from the Azure Resource
65
+ # Manager API or the portal.
66
+ # @param server_name [String] The name of the server.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_by_server_async(resource_group_name, server_name, custom_headers = nil)
73
+ api_version = '2014-04-01'
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
77
+
78
+
79
+ request_headers = {}
80
+
81
+ # Set Headers
82
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
83
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
84
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
91
+ query_params: {'api-version' => api_version},
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
94
+ }
95
+ promise = @client.make_request_async(:get, path_template, options)
96
+
97
+ promise = promise.then do |result|
98
+ http_response = result.response
99
+ status_code = http_response.status
100
+ response_content = http_response.body
101
+ unless status_code == 200
102
+ error_model = JSON.load(response_content)
103
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
104
+ end
105
+
106
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::ARM::SQL::Models::ServerUsageListResult.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ end
125
+ end
@@ -25,210 +25,47 @@ module Azure::ARM::SQL
25
25
  attr_reader :client
26
26
 
27
27
  #
28
- # Gets a server backup long term retention vault
29
- #
30
- # @param resource_group_name [String] The name of the resource group that
31
- # contains the resource. You can obtain this value from the Azure Resource
32
- # Manager API or the portal.
33
- # @param server_name [String] The name of the server.
34
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
- # will be added to the HTTP request.
36
- #
37
- # @return [BackupLongTermRetentionVault] operation results.
38
- #
39
- def get_backup_long_term_retention_vault(resource_group_name, server_name, custom_headers = nil)
40
- response = get_backup_long_term_retention_vault_async(resource_group_name, server_name, custom_headers).value!
41
- response.body unless response.nil?
42
- end
43
-
44
- #
45
- # Gets a server backup long term retention vault
46
- #
47
- # @param resource_group_name [String] The name of the resource group that
48
- # contains the resource. You can obtain this value from the Azure Resource
49
- # Manager API or the portal.
50
- # @param server_name [String] The name of the server.
51
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
- # will be added to the HTTP request.
53
- #
54
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
- #
56
- def get_backup_long_term_retention_vault_with_http_info(resource_group_name, server_name, custom_headers = nil)
57
- get_backup_long_term_retention_vault_async(resource_group_name, server_name, custom_headers).value!
58
- end
59
-
60
- #
61
- # Gets a server backup long term retention vault
62
- #
63
- # @param resource_group_name [String] The name of the resource group that
64
- # contains the resource. You can obtain this value from the Azure Resource
65
- # Manager API or the portal.
66
- # @param server_name [String] The name of the server.
67
- # @param [Hash{String => String}] A hash of custom headers that will be added
68
- # to the HTTP request.
69
- #
70
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
- #
72
- def get_backup_long_term_retention_vault_async(resource_group_name, server_name, custom_headers = nil)
73
- api_version = '2014-04-01'
74
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
- fail ArgumentError, 'server_name is nil' if server_name.nil?
77
- backup_long_term_retention_vault_name = 'RegisteredVault'
78
-
79
-
80
- request_headers = {}
81
-
82
- # Set Headers
83
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}'
86
-
87
- request_url = @base_url || @client.base_url
88
-
89
- options = {
90
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'backupLongTermRetentionVaultName' => backup_long_term_retention_vault_name},
92
- query_params: {'api-version' => api_version},
93
- headers: request_headers.merge(custom_headers || {}),
94
- base_url: request_url
95
- }
96
- promise = @client.make_request_async(:get, path_template, options)
97
-
98
- promise = promise.then do |result|
99
- http_response = result.response
100
- status_code = http_response.status
101
- response_content = http_response.body
102
- unless status_code == 200
103
- error_model = JSON.load(response_content)
104
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
- end
106
-
107
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
- # Deserialize Response
109
- if status_code == 200
110
- begin
111
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
113
- result.body = @client.deserialize(result_mapper, parsed_response)
114
- rescue Exception => e
115
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
- end
117
- end
118
-
119
- result
120
- end
121
-
122
- promise.execute
123
- end
124
-
125
- #
126
- # Updates a server backup long term retention vault
127
- #
128
- # @param resource_group_name [String] The name of the resource group that
129
- # contains the resource. You can obtain this value from the Azure Resource
130
- # Manager API or the portal.
131
- # @param server_name [String] The name of the server.
132
- # @param parameters [BackupLongTermRetentionVault] The required parameters to
133
- # update a backup long term retention vault
134
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
- # will be added to the HTTP request.
136
- #
137
- # @return [BackupLongTermRetentionVault] operation results.
138
- #
139
- def create_backup_long_term_retention_vault(resource_group_name, server_name, parameters, custom_headers = nil)
140
- response = create_backup_long_term_retention_vault_async(resource_group_name, server_name, parameters, custom_headers).value!
141
- response.body unless response.nil?
142
- end
143
-
144
- #
145
- # @param resource_group_name [String] The name of the resource group that
146
- # contains the resource. You can obtain this value from the Azure Resource
147
- # Manager API or the portal.
148
- # @param server_name [String] The name of the server.
149
- # @param parameters [BackupLongTermRetentionVault] The required parameters to
150
- # update a backup long term retention vault
151
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
- # will be added to the HTTP request.
153
- #
154
- # @return [Concurrent::Promise] promise which provides async access to http
155
- # response.
156
- #
157
- def create_backup_long_term_retention_vault_async(resource_group_name, server_name, parameters, custom_headers = nil)
158
- # Send request
159
- promise = begin_create_backup_long_term_retention_vault_async(resource_group_name, server_name, parameters, custom_headers)
160
-
161
- promise = promise.then do |response|
162
- # Defining deserialization method.
163
- deserialize_method = lambda do |parsed_response|
164
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
165
- parsed_response = @client.deserialize(result_mapper, parsed_response)
166
- end
167
-
168
- # Waiting for response.
169
- @client.get_long_running_operation_result(response, deserialize_method)
170
- end
171
-
172
- promise
173
- end
174
-
175
- #
176
- # Creates or updates the server's connection policy.
28
+ # Determines whether a resource can be created with the specified name.
177
29
  #
178
- # @param resource_group_name [String] The name of the resource group that
179
- # contains the resource. You can obtain this value from the Azure Resource
180
- # Manager API or the portal.
181
- # @param server_name [String] The name of the server.
182
- # @param parameters [ServerConnectionPolicy] The required parameters for
183
- # updating a secure connection policy.
30
+ # @param parameters [CheckNameAvailabilityRequest] The parameters to request
31
+ # for name availability.
184
32
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
185
33
  # will be added to the HTTP request.
186
34
  #
187
- # @return [ServerConnectionPolicy] operation results.
35
+ # @return [CheckNameAvailabilityResponse] operation results.
188
36
  #
189
- def create_or_update_connection_policy(resource_group_name, server_name, parameters, custom_headers = nil)
190
- response = create_or_update_connection_policy_async(resource_group_name, server_name, parameters, custom_headers).value!
37
+ def check_name_availability(parameters, custom_headers = nil)
38
+ response = check_name_availability_async(parameters, custom_headers).value!
191
39
  response.body unless response.nil?
192
40
  end
193
41
 
194
42
  #
195
- # Creates or updates the server's connection policy.
43
+ # Determines whether a resource can be created with the specified name.
196
44
  #
197
- # @param resource_group_name [String] The name of the resource group that
198
- # contains the resource. You can obtain this value from the Azure Resource
199
- # Manager API or the portal.
200
- # @param server_name [String] The name of the server.
201
- # @param parameters [ServerConnectionPolicy] The required parameters for
202
- # updating a secure connection policy.
45
+ # @param parameters [CheckNameAvailabilityRequest] The parameters to request
46
+ # for name availability.
203
47
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
204
48
  # will be added to the HTTP request.
205
49
  #
206
50
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
207
51
  #
208
- def create_or_update_connection_policy_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil)
209
- create_or_update_connection_policy_async(resource_group_name, server_name, parameters, custom_headers).value!
52
+ def check_name_availability_with_http_info(parameters, custom_headers = nil)
53
+ check_name_availability_async(parameters, custom_headers).value!
210
54
  end
211
55
 
212
56
  #
213
- # Creates or updates the server's connection policy.
57
+ # Determines whether a resource can be created with the specified name.
214
58
  #
215
- # @param resource_group_name [String] The name of the resource group that
216
- # contains the resource. You can obtain this value from the Azure Resource
217
- # Manager API or the portal.
218
- # @param server_name [String] The name of the server.
219
- # @param parameters [ServerConnectionPolicy] The required parameters for
220
- # updating a secure connection policy.
59
+ # @param parameters [CheckNameAvailabilityRequest] The parameters to request
60
+ # for name availability.
221
61
  # @param [Hash{String => String}] A hash of custom headers that will be added
222
62
  # to the HTTP request.
223
63
  #
224
64
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
225
65
  #
226
- def create_or_update_connection_policy_async(resource_group_name, server_name, parameters, custom_headers = nil)
66
+ def check_name_availability_async(parameters, custom_headers = nil)
227
67
  api_version = '2014-04-01'
228
68
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
229
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
230
- fail ArgumentError, 'server_name is nil' if server_name.nil?
231
- connection_policy_name = 'default'
232
69
  fail ArgumentError, 'parameters is nil' if parameters.nil?
233
70
 
234
71
 
@@ -241,29 +78,29 @@ module Azure::ARM::SQL
241
78
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
242
79
 
243
80
  # Serialize Request
244
- request_mapper = Azure::ARM::SQL::Models::ServerConnectionPolicy.mapper()
81
+ request_mapper = Azure::ARM::SQL::Models::CheckNameAvailabilityRequest.mapper()
245
82
  request_content = @client.serialize(request_mapper, parameters)
246
83
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
247
84
 
248
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'
85
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability'
249
86
 
250
87
  request_url = @base_url || @client.base_url
251
88
 
252
89
  options = {
253
90
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
254
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'connectionPolicyName' => connection_policy_name},
91
+ path_params: {'subscriptionId' => @client.subscription_id},
255
92
  query_params: {'api-version' => api_version},
256
93
  body: request_content,
257
94
  headers: request_headers.merge(custom_headers || {}),
258
95
  base_url: request_url
259
96
  }
260
- promise = @client.make_request_async(:put, path_template, options)
97
+ promise = @client.make_request_async(:post, path_template, options)
261
98
 
262
99
  promise = promise.then do |result|
263
100
  http_response = result.response
264
101
  status_code = http_response.status
265
102
  response_content = http_response.body
266
- unless status_code == 200 || status_code == 201
103
+ unless status_code == 200
267
104
  error_model = JSON.load(response_content)
268
105
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
269
106
  end
@@ -273,17 +110,7 @@ module Azure::ARM::SQL
273
110
  if status_code == 200
274
111
  begin
275
112
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
276
- result_mapper = Azure::ARM::SQL::Models::ServerConnectionPolicy.mapper()
277
- result.body = @client.deserialize(result_mapper, parsed_response)
278
- rescue Exception => e
279
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
280
- end
281
- end
282
- # Deserialize Response
283
- if status_code == 201
284
- begin
285
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
286
- result_mapper = Azure::ARM::SQL::Models::ServerConnectionPolicy.mapper()
113
+ result_mapper = Azure::ARM::SQL::Models::CheckNameAvailabilityResponse.mapper()
287
114
  result.body = @client.deserialize(result_mapper, parsed_response)
288
115
  rescue Exception => e
289
116
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -297,56 +124,41 @@ module Azure::ARM::SQL
297
124
  end
298
125
 
299
126
  #
300
- # Gets the server's secure connection policy.
127
+ # Gets a list of all servers in the subscription.
301
128
  #
302
- # @param resource_group_name [String] The name of the resource group that
303
- # contains the resource. You can obtain this value from the Azure Resource
304
- # Manager API or the portal.
305
- # @param server_name [String] The name of the server.
306
129
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
307
130
  # will be added to the HTTP request.
308
131
  #
309
- # @return [ServerConnectionPolicy] operation results.
132
+ # @return [Array<Server>] operation results.
310
133
  #
311
- def get_connection_policy(resource_group_name, server_name, custom_headers = nil)
312
- response = get_connection_policy_async(resource_group_name, server_name, custom_headers).value!
313
- response.body unless response.nil?
134
+ def list(custom_headers = nil)
135
+ first_page = list_as_lazy(custom_headers)
136
+ first_page.get_all_items
314
137
  end
315
138
 
316
139
  #
317
- # Gets the server's secure connection policy.
140
+ # Gets a list of all servers in the subscription.
318
141
  #
319
- # @param resource_group_name [String] The name of the resource group that
320
- # contains the resource. You can obtain this value from the Azure Resource
321
- # Manager API or the portal.
322
- # @param server_name [String] The name of the server.
323
142
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
324
143
  # will be added to the HTTP request.
325
144
  #
326
145
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
327
146
  #
328
- def get_connection_policy_with_http_info(resource_group_name, server_name, custom_headers = nil)
329
- get_connection_policy_async(resource_group_name, server_name, custom_headers).value!
147
+ def list_with_http_info(custom_headers = nil)
148
+ list_async(custom_headers).value!
330
149
  end
331
150
 
332
151
  #
333
- # Gets the server's secure connection policy.
152
+ # Gets a list of all servers in the subscription.
334
153
  #
335
- # @param resource_group_name [String] The name of the resource group that
336
- # contains the resource. You can obtain this value from the Azure Resource
337
- # Manager API or the portal.
338
- # @param server_name [String] The name of the server.
339
154
  # @param [Hash{String => String}] A hash of custom headers that will be added
340
155
  # to the HTTP request.
341
156
  #
342
157
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
343
158
  #
344
- def get_connection_policy_async(resource_group_name, server_name, custom_headers = nil)
345
- api_version = '2014-04-01'
159
+ def list_async(custom_headers = nil)
346
160
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
347
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
348
- fail ArgumentError, 'server_name is nil' if server_name.nil?
349
- connection_policy_name = 'default'
161
+ api_version = '2015-05-01-preview'
350
162
 
351
163
 
352
164
  request_headers = {}
@@ -354,13 +166,13 @@ module Azure::ARM::SQL
354
166
  # Set Headers
355
167
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
356
168
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
357
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'
169
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers'
358
170
 
359
171
  request_url = @base_url || @client.base_url
360
172
 
361
173
  options = {
362
174
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
363
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'connectionPolicyName' => connection_policy_name},
175
+ path_params: {'subscriptionId' => @client.subscription_id},
364
176
  query_params: {'api-version' => api_version},
365
177
  headers: request_headers.merge(custom_headers || {}),
366
178
  base_url: request_url
@@ -381,7 +193,7 @@ module Azure::ARM::SQL
381
193
  if status_code == 200
382
194
  begin
383
195
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
384
- result_mapper = Azure::ARM::SQL::Models::ServerConnectionPolicy.mapper()
196
+ result_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper()
385
197
  result.body = @client.deserialize(result_mapper, parsed_response)
386
198
  rescue Exception => e
387
199
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -395,62 +207,51 @@ module Azure::ARM::SQL
395
207
  end
396
208
 
397
209
  #
398
- # Gets a database service objective.
210
+ # Gets a list of servers in a resource groups.
399
211
  #
400
212
  # @param resource_group_name [String] The name of the resource group that
401
213
  # contains the resource. You can obtain this value from the Azure Resource
402
214
  # Manager API or the portal.
403
- # @param server_name [String] The name of the server.
404
- # @param service_objective_name [String] The name of the service objective to
405
- # retrieve.
406
215
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
407
216
  # will be added to the HTTP request.
408
217
  #
409
- # @return [ServiceObjective] operation results.
218
+ # @return [Array<Server>] operation results.
410
219
  #
411
- def get_service_objective(resource_group_name, server_name, service_objective_name, custom_headers = nil)
412
- response = get_service_objective_async(resource_group_name, server_name, service_objective_name, custom_headers).value!
413
- response.body unless response.nil?
220
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
221
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
222
+ first_page.get_all_items
414
223
  end
415
224
 
416
225
  #
417
- # Gets a database service objective.
226
+ # Gets a list of servers in a resource groups.
418
227
  #
419
228
  # @param resource_group_name [String] The name of the resource group that
420
229
  # contains the resource. You can obtain this value from the Azure Resource
421
230
  # Manager API or the portal.
422
- # @param server_name [String] The name of the server.
423
- # @param service_objective_name [String] The name of the service objective to
424
- # retrieve.
425
231
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
426
232
  # will be added to the HTTP request.
427
233
  #
428
234
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
429
235
  #
430
- def get_service_objective_with_http_info(resource_group_name, server_name, service_objective_name, custom_headers = nil)
431
- get_service_objective_async(resource_group_name, server_name, service_objective_name, custom_headers).value!
236
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
237
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
432
238
  end
433
239
 
434
240
  #
435
- # Gets a database service objective.
241
+ # Gets a list of servers in a resource groups.
436
242
  #
437
243
  # @param resource_group_name [String] The name of the resource group that
438
244
  # contains the resource. You can obtain this value from the Azure Resource
439
245
  # Manager API or the portal.
440
- # @param server_name [String] The name of the server.
441
- # @param service_objective_name [String] The name of the service objective to
442
- # retrieve.
443
246
  # @param [Hash{String => String}] A hash of custom headers that will be added
444
247
  # to the HTTP request.
445
248
  #
446
249
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
447
250
  #
448
- def get_service_objective_async(resource_group_name, server_name, service_objective_name, custom_headers = nil)
449
- api_version = '2014-04-01'
450
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
251
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
451
252
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
452
- fail ArgumentError, 'server_name is nil' if server_name.nil?
453
- fail ArgumentError, 'service_objective_name is nil' if service_objective_name.nil?
253
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
254
+ api_version = '2015-05-01-preview'
454
255
 
455
256
 
456
257
  request_headers = {}
@@ -458,13 +259,13 @@ module Azure::ARM::SQL
458
259
  # Set Headers
459
260
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
460
261
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
461
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}'
262
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers'
462
263
 
463
264
  request_url = @base_url || @client.base_url
464
265
 
465
266
  options = {
466
267
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
467
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'serviceObjectiveName' => service_objective_name},
268
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
468
269
  query_params: {'api-version' => api_version},
469
270
  headers: request_headers.merge(custom_headers || {}),
470
271
  base_url: request_url
@@ -485,7 +286,7 @@ module Azure::ARM::SQL
485
286
  if status_code == 200
486
287
  begin
487
288
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
488
- result_mapper = Azure::ARM::SQL::Models::ServiceObjective.mapper()
289
+ result_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper()
489
290
  result.body = @client.deserialize(result_mapper, parsed_response)
490
291
  rescue Exception => e
491
292
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -499,7 +300,7 @@ module Azure::ARM::SQL
499
300
  end
500
301
 
501
302
  #
502
- # Returns database service objectives.
303
+ # Gets a server.
503
304
  #
504
305
  # @param resource_group_name [String] The name of the resource group that
505
306
  # contains the resource. You can obtain this value from the Azure Resource
@@ -508,15 +309,15 @@ module Azure::ARM::SQL
508
309
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
509
310
  # will be added to the HTTP request.
510
311
  #
511
- # @return [ServiceObjectiveListResult] operation results.
312
+ # @return [Server] operation results.
512
313
  #
513
- def list_service_objectives(resource_group_name, server_name, custom_headers = nil)
514
- response = list_service_objectives_async(resource_group_name, server_name, custom_headers).value!
314
+ def get(resource_group_name, server_name, custom_headers = nil)
315
+ response = get_async(resource_group_name, server_name, custom_headers).value!
515
316
  response.body unless response.nil?
516
317
  end
517
318
 
518
319
  #
519
- # Returns database service objectives.
320
+ # Gets a server.
520
321
  #
521
322
  # @param resource_group_name [String] The name of the resource group that
522
323
  # contains the resource. You can obtain this value from the Azure Resource
@@ -527,12 +328,12 @@ module Azure::ARM::SQL
527
328
  #
528
329
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
529
330
  #
530
- def list_service_objectives_with_http_info(resource_group_name, server_name, custom_headers = nil)
531
- list_service_objectives_async(resource_group_name, server_name, custom_headers).value!
331
+ def get_with_http_info(resource_group_name, server_name, custom_headers = nil)
332
+ get_async(resource_group_name, server_name, custom_headers).value!
532
333
  end
533
334
 
534
335
  #
535
- # Returns database service objectives.
336
+ # Gets a server.
536
337
  #
537
338
  # @param resource_group_name [String] The name of the resource group that
538
339
  # contains the resource. You can obtain this value from the Azure Resource
@@ -543,1002 +344,36 @@ module Azure::ARM::SQL
543
344
  #
544
345
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
545
346
  #
546
- def list_service_objectives_async(resource_group_name, server_name, custom_headers = nil)
547
- api_version = '2014-04-01'
548
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
347
+ def get_async(resource_group_name, server_name, custom_headers = nil)
549
348
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
550
349
  fail ArgumentError, 'server_name is nil' if server_name.nil?
350
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
351
+ api_version = '2015-05-01-preview'
551
352
 
552
353
 
553
354
  request_headers = {}
554
355
 
555
356
  # Set Headers
556
357
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
557
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
558
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives'
559
-
560
- request_url = @base_url || @client.base_url
561
-
562
- options = {
563
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
564
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
565
- query_params: {'api-version' => api_version},
566
- headers: request_headers.merge(custom_headers || {}),
567
- base_url: request_url
568
- }
569
- promise = @client.make_request_async(:get, path_template, options)
570
-
571
- promise = promise.then do |result|
572
- http_response = result.response
573
- status_code = http_response.status
574
- response_content = http_response.body
575
- unless status_code == 200
576
- error_model = JSON.load(response_content)
577
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
578
- end
579
-
580
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
581
- # Deserialize Response
582
- if status_code == 200
583
- begin
584
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
585
- result_mapper = Azure::ARM::SQL::Models::ServiceObjectiveListResult.mapper()
586
- result.body = @client.deserialize(result_mapper, parsed_response)
587
- rescue Exception => e
588
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
589
- end
590
- end
591
-
592
- result
593
- end
594
-
595
- promise.execute
596
- end
597
-
598
- #
599
- # Determines whether a resource can be created with the specified name.
600
- #
601
- # @param parameters [CheckNameAvailabilityRequest] The parameters to request
602
- # for name availability.
603
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
604
- # will be added to the HTTP request.
605
- #
606
- # @return [CheckNameAvailabilityResponse] operation results.
607
- #
608
- def check_name_availability(parameters, custom_headers = nil)
609
- response = check_name_availability_async(parameters, custom_headers).value!
610
- response.body unless response.nil?
611
- end
612
-
613
- #
614
- # Determines whether a resource can be created with the specified name.
615
- #
616
- # @param parameters [CheckNameAvailabilityRequest] The parameters to request
617
- # for name availability.
618
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
- # will be added to the HTTP request.
620
- #
621
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
622
- #
623
- def check_name_availability_with_http_info(parameters, custom_headers = nil)
624
- check_name_availability_async(parameters, custom_headers).value!
625
- end
626
-
627
- #
628
- # Determines whether a resource can be created with the specified name.
629
- #
630
- # @param parameters [CheckNameAvailabilityRequest] The parameters to request
631
- # for name availability.
632
- # @param [Hash{String => String}] A hash of custom headers that will be added
633
- # to the HTTP request.
634
- #
635
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
636
- #
637
- def check_name_availability_async(parameters, custom_headers = nil)
638
- api_version = '2014-04-01'
639
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
640
- fail ArgumentError, 'parameters is nil' if parameters.nil?
641
-
642
-
643
- request_headers = {}
644
-
645
- # Set Headers
646
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
647
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
648
-
649
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
650
-
651
- # Serialize Request
652
- request_mapper = Azure::ARM::SQL::Models::CheckNameAvailabilityRequest.mapper()
653
- request_content = @client.serialize(request_mapper, parameters)
654
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
655
-
656
- path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability'
657
-
658
- request_url = @base_url || @client.base_url
659
-
660
- options = {
661
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
662
- path_params: {'subscriptionId' => @client.subscription_id},
663
- query_params: {'api-version' => api_version},
664
- body: request_content,
665
- headers: request_headers.merge(custom_headers || {}),
666
- base_url: request_url
667
- }
668
- promise = @client.make_request_async(:post, path_template, options)
669
-
670
- promise = promise.then do |result|
671
- http_response = result.response
672
- status_code = http_response.status
673
- response_content = http_response.body
674
- unless status_code == 200
675
- error_model = JSON.load(response_content)
676
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
677
- end
678
-
679
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
680
- # Deserialize Response
681
- if status_code == 200
682
- begin
683
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
684
- result_mapper = Azure::ARM::SQL::Models::CheckNameAvailabilityResponse.mapper()
685
- result.body = @client.deserialize(result_mapper, parsed_response)
686
- rescue Exception => e
687
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
688
- end
689
- end
690
-
691
- result
692
- end
693
-
694
- promise.execute
695
- end
696
-
697
- #
698
- # Returns server usages.
699
- #
700
- # @param resource_group_name [String] The name of the resource group that
701
- # contains the resource. You can obtain this value from the Azure Resource
702
- # Manager API or the portal.
703
- # @param server_name [String] The name of the server.
704
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
705
- # will be added to the HTTP request.
706
- #
707
- # @return [ServerUsageListResult] operation results.
708
- #
709
- def list_usages(resource_group_name, server_name, custom_headers = nil)
710
- response = list_usages_async(resource_group_name, server_name, custom_headers).value!
711
- response.body unless response.nil?
712
- end
713
-
714
- #
715
- # Returns server usages.
716
- #
717
- # @param resource_group_name [String] The name of the resource group that
718
- # contains the resource. You can obtain this value from the Azure Resource
719
- # Manager API or the portal.
720
- # @param server_name [String] The name of the server.
721
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
722
- # will be added to the HTTP request.
723
- #
724
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
725
- #
726
- def list_usages_with_http_info(resource_group_name, server_name, custom_headers = nil)
727
- list_usages_async(resource_group_name, server_name, custom_headers).value!
728
- end
729
-
730
- #
731
- # Returns server usages.
732
- #
733
- # @param resource_group_name [String] The name of the resource group that
734
- # contains the resource. You can obtain this value from the Azure Resource
735
- # Manager API or the portal.
736
- # @param server_name [String] The name of the server.
737
- # @param [Hash{String => String}] A hash of custom headers that will be added
738
- # to the HTTP request.
739
- #
740
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
741
- #
742
- def list_usages_async(resource_group_name, server_name, custom_headers = nil)
743
- api_version = '2014-04-01'
744
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
745
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
746
- fail ArgumentError, 'server_name is nil' if server_name.nil?
747
-
748
-
749
- request_headers = {}
750
-
751
- # Set Headers
752
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
753
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
754
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages'
755
-
756
- request_url = @base_url || @client.base_url
757
-
758
- options = {
759
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
760
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
761
- query_params: {'api-version' => api_version},
762
- headers: request_headers.merge(custom_headers || {}),
763
- base_url: request_url
764
- }
765
- promise = @client.make_request_async(:get, path_template, options)
766
-
767
- promise = promise.then do |result|
768
- http_response = result.response
769
- status_code = http_response.status
770
- response_content = http_response.body
771
- unless status_code == 200
772
- error_model = JSON.load(response_content)
773
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
774
- end
775
-
776
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
777
- # Deserialize Response
778
- if status_code == 200
779
- begin
780
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
781
- result_mapper = Azure::ARM::SQL::Models::ServerUsageListResult.mapper()
782
- result.body = @client.deserialize(result_mapper, parsed_response)
783
- rescue Exception => e
784
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
785
- end
786
- end
787
-
788
- result
789
- end
790
-
791
- promise.execute
792
- end
793
-
794
- #
795
- # Returns a list of the server encryption protectors
796
- #
797
- # @param resource_group_name [String] The name of the resource group that
798
- # contains the resource. You can obtain this value from the Azure Resource
799
- # Manager API or the portal.
800
- # @param server_name [String] The name of the server.
801
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
802
- # will be added to the HTTP request.
803
- #
804
- # @return [Array<EncryptionProtector>] operation results.
805
- #
806
- def list_encryption_protectors(resource_group_name, server_name, custom_headers = nil)
807
- first_page = list_encryption_protectors_as_lazy(resource_group_name, server_name, custom_headers)
808
- first_page.get_all_items
809
- end
810
-
811
- #
812
- # Returns a list of the server encryption protectors
813
- #
814
- # @param resource_group_name [String] The name of the resource group that
815
- # contains the resource. You can obtain this value from the Azure Resource
816
- # Manager API or the portal.
817
- # @param server_name [String] The name of the server.
818
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
819
- # will be added to the HTTP request.
820
- #
821
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
822
- #
823
- def list_encryption_protectors_with_http_info(resource_group_name, server_name, custom_headers = nil)
824
- list_encryption_protectors_async(resource_group_name, server_name, custom_headers).value!
825
- end
826
-
827
- #
828
- # Returns a list of the server encryption protectors
829
- #
830
- # @param resource_group_name [String] The name of the resource group that
831
- # contains the resource. You can obtain this value from the Azure Resource
832
- # Manager API or the portal.
833
- # @param server_name [String] The name of the server.
834
- # @param [Hash{String => String}] A hash of custom headers that will be added
835
- # to the HTTP request.
836
- #
837
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
838
- #
839
- def list_encryption_protectors_async(resource_group_name, server_name, custom_headers = nil)
840
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
841
- fail ArgumentError, 'server_name is nil' if server_name.nil?
842
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
843
- api_version = '2015-05-01-preview'
844
-
845
-
846
- request_headers = {}
847
-
848
- # Set Headers
849
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
850
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
851
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector'
852
-
853
- request_url = @base_url || @client.base_url
854
-
855
- options = {
856
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
857
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
858
- query_params: {'api-version' => api_version},
859
- headers: request_headers.merge(custom_headers || {}),
860
- base_url: request_url
861
- }
862
- promise = @client.make_request_async(:get, path_template, options)
863
-
864
- promise = promise.then do |result|
865
- http_response = result.response
866
- status_code = http_response.status
867
- response_content = http_response.body
868
- unless status_code == 200
869
- error_model = JSON.load(response_content)
870
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
871
- end
872
-
873
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
874
- # Deserialize Response
875
- if status_code == 200
876
- begin
877
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
878
- result_mapper = Azure::ARM::SQL::Models::EncryptionProtectorListResult.mapper()
879
- result.body = @client.deserialize(result_mapper, parsed_response)
880
- rescue Exception => e
881
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
882
- end
883
- end
884
-
885
- result
886
- end
887
-
888
- promise.execute
889
- end
890
-
891
- #
892
- # Returns the server encryption protector.
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 custom_headers [Hash{String => String}] A hash of custom headers that
899
- # will be added to the HTTP request.
900
- #
901
- # @return [EncryptionProtector] operation results.
902
- #
903
- def get_encryption_protector(resource_group_name, server_name, custom_headers = nil)
904
- response = get_encryption_protector_async(resource_group_name, server_name, custom_headers).value!
905
- response.body unless response.nil?
906
- end
907
-
908
- #
909
- # Returns the server encryption protector.
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 custom_headers [Hash{String => String}] A hash of custom headers that
916
- # will be added to the HTTP request.
917
- #
918
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
919
- #
920
- def get_encryption_protector_with_http_info(resource_group_name, server_name, custom_headers = nil)
921
- get_encryption_protector_async(resource_group_name, server_name, custom_headers).value!
922
- end
923
-
924
- #
925
- # Returns the server encryption protector.
926
- #
927
- # @param resource_group_name [String] The name of the resource group that
928
- # contains the resource. You can obtain this value from the Azure Resource
929
- # Manager API or the portal.
930
- # @param server_name [String] The name of the server.
931
- # @param [Hash{String => String}] A hash of custom headers that will be added
932
- # to the HTTP request.
933
- #
934
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
935
- #
936
- def get_encryption_protector_async(resource_group_name, server_name, custom_headers = nil)
937
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
938
- fail ArgumentError, 'server_name is nil' if server_name.nil?
939
- encryption_protector_name = 'current'
940
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
941
- api_version = '2015-05-01-preview'
942
-
943
-
944
- request_headers = {}
945
-
946
- # Set Headers
947
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
948
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
949
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}'
950
-
951
- request_url = @base_url || @client.base_url
952
-
953
- options = {
954
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
955
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'encryptionProtectorName' => encryption_protector_name,'subscriptionId' => @client.subscription_id},
956
- query_params: {'api-version' => api_version},
957
- headers: request_headers.merge(custom_headers || {}),
958
- base_url: request_url
959
- }
960
- promise = @client.make_request_async(:get, path_template, options)
961
-
962
- promise = promise.then do |result|
963
- http_response = result.response
964
- status_code = http_response.status
965
- response_content = http_response.body
966
- unless status_code == 200
967
- error_model = JSON.load(response_content)
968
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
969
- end
970
-
971
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
972
- # Deserialize Response
973
- if status_code == 200
974
- begin
975
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
976
- result_mapper = Azure::ARM::SQL::Models::EncryptionProtector.mapper()
977
- result.body = @client.deserialize(result_mapper, parsed_response)
978
- rescue Exception => e
979
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
980
- end
981
- end
982
-
983
- result
984
- end
985
-
986
- promise.execute
987
- end
988
-
989
- #
990
- # Updates an existing encryption protector.
991
- #
992
- # @param resource_group_name [String] The name of the resource group that
993
- # contains the resource. You can obtain this value from the Azure Resource
994
- # Manager API or the portal.
995
- # @param server_name [String] The name of the server.
996
- # @param parameters [EncryptionProtector] The requested encryption protector
997
- # resource state.
998
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
999
- # will be added to the HTTP request.
1000
- #
1001
- # @return [EncryptionProtector] operation results.
1002
- #
1003
- def create_or_update_encryption_protector(resource_group_name, server_name, parameters, custom_headers = nil)
1004
- response = create_or_update_encryption_protector_async(resource_group_name, server_name, parameters, custom_headers).value!
1005
- response.body unless response.nil?
1006
- end
1007
-
1008
- #
1009
- # @param resource_group_name [String] The name of the resource group that
1010
- # contains the resource. You can obtain this value from the Azure Resource
1011
- # Manager API or the portal.
1012
- # @param server_name [String] The name of the server.
1013
- # @param parameters [EncryptionProtector] The requested encryption protector
1014
- # resource state.
1015
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1016
- # will be added to the HTTP request.
1017
- #
1018
- # @return [Concurrent::Promise] promise which provides async access to http
1019
- # response.
1020
- #
1021
- def create_or_update_encryption_protector_async(resource_group_name, server_name, parameters, custom_headers = nil)
1022
- # Send request
1023
- promise = begin_create_or_update_encryption_protector_async(resource_group_name, server_name, parameters, custom_headers)
1024
-
1025
- promise = promise.then do |response|
1026
- # Defining deserialization method.
1027
- deserialize_method = lambda do |parsed_response|
1028
- result_mapper = Azure::ARM::SQL::Models::EncryptionProtector.mapper()
1029
- parsed_response = @client.deserialize(result_mapper, parsed_response)
1030
- end
1031
-
1032
- # Waiting for response.
1033
- @client.get_long_running_operation_result(response, deserialize_method)
1034
- end
1035
-
1036
- promise
1037
- end
1038
-
1039
- #
1040
- # Gets a list of all servers in the subscription.
1041
- #
1042
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1043
- # will be added to the HTTP request.
1044
- #
1045
- # @return [Array<Server>] operation results.
1046
- #
1047
- def list(custom_headers = nil)
1048
- first_page = list_as_lazy(custom_headers)
1049
- first_page.get_all_items
1050
- end
1051
-
1052
- #
1053
- # Gets a list of all servers in the subscription.
1054
- #
1055
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1056
- # will be added to the HTTP request.
1057
- #
1058
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1059
- #
1060
- def list_with_http_info(custom_headers = nil)
1061
- list_async(custom_headers).value!
1062
- end
1063
-
1064
- #
1065
- # Gets a list of all servers in the subscription.
1066
- #
1067
- # @param [Hash{String => String}] A hash of custom headers that will be added
1068
- # to the HTTP request.
1069
- #
1070
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1071
- #
1072
- def list_async(custom_headers = nil)
1073
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1074
- api_version = '2015-05-01-preview'
1075
-
1076
-
1077
- request_headers = {}
1078
-
1079
- # Set Headers
1080
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1081
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1082
- path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers'
1083
-
1084
- request_url = @base_url || @client.base_url
1085
-
1086
- options = {
1087
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1088
- path_params: {'subscriptionId' => @client.subscription_id},
1089
- query_params: {'api-version' => api_version},
1090
- headers: request_headers.merge(custom_headers || {}),
1091
- base_url: request_url
1092
- }
1093
- promise = @client.make_request_async(:get, path_template, options)
1094
-
1095
- promise = promise.then do |result|
1096
- http_response = result.response
1097
- status_code = http_response.status
1098
- response_content = http_response.body
1099
- unless status_code == 200
1100
- error_model = JSON.load(response_content)
1101
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1102
- end
1103
-
1104
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1105
- # Deserialize Response
1106
- if status_code == 200
1107
- begin
1108
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1109
- result_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper()
1110
- result.body = @client.deserialize(result_mapper, parsed_response)
1111
- rescue Exception => e
1112
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1113
- end
1114
- end
1115
-
1116
- result
1117
- end
1118
-
1119
- promise.execute
1120
- end
1121
-
1122
- #
1123
- # Gets a list of servers in a resource groups.
1124
- #
1125
- # @param resource_group_name [String] The name of the resource group that
1126
- # contains the resource. You can obtain this value from the Azure Resource
1127
- # Manager API or the portal.
1128
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1129
- # will be added to the HTTP request.
1130
- #
1131
- # @return [Array<Server>] operation results.
1132
- #
1133
- def list_by_resource_group(resource_group_name, custom_headers = nil)
1134
- first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
1135
- first_page.get_all_items
1136
- end
1137
-
1138
- #
1139
- # Gets a list of servers in a resource groups.
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 custom_headers [Hash{String => String}] A hash of custom headers that
1145
- # will be added to the HTTP request.
1146
- #
1147
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1148
- #
1149
- def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
1150
- list_by_resource_group_async(resource_group_name, custom_headers).value!
1151
- end
1152
-
1153
- #
1154
- # Gets a list of servers in a resource groups.
1155
- #
1156
- # @param resource_group_name [String] The name of the resource group that
1157
- # contains the resource. You can obtain this value from the Azure Resource
1158
- # Manager API or the portal.
1159
- # @param [Hash{String => String}] A hash of custom headers that will be added
1160
- # to the HTTP request.
1161
- #
1162
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1163
- #
1164
- def list_by_resource_group_async(resource_group_name, custom_headers = nil)
1165
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1166
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1167
- api_version = '2015-05-01-preview'
1168
-
1169
-
1170
- request_headers = {}
1171
-
1172
- # Set Headers
1173
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1174
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1175
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers'
1176
-
1177
- request_url = @base_url || @client.base_url
1178
-
1179
- options = {
1180
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1181
- path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
1182
- query_params: {'api-version' => api_version},
1183
- headers: request_headers.merge(custom_headers || {}),
1184
- base_url: request_url
1185
- }
1186
- promise = @client.make_request_async(:get, path_template, options)
1187
-
1188
- promise = promise.then do |result|
1189
- http_response = result.response
1190
- status_code = http_response.status
1191
- response_content = http_response.body
1192
- unless status_code == 200
1193
- error_model = JSON.load(response_content)
1194
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1195
- end
1196
-
1197
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1198
- # Deserialize Response
1199
- if status_code == 200
1200
- begin
1201
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1202
- result_mapper = Azure::ARM::SQL::Models::ServerListResult.mapper()
1203
- result.body = @client.deserialize(result_mapper, parsed_response)
1204
- rescue Exception => e
1205
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1206
- end
1207
- end
1208
-
1209
- result
1210
- end
1211
-
1212
- promise.execute
1213
- end
1214
-
1215
- #
1216
- # Gets a server.
1217
- #
1218
- # @param resource_group_name [String] The name of the resource group that
1219
- # contains the resource. You can obtain this value from the Azure Resource
1220
- # Manager API or the portal.
1221
- # @param server_name [String] The name of the server.
1222
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1223
- # will be added to the HTTP request.
1224
- #
1225
- # @return [Server] operation results.
1226
- #
1227
- def get(resource_group_name, server_name, custom_headers = nil)
1228
- response = get_async(resource_group_name, server_name, custom_headers).value!
1229
- response.body unless response.nil?
1230
- end
1231
-
1232
- #
1233
- # Gets a server.
1234
- #
1235
- # @param resource_group_name [String] The name of the resource group that
1236
- # contains the resource. You can obtain this value from the Azure Resource
1237
- # Manager API or the portal.
1238
- # @param server_name [String] The name of the server.
1239
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1240
- # will be added to the HTTP request.
1241
- #
1242
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1243
- #
1244
- def get_with_http_info(resource_group_name, server_name, custom_headers = nil)
1245
- get_async(resource_group_name, server_name, custom_headers).value!
1246
- end
1247
-
1248
- #
1249
- # Gets a server.
1250
- #
1251
- # @param resource_group_name [String] The name of the resource group that
1252
- # contains the resource. You can obtain this value from the Azure Resource
1253
- # Manager API or the portal.
1254
- # @param server_name [String] The name of the server.
1255
- # @param [Hash{String => String}] A hash of custom headers that will be added
1256
- # to the HTTP request.
1257
- #
1258
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1259
- #
1260
- def get_async(resource_group_name, server_name, custom_headers = nil)
1261
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1262
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1263
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1264
- api_version = '2015-05-01-preview'
1265
-
1266
-
1267
- request_headers = {}
1268
-
1269
- # Set Headers
1270
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1271
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1272
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}'
1273
-
1274
- request_url = @base_url || @client.base_url
1275
-
1276
- options = {
1277
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1278
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1279
- query_params: {'api-version' => api_version},
1280
- headers: request_headers.merge(custom_headers || {}),
1281
- base_url: request_url
1282
- }
1283
- promise = @client.make_request_async(:get, path_template, options)
1284
-
1285
- promise = promise.then do |result|
1286
- http_response = result.response
1287
- status_code = http_response.status
1288
- response_content = http_response.body
1289
- unless status_code == 200
1290
- error_model = JSON.load(response_content)
1291
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1292
- end
1293
-
1294
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1295
- # Deserialize Response
1296
- if status_code == 200
1297
- begin
1298
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1299
- result_mapper = Azure::ARM::SQL::Models::Server.mapper()
1300
- result.body = @client.deserialize(result_mapper, parsed_response)
1301
- rescue Exception => e
1302
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1303
- end
1304
- end
1305
-
1306
- result
1307
- end
1308
-
1309
- promise.execute
1310
- end
1311
-
1312
- #
1313
- # Creates or updates a server.
1314
- #
1315
- # @param resource_group_name [String] The name of the resource group that
1316
- # contains the resource. You can obtain this value from the Azure Resource
1317
- # Manager API or the portal.
1318
- # @param server_name [String] The name of the server.
1319
- # @param parameters [Server] The requested server resource state.
1320
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1321
- # will be added to the HTTP request.
1322
- #
1323
- # @return [Server] operation results.
1324
- #
1325
- def create_or_update(resource_group_name, server_name, parameters, custom_headers = nil)
1326
- response = create_or_update_async(resource_group_name, server_name, parameters, custom_headers).value!
1327
- response.body unless response.nil?
1328
- end
1329
-
1330
- #
1331
- # @param resource_group_name [String] The name of the resource group that
1332
- # contains the resource. You can obtain this value from the Azure Resource
1333
- # Manager API or the portal.
1334
- # @param server_name [String] The name of the server.
1335
- # @param parameters [Server] The requested server resource state.
1336
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1337
- # will be added to the HTTP request.
1338
- #
1339
- # @return [Concurrent::Promise] promise which provides async access to http
1340
- # response.
1341
- #
1342
- def create_or_update_async(resource_group_name, server_name, parameters, custom_headers = nil)
1343
- # Send request
1344
- promise = begin_create_or_update_async(resource_group_name, server_name, parameters, custom_headers)
1345
-
1346
- promise = promise.then do |response|
1347
- # Defining deserialization method.
1348
- deserialize_method = lambda do |parsed_response|
1349
- result_mapper = Azure::ARM::SQL::Models::Server.mapper()
1350
- parsed_response = @client.deserialize(result_mapper, parsed_response)
1351
- end
1352
-
1353
- # Waiting for response.
1354
- @client.get_long_running_operation_result(response, deserialize_method)
1355
- end
1356
-
1357
- promise
1358
- end
1359
-
1360
- #
1361
- # Deletes a server.
1362
- #
1363
- # @param resource_group_name [String] The name of the resource group that
1364
- # contains the resource. You can obtain this value from the Azure Resource
1365
- # Manager API or the portal.
1366
- # @param server_name [String] The name of the server.
1367
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1368
- # will be added to the HTTP request.
1369
- #
1370
- def delete(resource_group_name, server_name, custom_headers = nil)
1371
- response = delete_async(resource_group_name, server_name, custom_headers).value!
1372
- nil
1373
- end
1374
-
1375
- #
1376
- # @param resource_group_name [String] The name of the resource group that
1377
- # contains the resource. You can obtain this value from the Azure Resource
1378
- # Manager API or the portal.
1379
- # @param server_name [String] The name of the server.
1380
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1381
- # will be added to the HTTP request.
1382
- #
1383
- # @return [Concurrent::Promise] promise which provides async access to http
1384
- # response.
1385
- #
1386
- def delete_async(resource_group_name, server_name, custom_headers = nil)
1387
- # Send request
1388
- promise = begin_delete_async(resource_group_name, server_name, custom_headers)
1389
-
1390
- promise = promise.then do |response|
1391
- # Defining deserialization method.
1392
- deserialize_method = lambda do |parsed_response|
1393
- end
1394
-
1395
- # Waiting for response.
1396
- @client.get_long_running_operation_result(response, deserialize_method)
1397
- end
1398
-
1399
- promise
1400
- end
1401
-
1402
- #
1403
- # Updates a server.
1404
- #
1405
- # @param resource_group_name [String] The name of the resource group that
1406
- # contains the resource. You can obtain this value from the Azure Resource
1407
- # Manager API or the portal.
1408
- # @param server_name [String] The name of the server.
1409
- # @param parameters [ServerUpdate] The requested server resource state.
1410
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1411
- # will be added to the HTTP request.
1412
- #
1413
- # @return [Server] operation results.
1414
- #
1415
- def update(resource_group_name, server_name, parameters, custom_headers = nil)
1416
- response = update_async(resource_group_name, server_name, parameters, custom_headers).value!
1417
- response.body unless response.nil?
1418
- end
1419
-
1420
- #
1421
- # @param resource_group_name [String] The name of the resource group that
1422
- # contains the resource. You can obtain this value from the Azure Resource
1423
- # Manager API or the portal.
1424
- # @param server_name [String] The name of the server.
1425
- # @param parameters [ServerUpdate] The requested server resource state.
1426
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1427
- # will be added to the HTTP request.
1428
- #
1429
- # @return [Concurrent::Promise] promise which provides async access to http
1430
- # response.
1431
- #
1432
- def update_async(resource_group_name, server_name, parameters, custom_headers = nil)
1433
- # Send request
1434
- promise = begin_update_async(resource_group_name, server_name, parameters, custom_headers)
1435
-
1436
- promise = promise.then do |response|
1437
- # Defining deserialization method.
1438
- deserialize_method = lambda do |parsed_response|
1439
- result_mapper = Azure::ARM::SQL::Models::Server.mapper()
1440
- parsed_response = @client.deserialize(result_mapper, parsed_response)
1441
- end
1442
-
1443
- # Waiting for response.
1444
- @client.get_long_running_operation_result(response, deserialize_method)
1445
- end
1446
-
1447
- promise
1448
- end
1449
-
1450
- #
1451
- # Updates a server backup long term retention vault
1452
- #
1453
- # @param resource_group_name [String] The name of the resource group that
1454
- # contains the resource. You can obtain this value from the Azure Resource
1455
- # Manager API or the portal.
1456
- # @param server_name [String] The name of the server.
1457
- # @param parameters [BackupLongTermRetentionVault] The required parameters to
1458
- # update a backup long term retention vault
1459
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1460
- # will be added to the HTTP request.
1461
- #
1462
- # @return [BackupLongTermRetentionVault] operation results.
1463
- #
1464
- def begin_create_backup_long_term_retention_vault(resource_group_name, server_name, parameters, custom_headers = nil)
1465
- response = begin_create_backup_long_term_retention_vault_async(resource_group_name, server_name, parameters, custom_headers).value!
1466
- response.body unless response.nil?
1467
- end
1468
-
1469
- #
1470
- # Updates a server backup long term retention vault
1471
- #
1472
- # @param resource_group_name [String] The name of the resource group that
1473
- # contains the resource. You can obtain this value from the Azure Resource
1474
- # Manager API or the portal.
1475
- # @param server_name [String] The name of the server.
1476
- # @param parameters [BackupLongTermRetentionVault] The required parameters to
1477
- # update a backup long term retention vault
1478
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1479
- # will be added to the HTTP request.
1480
- #
1481
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1482
- #
1483
- def begin_create_backup_long_term_retention_vault_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil)
1484
- begin_create_backup_long_term_retention_vault_async(resource_group_name, server_name, parameters, custom_headers).value!
1485
- end
1486
-
1487
- #
1488
- # Updates a server backup long term retention vault
1489
- #
1490
- # @param resource_group_name [String] The name of the resource group that
1491
- # contains the resource. You can obtain this value from the Azure Resource
1492
- # Manager API or the portal.
1493
- # @param server_name [String] The name of the server.
1494
- # @param parameters [BackupLongTermRetentionVault] The required parameters to
1495
- # update a backup long term retention vault
1496
- # @param [Hash{String => String}] A hash of custom headers that will be added
1497
- # to the HTTP request.
1498
- #
1499
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1500
- #
1501
- def begin_create_backup_long_term_retention_vault_async(resource_group_name, server_name, parameters, custom_headers = nil)
1502
- api_version = '2014-04-01'
1503
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1504
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1505
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1506
- backup_long_term_retention_vault_name = 'RegisteredVault'
1507
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1508
-
1509
-
1510
- request_headers = {}
1511
-
1512
- # Set Headers
1513
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1514
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1515
-
1516
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1517
-
1518
- # Serialize Request
1519
- request_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
1520
- request_content = @client.serialize(request_mapper, parameters)
1521
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1522
-
1523
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}'
358
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
359
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}'
1524
360
 
1525
361
  request_url = @base_url || @client.base_url
1526
362
 
1527
363
  options = {
1528
364
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1529
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'backupLongTermRetentionVaultName' => backup_long_term_retention_vault_name},
365
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
1530
366
  query_params: {'api-version' => api_version},
1531
- body: request_content,
1532
367
  headers: request_headers.merge(custom_headers || {}),
1533
368
  base_url: request_url
1534
369
  }
1535
- promise = @client.make_request_async(:put, path_template, options)
370
+ promise = @client.make_request_async(:get, path_template, options)
1536
371
 
1537
372
  promise = promise.then do |result|
1538
373
  http_response = result.response
1539
374
  status_code = http_response.status
1540
375
  response_content = http_response.body
1541
- unless status_code == 200 || status_code == 201 || status_code == 202
376
+ unless status_code == 200
1542
377
  error_model = JSON.load(response_content)
1543
378
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1544
379
  end
@@ -1548,17 +383,7 @@ module Azure::ARM::SQL
1548
383
  if status_code == 200
1549
384
  begin
1550
385
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1551
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
1552
- result.body = @client.deserialize(result_mapper, parsed_response)
1553
- rescue Exception => e
1554
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1555
- end
1556
- end
1557
- # Deserialize Response
1558
- if status_code == 201
1559
- begin
1560
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1561
- result_mapper = Azure::ARM::SQL::Models::BackupLongTermRetentionVault.mapper()
386
+ result_mapper = Azure::ARM::SQL::Models::Server.mapper()
1562
387
  result.body = @client.deserialize(result_mapper, parsed_response)
1563
388
  rescue Exception => e
1564
389
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1572,117 +397,141 @@ module Azure::ARM::SQL
1572
397
  end
1573
398
 
1574
399
  #
1575
- # Updates an existing encryption protector.
400
+ # Creates or updates a server.
1576
401
  #
1577
402
  # @param resource_group_name [String] The name of the resource group that
1578
403
  # contains the resource. You can obtain this value from the Azure Resource
1579
404
  # Manager API or the portal.
1580
405
  # @param server_name [String] The name of the server.
1581
- # @param parameters [EncryptionProtector] The requested encryption protector
1582
- # resource state.
406
+ # @param parameters [Server] The requested server resource state.
1583
407
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1584
408
  # will be added to the HTTP request.
1585
409
  #
1586
- # @return [EncryptionProtector] operation results.
410
+ # @return [Server] operation results.
1587
411
  #
1588
- def begin_create_or_update_encryption_protector(resource_group_name, server_name, parameters, custom_headers = nil)
1589
- response = begin_create_or_update_encryption_protector_async(resource_group_name, server_name, parameters, custom_headers).value!
412
+ def create_or_update(resource_group_name, server_name, parameters, custom_headers = nil)
413
+ response = create_or_update_async(resource_group_name, server_name, parameters, custom_headers).value!
1590
414
  response.body unless response.nil?
1591
415
  end
1592
416
 
1593
- #
1594
- # Updates an existing encryption protector.
1595
417
  #
1596
418
  # @param resource_group_name [String] The name of the resource group that
1597
419
  # contains the resource. You can obtain this value from the Azure Resource
1598
420
  # Manager API or the portal.
1599
421
  # @param server_name [String] The name of the server.
1600
- # @param parameters [EncryptionProtector] The requested encryption protector
1601
- # resource state.
422
+ # @param parameters [Server] The requested server resource state.
1602
423
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1603
424
  # will be added to the HTTP request.
1604
425
  #
1605
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
+ # @return [Concurrent::Promise] promise which provides async access to http
427
+ # response.
1606
428
  #
1607
- def begin_create_or_update_encryption_protector_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil)
1608
- begin_create_or_update_encryption_protector_async(resource_group_name, server_name, parameters, custom_headers).value!
429
+ def create_or_update_async(resource_group_name, server_name, parameters, custom_headers = nil)
430
+ # Send request
431
+ promise = begin_create_or_update_async(resource_group_name, server_name, parameters, custom_headers)
432
+
433
+ promise = promise.then do |response|
434
+ # Defining deserialization method.
435
+ deserialize_method = lambda do |parsed_response|
436
+ result_mapper = Azure::ARM::SQL::Models::Server.mapper()
437
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
438
+ end
439
+
440
+ # Waiting for response.
441
+ @client.get_long_running_operation_result(response, deserialize_method)
442
+ end
443
+
444
+ promise
1609
445
  end
1610
446
 
1611
447
  #
1612
- # Updates an existing encryption protector.
448
+ # Deletes a server.
1613
449
  #
1614
450
  # @param resource_group_name [String] The name of the resource group that
1615
451
  # contains the resource. You can obtain this value from the Azure Resource
1616
452
  # Manager API or the portal.
1617
453
  # @param server_name [String] The name of the server.
1618
- # @param parameters [EncryptionProtector] The requested encryption protector
1619
- # resource state.
1620
- # @param [Hash{String => String}] A hash of custom headers that will be added
1621
- # to the HTTP request.
1622
- #
1623
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
454
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
455
+ # will be added to the HTTP request.
1624
456
  #
1625
- def begin_create_or_update_encryption_protector_async(resource_group_name, server_name, parameters, custom_headers = nil)
1626
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1627
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1628
- encryption_protector_name = 'current'
1629
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1630
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1631
- api_version = '2015-05-01-preview'
1632
-
1633
-
1634
- request_headers = {}
1635
-
1636
- # Set Headers
1637
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1638
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
457
+ def delete(resource_group_name, server_name, custom_headers = nil)
458
+ response = delete_async(resource_group_name, server_name, custom_headers).value!
459
+ nil
460
+ end
1639
461
 
1640
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
462
+ #
463
+ # @param resource_group_name [String] The name of the resource group that
464
+ # contains the resource. You can obtain this value from the Azure Resource
465
+ # Manager API or the portal.
466
+ # @param server_name [String] The name of the server.
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [Concurrent::Promise] promise which provides async access to http
471
+ # response.
472
+ #
473
+ def delete_async(resource_group_name, server_name, custom_headers = nil)
474
+ # Send request
475
+ promise = begin_delete_async(resource_group_name, server_name, custom_headers)
1641
476
 
1642
- # Serialize Request
1643
- request_mapper = Azure::ARM::SQL::Models::EncryptionProtector.mapper()
1644
- request_content = @client.serialize(request_mapper, parameters)
1645
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
477
+ promise = promise.then do |response|
478
+ # Defining deserialization method.
479
+ deserialize_method = lambda do |parsed_response|
480
+ end
1646
481
 
1647
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}'
482
+ # Waiting for response.
483
+ @client.get_long_running_operation_result(response, deserialize_method)
484
+ end
1648
485
 
1649
- request_url = @base_url || @client.base_url
486
+ promise
487
+ end
1650
488
 
1651
- options = {
1652
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1653
- path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'encryptionProtectorName' => encryption_protector_name,'subscriptionId' => @client.subscription_id},
1654
- query_params: {'api-version' => api_version},
1655
- body: request_content,
1656
- headers: request_headers.merge(custom_headers || {}),
1657
- base_url: request_url
1658
- }
1659
- promise = @client.make_request_async(:put, path_template, options)
489
+ #
490
+ # Updates a server.
491
+ #
492
+ # @param resource_group_name [String] The name of the resource group that
493
+ # contains the resource. You can obtain this value from the Azure Resource
494
+ # Manager API or the portal.
495
+ # @param server_name [String] The name of the server.
496
+ # @param parameters [ServerUpdate] The requested server resource state.
497
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
498
+ # will be added to the HTTP request.
499
+ #
500
+ # @return [Server] operation results.
501
+ #
502
+ def update(resource_group_name, server_name, parameters, custom_headers = nil)
503
+ response = update_async(resource_group_name, server_name, parameters, custom_headers).value!
504
+ response.body unless response.nil?
505
+ end
1660
506
 
1661
- promise = promise.then do |result|
1662
- http_response = result.response
1663
- status_code = http_response.status
1664
- response_content = http_response.body
1665
- unless status_code == 200 || status_code == 202
1666
- error_model = JSON.load(response_content)
1667
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1668
- end
507
+ #
508
+ # @param resource_group_name [String] The name of the resource group that
509
+ # contains the resource. You can obtain this value from the Azure Resource
510
+ # Manager API or the portal.
511
+ # @param server_name [String] The name of the server.
512
+ # @param parameters [ServerUpdate] The requested server resource state.
513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
514
+ # will be added to the HTTP request.
515
+ #
516
+ # @return [Concurrent::Promise] promise which provides async access to http
517
+ # response.
518
+ #
519
+ def update_async(resource_group_name, server_name, parameters, custom_headers = nil)
520
+ # Send request
521
+ promise = begin_update_async(resource_group_name, server_name, parameters, custom_headers)
1669
522
 
1670
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1671
- # Deserialize Response
1672
- if status_code == 200
1673
- begin
1674
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1675
- result_mapper = Azure::ARM::SQL::Models::EncryptionProtector.mapper()
1676
- result.body = @client.deserialize(result_mapper, parsed_response)
1677
- rescue Exception => e
1678
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1679
- end
523
+ promise = promise.then do |response|
524
+ # Defining deserialization method.
525
+ deserialize_method = lambda do |parsed_response|
526
+ result_mapper = Azure::ARM::SQL::Models::Server.mapper()
527
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1680
528
  end
1681
529
 
1682
- result
530
+ # Waiting for response.
531
+ @client.get_long_running_operation_result(response, deserialize_method)
1683
532
  end
1684
533
 
1685
- promise.execute
534
+ promise
1686
535
  end
1687
536
 
1688
537
  #
@@ -2001,93 +850,6 @@ module Azure::ARM::SQL
2001
850
  promise.execute
2002
851
  end
2003
852
 
2004
- #
2005
- # Returns a list of the server encryption protectors
2006
- #
2007
- # @param next_page_link [String] The NextLink from the previous successful call
2008
- # to List operation.
2009
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2010
- # will be added to the HTTP request.
2011
- #
2012
- # @return [EncryptionProtectorListResult] operation results.
2013
- #
2014
- def list_encryption_protectors_next(next_page_link, custom_headers = nil)
2015
- response = list_encryption_protectors_next_async(next_page_link, custom_headers).value!
2016
- response.body unless response.nil?
2017
- end
2018
-
2019
- #
2020
- # Returns a list of the server encryption protectors
2021
- #
2022
- # @param next_page_link [String] The NextLink from the previous successful call
2023
- # to List operation.
2024
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
2025
- # will be added to the HTTP request.
2026
- #
2027
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2028
- #
2029
- def list_encryption_protectors_next_with_http_info(next_page_link, custom_headers = nil)
2030
- list_encryption_protectors_next_async(next_page_link, custom_headers).value!
2031
- end
2032
-
2033
- #
2034
- # Returns a list of the server encryption protectors
2035
- #
2036
- # @param next_page_link [String] The NextLink from the previous successful call
2037
- # to List operation.
2038
- # @param [Hash{String => String}] A hash of custom headers that will be added
2039
- # to the HTTP request.
2040
- #
2041
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2042
- #
2043
- def list_encryption_protectors_next_async(next_page_link, custom_headers = nil)
2044
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2045
-
2046
-
2047
- request_headers = {}
2048
-
2049
- # Set Headers
2050
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2051
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2052
- path_template = '{nextLink}'
2053
-
2054
- request_url = @base_url || @client.base_url
2055
-
2056
- options = {
2057
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2058
- skip_encoding_path_params: {'nextLink' => next_page_link},
2059
- headers: request_headers.merge(custom_headers || {}),
2060
- base_url: request_url
2061
- }
2062
- promise = @client.make_request_async(:get, path_template, options)
2063
-
2064
- promise = promise.then do |result|
2065
- http_response = result.response
2066
- status_code = http_response.status
2067
- response_content = http_response.body
2068
- unless status_code == 200
2069
- error_model = JSON.load(response_content)
2070
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2071
- end
2072
-
2073
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2074
- # Deserialize Response
2075
- if status_code == 200
2076
- begin
2077
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2078
- result_mapper = Azure::ARM::SQL::Models::EncryptionProtectorListResult.mapper()
2079
- result.body = @client.deserialize(result_mapper, parsed_response)
2080
- rescue Exception => e
2081
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2082
- end
2083
- end
2084
-
2085
- result
2086
- end
2087
-
2088
- promise.execute
2089
- end
2090
-
2091
853
  #
2092
854
  # Gets a list of all servers in the subscription.
2093
855
  #
@@ -2262,30 +1024,6 @@ module Azure::ARM::SQL
2262
1024
  promise.execute
2263
1025
  end
2264
1026
 
2265
- #
2266
- # Returns a list of the server encryption protectors
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 custom_headers [Hash{String => String}] A hash of custom headers that
2273
- # will be added to the HTTP request.
2274
- #
2275
- # @return [EncryptionProtectorListResult] which provide lazy access to pages of
2276
- # the response.
2277
- #
2278
- def list_encryption_protectors_as_lazy(resource_group_name, server_name, custom_headers = nil)
2279
- response = list_encryption_protectors_async(resource_group_name, server_name, custom_headers).value!
2280
- unless response.nil?
2281
- page = response.body
2282
- page.next_method = Proc.new do |next_page_link|
2283
- list_encryption_protectors_next_async(next_page_link, custom_headers)
2284
- end
2285
- page
2286
- end
2287
- end
2288
-
2289
1027
  #
2290
1028
  # Gets a list of all servers in the subscription.
2291
1029
  #