Class: Azure::Dns::Mgmt::V2017_10_01::RecordSets

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2017-10-01/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.



17
18
19
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientDnsManagementClient (readonly)

Returns reference to the DnsManagementClient.

Returns:



22
23
24
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 22

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.

is case insensitive. 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’, ‘CAA’, ‘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. The name

  • 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:

  • (RecordSet)

    operation results.



192
193
194
195
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 192

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_match, if_none_match:if_none_match, custom_headers: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.

is case insensitive. 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’, ‘CAA’, ‘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. The name

  • 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.



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
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 253

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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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?

  # Serialize Request
  request_mapper = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSet.mapper()
  request_content = @client.serialize(request_mapper,  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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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.

is case insensitive. 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’, ‘CAA’, ‘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. The name

  • 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.



223
224
225
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 223

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_match, if_none_match:if_none_match, custom_headers: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.

is case insensitive. 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’, ‘CAA’, ‘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. The name

  • 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



354
355
356
357
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 354

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:if_match, custom_headers: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.

is case insensitive. 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’, ‘CAA’, ‘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. The name

  • 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.



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
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 405

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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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.

is case insensitive. 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’, ‘CAA’, ‘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. The name

  • 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.



380
381
382
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 380

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:if_match, custom_headers:custom_headers).value!
end

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

Gets a record set.

is case insensitive. dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘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. The name

  • 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:

  • (RecordSet)

    operation results.



474
475
476
477
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 474

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: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.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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.



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
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 517

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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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.

is case insensitive. dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘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. The name

  • 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.



496
497
498
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 496

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:custom_headers).value!
end

#list_all_by_dns_zone(resource_group_name, zone_name, top: nil, record_set_name_suffix: nil, custom_headers: nil) ⇒ Array<RecordSet>

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • record_set_name_suffix (String) (defaults to: nil)

    The suffix label of the record set

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

    A hash of custom headers that

Returns:

  • (Array<RecordSet>)

    operation results.



848
849
850
851
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 848

def list_all_by_dns_zone(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
  first_page = list_all_by_dns_zone_as_lazy(resource_group_name, zone_name, top:top, record_set_name_suffix:record_set_name_suffix, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_all_by_dns_zone_as_lazy(resource_group_name, zone_name, top: nil, record_set_name_suffix: nil, custom_headers: nil) ⇒ RecordSetListResult

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • record_set_name_suffix (String) (defaults to: nil)

    The suffix label of the record set

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

    A hash of custom headers that

Returns:

  • (RecordSetListResult)

    which provide lazy access to pages of the



1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1297

def list_all_by_dns_zone_as_lazy(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
  response = list_all_by_dns_zone_async(resource_group_name, zone_name, top:top, record_set_name_suffix:record_set_name_suffix, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_all_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_all_by_dns_zone_async(resource_group_name, zone_name, top: nil, record_set_name_suffix: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • record_set_name_suffix (String) (defaults to: nil)

    The suffix label of the record set

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 893

def list_all_by_dns_zone_async(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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}/all'

  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,'$recordsetnamesuffix' => record_set_name_suffix,'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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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_all_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:

  • (RecordSetListResult)

    operation results.



1137
1138
1139
1140
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1137

def list_all_by_dns_zone_next(next_page_link, custom_headers:nil)
  response = list_all_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_all_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.



1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1166

def list_all_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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_all_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.



1152
1153
1154
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1152

def list_all_by_dns_zone_next_with_http_info(next_page_link, custom_headers:nil)
  list_all_by_dns_zone_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_all_by_dns_zone_with_http_info(resource_group_name, zone_name, top: nil, record_set_name_suffix: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • record_set_name_suffix (String) (defaults to: nil)

    The suffix label of the record set

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



871
872
873
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 871

def list_all_by_dns_zone_with_http_info(resource_group_name, zone_name, top:nil, record_set_name_suffix:nil, custom_headers:nil)
  list_all_by_dns_zone_async(resource_group_name, zone_name, top:top, record_set_name_suffix:record_set_name_suffix, custom_headers:custom_headers).value!
end

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

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

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

    A hash of custom headers that

Returns:

  • (Array<RecordSet>)

    operation results.



727
728
729
730
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 727

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

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

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

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

    A hash of custom headers that

Returns:

  • (RecordSetListResult)

    which provide lazy access to pages of the



1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1267

def list_by_dns_zone_as_lazy(resource_group_name, zone_name, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
  response = list_by_dns_zone_async(resource_group_name, zone_name, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers: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:custom_headers)
    end
    page
  end
end

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

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
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
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 772

def list_by_dns_zone_async(resource_group_name, zone_name, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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,'$recordsetnamesuffix' => recordsetnamesuffix,'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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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:

  • (RecordSetListResult)

    operation results.



1049
1050
1051
1052
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1049

def list_by_dns_zone_next(next_page_link, custom_headers:nil)
  response = list_by_dns_zone_next_async(next_page_link, custom_headers: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.



1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1078

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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.



1064
1065
1066
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1064

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:custom_headers).value!
end

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

Lists all record sets in a DNS zone.

is case insensitive. dot). specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



750
751
752
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 750

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

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

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

is case insensitive. dot). Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

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

    A hash of custom headers that

Returns:

  • (Array<RecordSet>)

    operation results.



599
600
601
602
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 599

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

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

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

is case insensitive. dot). Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

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

    A hash of custom headers that

Returns:

  • (RecordSetListResult)

    which provide lazy access to pages of the



1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 1237

def list_by_type_as_lazy(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
  response = list_by_type_async(resource_group_name, zone_name, record_type, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers: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:custom_headers)
    end
    page
  end
end

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

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

is case insensitive. dot). Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 650

def list_by_type_async(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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,'$recordsetnamesuffix' => recordsetnamesuffix,'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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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:

  • (RecordSetListResult)

    operation results.



961
962
963
964
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 961

def list_by_type_next(next_page_link, custom_headers:nil)
  response = list_by_type_next_async(next_page_link, custom_headers: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.



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 990

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # 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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSetListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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.



976
977
978
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 976

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

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

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

is case insensitive. dot). Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’ specified, returns up to 100 record sets. that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix> will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • 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

  • recordsetnamesuffix (String) (defaults to: nil)

    The suffix label of the record set name

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



625
626
627
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 625

def list_by_type_with_http_info(resource_group_name, zone_name, record_type, top:nil, recordsetnamesuffix:nil, custom_headers:nil)
  list_by_type_async(resource_group_name, zone_name, record_type, top:top, recordsetnamesuffix:recordsetnamesuffix, custom_headers: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.

is case insensitive. dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘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. The name

  • 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:

  • (RecordSet)

    operation results.



45
46
47
48
# File 'lib/2017-10-01/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:if_match, custom_headers: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.

is case insensitive. dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘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. The name

  • 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.



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
159
160
161
162
163
164
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 96

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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


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

  # 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?

  # Serialize Request
  request_mapper = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSet.mapper()
  request_content = @client.serialize(request_mapper,  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 = Azure::Dns::Mgmt::V2017_10_01::Models::RecordSet.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      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.

is case insensitive. dot). to the name of the zone. Possible values include: ‘A’, ‘AAAA’, ‘CAA’, ‘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. The name

  • 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.



71
72
73
# File 'lib/2017-10-01/generated/azure_mgmt_dns/record_sets.rb', line 71

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:if_match, custom_headers:custom_headers).value!
end