class Azure::Network::Mgmt::V2018_10_01::ExpressRouteCrossConnections

ExpressRouteCrossConnections

Attributes

client[R]

@return [NetworkManagementClient] reference to the NetworkManagementClient

Public Class Methods

new(client) click to toggle source

Creates and initializes a new instance of the ExpressRouteCrossConnections class. @param client service class for accessing basic functionality.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 16
def initialize(client)
  @client = client
end

Public Instance Methods

begin_create_or_update(resource_group_name, cross_connection_name, parameters, custom_headers:nil) click to toggle source

Update the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param parameters [ExpressRouteCrossConnection] Parameters supplied to the update express route crossConnection operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnection] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 554
def begin_create_or_update(resource_group_name, cross_connection_name, parameters, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:nil) click to toggle source

Update the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param parameters [ExpressRouteCrossConnection] Parameters supplied to the update express route crossConnection operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 589
def begin_create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cross_connection_name is nil' if cross_connection_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnection.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'crossConnectionName' => cross_connection_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
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnection.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_or_update_with_http_info(resource_group_name, cross_connection_name, parameters, custom_headers:nil) click to toggle source

Update the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param parameters [ExpressRouteCrossConnection] Parameters supplied to the update express route crossConnection operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 572
def begin_create_or_update_with_http_info(resource_group_name, cross_connection_name, parameters, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:custom_headers).value!
end
begin_list_arp_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised ARP table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCircuitsArpTableListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 774
def begin_list_arp_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  response = begin_list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised ARP table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 811
def begin_list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cross_connection_name is nil' if cross_connection_name.nil?
  fail ArgumentError, 'peering_name is nil' if peering_name.nil?
  fail ArgumentError, 'device_path is nil' if device_path.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'crossConnectionName' => cross_connection_name,'peeringName' => peering_name,'devicePath' => device_path,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCircuitsArpTableListResult.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_list_arp_table_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised ARP table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 793
def begin_list_arp_table_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  begin_list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
end
begin_list_routes_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised routes table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCircuitsRoutesTableListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 991
def begin_list_routes_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  response = begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised routes table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1028
def begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cross_connection_name is nil' if cross_connection_name.nil?
  fail ArgumentError, 'peering_name is nil' if peering_name.nil?
  fail ArgumentError, 'device_path is nil' if device_path.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'crossConnectionName' => cross_connection_name,'peeringName' => peering_name,'devicePath' => device_path,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCircuitsRoutesTableListResult.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_list_routes_table_summary(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the route table summary associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnectionsRoutesTableSummaryListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 883
def begin_list_routes_table_summary(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  response = begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the route table summary associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 920
def begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cross_connection_name is nil' if cross_connection_name.nil?
  fail ArgumentError, 'peering_name is nil' if peering_name.nil?
  fail ArgumentError, 'device_path is nil' if device_path.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'crossConnectionName' => cross_connection_name,'peeringName' => peering_name,'devicePath' => device_path,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult.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_list_routes_table_summary_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the route table summary associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 902
def begin_list_routes_table_summary_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
end
begin_list_routes_table_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised routes table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1010
def begin_list_routes_table_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
end
begin_update_tags(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) click to toggle source

Updates an express route cross connection tags.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the cross connection. @param cross_connection_parameters [TagsObject] Parameters supplied to update express route cross connection tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnection] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 664
def begin_update_tags(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil)
  response = begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) click to toggle source

Updates an express route cross connection tags.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the cross connection. @param cross_connection_parameters [TagsObject] Parameters supplied to update express route cross connection tags. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 697
def begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cross_connection_name is nil' if cross_connection_name.nil?
  fail ArgumentError, 'cross_connection_parameters is nil' if cross_connection_parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2018_10_01::Models::TagsObject.mapper()
  request_content = @client.serialize(request_mapper,  cross_connection_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'crossConnectionName' => cross_connection_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
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnection.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_tags_with_http_info(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) click to toggle source

Updates an express route cross connection tags.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the cross connection. @param cross_connection_parameters [TagsObject] Parameters supplied to update express route cross connection tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 681
def begin_update_tags_with_http_info(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil)
  begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:custom_headers).value!
end
create_or_update(resource_group_name, cross_connection_name, parameters, custom_headers:nil) click to toggle source

Update the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param parameters [ExpressRouteCrossConnection] Parameters supplied to the update express route crossConnection operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnection] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 312
def create_or_update(resource_group_name, cross_connection_name, parameters, custom_headers:nil)
  response = create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param parameters [ExpressRouteCrossConnection] Parameters supplied to the update express route crossConnection operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 329
def create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, cross_connection_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnection.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
get(resource_group_name, cross_connection_name, custom_headers:nil) click to toggle source

Gets details about the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group (peering location of the circuit). @param cross_connection_name [String] The name of the ExpressRouteCrossConnection (service key of the circuit). @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnection] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 211
def get(resource_group_name, cross_connection_name, custom_headers:nil)
  response = get_async(resource_group_name, cross_connection_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_async(resource_group_name, cross_connection_name, custom_headers:nil) click to toggle source

Gets details about the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group (peering location of the circuit). @param cross_connection_name [String] The name of the ExpressRouteCrossConnection (service key of the circuit). @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 244
def get_async(resource_group_name, cross_connection_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'cross_connection_name is nil' if cross_connection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'crossConnectionName' => cross_connection_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 MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnection.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, cross_connection_name, custom_headers:nil) click to toggle source

Gets details about the specified ExpressRouteCrossConnection.

@param resource_group_name [String] The name of the resource group (peering location of the circuit). @param cross_connection_name [String] The name of the ExpressRouteCrossConnection (service key of the circuit). @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 228
def get_with_http_info(resource_group_name, cross_connection_name, custom_headers:nil)
  get_async(resource_group_name, cross_connection_name, custom_headers:custom_headers).value!
end
list(custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ExpressRouteCrossConnection>] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 31
def list(custom_headers:nil)
  first_page = list_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end
list_arp_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised ARP table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCircuitsArpTableListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 407
def list_arp_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  response = list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 424
def list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  # Send request
  promise = begin_list_arp_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCircuitsArpTableListResult.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
list_as_lazy(custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnectionListResult] which provide lazy access to pages of the response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1274
def list_as_lazy(custom_headers:nil)
  response = list_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_async(custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 56
def list_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnectionListResult.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_resource_group(resource_group_name, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param resource_group_name [String] The name of the resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ExpressRouteCrossConnection>] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 118
def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param resource_group_name [String] The name of the resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnectionListResult] which provide lazy access to pages of the response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1295
def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_by_resource_group_async(resource_group_name, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param resource_group_name [String] The name of the resource group. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 145
def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnectionListResult.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_resource_group_next(next_page_link, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnectionListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1185
def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_by_resource_group_next_async(next_page_link, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1214
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnectionListResult.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_resource_group_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1200
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a resource group.

@param resource_group_name [String] The name of the resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 132
def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end
list_next(next_page_link, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnectionListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1095
def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_next_async(next_page_link, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1124
def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnectionListResult.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_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 1110
def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_routes_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the currently advertised routes table associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCircuitsRoutesTableListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 506
def list_routes_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  response = list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 523
def list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  # Send request
  promise = begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCircuitsRoutesTableListResult.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
list_routes_table_summary(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

Gets the route table summary associated with the express route cross connection in a resource group.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnectionsRoutesTableSummaryListResult] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 457
def list_routes_table_summary(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  response = list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 474
def list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
  # Send request
  promise = begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2018_10_01::Models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult.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
list_with_http_info(custom_headers:nil) click to toggle source

Retrieves all the ExpressRouteCrossConnections in a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 44
def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end
update_tags(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) click to toggle source

Updates an express route cross connection tags.

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the cross connection. @param cross_connection_parameters [TagsObject] Parameters supplied to update express route cross connection tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExpressRouteCrossConnection] operation results.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 359
def update_tags(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil)
  response = update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the cross connection. @param cross_connection_parameters [TagsObject] Parameters supplied to update express route cross connection tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2018-10-01/generated/azure_mgmt_network/express_route_cross_connections.rb, line 375
def update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:custom_headers)

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