azure_mgmt_sql 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2014-04-01/generated/azure_mgmt_sql.rb +77 -63
  3. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +118 -16
  4. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +114 -16
  5. data/lib/2014-04-01/generated/azure_mgmt_sql/capabilities.rb +6 -5
  6. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_policies.rb +12 -12
  7. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_rules.rb +12 -12
  8. data/lib/2014-04-01/generated/azure_mgmt_sql/database_advisors.rb +18 -17
  9. data/lib/2014-04-01/generated/azure_mgmt_sql/database_connection_policies.rb +12 -12
  10. data/lib/2014-04-01/generated/azure_mgmt_sql/database_table_auditing_policies.rb +18 -17
  11. data/lib/2014-04-01/generated/azure_mgmt_sql/database_threat_detection_policies.rb +12 -12
  12. data/lib/2014-04-01/generated/azure_mgmt_sql/database_usages.rb +6 -5
  13. data/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb +649 -643
  14. data/lib/2014-04-01/generated/azure_mgmt_sql/disaster_recovery_configurations.rb +830 -0
  15. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_activities.rb +6 -5
  16. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +6 -5
  17. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pools.rb +216 -213
  18. data/lib/2014-04-01/generated/azure_mgmt_sql/extensions.rb +130 -0
  19. data/lib/2014-04-01/generated/azure_mgmt_sql/firewall_rules.rb +24 -22
  20. data/lib/2014-04-01/generated/azure_mgmt_sql/geo_backup_policies.rb +18 -17
  21. data/lib/2014-04-01/generated/azure_mgmt_sql/models/backup_long_term_retention_policy_list_result.rb +56 -0
  22. data/lib/2014-04-01/generated/azure_mgmt_sql/models/backup_long_term_retention_vault_list_result.rb +56 -0
  23. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database.rb +43 -10
  24. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_edition.rb +1 -0
  25. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_update.rb +43 -10
  26. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration.rb +164 -0
  27. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_auto_failover.rb +16 -0
  28. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_failover_policy.rb +16 -0
  29. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_list_result.rb +57 -0
  30. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_role.rb +17 -0
  31. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_status.rb +18 -0
  32. data/lib/2014-04-01/generated/azure_mgmt_sql/models/edition_capability.rb +13 -0
  33. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool.rb +13 -0
  34. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_edition_capability.rb +13 -0
  35. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_update.rb +13 -0
  36. data/lib/2014-04-01/generated/azure_mgmt_sql/models/extension_list_result.rb +54 -0
  37. data/lib/2014-04-01/generated/azure_mgmt_sql/models/import_request.rb +12 -4
  38. data/lib/2014-04-01/generated/azure_mgmt_sql/models/query_text.rb +72 -0
  39. data/lib/2014-04-01/generated/azure_mgmt_sql/models/query_text_list_result.rb +55 -0
  40. data/lib/2014-04-01/generated/azure_mgmt_sql/models/service_objective_name.rb +52 -2
  41. data/lib/2014-04-01/generated/azure_mgmt_sql/models/slo_usage_metric.rb +10 -3
  42. data/lib/2014-04-01/generated/azure_mgmt_sql/operations.rb +6 -5
  43. data/lib/2014-04-01/generated/azure_mgmt_sql/queries.rb +6 -5
  44. data/lib/2014-04-01/generated/azure_mgmt_sql/query_statistics.rb +6 -5
  45. data/lib/2014-04-01/generated/azure_mgmt_sql/query_texts.rb +134 -0
  46. data/lib/2014-04-01/generated/azure_mgmt_sql/recommended_elastic_pools.rb +18 -15
  47. data/lib/2014-04-01/generated/azure_mgmt_sql/recoverable_databases.rb +12 -10
  48. data/lib/2014-04-01/generated/azure_mgmt_sql/replication_links.rb +38 -33
  49. data/lib/2014-04-01/generated/azure_mgmt_sql/restorable_dropped_databases.rb +12 -10
  50. data/lib/2014-04-01/generated/azure_mgmt_sql/restore_points.rb +6 -5
  51. data/lib/2014-04-01/generated/azure_mgmt_sql/server_azure_adadministrators.rb +32 -30
  52. data/lib/2014-04-01/generated/azure_mgmt_sql/server_communication_links.rb +28 -26
  53. data/lib/2014-04-01/generated/azure_mgmt_sql/server_connection_policies.rb +12 -12
  54. data/lib/2014-04-01/generated/azure_mgmt_sql/server_table_auditing_policies.rb +18 -17
  55. data/lib/2014-04-01/generated/azure_mgmt_sql/server_usages.rb +6 -5
  56. data/lib/2014-04-01/generated/azure_mgmt_sql/servers.rb +134 -133
  57. data/lib/2014-04-01/generated/azure_mgmt_sql/service_objectives.rb +12 -10
  58. data/lib/2014-04-01/generated/azure_mgmt_sql/service_tier_advisors.rb +12 -10
  59. data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +32 -17
  60. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +6 -5
  61. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_configurations.rb +6 -5
  62. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryptions.rb +12 -12
  63. data/lib/2015-05-01-preview/generated/azure_mgmt_sql.rb +22 -19
  64. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_advisors.rb +18 -17
  65. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +12 -12
  66. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_recommended_actions.rb +18 -17
  67. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/encryption_protectors.rb +31 -29
  68. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/failover_groups.rb +71 -67
  69. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/subscription_usage.rb +110 -0
  70. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/subscription_usage_list_result.rb +100 -0
  71. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/operations.rb +15 -13
  72. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_advisors.rb +18 -17
  73. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_keys.rb +41 -38
  74. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/servers.rb +66 -62
  75. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +8 -1
  76. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/subscription_usages.rb +324 -0
  77. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_agents.rb +62 -56
  78. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb +118 -107
  79. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_members.rb +76 -71
  80. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_network_rules.rb +41 -38
  81. data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +30 -1
  82. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb +21 -18
  83. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_restore_points.rb +527 -0
  84. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/databases.rb +1599 -0
  85. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/arm_sku.rb +92 -0
  86. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_actual.rb +16 -0
  87. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_desired.rb +17 -0
  88. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_mode.rb +17 -0
  89. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_options.rb +90 -0
  90. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_reason.rb +17 -0
  91. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/catalog_collation_type.rb +16 -0
  92. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_database_restore_point_definition.rb +47 -0
  93. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_mode.rb +23 -0
  94. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database.rb +393 -0
  95. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_list_result.rb +100 -0
  96. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point.rb +124 -0
  97. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point_list_result.rb +100 -0
  98. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_update.rb +348 -0
  99. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_database_definition.rb +145 -0
  100. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_operation_result.rb +170 -0
  101. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/resource_move_definition.rb +46 -0
  102. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restore_point_type.rb +16 -0
  103. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sample_name.rb +17 -0
  104. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_automatic_tuning.rb +110 -0
  105. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias.rb +74 -0
  106. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_acquisition.rb +47 -0
  107. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_list_result.rb +100 -0
  108. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/status.rb +32 -0
  109. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/tracked_resource.rb +92 -0
  110. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_automatic_tuning_operations.rb +238 -0
  111. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb +805 -0
  112. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +21 -1
  113. data/lib/profiles/latest/modules/sql_profile_module.rb +912 -749
  114. data/lib/profiles/latest/sql_latest_profile_client.rb +28 -9
  115. data/lib/profiles/latest/sql_module_definition.rb +0 -1
  116. data/lib/version.rb +1 -1
  117. metadata +49 -3
@@ -0,0 +1,805 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::SQL::Mgmt::V2017_03_01_preview
7
+ #
8
+ # The Azure SQL Database management API provides a RESTful set of web APIs
9
+ # that interact with Azure SQL Database services to manage your databases.
10
+ # The API enables users to create, retrieve, update, and delete databases,
11
+ # servers, and other entities.
12
+ #
13
+ class ServerDnsAliases
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the ServerDnsAliases class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [SqlManagementClient] reference to the SqlManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Gets a server DNS alias.
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 that the alias is pointing
34
+ # to.
35
+ # @param dns_alias_name [String] The name of the server DNS alias.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [ServerDnsAlias] operation results.
40
+ #
41
+ def get(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
42
+ response = get_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Gets a server DNS alias.
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group that
50
+ # contains the resource. You can obtain this value from the Azure Resource
51
+ # Manager API or the portal.
52
+ # @param server_name [String] The name of the server that the alias is pointing
53
+ # to.
54
+ # @param dns_alias_name [String] The name of the server DNS alias.
55
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
+ # will be added to the HTTP request.
57
+ #
58
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
+ #
60
+ def get_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
61
+ get_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
62
+ end
63
+
64
+ #
65
+ # Gets a server DNS alias.
66
+ #
67
+ # @param resource_group_name [String] The name of the resource group that
68
+ # contains the resource. You can obtain this value from the Azure Resource
69
+ # Manager API or the portal.
70
+ # @param server_name [String] The name of the server that the alias is pointing
71
+ # to.
72
+ # @param dns_alias_name [String] The name of the server DNS alias.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def get_async(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
79
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
80
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
81
+ fail ArgumentError, 'dns_alias_name is nil' if dns_alias_name.nil?
82
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
83
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
84
+
85
+
86
+ request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
88
+
89
+ # Set Headers
90
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
91
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
92
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'
93
+
94
+ request_url = @base_url || @client.base_url
95
+
96
+ options = {
97
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
98
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'dnsAliasName' => dns_alias_name,'subscriptionId' => @client.subscription_id},
99
+ query_params: {'api-version' => @client.api_version},
100
+ headers: request_headers.merge(custom_headers || {}),
101
+ base_url: request_url
102
+ }
103
+ promise = @client.make_request_async(:get, path_template, options)
104
+
105
+ promise = promise.then do |result|
106
+ http_response = result.response
107
+ status_code = http_response.status
108
+ response_content = http_response.body
109
+ unless status_code == 200
110
+ error_model = JSON.load(response_content)
111
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
112
+ end
113
+
114
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAlias.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Creates a server dns alias.
134
+ #
135
+ # @param resource_group_name [String] The name of the resource group that
136
+ # contains the resource. You can obtain this value from the Azure Resource
137
+ # Manager API or the portal.
138
+ # @param server_name [String] The name of the server that the alias is pointing
139
+ # to.
140
+ # @param dns_alias_name [String] The name of the server DNS alias.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [ServerDnsAlias] operation results.
145
+ #
146
+ def create_or_update(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
147
+ response = create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
148
+ response.body unless response.nil?
149
+ end
150
+
151
+ #
152
+ # @param resource_group_name [String] The name of the resource group that
153
+ # contains the resource. You can obtain this value from the Azure Resource
154
+ # Manager API or the portal.
155
+ # @param server_name [String] The name of the server that the alias is pointing
156
+ # to.
157
+ # @param dns_alias_name [String] The name of the server DNS alias.
158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
+ # will be added to the HTTP request.
160
+ #
161
+ # @return [Concurrent::Promise] promise which provides async access to http
162
+ # response.
163
+ #
164
+ def create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
165
+ # Send request
166
+ promise = begin_create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers)
167
+
168
+ promise = promise.then do |response|
169
+ # Defining deserialization method.
170
+ deserialize_method = lambda do |parsed_response|
171
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAlias.mapper()
172
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
173
+ end
174
+
175
+ # Waiting for response.
176
+ @client.get_long_running_operation_result(response, deserialize_method)
177
+ end
178
+
179
+ promise
180
+ end
181
+
182
+ #
183
+ # Deletes the server DNS alias with the given name.
184
+ #
185
+ # @param resource_group_name [String] The name of the resource group that
186
+ # contains the resource. You can obtain this value from the Azure Resource
187
+ # Manager API or the portal.
188
+ # @param server_name [String] The name of the server that the alias is pointing
189
+ # to.
190
+ # @param dns_alias_name [String] The name of the server DNS alias.
191
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
192
+ # will be added to the HTTP request.
193
+ #
194
+ def delete(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
195
+ response = delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
196
+ nil
197
+ end
198
+
199
+ #
200
+ # @param resource_group_name [String] The name of the resource group that
201
+ # contains the resource. You can obtain this value from the Azure Resource
202
+ # Manager API or the portal.
203
+ # @param server_name [String] The name of the server that the alias is pointing
204
+ # to.
205
+ # @param dns_alias_name [String] The name of the server DNS alias.
206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
+ # will be added to the HTTP request.
208
+ #
209
+ # @return [Concurrent::Promise] promise which provides async access to http
210
+ # response.
211
+ #
212
+ def delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
213
+ # Send request
214
+ promise = begin_delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers)
215
+
216
+ promise = promise.then do |response|
217
+ # Defining deserialization method.
218
+ deserialize_method = lambda do |parsed_response|
219
+ end
220
+
221
+ # Waiting for response.
222
+ @client.get_long_running_operation_result(response, deserialize_method)
223
+ end
224
+
225
+ promise
226
+ end
227
+
228
+ #
229
+ # Gets a list of server DNS aliases for a server.
230
+ #
231
+ # @param resource_group_name [String] The name of the resource group that
232
+ # contains the resource. You can obtain this value from the Azure Resource
233
+ # Manager API or the portal.
234
+ # @param server_name [String] The name of the server that the alias is pointing
235
+ # to.
236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
+ # will be added to the HTTP request.
238
+ #
239
+ # @return [Array<ServerDnsAlias>] operation results.
240
+ #
241
+ def list_by_server(resource_group_name, server_name, custom_headers:nil)
242
+ first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers:custom_headers)
243
+ first_page.get_all_items
244
+ end
245
+
246
+ #
247
+ # Gets a list of server DNS aliases for a server.
248
+ #
249
+ # @param resource_group_name [String] The name of the resource group that
250
+ # contains the resource. You can obtain this value from the Azure Resource
251
+ # Manager API or the portal.
252
+ # @param server_name [String] The name of the server that the alias is pointing
253
+ # to.
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
258
+ #
259
+ def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
260
+ list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
261
+ end
262
+
263
+ #
264
+ # Gets a list of server DNS aliases for a server.
265
+ #
266
+ # @param resource_group_name [String] The name of the resource group that
267
+ # contains the resource. You can obtain this value from the Azure Resource
268
+ # Manager API or the portal.
269
+ # @param server_name [String] The name of the server that the alias is pointing
270
+ # to.
271
+ # @param [Hash{String => String}] A hash of custom headers that will be added
272
+ # to the HTTP request.
273
+ #
274
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
275
+ #
276
+ def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
277
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
279
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
280
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
281
+
282
+
283
+ request_headers = {}
284
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
285
+
286
+ # Set Headers
287
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
288
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
289
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases'
290
+
291
+ request_url = @base_url || @client.base_url
292
+
293
+ options = {
294
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
295
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
296
+ query_params: {'api-version' => @client.api_version},
297
+ headers: request_headers.merge(custom_headers || {}),
298
+ base_url: request_url
299
+ }
300
+ promise = @client.make_request_async(:get, path_template, options)
301
+
302
+ promise = promise.then do |result|
303
+ http_response = result.response
304
+ status_code = http_response.status
305
+ response_content = http_response.body
306
+ unless status_code == 200
307
+ error_model = JSON.load(response_content)
308
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
309
+ end
310
+
311
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
312
+ # Deserialize Response
313
+ if status_code == 200
314
+ begin
315
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
316
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAliasListResult.mapper()
317
+ result.body = @client.deserialize(result_mapper, parsed_response)
318
+ rescue Exception => e
319
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
320
+ end
321
+ end
322
+
323
+ result
324
+ end
325
+
326
+ promise.execute
327
+ end
328
+
329
+ #
330
+ # Acquires server DNS alias from another server.
331
+ #
332
+ # @param resource_group_name [String] The name of the resource group that
333
+ # contains the resource. You can obtain this value from the Azure Resource
334
+ # Manager API or the portal.
335
+ # @param server_name [String] The name of the server that the alias is pointing
336
+ # to.
337
+ # @param dns_alias_name [String] The name of the server dns alias.
338
+ # @param parameters [ServerDnsAliasAcquisition]
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ def acquire(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:nil)
343
+ response = acquire_async(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:custom_headers).value!
344
+ nil
345
+ end
346
+
347
+ #
348
+ # @param resource_group_name [String] The name of the resource group that
349
+ # contains the resource. You can obtain this value from the Azure Resource
350
+ # Manager API or the portal.
351
+ # @param server_name [String] The name of the server that the alias is pointing
352
+ # to.
353
+ # @param dns_alias_name [String] The name of the server dns alias.
354
+ # @param parameters [ServerDnsAliasAcquisition]
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [Concurrent::Promise] promise which provides async access to http
359
+ # response.
360
+ #
361
+ def acquire_async(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:nil)
362
+ # Send request
363
+ promise = begin_acquire_async(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:custom_headers)
364
+
365
+ promise = promise.then do |response|
366
+ # Defining deserialization method.
367
+ deserialize_method = lambda do |parsed_response|
368
+ end
369
+
370
+ # Waiting for response.
371
+ @client.get_long_running_operation_result(response, deserialize_method)
372
+ end
373
+
374
+ promise
375
+ end
376
+
377
+ #
378
+ # Creates a server dns alias.
379
+ #
380
+ # @param resource_group_name [String] The name of the resource group that
381
+ # contains the resource. You can obtain this value from the Azure Resource
382
+ # Manager API or the portal.
383
+ # @param server_name [String] The name of the server that the alias is pointing
384
+ # to.
385
+ # @param dns_alias_name [String] The name of the server DNS alias.
386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
387
+ # will be added to the HTTP request.
388
+ #
389
+ # @return [ServerDnsAlias] operation results.
390
+ #
391
+ def begin_create_or_update(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
392
+ response = begin_create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
393
+ response.body unless response.nil?
394
+ end
395
+
396
+ #
397
+ # Creates a server dns alias.
398
+ #
399
+ # @param resource_group_name [String] The name of the resource group that
400
+ # contains the resource. You can obtain this value from the Azure Resource
401
+ # Manager API or the portal.
402
+ # @param server_name [String] The name of the server that the alias is pointing
403
+ # to.
404
+ # @param dns_alias_name [String] The name of the server DNS alias.
405
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
406
+ # will be added to the HTTP request.
407
+ #
408
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
409
+ #
410
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
411
+ begin_create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
412
+ end
413
+
414
+ #
415
+ # Creates a server dns alias.
416
+ #
417
+ # @param resource_group_name [String] The name of the resource group that
418
+ # contains the resource. You can obtain this value from the Azure Resource
419
+ # Manager API or the portal.
420
+ # @param server_name [String] The name of the server that the alias is pointing
421
+ # to.
422
+ # @param dns_alias_name [String] The name of the server DNS alias.
423
+ # @param [Hash{String => String}] A hash of custom headers that will be added
424
+ # to the HTTP request.
425
+ #
426
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
427
+ #
428
+ def begin_create_or_update_async(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
429
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
430
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
431
+ fail ArgumentError, 'dns_alias_name is nil' if dns_alias_name.nil?
432
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
433
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
434
+
435
+
436
+ request_headers = {}
437
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
438
+
439
+ # Set Headers
440
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
441
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
442
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'
443
+
444
+ request_url = @base_url || @client.base_url
445
+
446
+ options = {
447
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
448
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'dnsAliasName' => dns_alias_name,'subscriptionId' => @client.subscription_id},
449
+ query_params: {'api-version' => @client.api_version},
450
+ headers: request_headers.merge(custom_headers || {}),
451
+ base_url: request_url
452
+ }
453
+ promise = @client.make_request_async(:put, path_template, options)
454
+
455
+ promise = promise.then do |result|
456
+ http_response = result.response
457
+ status_code = http_response.status
458
+ response_content = http_response.body
459
+ unless status_code == 200 || status_code == 202 || status_code == 201
460
+ error_model = JSON.load(response_content)
461
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
462
+ end
463
+
464
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
465
+ # Deserialize Response
466
+ if status_code == 200
467
+ begin
468
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
469
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAlias.mapper()
470
+ result.body = @client.deserialize(result_mapper, parsed_response)
471
+ rescue Exception => e
472
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
473
+ end
474
+ end
475
+ # Deserialize Response
476
+ if status_code == 201
477
+ begin
478
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
479
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAlias.mapper()
480
+ result.body = @client.deserialize(result_mapper, parsed_response)
481
+ rescue Exception => e
482
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
483
+ end
484
+ end
485
+
486
+ result
487
+ end
488
+
489
+ promise.execute
490
+ end
491
+
492
+ #
493
+ # Deletes the server DNS alias with the given name.
494
+ #
495
+ # @param resource_group_name [String] The name of the resource group that
496
+ # contains the resource. You can obtain this value from the Azure Resource
497
+ # Manager API or the portal.
498
+ # @param server_name [String] The name of the server that the alias is pointing
499
+ # to.
500
+ # @param dns_alias_name [String] The name of the server DNS alias.
501
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
+ # will be added to the HTTP request.
503
+ #
504
+ #
505
+ def begin_delete(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
506
+ response = begin_delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
507
+ nil
508
+ end
509
+
510
+ #
511
+ # Deletes the server DNS alias with the given name.
512
+ #
513
+ # @param resource_group_name [String] The name of the resource group that
514
+ # contains the resource. You can obtain this value from the Azure Resource
515
+ # Manager API or the portal.
516
+ # @param server_name [String] The name of the server that the alias is pointing
517
+ # to.
518
+ # @param dns_alias_name [String] The name of the server DNS alias.
519
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
520
+ # will be added to the HTTP request.
521
+ #
522
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
523
+ #
524
+ def begin_delete_with_http_info(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
525
+ begin_delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:custom_headers).value!
526
+ end
527
+
528
+ #
529
+ # Deletes the server DNS alias with the given name.
530
+ #
531
+ # @param resource_group_name [String] The name of the resource group that
532
+ # contains the resource. You can obtain this value from the Azure Resource
533
+ # Manager API or the portal.
534
+ # @param server_name [String] The name of the server that the alias is pointing
535
+ # to.
536
+ # @param dns_alias_name [String] The name of the server DNS alias.
537
+ # @param [Hash{String => String}] A hash of custom headers that will be added
538
+ # to the HTTP request.
539
+ #
540
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
541
+ #
542
+ def begin_delete_async(resource_group_name, server_name, dns_alias_name, custom_headers:nil)
543
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
544
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
545
+ fail ArgumentError, 'dns_alias_name is nil' if dns_alias_name.nil?
546
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
547
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
548
+
549
+
550
+ request_headers = {}
551
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
552
+
553
+ # Set Headers
554
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
555
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
556
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'
557
+
558
+ request_url = @base_url || @client.base_url
559
+
560
+ options = {
561
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
562
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'dnsAliasName' => dns_alias_name,'subscriptionId' => @client.subscription_id},
563
+ query_params: {'api-version' => @client.api_version},
564
+ headers: request_headers.merge(custom_headers || {}),
565
+ base_url: request_url
566
+ }
567
+ promise = @client.make_request_async(:delete, path_template, options)
568
+
569
+ promise = promise.then do |result|
570
+ http_response = result.response
571
+ status_code = http_response.status
572
+ response_content = http_response.body
573
+ unless status_code == 200 || status_code == 202 || status_code == 204
574
+ error_model = JSON.load(response_content)
575
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
576
+ end
577
+
578
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
579
+
580
+ result
581
+ end
582
+
583
+ promise.execute
584
+ end
585
+
586
+ #
587
+ # Acquires server DNS alias from another server.
588
+ #
589
+ # @param resource_group_name [String] The name of the resource group that
590
+ # contains the resource. You can obtain this value from the Azure Resource
591
+ # Manager API or the portal.
592
+ # @param server_name [String] The name of the server that the alias is pointing
593
+ # to.
594
+ # @param dns_alias_name [String] The name of the server dns alias.
595
+ # @param parameters [ServerDnsAliasAcquisition]
596
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
597
+ # will be added to the HTTP request.
598
+ #
599
+ #
600
+ def begin_acquire(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:nil)
601
+ response = begin_acquire_async(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:custom_headers).value!
602
+ nil
603
+ end
604
+
605
+ #
606
+ # Acquires server DNS alias from another server.
607
+ #
608
+ # @param resource_group_name [String] The name of the resource group that
609
+ # contains the resource. You can obtain this value from the Azure Resource
610
+ # Manager API or the portal.
611
+ # @param server_name [String] The name of the server that the alias is pointing
612
+ # to.
613
+ # @param dns_alias_name [String] The name of the server dns alias.
614
+ # @param parameters [ServerDnsAliasAcquisition]
615
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
616
+ # will be added to the HTTP request.
617
+ #
618
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
619
+ #
620
+ def begin_acquire_with_http_info(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:nil)
621
+ begin_acquire_async(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:custom_headers).value!
622
+ end
623
+
624
+ #
625
+ # Acquires server DNS alias from another server.
626
+ #
627
+ # @param resource_group_name [String] The name of the resource group that
628
+ # contains the resource. You can obtain this value from the Azure Resource
629
+ # Manager API or the portal.
630
+ # @param server_name [String] The name of the server that the alias is pointing
631
+ # to.
632
+ # @param dns_alias_name [String] The name of the server dns alias.
633
+ # @param parameters [ServerDnsAliasAcquisition]
634
+ # @param [Hash{String => String}] A hash of custom headers that will be added
635
+ # to the HTTP request.
636
+ #
637
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
638
+ #
639
+ def begin_acquire_async(resource_group_name, server_name, dns_alias_name, parameters, custom_headers:nil)
640
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
641
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
642
+ fail ArgumentError, 'dns_alias_name is nil' if dns_alias_name.nil?
643
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
644
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
645
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
646
+
647
+
648
+ request_headers = {}
649
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
650
+
651
+ # Set Headers
652
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
653
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
654
+
655
+ # Serialize Request
656
+ request_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAliasAcquisition.mapper()
657
+ request_content = @client.serialize(request_mapper, parameters)
658
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
659
+
660
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire'
661
+
662
+ request_url = @base_url || @client.base_url
663
+
664
+ options = {
665
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
666
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'dnsAliasName' => dns_alias_name,'subscriptionId' => @client.subscription_id},
667
+ query_params: {'api-version' => @client.api_version},
668
+ body: request_content,
669
+ headers: request_headers.merge(custom_headers || {}),
670
+ base_url: request_url
671
+ }
672
+ promise = @client.make_request_async(:post, path_template, options)
673
+
674
+ promise = promise.then do |result|
675
+ http_response = result.response
676
+ status_code = http_response.status
677
+ response_content = http_response.body
678
+ unless status_code == 200 || status_code == 202
679
+ error_model = JSON.load(response_content)
680
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
681
+ end
682
+
683
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
684
+
685
+ result
686
+ end
687
+
688
+ promise.execute
689
+ end
690
+
691
+ #
692
+ # Gets a list of server DNS aliases for a server.
693
+ #
694
+ # @param next_page_link [String] The NextLink from the previous successful call
695
+ # to List operation.
696
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
697
+ # will be added to the HTTP request.
698
+ #
699
+ # @return [ServerDnsAliasListResult] operation results.
700
+ #
701
+ def list_by_server_next(next_page_link, custom_headers:nil)
702
+ response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
703
+ response.body unless response.nil?
704
+ end
705
+
706
+ #
707
+ # Gets a list of server DNS aliases for a server.
708
+ #
709
+ # @param next_page_link [String] The NextLink from the previous successful call
710
+ # to List operation.
711
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
712
+ # will be added to the HTTP request.
713
+ #
714
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
715
+ #
716
+ def list_by_server_next_with_http_info(next_page_link, custom_headers:nil)
717
+ list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
718
+ end
719
+
720
+ #
721
+ # Gets a list of server DNS aliases for a server.
722
+ #
723
+ # @param next_page_link [String] The NextLink from the previous successful call
724
+ # to List operation.
725
+ # @param [Hash{String => String}] A hash of custom headers that will be added
726
+ # to the HTTP request.
727
+ #
728
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
729
+ #
730
+ def list_by_server_next_async(next_page_link, custom_headers:nil)
731
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
732
+
733
+
734
+ request_headers = {}
735
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
736
+
737
+ # Set Headers
738
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
739
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
740
+ path_template = '{nextLink}'
741
+
742
+ request_url = @base_url || @client.base_url
743
+
744
+ options = {
745
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
746
+ skip_encoding_path_params: {'nextLink' => next_page_link},
747
+ headers: request_headers.merge(custom_headers || {}),
748
+ base_url: request_url
749
+ }
750
+ promise = @client.make_request_async(:get, path_template, options)
751
+
752
+ promise = promise.then do |result|
753
+ http_response = result.response
754
+ status_code = http_response.status
755
+ response_content = http_response.body
756
+ unless status_code == 200
757
+ error_model = JSON.load(response_content)
758
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
759
+ end
760
+
761
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
762
+ # Deserialize Response
763
+ if status_code == 200
764
+ begin
765
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
766
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerDnsAliasListResult.mapper()
767
+ result.body = @client.deserialize(result_mapper, parsed_response)
768
+ rescue Exception => e
769
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
770
+ end
771
+ end
772
+
773
+ result
774
+ end
775
+
776
+ promise.execute
777
+ end
778
+
779
+ #
780
+ # Gets a list of server DNS aliases for a server.
781
+ #
782
+ # @param resource_group_name [String] The name of the resource group that
783
+ # contains the resource. You can obtain this value from the Azure Resource
784
+ # Manager API or the portal.
785
+ # @param server_name [String] The name of the server that the alias is pointing
786
+ # to.
787
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
788
+ # will be added to the HTTP request.
789
+ #
790
+ # @return [ServerDnsAliasListResult] which provide lazy access to pages of the
791
+ # response.
792
+ #
793
+ def list_by_server_as_lazy(resource_group_name, server_name, custom_headers:nil)
794
+ response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
795
+ unless response.nil?
796
+ page = response.body
797
+ page.next_method = Proc.new do |next_page_link|
798
+ list_by_server_next_async(next_page_link, custom_headers:custom_headers)
799
+ end
800
+ page
801
+ end
802
+ end
803
+
804
+ end
805
+ end