Class: Azure::ARM::Dns::RecordSets

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_dns/record_sets.rb

Overview

The DNS Management Client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RecordSets

Creates and initializes a new instance of the RecordSets class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientDnsManagementClient (readonly)

Returns reference to the DnsManagementClient.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 23

def client
  @client
end

Instance Method Details

#create_or_update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, if_none_match = nil, custom_headers = nil) ⇒ RecordSet

Creates or updates a record set within a DNS zone.

dot). to the name of the zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ operation. always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. created, but to prevent updating an existing record set. Other values will be ignored. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • parameters (RecordSet)

    Parameters supplied to the CreateOrUpdate

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • if_none_match (String) (defaults to: nil)

    Set to ‘*’ to allow a new record set to be

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



185
186
187
188
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 185

def create_or_update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, if_none_match = nil, custom_headers = nil)
  response = create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match, if_none_match, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, if_none_match = nil, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates a record set within a DNS zone.

dot). to the name of the zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ operation. always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. created, but to prevent updating an existing record set. Other values will be ignored. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • parameters (RecordSet)

    Parameters supplied to the CreateOrUpdate

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • if_none_match (String) (defaults to: nil)

    Set to ‘*’ to allow a new record set to be

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 244

def create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, if_none_match = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
  fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
  fail ArgumentError, 'record_type is nil' if record_type.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = RecordSet.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
      skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, if_none_match = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a record set within a DNS zone.

dot). to the name of the zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ operation. always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes. created, but to prevent updating an existing record set. Other values will be ignored. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • parameters (RecordSet)

    Parameters supplied to the CreateOrUpdate

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • if_none_match (String) (defaults to: nil)

    Set to ‘*’ to allow a new record set to be

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



215
216
217
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 215

def create_or_update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, if_none_match = nil, custom_headers = nil)
  create_or_update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match, if_none_match, custom_headers).value!
end

#delete(resource_group_name, zone_name, relative_record_set_name, record_type, if_match = nil, custom_headers = nil) ⇒ Object

Deletes a record set from a DNS zone. This operation cannot be undone.

dot). to the name of the zone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



340
341
342
343
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 340

def delete(resource_group_name, zone_name, relative_record_set_name, record_type, if_match = nil, custom_headers = nil)
  response = delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match, custom_headers).value!
  nil
end

#delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match = nil, custom_headers = nil) ⇒ Concurrent::Promise

Deletes a record set from a DNS zone. This operation cannot be undone.

dot). to the name of the zone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 389

def delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
  fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
  fail ArgumentError, 'record_type is nil' if record_type.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
      skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#delete_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, if_match = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a record set from a DNS zone. This operation cannot be undone.

dot). to the name of the zone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



365
366
367
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 365

def delete_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, if_match = nil, custom_headers = nil)
  delete_async(resource_group_name, zone_name, relative_record_set_name, record_type, if_match, custom_headers).value!
end

#get(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers = nil) ⇒ RecordSet

Gets a record set.

dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



451
452
453
454
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 451

def get(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers = nil)
  response = get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers = nil) ⇒ Concurrent::Promise

Gets a record set.

dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 492

def get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
  fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
  fail ArgumentError, 'record_type is nil' if record_type.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
      skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a record set.

dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



472
473
474
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 472

def get_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers = nil)
  get_async(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers).value!
end

#list_by_dns_zone(resource_group_name, zone_name, top = nil, custom_headers = nil) ⇒ Array<RecordSet>

Lists all record sets in a DNS zone.

dot). specified, returns up to 100 record sets. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



670
671
672
673
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 670

def list_by_dns_zone(resource_group_name, zone_name, top = nil, custom_headers = nil)
  first_page = list_by_dns_zone_as_lazy(resource_group_name, zone_name, top, custom_headers)
  first_page.get_all_items
end

#list_by_dns_zone_as_lazy(resource_group_name, zone_name, top = nil, custom_headers = nil) ⇒ RecordSetListResult

Lists all record sets in a DNS zone.

dot). specified, returns up to 100 record sets. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



973
974
975
976
977
978
979
980
981
982
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 973

def list_by_dns_zone_as_lazy(resource_group_name, zone_name, top = nil, custom_headers = nil)
  response = list_by_dns_zone_async(resource_group_name, zone_name, top, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_dns_zone_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_by_dns_zone_async(resource_group_name, zone_name, top = nil, custom_headers = nil) ⇒ Concurrent::Promise

Lists all record sets in a DNS zone.

dot). specified, returns up to 100 record sets. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 705

def list_by_dns_zone_async(resource_group_name, zone_name, top = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_dns_zone_next(next_page_link, custom_headers = nil) ⇒ RecordSetListResult

Lists all record sets in a DNS zone.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



854
855
856
857
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 854

def list_by_dns_zone_next(next_page_link, custom_headers = nil)
  response = list_by_dns_zone_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_by_dns_zone_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Lists all record sets in a DNS zone.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 883

def list_by_dns_zone_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_dns_zone_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all record sets in a DNS zone.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



869
870
871
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 869

def list_by_dns_zone_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_dns_zone_next_async(next_page_link, custom_headers).value!
end

#list_by_dns_zone_with_http_info(resource_group_name, zone_name, top = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all record sets in a DNS zone.

dot). specified, returns up to 100 record sets. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



688
689
690
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 688

def list_by_dns_zone_with_http_info(resource_group_name, zone_name, top = nil, custom_headers = nil)
  list_by_dns_zone_async(resource_group_name, zone_name, top, custom_headers).value!
end

#list_by_type(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil) ⇒ Array<RecordSet>

Lists the record sets of a specified type in a DNS zone.

dot). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • record_type (RecordType)

    The type of record sets to enumerate.

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



563
564
565
566
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 563

def list_by_type(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil)
  first_page = list_by_type_as_lazy(resource_group_name, zone_name, record_type, top, custom_headers)
  first_page.get_all_items
end

#list_by_type_as_lazy(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil) ⇒ RecordSetListResult

Lists the record sets of a specified type in a DNS zone.

dot). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • record_type (RecordType)

    The type of record sets to enumerate.

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



948
949
950
951
952
953
954
955
956
957
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 948

def list_by_type_as_lazy(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil)
  response = list_by_type_async(resource_group_name, zone_name, record_type, top, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_type_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_by_type_async(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil) ⇒ Concurrent::Promise

Lists the record sets of a specified type in a DNS zone.

dot). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • record_type (RecordType)

    The type of record sets to enumerate.

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 604

def list_by_type_async(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
  fail ArgumentError, 'record_type is nil' if record_type.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
      query_params: {'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_type_next(next_page_link, custom_headers = nil) ⇒ RecordSetListResult

Lists the record sets of a specified type in a DNS zone.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



767
768
769
770
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 767

def list_by_type_next(next_page_link, custom_headers = nil)
  response = list_by_type_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_by_type_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Lists the record sets of a specified type in a DNS zone.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 796

def list_by_type_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_type_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the record sets of a specified type in a DNS zone.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



782
783
784
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 782

def list_by_type_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_type_next_async(next_page_link, custom_headers).value!
end

#list_by_type_with_http_info(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the record sets of a specified type in a DNS zone.

dot). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • record_type (RecordType)

    The type of record sets to enumerate.

  • top (Integer) (defaults to: nil)

    The maximum number of record sets to return. If not

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



584
585
586
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 584

def list_by_type_with_http_info(resource_group_name, zone_name, record_type, top = nil, custom_headers = nil)
  list_by_type_async(resource_group_name, zone_name, record_type, top, custom_headers).value!
end

#update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, custom_headers = nil) ⇒ RecordSet

Updates a record set within a DNS zone.

dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting concurrent changes. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • parameters (RecordSet)

    Parameters supplied to the Update operation.

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



45
46
47
48
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 45

def update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, custom_headers = nil)
  response = update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match, custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, custom_headers = nil) ⇒ Concurrent::Promise

Updates a record set within a DNS zone.

dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting concurrent changes. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • parameters (RecordSet)

    Parameters supplied to the Update operation.

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 94

def update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'zone_name is nil' if zone_name.nil?
  fail ArgumentError, 'relative_record_set_name is nil' if relative_record_set_name.nil?
  fail ArgumentError, 'record_type is nil' if record_type.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = RecordSet.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'zoneName' => zone_name,'recordType' => record_type,'subscriptionId' => @client.subscription_id},
      skip_encoding_path_params: {'relativeRecordSetName' => relative_record_set_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a record set within a DNS zone.

dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting concurrent changes. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • zone_name (String)

    The name of the DNS zone (without a terminating

  • relative_record_set_name (String)

    The name of the record set, relative

  • record_type (RecordType)

    The type of DNS record in this record set.

  • parameters (RecordSet)

    Parameters supplied to the Update operation.

  • if_match (String) (defaults to: nil)

    The etag of the record set. Omit this value to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



70
71
72
# File 'lib/generated/azure_mgmt_dns/record_sets.rb', line 70

def update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match = nil, custom_headers = nil)
  update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match, custom_headers).value!
end