Class: Azure::CDN::Mgmt::V2016_10_02::Endpoints

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



840
841
842
843
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 840

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



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
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
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 881

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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::V2016_10_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::V2016_10_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.



861
862
863
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 861

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



1120
1121
1122
1123
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1120

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



1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1159

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, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

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

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



1140
1141
1142
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1140

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).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. ‘/pictires/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



1541
1542
1543
1544
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1541

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).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. ‘/pictires/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.



1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1584

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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 == 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
  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. ‘/pictires/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.



1563
1564
1565
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1563

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



1427
1428
1429
1430
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1427

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



1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1472

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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 == 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
  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.



1450
1451
1452
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1450

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



1216
1217
1218
1219
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1216

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



1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1253

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, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_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.



1235
1236
1237
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1235

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



1320
1321
1322
1323
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1320

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



1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1357

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, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_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.



1339
1340
1341
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1339

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



984
985
986
987
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 984

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



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
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
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1033

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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::V2016_10_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.



1009
1010
1011
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1009

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



246
247
248
249
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 246

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



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 265

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)

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



354
355
356
357
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 354

def delete(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  response = delete_async(resource_group_name, profile_name, endpoint_name, 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



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 372

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)

  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.



138
139
140
141
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 138

def get(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  response = get_async(resource_group_name, profile_name, endpoint_name, 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.



177
178
179
180
181
182
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
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 177

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, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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.



158
159
160
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 158

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).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/2016-10-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)
  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



1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1827

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).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)
    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
# File 'lib/2016-10-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, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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.



1647
1648
1649
1650
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1647

def list_by_profile_next(next_page_link, custom_headers = nil)
  response = list_by_profile_next_async(next_page_link, 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.



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
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1676

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 = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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.



1662
1663
1664
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1662

def list_by_profile_next_with_http_info(next_page_link, custom_headers = nil)
  list_by_profile_next_async(next_page_link, 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/2016-10-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).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.



732
733
734
735
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 732

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)
  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



1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1854

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



771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 771

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, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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.



1735
1736
1737
1738
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1735

def list_resource_usage_next(next_page_link, custom_headers = nil)
  response = list_resource_usage_next_async(next_page_link, 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.



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
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1766

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 = {}

  # 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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.



1751
1752
1753
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 1751

def list_resource_usage_next_with_http_info(next_page_link, custom_headers = nil)
  list_resource_usage_next_async(next_page_link, 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.



752
753
754
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 752

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).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. ‘/pictires/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



557
558
559
560
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 557

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).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. ‘/pictires/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



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 578

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)

  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



504
505
506
507
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 504

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



526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 526

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)

  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.



402
403
404
405
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 402

def start(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  response = start_async(resource_group_name, profile_name, endpoint_name, 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



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 420

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)

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



452
453
454
455
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 452

def stop(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
  response = stop_async(resource_group_name, profile_name, endpoint_name, 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



470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 470

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)

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



303
304
305
306
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 303

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



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 323

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)

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



611
612
613
614
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 611

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



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 654

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::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.



633
634
635
# File 'lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb', line 633

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