Class: Azure::CDN::Mgmt::V2017_04_02::Endpoints

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.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) ⇒ Endpoints

Creates and initializes a new instance of the Endpoints class.

Parameters:

  • client

    service class for accessing basic functionality.



19
20
21
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.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/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 24

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers: nil) ⇒ Endpoint

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

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

  • endpoint (Endpoint)

    Endpoint properties

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

    A hash of custom headers that

Returns:

  • (Endpoint)

    operation results.



862
863
864
865
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 862

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

#begin_create_async(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers: nil) ⇒ Concurrent::Promise

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

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

  • endpoint (Endpoint)

    Endpoint properties

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
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
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 903

def begin_create_async(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'endpoint is nil' if endpoint.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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::Endpoint.mapper()
  request_content = @client.serialize(request_mapper,  endpoint)
  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}'

  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},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::Endpoint.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::V2017_04_02::Models::Endpoint.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::V2017_04_02::Models::Endpoint.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, endpoint, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

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

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

  • endpoint (Endpoint)

    Endpoint properties

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



883
884
885
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 883

def begin_create_with_http_info(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers:nil)
  begin_create_async(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Object

Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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



1150
1151
1152
1153
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1150

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

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

Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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.



1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1189

def begin_delete_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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'

  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(: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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

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

Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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.



1170
1171
1172
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1170

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

#begin_load_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Object

Pre-loads a content to CDN. Available for Verizon Profiles.

Azure subscription. the resource group. unique globally. loaded. Path should be a full URL, e.g. ‘/pictures/city.png’ which loads a single file 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

  • content_file_paths (LoadParameters)

    The path to the content to be

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

    A hash of custom headers that



1613
1614
1615
1616
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1613

def begin_load_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  response = begin_load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:custom_headers).value!
  nil
end

#begin_load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Concurrent::Promise

Pre-loads a content to CDN. Available for Verizon Profiles.

Azure subscription. the resource group. unique globally. loaded. Path should be a full URL, e.g. ‘/pictures/city.png’ which loads a single file 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

  • content_file_paths (LoadParameters)

    The path to the content to be

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1656

def begin_load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'content_file_paths is nil' if content_file_paths.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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::LoadParameters.mapper()
  request_content = @client.serialize(request_mapper,  content_file_paths)
  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}/load'

  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},
      body: request_content,
      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 || 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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_load_content_with_http_info(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Pre-loads a content to CDN. Available for Verizon Profiles.

Azure subscription. the resource group. unique globally. loaded. Path should be a full URL, e.g. ‘/pictures/city.png’ which loads a single file 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

  • content_file_paths (LoadParameters)

    The path to the content to be

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1635
1636
1637
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1635

def begin_load_content_with_http_info(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  begin_load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:custom_headers).value!
end

#begin_purge_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Object

Removes a content from CDN.

Azure subscription. the resource group. unique globally. purged. Path can be a full URL, e.g. ‘/pictures/city.png’ which removes a single file, or a directory with a wildcard, e.g. ‘/pictures/*’ which removes all folders and files in the directory. 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

  • content_file_paths (PurgeParameters)

    The path to the content to be

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

    A hash of custom headers that



1495
1496
1497
1498
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1495

def begin_purge_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  response = begin_purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:custom_headers).value!
  nil
end

#begin_purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Concurrent::Promise

Removes a content from CDN.

Azure subscription. the resource group. unique globally. purged. Path can be a full URL, e.g. ‘/pictures/city.png’ which removes a single file, or a directory with a wildcard, e.g. ‘/pictures/*’ which removes all folders and files in the directory. 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

  • content_file_paths (PurgeParameters)

    The path to the content to be

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1540

def begin_purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'content_file_paths is nil' if content_file_paths.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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::PurgeParameters.mapper()
  request_content = @client.serialize(request_mapper,  content_file_paths)
  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}/purge'

  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},
      body: request_content,
      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 || 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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_purge_content_with_http_info(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Removes a content from CDN.

Azure subscription. the resource group. unique globally. purged. Path can be a full URL, e.g. ‘/pictures/city.png’ which removes a single file, or a directory with a wildcard, e.g. ‘/pictures/*’ which removes all folders and files in the directory. 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

  • content_file_paths (PurgeParameters)

    The path to the content to be

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1518
1519
1520
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1518

def begin_purge_content_with_http_info(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  begin_purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:custom_headers).value!
end

#begin_start(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Endpoint

Starts an existing CDN endpoint that is on a stopped state.

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:

  • (Endpoint)

    operation results.



1252
1253
1254
1255
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1252

def begin_start(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  response = begin_start_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Starts an existing CDN endpoint that is on a stopped state.

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.



1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1289

def begin_start_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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start'

  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(: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 || 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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::Endpoint.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::V2017_04_02::Models::Endpoint.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_start_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Starts an existing CDN endpoint that is on a stopped state.

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.



1271
1272
1273
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1271

def begin_start_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  begin_start_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
end

#begin_stop(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Endpoint

Stops an existing running CDN 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:

  • (Endpoint)

    operation results.



1372
1373
1374
1375
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1372

def begin_stop(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  response = begin_stop_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Stops an existing running CDN 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.



1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1409

def begin_stop_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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop'

  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(: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 || 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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::Endpoint.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::V2017_04_02::Models::Endpoint.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_stop_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Stops an existing running CDN 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.



1391
1392
1393
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1391

def begin_stop_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  begin_stop_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers: nil) ⇒ Endpoint

Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation.

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

  • endpoint_update_properties (EndpointUpdateParameters)

    Endpoint update

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

    A hash of custom headers that

Returns:

  • (Endpoint)

    operation results.



1010
1011
1012
1013
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1010

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

#begin_update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers: nil) ⇒ Concurrent::Promise

Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation.

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

  • endpoint_update_properties (EndpointUpdateParameters)

    Endpoint update

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1059

def begin_update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, 'endpoint_update_properties is nil' if endpoint_update_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::EndpointUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  endpoint_update_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}'

  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},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::Endpoint.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::V2017_04_02::Models::Endpoint.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_update_with_http_info(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation.

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

  • endpoint_update_properties (EndpointUpdateParameters)

    Endpoint update

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1035
1036
1037
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1035

def begin_update_with_http_info(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:nil)
  begin_update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:custom_headers).value!
end

#create(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers: nil) ⇒ Endpoint

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

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

  • endpoint (Endpoint)

    Endpoint properties

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

    A hash of custom headers that

Returns:

  • (Endpoint)

    operation results.



258
259
260
261
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 258

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

#create_async(resource_group_name, profile_name, endpoint_name, endpoint, custom_headers: nil) ⇒ Concurrent::Promise

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

  • endpoint (Endpoint)

    Endpoint 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



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 277

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::Endpoint.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_headers: nil) ⇒ Object

Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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



366
367
368
369
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 366

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

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

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:

  • (Concurrent::Promise)

    promise which provides async access to http



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 384

def delete_async(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_headers: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

#get(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Endpoint

Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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:

  • (Endpoint)

    operation results.



144
145
146
147
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 144

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

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

Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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.



183
184
185
186
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
240
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 183

def get_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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'

  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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::Endpoint.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_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile.

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.



164
165
166
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 164

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

#list_by_profile(resource_group_name, profile_name, custom_headers: nil) ⇒ Array<Endpoint>

Lists existing CDN endpoints.

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:

  • (Array<Endpoint>)

    operation results.



38
39
40
41
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 38

def list_by_profile(resource_group_name, profile_name, custom_headers:nil)
  first_page = list_by_profile_as_lazy(resource_group_name, profile_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_profile_as_lazy(resource_group_name, profile_name, custom_headers: nil) ⇒ EndpointListResult

Lists existing CDN endpoints.

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:

  • (EndpointListResult)

    which provide lazy access to pages of the



1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1909

def list_by_profile_as_lazy(resource_group_name, profile_name, custom_headers:nil)
  response = list_by_profile_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_profile_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Lists existing CDN endpoints.

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.



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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 71

def list_by_profile_async(resource_group_name, profile_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::EndpointListResult.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_profile_next(next_page_link, custom_headers: nil) ⇒ EndpointListResult

Lists existing CDN endpoints.

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:

  • (EndpointListResult)

    operation results.



1723
1724
1725
1726
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1723

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

#list_by_profile_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Lists existing CDN endpoints.

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.



1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1752

def list_by_profile_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::EndpointListResult.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_profile_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists existing CDN endpoints.

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.



1738
1739
1740
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1738

def list_by_profile_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_profile_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Lists existing CDN endpoints.

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.



55
56
57
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 55

def list_by_profile_with_http_info(resource_group_name, profile_name, custom_headers:nil)
  list_by_profile_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
end

#list_resource_usage(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Array<ResourceUsage>

Checks the quota and usage of geo filters and custom domains under the given 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<ResourceUsage>)

    operation results.



748
749
750
751
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 748

def list_resource_usage(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  first_page = list_resource_usage_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_resource_usage_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ ResourceUsageListResult

Checks the quota and usage of geo filters and custom domains under the given 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:

  • (ResourceUsageListResult)

    which provide lazy access to pages of the



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1936

def list_resource_usage_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  response = list_resource_usage_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_resource_usage_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Checks the quota and usage of geo filters and custom domains under the given 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.



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
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 787

def list_resource_usage_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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage'

  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(: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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::ResourceUsageListResult.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_resource_usage_next(next_page_link, custom_headers: nil) ⇒ ResourceUsageListResult

Checks the quota and usage of geo filters and custom domains under the given 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:

  • (ResourceUsageListResult)

    operation results.



1814
1815
1816
1817
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1814

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

#list_resource_usage_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Checks the quota and usage of geo filters and custom domains under the given 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.



1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1845

def list_resource_usage_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(: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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::ResourceUsageListResult.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_resource_usage_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks the quota and usage of geo filters and custom domains under the given 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.



1830
1831
1832
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 1830

def list_resource_usage_next_with_http_info(next_page_link, custom_headers:nil)
  list_resource_usage_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Checks the quota and usage of geo filters and custom domains under the given 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.



768
769
770
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 768

def list_resource_usage_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  list_resource_usage_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
end

#load_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Object

Pre-loads a content to CDN. Available for Verizon Profiles.

Azure subscription. the resource group. unique globally. loaded. Path should be a full URL, e.g. ‘/pictures/city.png’ which loads a single file 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

  • content_file_paths (LoadParameters)

    The path to the content to be

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

    A hash of custom headers that



569
570
571
572
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 569

def load_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  response = load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:custom_headers).value!
  nil
end

#load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Concurrent::Promise

Azure subscription. the resource group. unique globally. loaded. Path should be a full URL, e.g. ‘/pictures/city.png’ which loads a single file 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

  • content_file_paths (LoadParameters)

    The path to the content to be

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 590

def load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  # Send request
  promise = begin_load_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: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

#purge_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Object

Removes a content from CDN.

Azure subscription. the resource group. unique globally. purged. Path can be a full URL, e.g. ‘/pictures/city.png’ which removes a single file, or a directory with a wildcard, e.g. ‘/pictures/*’ which removes all folders and files in the directory. 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

  • content_file_paths (PurgeParameters)

    The path to the content to be

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

    A hash of custom headers that



516
517
518
519
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 516

def purge_content(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  response = purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:custom_headers).value!
  nil
end

#purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: nil) ⇒ Concurrent::Promise

Azure subscription. the resource group. unique globally. purged. Path can be a full URL, e.g. ‘/pictures/city.png’ which removes a single file, or a directory with a wildcard, e.g. ‘/pictures/*’ which removes all folders and files in the directory. 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

  • content_file_paths (PurgeParameters)

    The path to the content to be

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 538

def purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers:nil)
  # Send request
  promise = begin_purge_content_async(resource_group_name, profile_name, endpoint_name, content_file_paths, custom_headers: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

#start(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Endpoint

Starts an existing CDN endpoint that is on a stopped state.

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:

  • (Endpoint)

    operation results.



414
415
416
417
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 414

def start(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  response = start_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

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:

  • (Concurrent::Promise)

    promise which provides async access to http



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 432

def start_async(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  # Send request
  promise = begin_start_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::Endpoint.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

#stop(resource_group_name, profile_name, endpoint_name, custom_headers: nil) ⇒ Endpoint

Stops an existing running CDN 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:

  • (Endpoint)

    operation results.



464
465
466
467
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 464

def stop(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  response = stop_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

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:

  • (Concurrent::Promise)

    promise which provides async access to http



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 482

def stop_async(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
  # Send request
  promise = begin_stop_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::Endpoint.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

#update(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers: nil) ⇒ Endpoint

Updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and profile. Only tags and Origin HostHeader can be updated after creating an endpoint. To update origins, use the Update Origin operation. To update custom domains, use the Update Custom Domain operation.

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

  • endpoint_update_properties (EndpointUpdateParameters)

    Endpoint update

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

    A hash of custom headers that

Returns:

  • (Endpoint)

    operation results.



315
316
317
318
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 315

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

#update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers: nil) ⇒ Concurrent::Promise

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

  • endpoint_update_properties (EndpointUpdateParameters)

    Endpoint update

  • 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/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 335

def update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::Endpoint.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

#validate_custom_domain(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers: nil) ⇒ ValidateCustomDomainOutput

Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.

Azure subscription. the resource group. unique globally. be validated. 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_properties (ValidateCustomDomainInput)

    Custom domain to

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

    A hash of custom headers that

Returns:

  • (ValidateCustomDomainOutput)

    operation results.



623
624
625
626
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 623

def validate_custom_domain(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers:nil)
  response = validate_custom_domain_async(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_custom_domain_async(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers: nil) ⇒ Concurrent::Promise

Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.

Azure subscription. the resource group. unique globally. be validated. 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_properties (ValidateCustomDomainInput)

    Custom domain to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
721
722
723
724
725
726
727
728
729
730
731
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 666

def validate_custom_domain_async(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2017_04_02::Models::ValidateCustomDomainInput.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}/validateCustomDomain'

  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},
      body: request_content,
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::V2017_04_02::Models::ValidateCustomDomainOutput.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

#validate_custom_domain_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.

Azure subscription. the resource group. unique globally. be validated. 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_properties (ValidateCustomDomainInput)

    Custom domain to

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



645
646
647
# File 'lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb', line 645

def validate_custom_domain_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers:nil)
  validate_custom_domain_async(resource_group_name, profile_name, endpoint_name, custom_domain_properties, custom_headers:custom_headers).value!
end