azure_mgmt_dns 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_dns.rb +9 -9
  3. data/lib/generated/azure_mgmt_dns/dns_management_client.rb +17 -5
  4. data/lib/generated/azure_mgmt_dns/models/aaaa_record.rb +2 -3
  5. data/lib/generated/azure_mgmt_dns/models/arecord.rb +2 -3
  6. data/lib/generated/azure_mgmt_dns/models/cname_record.rb +2 -3
  7. data/lib/generated/azure_mgmt_dns/models/{htp_status_code.rb → http_status_code.rb} +3 -3
  8. data/lib/generated/azure_mgmt_dns/models/mx_record.rb +3 -4
  9. data/lib/generated/azure_mgmt_dns/models/ns_record.rb +2 -3
  10. data/lib/generated/azure_mgmt_dns/models/operation_status.rb +1 -1
  11. data/lib/generated/azure_mgmt_dns/models/ptr_record.rb +2 -3
  12. data/lib/generated/azure_mgmt_dns/models/record_set.rb +20 -26
  13. data/lib/generated/azure_mgmt_dns/models/record_set_list_result.rb +5 -5
  14. data/lib/generated/azure_mgmt_dns/models/record_set_update_parameters.rb +3 -3
  15. data/lib/generated/azure_mgmt_dns/models/record_type.rb +1 -1
  16. data/lib/generated/azure_mgmt_dns/models/soa_record.rb +10 -9
  17. data/lib/generated/azure_mgmt_dns/models/srv_record.rb +5 -6
  18. data/lib/generated/azure_mgmt_dns/models/txt_record.rb +2 -2
  19. data/lib/generated/azure_mgmt_dns/models/zone.rb +10 -10
  20. data/lib/generated/azure_mgmt_dns/models/zone_delete_result.rb +8 -9
  21. data/lib/generated/azure_mgmt_dns/models/zone_list_result.rb +3 -4
  22. data/lib/generated/azure_mgmt_dns/module_definition.rb +1 -1
  23. data/lib/generated/azure_mgmt_dns/record_sets.rb +261 -241
  24. data/lib/generated/azure_mgmt_dns/version.rb +2 -2
  25. data/lib/generated/azure_mgmt_dns/zones.rb +212 -201
  26. metadata +5 -5
@@ -1,8 +1,8 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Dns
7
- VERSION = '0.7.0'
7
+ VERSION = '0.8.0'
8
8
  end
@@ -1,11 +1,11 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Dns
7
7
  #
8
- # Zones
8
+ # The DNS Management Client.
9
9
  #
10
10
  class Zones
11
11
  include Azure::ARM::Dns::Models
@@ -23,14 +23,18 @@ module Azure::ARM::Dns
23
23
  attr_reader :client
24
24
 
25
25
  #
26
- # Creates or Updates a DNS zone within a resource group.
26
+ # Creates or updates a DNS zone. Does not modify DNS records within the zone.
27
27
  #
28
28
  # @param resource_group_name [String] The name of the resource group.
29
- # @param zone_name [String] The name of the zone without a terminating dot.
29
+ # @param zone_name [String] The name of the DNS zone (without a terminating
30
+ # dot).
30
31
  # @param parameters [Zone] Parameters supplied to the CreateOrUpdate operation.
31
- # @param if_match [String] The etag of Zone.
32
- # @param if_none_match [String] Defines the If-None-Match condition. Set to
33
- # '*' to force Create-If-Not-Exist. Other values will be ignored.
32
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
33
+ # overwrite the current zone. Specify the last-seen etag value to prevent
34
+ # accidentally overwritting any concurrent changes.
35
+ # @param if_none_match [String] Set to '*' to allow a new DNS zone to be
36
+ # created, but to prevent updating an existing zone. Other values will be
37
+ # ignored.
34
38
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
39
  # will be added to the HTTP request.
36
40
  #
@@ -42,14 +46,18 @@ module Azure::ARM::Dns
42
46
  end
43
47
 
44
48
  #
45
- # Creates or Updates a DNS zone within a resource group.
49
+ # Creates or updates a DNS zone. Does not modify DNS records within the zone.
46
50
  #
47
51
  # @param resource_group_name [String] The name of the resource group.
48
- # @param zone_name [String] The name of the zone without a terminating dot.
52
+ # @param zone_name [String] The name of the DNS zone (without a terminating
53
+ # dot).
49
54
  # @param parameters [Zone] Parameters supplied to the CreateOrUpdate operation.
50
- # @param if_match [String] The etag of Zone.
51
- # @param if_none_match [String] Defines the If-None-Match condition. Set to
52
- # '*' to force Create-If-Not-Exist. Other values will be ignored.
55
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
56
+ # overwrite the current zone. Specify the last-seen etag value to prevent
57
+ # accidentally overwritting any concurrent changes.
58
+ # @param if_none_match [String] Set to '*' to allow a new DNS zone to be
59
+ # created, but to prevent updating an existing zone. Other values will be
60
+ # ignored.
53
61
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
62
  # will be added to the HTTP request.
55
63
  #
@@ -60,14 +68,18 @@ module Azure::ARM::Dns
60
68
  end
61
69
 
62
70
  #
63
- # Creates or Updates a DNS zone within a resource group.
71
+ # Creates or updates a DNS zone. Does not modify DNS records within the zone.
64
72
  #
65
73
  # @param resource_group_name [String] The name of the resource group.
66
- # @param zone_name [String] The name of the zone without a terminating dot.
74
+ # @param zone_name [String] The name of the DNS zone (without a terminating
75
+ # dot).
67
76
  # @param parameters [Zone] Parameters supplied to the CreateOrUpdate operation.
68
- # @param if_match [String] The etag of Zone.
69
- # @param if_none_match [String] Defines the If-None-Match condition. Set to
70
- # '*' to force Create-If-Not-Exist. Other values will be ignored.
77
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
78
+ # overwrite the current zone. Specify the last-seen etag value to prevent
79
+ # accidentally overwritting any concurrent changes.
80
+ # @param if_none_match [String] Set to '*' to allow a new DNS zone to be
81
+ # created, but to prevent updating an existing zone. Other values will be
82
+ # ignored.
71
83
  # @param [Hash{String => String}] A hash of custom headers that will be added
72
84
  # to the HTTP request.
73
85
  #
@@ -96,7 +108,7 @@ module Azure::ARM::Dns
96
108
  request_content = @client.serialize(request_mapper, parameters, 'parameters')
97
109
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
98
110
 
99
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}'
111
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'
100
112
 
101
113
  request_url = @base_url || @client.base_url
102
114
 
@@ -148,44 +160,41 @@ module Azure::ARM::Dns
148
160
  end
149
161
 
150
162
  #
151
- # Removes a DNS zone from a resource group.
163
+ # Deletes a DNS zone. WARNING: All DNS records in the zone will also be
164
+ # deleted. This operation cannot be undone.
152
165
  #
153
166
  # @param resource_group_name [String] The name of the resource group.
154
- # @param zone_name [String] The name of the zone without a terminating dot.
155
- # @param if_match [String] Defines the If-Match condition. The delete
156
- # operation will be performed only if the ETag of the zone on the server
157
- # matches this value.
158
- # @param if_none_match [String] Defines the If-None-Match condition. The
159
- # delete operation will be performed only if the ETag of the zone on the
160
- # server does not match this value.
167
+ # @param zone_name [String] The name of the DNS zone (without a terminating
168
+ # dot).
169
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
170
+ # delete the current zone. Specify the last-seen etag value to prevent
171
+ # accidentally deleting any concurrent changes.
161
172
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
173
  # will be added to the HTTP request.
163
174
  #
164
175
  # @return [ZoneDeleteResult] operation results.
165
176
  #
166
- def delete(resource_group_name, zone_name, if_match = nil, if_none_match = nil, custom_headers = nil)
167
- response = delete_async(resource_group_name, zone_name, if_match, if_none_match, custom_headers).value!
177
+ def delete(resource_group_name, zone_name, if_match = nil, custom_headers = nil)
178
+ response = delete_async(resource_group_name, zone_name, if_match, custom_headers).value!
168
179
  response.body unless response.nil?
169
180
  end
170
181
 
171
182
  #
172
183
  # @param resource_group_name [String] The name of the resource group.
173
- # @param zone_name [String] The name of the zone without a terminating dot.
174
- # @param if_match [String] Defines the If-Match condition. The delete
175
- # operation will be performed only if the ETag of the zone on the server
176
- # matches this value.
177
- # @param if_none_match [String] Defines the If-None-Match condition. The
178
- # delete operation will be performed only if the ETag of the zone on the
179
- # server does not match this value.
184
+ # @param zone_name [String] The name of the DNS zone (without a terminating
185
+ # dot).
186
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
187
+ # delete the current zone. Specify the last-seen etag value to prevent
188
+ # accidentally deleting any concurrent changes.
180
189
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
181
190
  # will be added to the HTTP request.
182
191
  #
183
192
  # @return [Concurrent::Promise] promise which provides async access to http
184
193
  # response.
185
194
  #
186
- def delete_async(resource_group_name, zone_name, if_match = nil, if_none_match = nil, custom_headers = nil)
195
+ def delete_async(resource_group_name, zone_name, if_match = nil, custom_headers = nil)
187
196
  # Send request
188
- promise = begin_delete_async(resource_group_name, zone_name, if_match, if_none_match, custom_headers)
197
+ promise = begin_delete_async(resource_group_name, zone_name, if_match, custom_headers)
189
198
 
190
199
  promise = promise.then do |response|
191
200
  # Defining deserialization method.
@@ -202,63 +211,51 @@ module Azure::ARM::Dns
202
211
  end
203
212
 
204
213
  #
205
- # Removes a DNS zone from a resource group.
214
+ # Gets a DNS zone. Retrieves the zone properties, but not the record sets
215
+ # within the zone.
206
216
  #
207
217
  # @param resource_group_name [String] The name of the resource group.
208
- # @param zone_name [String] The name of the zone without a terminating dot.
209
- # @param if_match [String] Defines the If-Match condition. The delete
210
- # operation will be performed only if the ETag of the zone on the server
211
- # matches this value.
212
- # @param if_none_match [String] Defines the If-None-Match condition. The
213
- # delete operation will be performed only if the ETag of the zone on the
214
- # server does not match this value.
218
+ # @param zone_name [String] The name of the DNS zone (without a terminating
219
+ # dot).
215
220
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
221
  # will be added to the HTTP request.
217
222
  #
218
- # @return [ZoneDeleteResult] operation results.
223
+ # @return [Zone] operation results.
219
224
  #
220
- def begin_delete(resource_group_name, zone_name, if_match = nil, if_none_match = nil, custom_headers = nil)
221
- response = begin_delete_async(resource_group_name, zone_name, if_match, if_none_match, custom_headers).value!
225
+ def get(resource_group_name, zone_name, custom_headers = nil)
226
+ response = get_async(resource_group_name, zone_name, custom_headers).value!
222
227
  response.body unless response.nil?
223
228
  end
224
229
 
225
230
  #
226
- # Removes a DNS zone from a resource group.
231
+ # Gets a DNS zone. Retrieves the zone properties, but not the record sets
232
+ # within the zone.
227
233
  #
228
234
  # @param resource_group_name [String] The name of the resource group.
229
- # @param zone_name [String] The name of the zone without a terminating dot.
230
- # @param if_match [String] Defines the If-Match condition. The delete
231
- # operation will be performed only if the ETag of the zone on the server
232
- # matches this value.
233
- # @param if_none_match [String] Defines the If-None-Match condition. The
234
- # delete operation will be performed only if the ETag of the zone on the
235
- # server does not match this value.
235
+ # @param zone_name [String] The name of the DNS zone (without a terminating
236
+ # dot).
236
237
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
238
  # will be added to the HTTP request.
238
239
  #
239
240
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
240
241
  #
241
- def begin_delete_with_http_info(resource_group_name, zone_name, if_match = nil, if_none_match = nil, custom_headers = nil)
242
- begin_delete_async(resource_group_name, zone_name, if_match, if_none_match, custom_headers).value!
242
+ def get_with_http_info(resource_group_name, zone_name, custom_headers = nil)
243
+ get_async(resource_group_name, zone_name, custom_headers).value!
243
244
  end
244
245
 
245
246
  #
246
- # Removes a DNS zone from a resource group.
247
+ # Gets a DNS zone. Retrieves the zone properties, but not the record sets
248
+ # within the zone.
247
249
  #
248
250
  # @param resource_group_name [String] The name of the resource group.
249
- # @param zone_name [String] The name of the zone without a terminating dot.
250
- # @param if_match [String] Defines the If-Match condition. The delete
251
- # operation will be performed only if the ETag of the zone on the server
252
- # matches this value.
253
- # @param if_none_match [String] Defines the If-None-Match condition. The
254
- # delete operation will be performed only if the ETag of the zone on the
255
- # server does not match this value.
251
+ # @param zone_name [String] The name of the DNS zone (without a terminating
252
+ # dot).
256
253
  # @param [Hash{String => String}] A hash of custom headers that will be added
257
254
  # to the HTTP request.
258
255
  #
259
256
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
260
257
  #
261
- def begin_delete_async(resource_group_name, zone_name, if_match = nil, if_none_match = nil, custom_headers = nil)
258
+ def get_async(resource_group_name, zone_name, custom_headers = nil)
262
259
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
263
260
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
264
261
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -269,10 +266,8 @@ module Azure::ARM::Dns
269
266
 
270
267
  # Set Headers
271
268
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
272
- request_headers['If-Match'] = if_match unless if_match.nil?
273
- request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
274
269
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
275
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}'
270
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'
276
271
 
277
272
  request_url = @base_url || @client.base_url
278
273
 
@@ -283,13 +278,13 @@ module Azure::ARM::Dns
283
278
  headers: request_headers.merge(custom_headers || {}),
284
279
  base_url: request_url
285
280
  }
286
- promise = @client.make_request_async(:delete, path_template, options)
281
+ promise = @client.make_request_async(:get, path_template, options)
287
282
 
288
283
  promise = promise.then do |result|
289
284
  http_response = result.response
290
285
  status_code = http_response.status
291
286
  response_content = http_response.body
292
- unless status_code == 204 || status_code == 202 || status_code == 200
287
+ unless status_code == 200
293
288
  error_model = JSON.load(response_content)
294
289
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
295
290
  end
@@ -299,7 +294,7 @@ module Azure::ARM::Dns
299
294
  if status_code == 200
300
295
  begin
301
296
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
302
- result_mapper = ZoneDeleteResult.mapper()
297
+ result_mapper = Zone.mapper()
303
298
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
304
299
  rescue Exception => e
305
300
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -313,47 +308,49 @@ module Azure::ARM::Dns
313
308
  end
314
309
 
315
310
  #
316
- # Gets a DNS zone.
311
+ # Lists the DNS zones within a resource group.
317
312
  #
318
313
  # @param resource_group_name [String] The name of the resource group.
319
- # @param zone_name [String] The name of the zone without a terminating dot.
314
+ # @param top [Integer] The maximum number of record sets to return. If not
315
+ # specified, returns up to 100 record sets.
320
316
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
321
317
  # will be added to the HTTP request.
322
318
  #
323
- # @return [Zone] operation results.
319
+ # @return [Array<Zone>] operation results.
324
320
  #
325
- def get(resource_group_name, zone_name, custom_headers = nil)
326
- response = get_async(resource_group_name, zone_name, custom_headers).value!
327
- response.body unless response.nil?
321
+ def list_by_resource_group(resource_group_name, top = nil, custom_headers = nil)
322
+ first_page = list_by_resource_group_as_lazy(resource_group_name, top, custom_headers)
323
+ first_page.get_all_items
328
324
  end
329
325
 
330
326
  #
331
- # Gets a DNS zone.
327
+ # Lists the DNS zones within a resource group.
332
328
  #
333
329
  # @param resource_group_name [String] The name of the resource group.
334
- # @param zone_name [String] The name of the zone without a terminating dot.
330
+ # @param top [Integer] The maximum number of record sets to return. If not
331
+ # specified, returns up to 100 record sets.
335
332
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
336
333
  # will be added to the HTTP request.
337
334
  #
338
335
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
339
336
  #
340
- def get_with_http_info(resource_group_name, zone_name, custom_headers = nil)
341
- get_async(resource_group_name, zone_name, custom_headers).value!
337
+ def list_by_resource_group_with_http_info(resource_group_name, top = nil, custom_headers = nil)
338
+ list_by_resource_group_async(resource_group_name, top, custom_headers).value!
342
339
  end
343
340
 
344
341
  #
345
- # Gets a DNS zone.
342
+ # Lists the DNS zones within a resource group.
346
343
  #
347
344
  # @param resource_group_name [String] The name of the resource group.
348
- # @param zone_name [String] The name of the zone without a terminating dot.
345
+ # @param top [Integer] The maximum number of record sets to return. If not
346
+ # specified, returns up to 100 record sets.
349
347
  # @param [Hash{String => String}] A hash of custom headers that will be added
350
348
  # to the HTTP request.
351
349
  #
352
350
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
353
351
  #
354
- def get_async(resource_group_name, zone_name, custom_headers = nil)
352
+ def list_by_resource_group_async(resource_group_name, top = nil, custom_headers = nil)
355
353
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
356
- fail ArgumentError, 'zone_name is nil' if zone_name.nil?
357
354
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
358
355
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
359
356
 
@@ -363,14 +360,14 @@ module Azure::ARM::Dns
363
360
  # Set Headers
364
361
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
365
362
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
366
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}'
363
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones'
367
364
 
368
365
  request_url = @base_url || @client.base_url
369
366
 
370
367
  options = {
371
368
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
372
- path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'subscriptionId' => @client.subscription_id},
373
- query_params: {'api-version' => @client.api_version},
369
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
370
+ query_params: {'$top' => top,'api-version' => @client.api_version},
374
371
  headers: request_headers.merge(custom_headers || {}),
375
372
  base_url: request_url
376
373
  }
@@ -390,7 +387,7 @@ module Azure::ARM::Dns
390
387
  if status_code == 200
391
388
  begin
392
389
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
393
- result_mapper = Zone.mapper()
390
+ result_mapper = ZoneListResult.mapper()
394
391
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
395
392
  rescue Exception => e
396
393
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -404,71 +401,45 @@ module Azure::ARM::Dns
404
401
  end
405
402
 
406
403
  #
407
- # Lists the DNS zones within a resource group.
408
- #
409
- # @param resource_group_name [String] The name of the resource group.
410
- # @param top [String] Query parameters. If null is passed returns the default
411
- # number of zones.
412
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
413
- # will be added to the HTTP request.
414
- #
415
- # @return [ZoneListResult] which provide lazy access to pages of the response.
416
- #
417
- def list_in_resource_group_as_lazy(resource_group_name, top = nil, custom_headers = nil)
418
- response = list_in_resource_group_async(resource_group_name, top, custom_headers).value!
419
- unless response.nil?
420
- page = response.body
421
- page.next_method = Proc.new do |next_page_link|
422
- list_in_resource_group_next_async(next_page_link, custom_headers)
423
- end
424
- page
425
- end
426
- end
427
-
428
- #
429
- # Lists the DNS zones within a resource group.
404
+ # Lists the DNS zones in all resource groups in a subscription.
430
405
  #
431
- # @param resource_group_name [String] The name of the resource group.
432
- # @param top [String] Query parameters. If null is passed returns the default
433
- # number of zones.
406
+ # @param top [Integer] The maximum number of DNS zones to return. If not
407
+ # specified, returns up to 100 zones.
434
408
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
409
  # will be added to the HTTP request.
436
410
  #
437
411
  # @return [Array<Zone>] operation results.
438
412
  #
439
- def list_in_resource_group(resource_group_name, top = nil, custom_headers = nil)
440
- first_page = list_in_resource_group_as_lazy(resource_group_name, top, custom_headers)
413
+ def list(top = nil, custom_headers = nil)
414
+ first_page = list_as_lazy(top, custom_headers)
441
415
  first_page.get_all_items
442
416
  end
443
417
 
444
418
  #
445
- # Lists the DNS zones within a resource group.
419
+ # Lists the DNS zones in all resource groups in a subscription.
446
420
  #
447
- # @param resource_group_name [String] The name of the resource group.
448
- # @param top [String] Query parameters. If null is passed returns the default
449
- # number of zones.
421
+ # @param top [Integer] The maximum number of DNS zones to return. If not
422
+ # specified, returns up to 100 zones.
450
423
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
424
  # will be added to the HTTP request.
452
425
  #
453
426
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
454
427
  #
455
- def list_in_resource_group_with_http_info(resource_group_name, top = nil, custom_headers = nil)
456
- list_in_resource_group_async(resource_group_name, top, custom_headers).value!
428
+ def list_with_http_info(top = nil, custom_headers = nil)
429
+ list_async(top, custom_headers).value!
457
430
  end
458
431
 
459
432
  #
460
- # Lists the DNS zones within a resource group.
433
+ # Lists the DNS zones in all resource groups in a subscription.
461
434
  #
462
- # @param resource_group_name [String] The name of the resource group.
463
- # @param top [String] Query parameters. If null is passed returns the default
464
- # number of zones.
435
+ # @param top [Integer] The maximum number of DNS zones to return. If not
436
+ # specified, returns up to 100 zones.
465
437
  # @param [Hash{String => String}] A hash of custom headers that will be added
466
438
  # to the HTTP request.
467
439
  #
468
440
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
469
441
  #
470
- def list_in_resource_group_async(resource_group_name, top = nil, custom_headers = nil)
471
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
442
+ def list_async(top = nil, custom_headers = nil)
472
443
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
473
444
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
474
445
 
@@ -478,13 +449,13 @@ module Azure::ARM::Dns
478
449
  # Set Headers
479
450
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
480
451
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
481
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones'
452
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones'
482
453
 
483
454
  request_url = @base_url || @client.base_url
484
455
 
485
456
  options = {
486
457
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
487
- path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
458
+ path_params: {'subscriptionId' => @client.subscription_id},
488
459
  query_params: {'$top' => top,'api-version' => @client.api_version},
489
460
  headers: request_headers.merge(custom_headers || {}),
490
461
  base_url: request_url
@@ -519,66 +490,62 @@ module Azure::ARM::Dns
519
490
  end
520
491
 
521
492
  #
522
- # Lists the DNS zones within a resource group.
523
- #
524
- # @param top [String] Query parameters. If null is passed returns the default
525
- # number of zones.
526
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
527
- # will be added to the HTTP request.
528
- #
529
- # @return [ZoneListResult] which provide lazy access to pages of the response.
530
- #
531
- def list_in_subscription_as_lazy(top = nil, custom_headers = nil)
532
- response = list_in_subscription_async(top, custom_headers).value!
533
- unless response.nil?
534
- page = response.body
535
- page.next_method = Proc.new do |next_page_link|
536
- list_in_subscription_next_async(next_page_link, custom_headers)
537
- end
538
- page
539
- end
540
- end
541
-
542
- #
543
- # Lists the DNS zones within a resource group.
493
+ # Deletes a DNS zone. WARNING: All DNS records in the zone will also be
494
+ # deleted. This operation cannot be undone.
544
495
  #
545
- # @param top [String] Query parameters. If null is passed returns the default
546
- # number of zones.
496
+ # @param resource_group_name [String] The name of the resource group.
497
+ # @param zone_name [String] The name of the DNS zone (without a terminating
498
+ # dot).
499
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
500
+ # delete the current zone. Specify the last-seen etag value to prevent
501
+ # accidentally deleting any concurrent changes.
547
502
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
548
503
  # will be added to the HTTP request.
549
504
  #
550
- # @return [Array<Zone>] operation results.
505
+ # @return [ZoneDeleteResult] operation results.
551
506
  #
552
- def list_in_subscription(top = nil, custom_headers = nil)
553
- first_page = list_in_subscription_as_lazy(top, custom_headers)
554
- first_page.get_all_items
507
+ def begin_delete(resource_group_name, zone_name, if_match = nil, custom_headers = nil)
508
+ response = begin_delete_async(resource_group_name, zone_name, if_match, custom_headers).value!
509
+ response.body unless response.nil?
555
510
  end
556
511
 
557
512
  #
558
- # Lists the DNS zones within a resource group.
513
+ # Deletes a DNS zone. WARNING: All DNS records in the zone will also be
514
+ # deleted. This operation cannot be undone.
559
515
  #
560
- # @param top [String] Query parameters. If null is passed returns the default
561
- # number of zones.
516
+ # @param resource_group_name [String] The name of the resource group.
517
+ # @param zone_name [String] The name of the DNS zone (without a terminating
518
+ # dot).
519
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
520
+ # delete the current zone. Specify the last-seen etag value to prevent
521
+ # accidentally deleting any concurrent changes.
562
522
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
523
  # will be added to the HTTP request.
564
524
  #
565
525
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
566
526
  #
567
- def list_in_subscription_with_http_info(top = nil, custom_headers = nil)
568
- list_in_subscription_async(top, custom_headers).value!
527
+ def begin_delete_with_http_info(resource_group_name, zone_name, if_match = nil, custom_headers = nil)
528
+ begin_delete_async(resource_group_name, zone_name, if_match, custom_headers).value!
569
529
  end
570
530
 
571
531
  #
572
- # Lists the DNS zones within a resource group.
532
+ # Deletes a DNS zone. WARNING: All DNS records in the zone will also be
533
+ # deleted. This operation cannot be undone.
573
534
  #
574
- # @param top [String] Query parameters. If null is passed returns the default
575
- # number of zones.
535
+ # @param resource_group_name [String] The name of the resource group.
536
+ # @param zone_name [String] The name of the DNS zone (without a terminating
537
+ # dot).
538
+ # @param if_match [String] The etag of the DNS zone. Omit this value to always
539
+ # delete the current zone. Specify the last-seen etag value to prevent
540
+ # accidentally deleting any concurrent changes.
576
541
  # @param [Hash{String => String}] A hash of custom headers that will be added
577
542
  # to the HTTP request.
578
543
  #
579
544
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
580
545
  #
581
- def list_in_subscription_async(top = nil, custom_headers = nil)
546
+ def begin_delete_async(resource_group_name, zone_name, if_match = nil, custom_headers = nil)
547
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
548
+ fail ArgumentError, 'zone_name is nil' if zone_name.nil?
582
549
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
583
550
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
584
551
 
@@ -587,25 +554,26 @@ module Azure::ARM::Dns
587
554
 
588
555
  # Set Headers
589
556
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
557
+ request_headers['If-Match'] = if_match unless if_match.nil?
590
558
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
591
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones'
559
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'
592
560
 
593
561
  request_url = @base_url || @client.base_url
594
562
 
595
563
  options = {
596
564
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
597
- path_params: {'subscriptionId' => @client.subscription_id},
598
- query_params: {'$top' => top,'api-version' => @client.api_version},
565
+ path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'subscriptionId' => @client.subscription_id},
566
+ query_params: {'api-version' => @client.api_version},
599
567
  headers: request_headers.merge(custom_headers || {}),
600
568
  base_url: request_url
601
569
  }
602
- promise = @client.make_request_async(:get, path_template, options)
570
+ promise = @client.make_request_async(:delete, path_template, options)
603
571
 
604
572
  promise = promise.then do |result|
605
573
  http_response = result.response
606
574
  status_code = http_response.status
607
575
  response_content = http_response.body
608
- unless status_code == 200
576
+ unless status_code == 204 || status_code == 202 || status_code == 200
609
577
  error_model = JSON.load(response_content)
610
578
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
611
579
  end
@@ -615,7 +583,7 @@ module Azure::ARM::Dns
615
583
  if status_code == 200
616
584
  begin
617
585
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
618
- result_mapper = ZoneListResult.mapper()
586
+ result_mapper = ZoneDeleteResult.mapper()
619
587
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
620
588
  rescue Exception => e
621
589
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -631,43 +599,43 @@ module Azure::ARM::Dns
631
599
  #
632
600
  # Lists the DNS zones within a resource group.
633
601
  #
634
- # @param next_page_link [String] The NextLink from the previous successful
635
- # call to List operation.
602
+ # @param next_page_link [String] The NextLink from the previous successful call
603
+ # to List operation.
636
604
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
637
605
  # will be added to the HTTP request.
638
606
  #
639
607
  # @return [ZoneListResult] operation results.
640
608
  #
641
- def list_in_resource_group_next(next_page_link, custom_headers = nil)
642
- response = list_in_resource_group_next_async(next_page_link, custom_headers).value!
609
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
610
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
643
611
  response.body unless response.nil?
644
612
  end
645
613
 
646
614
  #
647
615
  # Lists the DNS zones within a resource group.
648
616
  #
649
- # @param next_page_link [String] The NextLink from the previous successful
650
- # call to List operation.
617
+ # @param next_page_link [String] The NextLink from the previous successful call
618
+ # to List operation.
651
619
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
652
620
  # will be added to the HTTP request.
653
621
  #
654
622
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
655
623
  #
656
- def list_in_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
657
- list_in_resource_group_next_async(next_page_link, custom_headers).value!
624
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
625
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
658
626
  end
659
627
 
660
628
  #
661
629
  # Lists the DNS zones within a resource group.
662
630
  #
663
- # @param next_page_link [String] The NextLink from the previous successful
664
- # call to List operation.
631
+ # @param next_page_link [String] The NextLink from the previous successful call
632
+ # to List operation.
665
633
  # @param [Hash{String => String}] A hash of custom headers that will be added
666
634
  # to the HTTP request.
667
635
  #
668
636
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
669
637
  #
670
- def list_in_resource_group_next_async(next_page_link, custom_headers = nil)
638
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
671
639
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
672
640
 
673
641
 
@@ -716,45 +684,45 @@ module Azure::ARM::Dns
716
684
  end
717
685
 
718
686
  #
719
- # Lists the DNS zones within a resource group.
687
+ # Lists the DNS zones in all resource groups in a subscription.
720
688
  #
721
- # @param next_page_link [String] The NextLink from the previous successful
722
- # call to List operation.
689
+ # @param next_page_link [String] The NextLink from the previous successful call
690
+ # to List operation.
723
691
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
724
692
  # will be added to the HTTP request.
725
693
  #
726
694
  # @return [ZoneListResult] operation results.
727
695
  #
728
- def list_in_subscription_next(next_page_link, custom_headers = nil)
729
- response = list_in_subscription_next_async(next_page_link, custom_headers).value!
696
+ def list_next(next_page_link, custom_headers = nil)
697
+ response = list_next_async(next_page_link, custom_headers).value!
730
698
  response.body unless response.nil?
731
699
  end
732
700
 
733
701
  #
734
- # Lists the DNS zones within a resource group.
702
+ # Lists the DNS zones in all resource groups in a subscription.
735
703
  #
736
- # @param next_page_link [String] The NextLink from the previous successful
737
- # call to List operation.
704
+ # @param next_page_link [String] The NextLink from the previous successful call
705
+ # to List operation.
738
706
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
739
707
  # will be added to the HTTP request.
740
708
  #
741
709
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
742
710
  #
743
- def list_in_subscription_next_with_http_info(next_page_link, custom_headers = nil)
744
- list_in_subscription_next_async(next_page_link, custom_headers).value!
711
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
712
+ list_next_async(next_page_link, custom_headers).value!
745
713
  end
746
714
 
747
715
  #
748
- # Lists the DNS zones within a resource group.
716
+ # Lists the DNS zones in all resource groups in a subscription.
749
717
  #
750
- # @param next_page_link [String] The NextLink from the previous successful
751
- # call to List operation.
718
+ # @param next_page_link [String] The NextLink from the previous successful call
719
+ # to List operation.
752
720
  # @param [Hash{String => String}] A hash of custom headers that will be added
753
721
  # to the HTTP request.
754
722
  #
755
723
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
756
724
  #
757
- def list_in_subscription_next_async(next_page_link, custom_headers = nil)
725
+ def list_next_async(next_page_link, custom_headers = nil)
758
726
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
759
727
 
760
728
 
@@ -802,5 +770,48 @@ module Azure::ARM::Dns
802
770
  promise.execute
803
771
  end
804
772
 
773
+ #
774
+ # Lists the DNS zones within a resource group.
775
+ #
776
+ # @param resource_group_name [String] The name of the resource group.
777
+ # @param top [Integer] The maximum number of record sets to return. If not
778
+ # specified, returns up to 100 record sets.
779
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
780
+ # will be added to the HTTP request.
781
+ #
782
+ # @return [ZoneListResult] which provide lazy access to pages of the response.
783
+ #
784
+ def list_by_resource_group_as_lazy(resource_group_name, top = nil, custom_headers = nil)
785
+ response = list_by_resource_group_async(resource_group_name, top, custom_headers).value!
786
+ unless response.nil?
787
+ page = response.body
788
+ page.next_method = Proc.new do |next_page_link|
789
+ list_by_resource_group_next_async(next_page_link, custom_headers)
790
+ end
791
+ page
792
+ end
793
+ end
794
+
795
+ #
796
+ # Lists the DNS zones in all resource groups in a subscription.
797
+ #
798
+ # @param top [Integer] The maximum number of DNS zones to return. If not
799
+ # specified, returns up to 100 zones.
800
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
801
+ # will be added to the HTTP request.
802
+ #
803
+ # @return [ZoneListResult] which provide lazy access to pages of the response.
804
+ #
805
+ def list_as_lazy(top = nil, custom_headers = nil)
806
+ response = list_async(top, custom_headers).value!
807
+ unless response.nil?
808
+ page = response.body
809
+ page.next_method = Proc.new do |next_page_link|
810
+ list_next_async(next_page_link, custom_headers)
811
+ end
812
+ page
813
+ end
814
+ end
815
+
805
816
  end
806
817
  end