Class: Azure::CDN::Mgmt::V2016_10_02::CustomDomains

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb

Overview

Use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must make sure that requests made to these resources are secure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CustomDomains

Creates and initializes a new instance of the CustomDomains class.

Parameters:

  • client

    service class for accessing basic functionality.



19
20
21
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 19

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCdnManagementClient (readonly)

Returns reference to the CdnManagementClient.

Returns:



24
25
26
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 24

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil) ⇒ CustomDomain

Creates a new custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. to create a new custom domain. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • custom_domain_properties (CustomDomainParameters)

    Properties required

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



593
594
595
596
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 593

def begin_create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
  response = begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil) ⇒ Concurrent::Promise

Creates a new custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. to create a new custom domain. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • custom_domain_properties (CustomDomainParameters)

    Properties required

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



638
639
640
641
642
643
644
645
646
647
648
649
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
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 638

def begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
  fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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?

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomainParameters.mapper()
  request_content = @client.serialize(request_mapper,  custom_domain_properties)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
      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 == 200 || status_code == 201 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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 == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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

#begin_create_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. to create a new custom domain. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • custom_domain_properties (CustomDomainParameters)

    Properties required

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



616
617
618
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 616

def begin_create_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
  begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
end

#begin_delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ CustomDomain

Deletes an existing custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



738
739
740
741
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 738

def begin_delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  response = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
  response.body unless response.nil?
end

#begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes an existing custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
829
830
831
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 779

def begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
      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 == 200 || status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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

#begin_delete_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an existing custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



759
760
761
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 759

def begin_delete_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end

#create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil) ⇒ CustomDomain

Creates a new custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. to create a new custom domain. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • custom_domain_properties (CustomDomainParameters)

    Properties required

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



259
260
261
262
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 259

def create(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
  response = create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil) ⇒ Concurrent::Promise

Azure subscription. the resource group. unique globally. endpoint. to create a new custom domain. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • custom_domain_properties (CustomDomainParameters)

    Properties required

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 281

def create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers = nil)
  # Send request
  promise = begin_create_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_properties, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ CustomDomain

Deletes an existing custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



315
316
317
318
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 315

def delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  response = delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
  response.body unless response.nil?
end

#delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ Concurrent::Promise

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 335

def delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  # Send request
  promise = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#disable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ CustomDomain

Disable https delivery of the custom domain.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



369
370
371
372
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 369

def disable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  response = disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
  response.body unless response.nil?
end

#disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ Concurrent::Promise

Disable https delivery of the custom domain.

Azure subscription. the resource group. unique globally. endpoint. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
456
457
458
459
460
461
462
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 410

def disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, 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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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

#disable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Disable https delivery of the custom domain.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



390
391
392
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 390

def disable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end

#enable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ CustomDomain

Enable https delivery of the custom domain.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



480
481
482
483
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 480

def enable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  response = enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
  response.body unless response.nil?
end

#enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ Concurrent::Promise

Enable https delivery of the custom domain.

Azure subscription. the resource group. unique globally. endpoint. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 521

def enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, 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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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

#enable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Enable https delivery of the custom domain.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



501
502
503
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 501

def enable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end

#get(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ CustomDomain

Gets an exisitng custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (CustomDomain)

    operation results.



146
147
148
149
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 146

def get(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  response = get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets an exisitng custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 187

def get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id},
      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 MsRest::HttpOperationError.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::CDN::Mgmt::V2016_10_02::Models::CustomDomain.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, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets an exisitng custom domain within an endpoint.

Azure subscription. the resource group. unique globally. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • custom_domain_name (String)

    Name of the custom domain within an

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



167
168
169
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 167

def get_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil)
  get_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value!
end

#list_by_endpoint(resource_group_name, profile_name, endpoint_name, custom_headers = nil) ⇒ Array<CustomDomain>

Lists all of the existing custom domains within an endpoint.

Azure subscription. the resource group. unique globally. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

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

    A hash of custom headers that

Returns:

  • (Array<CustomDomain>)

    operation results.



40
41
42
43
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 40

def list_by_endpoint(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  first_page = list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers)
  first_page.get_all_items
end

#list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers = nil) ⇒ CustomDomainListResult

Lists all of the existing custom domains within an endpoint.

Azure subscription. the resource group. unique globally. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

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

    A hash of custom headers that

Returns:

  • (CustomDomainListResult)

    which provide lazy access to pages of the



935
936
937
938
939
940
941
942
943
944
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 935

def list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  response = list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_endpoint_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers = nil) ⇒ Concurrent::Promise

Lists all of the existing custom domains within an endpoint.

Azure subscription. the resource group. unique globally. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 77

def list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'subscriptionId' => @client.subscription_id},
      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 MsRest::HttpOperationError.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::CDN::Mgmt::V2016_10_02::Models::CustomDomainListResult.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_endpoint_next(next_page_link, custom_headers = nil) ⇒ CustomDomainListResult

Lists all of the existing custom domains within an endpoint.

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:

  • (CustomDomainListResult)

    operation results.



843
844
845
846
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 843

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

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

Lists all of the existing custom domains within an endpoint.

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.



872
873
874
875
876
877
878
879
880
881
882
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
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 872

def list_by_endpoint_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 MsRest::HttpOperationError.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::CDN::Mgmt::V2016_10_02::Models::CustomDomainListResult.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_endpoint_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all of the existing custom domains within an endpoint.

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.



858
859
860
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 858

def list_by_endpoint_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_endpoint_next_async(next_page_link, custom_headers).value!
end

#list_by_endpoint_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all of the existing custom domains within an endpoint.

Azure subscription. the resource group. unique globally. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • profile_name (String)

    Name of the CDN profile which is unique within

  • endpoint_name (String)

    Name of the endpoint under the profile which is

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



59
60
61
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb', line 59

def list_by_endpoint_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
end