Class: Azure::ARM::CDN::Profiles

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_cdn/profiles.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) ⇒ Profiles

Creates and initializes a new instance of the Profiles class.

Parameters:

  • client

    service class for accessing basic functionality.



20
21
22
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 20

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientCdnManagementClient (readonly)

Returns reference to the CdnManagementClient.

Returns:



25
26
27
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 25

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, profile_name, profile, custom_headers = nil) ⇒ Profile

Creates a new CDN profile with a profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

  • profile (Profile)

    Profile properties needed to create a new profile.

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

    A hash of custom headers that

Returns:



567
568
569
570
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 567

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

#begin_create_async(resource_group_name, profile_name, profile, custom_headers = nil) ⇒ Concurrent::Promise

Creates a new CDN profile with a profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

  • profile (Profile)

    Profile properties needed to create a new profile.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

def begin_create_async(resource_group_name, profile_name, profile, 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, 'profile is nil' if profile.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 = Profile.mapper()
  request_content = @client.serialize(request_mapper,  profile, 'profile')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  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,'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 = Profile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Profile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Profile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_with_http_info(resource_group_name, profile_name, profile, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new CDN profile with a profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

  • profile (Profile)

    Profile properties needed to create a new profile.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



586
587
588
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 586

def begin_create_with_http_info(resource_group_name, profile_name, profile, custom_headers = nil)
  begin_create_async(resource_group_name, profile_name, profile, custom_headers).value!
end

#begin_delete(resource_group_name, profile_name, custom_headers = nil) ⇒ Object

Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all subresources including endpoints, origins and custom domains.

Azure subscription. the resource group. 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

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

    A hash of custom headers that



825
826
827
828
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 825

def begin_delete(resource_group_name, profile_name, custom_headers = nil)
  response = begin_delete_async(resource_group_name, profile_name, custom_headers).value!
  nil
end

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

Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all subresources including endpoints, origins and custom domains.

Azure subscription. the resource group. 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

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



862
863
864
865
866
867
868
869
870
871
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
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 862

def begin_delete_async(resource_group_name, profile_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, '@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}'

  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,'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 == 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?

    result
  end

  promise.execute
end

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

Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all subresources including endpoints, origins and custom domains.

Azure subscription. the resource group. 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

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



844
845
846
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 844

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

#begin_update(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil) ⇒ Profile

Updates an existing CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. needed to update an existing profile. 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

  • profile_update_parameters (ProfileUpdateParameters)

    Profile properties

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

    A hash of custom headers that

Returns:



701
702
703
704
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 701

def begin_update(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil)
  response = begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil) ⇒ Concurrent::Promise

Updates an existing CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. needed to update an existing profile. 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

  • profile_update_parameters (ProfileUpdateParameters)

    Profile properties

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
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
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 740

def begin_update_async(resource_group_name, profile_name, profile_update_parameters, 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, 'profile_update_parameters is nil' if profile_update_parameters.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 = ProfileUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  profile_update_parameters, 'profile_update_parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  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,'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(: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 || 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 = Profile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Profile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_update_with_http_info(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Updates an existing CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. needed to update an existing profile. 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

  • profile_update_parameters (ProfileUpdateParameters)

    Profile properties

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



721
722
723
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 721

def begin_update_with_http_info(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil)
  begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers).value!
end

#create(resource_group_name, profile_name, profile, custom_headers = nil) ⇒ Profile

Creates a new CDN profile with a profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

  • profile (Profile)

    Profile properties needed to create a new profile.

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

    A hash of custom headers that

Returns:



314
315
316
317
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 314

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

#create_async(resource_group_name, profile_name, profile, custom_headers = nil) ⇒ Concurrent::Promise

Azure subscription. the resource group. 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

  • profile (Profile)

    Profile properties needed to create a new profile.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 331

def create_async(resource_group_name, profile_name, profile, custom_headers = nil)
  # Send request
  promise = begin_create_async(resource_group_name, profile_name, profile, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Profile.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

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

  promise
end

#delete(resource_group_name, profile_name, custom_headers = nil) ⇒ Object

Deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion of all subresources including endpoints, origins and custom domains.

Azure subscription. the resource group. 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

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

    A hash of custom headers that



412
413
414
415
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 412

def delete(resource_group_name, profile_name, custom_headers = nil)
  response = delete_async(resource_group_name, profile_name, custom_headers).value!
  nil
end

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

Azure subscription. the resource group. 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

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 428

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

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

  promise
end

#generate_sso_uri(resource_group_name, profile_name, custom_headers = nil) ⇒ SsoUri

Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The SSO URI changes approximately every 10 minutes.

Azure subscription. the resource group. 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

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

    A hash of custom headers that

Returns:

  • (SsoUri)

    operation results.



460
461
462
463
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 460

def generate_sso_uri(resource_group_name, profile_name, custom_headers = nil)
  response = generate_sso_uri_async(resource_group_name, profile_name, custom_headers).value!
  response.body unless response.nil?
end

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

Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The SSO URI changes approximately every 10 minutes.

Azure subscription. the resource group. 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

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 501

def generate_sso_uri_async(resource_group_name, profile_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, '@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}/generateSsoUri'

  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,'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 == 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 = SsoUri.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

Generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal portal is used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The SSO URI changes approximately every 10 minutes.

Azure subscription. the resource group. 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

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



481
482
483
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 481

def generate_sso_uri_with_http_info(resource_group_name, profile_name, custom_headers = nil)
  generate_sso_uri_async(resource_group_name, profile_name, custom_headers).value!
end

#get(resource_group_name, profile_name, custom_headers = nil) ⇒ Profile

Gets a CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

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

    A hash of custom headers that

Returns:



213
214
215
216
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 213

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

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

Gets a CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 248

def get_async(resource_group_name, profile_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, '@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}'

  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,'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 = Profile.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

Gets a CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. 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

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



231
232
233
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 231

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

#list(custom_headers = nil) ⇒ Array<Profile>

Lists all the CDN profiles within an Azure subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<Profile>)

    operation results.



35
36
37
38
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 35

def list(custom_headers = nil)
  first_page = list_as_lazy(custom_headers)
  first_page.get_all_items
end

#list_as_lazy(custom_headers = nil) ⇒ ProfileListResult

Lists all the CDN profiles within an Azure subscription.

will be added to the HTTP request.

response.

Parameters:

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

    A hash of custom headers that

Returns:



1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 1087

def list_as_lazy(custom_headers = nil)
  response = list_async(custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_async(custom_headers = nil) ⇒ Concurrent::Promise

Lists all the CDN profiles within an Azure subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 60

def list_async(custom_headers = 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}/providers/Microsoft.Cdn/profiles'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'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 = ProfileListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group(resource_group_name, custom_headers = nil) ⇒ Array<Profile>

Lists all the CDN profiles within a resource group.

Azure subscription. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

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

    A hash of custom headers that

Returns:

  • (Array<Profile>)

    operation results.



120
121
122
123
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 120

def list_by_resource_group(resource_group_name, custom_headers = nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil) ⇒ ProfileListResult

Lists all the CDN profiles within a resource group.

Azure subscription. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

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

    A hash of custom headers that

Returns:



1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 1109

def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Lists all the CDN profiles within a resource group.

Azure subscription. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 149

def list_by_resource_group_async(resource_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_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 = ProfileListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers = nil) ⇒ ProfileListResult

Lists all the CDN profiles within a resource group.

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:



1001
1002
1003
1004
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 1001

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

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

Lists all the CDN profiles within a resource group.

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.



1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 1030

def list_by_resource_group_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 = ProfileListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

Lists all the CDN profiles within a resource group.

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.



1016
1017
1018
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 1016

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_resource_group_next_async(next_page_link, custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the CDN profiles within a resource group.

Azure subscription. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the Resource group within the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



135
136
137
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 135

def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
  list_by_resource_group_async(resource_group_name, custom_headers).value!
end

#list_next(next_page_link, custom_headers = nil) ⇒ ProfileListResult

Lists all the CDN profiles within an Azure subscription.

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:



914
915
916
917
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 914

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

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

Lists all the CDN profiles within an Azure subscription.

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.



943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 943

def list_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 = ProfileListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

Lists all the CDN profiles within an Azure subscription.

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.



929
930
931
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 929

def list_next_with_http_info(next_page_link, custom_headers = nil)
  list_next_async(next_page_link, custom_headers).value!
end

#list_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the CDN profiles within an Azure subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



48
49
50
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 48

def list_with_http_info(custom_headers = nil)
  list_async(custom_headers).value!
end

#update(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil) ⇒ Profile

Updates an existing CDN profile with the specified profile name under the specified subscription and resource group.

Azure subscription. the resource group. needed to update an existing profile. 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

  • profile_update_parameters (ProfileUpdateParameters)

    Profile properties

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

    A hash of custom headers that

Returns:



364
365
366
367
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 364

def update(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil)
  response = update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil) ⇒ Concurrent::Promise

Azure subscription. the resource group. needed to update an existing profile. 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

  • profile_update_parameters (ProfileUpdateParameters)

    Profile properties

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/generated/azure_mgmt_cdn/profiles.rb', line 382

def update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers = nil)
  # Send request
  promise = begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Profile.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

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

  promise
end