Class: Azure::Network::Mgmt::V2017_09_01::VirtualNetworkGateways

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb

Overview

The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ VirtualNetworkGateways

Creates and initializes a new instance of the VirtualNetworkGateways class.

Parameters:

  • client

    service class for accessing basic functionality.



20
21
22
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 20

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientNetworkManagementClient (readonly)

Returns reference to the NetworkManagementClient.

Returns:



25
26
27
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 25

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ VirtualNetworkGateway

Creates or updates a virtual network gateway in the specified resource group.

gateway. update virtual network gateway operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



971
972
973
974
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 971

def begin_create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  response = begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates a virtual network gateway in the specified resource group.

gateway. update virtual network gateway operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1006

def begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGateway.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/virtualNetworkGateways/{virtualNetworkGatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_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
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGateway.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::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGateway.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, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a virtual network gateway in the specified resource group.

gateway. update virtual network gateway operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



989
990
991
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 989

def begin_create_or_update_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
end

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

Deletes the specified virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that



1088
1089
1090
1091
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1088

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

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

Deletes the specified virtual network gateway.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1119

def begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_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 == 204 || status_code == 202 || 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
  end

  promise.execute
end

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

Deletes the specified virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1104
1105
1106
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1104

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

#begin_generate_vpn_profile(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ String

Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



1397
1398
1399
1400
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1397

def begin_generate_vpn_profile(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  response = begin_generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#begin_generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.

gateway. virtual network gateway VPN client package operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1434

def begin_generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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::Network::Mgmt::V2017_09_01::Models::VpnClientParameters.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/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        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_generate_vpn_profile_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1416
1417
1418
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1416

def begin_generate_vpn_profile_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  begin_generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
end

#begin_generatevpnclientpackage(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ String

Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



1278
1279
1280
1281
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1278

def begin_generatevpnclientpackage(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  response = begin_generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#begin_generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.

gateway. virtual network gateway VPN client package operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
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
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1315

def begin_generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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::Network::Mgmt::V2017_09_01::Models::VpnClientParameters.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/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        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_generatevpnclientpackage_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1297
1298
1299
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1297

def begin_generatevpnclientpackage_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  begin_generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
end

#begin_get_advertised_routes(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil) ⇒ GatewayRouteListResult

This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



1815
1816
1817
1818
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1815

def begin_get_advertised_routes(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil)
  response = begin_get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers).value!
  response.body unless response.nil?
end

#begin_get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil) ⇒ Concurrent::Promise

This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1850

def begin_get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
  fail ArgumentError, 'peer is nil' if peer.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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
      query_params: {'peer' => peer,'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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::GatewayRouteListResult.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_get_advertised_routes_with_http_info(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1833
1834
1835
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1833

def begin_get_advertised_routes_with_http_info(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil)
  begin_get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers).value!
end

#begin_get_bgp_peer_status(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil) ⇒ BgpPeerStatusListResult

The GetBgpPeerStatus operation retrieves the status of all BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

    The IP address of the peer to retrieve the status of.

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

    A hash of custom headers that

Returns:

  • (BgpPeerStatusListResult)

    operation results.



1620
1621
1622
1623
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1620

def begin_get_bgp_peer_status(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil)
  response = begin_get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers).value!
  response.body unless response.nil?
end

#begin_get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil) ⇒ Concurrent::Promise

The GetBgpPeerStatus operation retrieves the status of all BGP peers.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

    The IP address of the peer to retrieve the status of.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1653

def begin_get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
      query_params: {'peer' => peer,'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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::BgpPeerStatusListResult.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_get_bgp_peer_status_with_http_info(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

The GetBgpPeerStatus operation retrieves the status of all BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

    The IP address of the peer to retrieve the status of.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1637
1638
1639
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1637

def begin_get_bgp_peer_status_with_http_info(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil)
  begin_get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers).value!
end

#begin_get_learned_routes(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ GatewayRouteListResult

This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



1717
1718
1719
1720
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1717

def begin_get_learned_routes(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  response = begin_get_learned_routes_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
  response.body unless response.nil?
end

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

This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

def begin_get_learned_routes_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::GatewayRouteListResult.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_get_learned_routes_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1734
1735
1736
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1734

def begin_get_learned_routes_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  begin_get_learned_routes_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
end

#begin_get_vpn_profile_package_url(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ String

Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



1515
1516
1517
1518
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1515

def begin_get_vpn_profile_package_url(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  response = begin_get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
  response.body unless response.nil?
end

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

Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1550

def begin_get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        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_get_vpn_profile_package_url_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1533
1534
1535
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1533

def begin_get_vpn_profile_package_url_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  begin_get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
end

#begin_reset(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil) ⇒ VirtualNetworkGateway

Resets the primary of the virtual network gateway in the specified resource group.

gateway. the begin reset of the active-active feature enabled gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



1175
1176
1177
1178
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1175

def begin_reset(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
  response = begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers).value!
  response.body unless response.nil?
end

#begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil) ⇒ Concurrent::Promise

Resets the primary of the virtual network gateway in the specified resource group.

gateway. the begin reset of the active-active feature enabled gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1212

def begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGateway.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_reset_with_http_info(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Resets the primary of the virtual network gateway in the specified resource group.

gateway. the begin reset of the active-active feature enabled gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1194
1195
1196
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1194

def begin_reset_with_http_info(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
  begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers).value!
end

#create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ VirtualNetworkGateway

Creates or updates a virtual network gateway in the specified resource group.

gateway. update virtual network gateway operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



40
41
42
43
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 40

def create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  response = create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

gateway. update virtual network gateway operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 57

def create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGateway.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, virtual_network_gateway_name, custom_headers = nil) ⇒ Object

Deletes the specified virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that



178
179
180
181
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 178

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

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 193

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

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

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

  promise
end

#generate_vpn_profile(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ String

Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



508
509
510
511
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 508

def generate_vpn_profile(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  response = generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 525

def generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  # Send request
  promise = begin_generate_vpn_profile_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        required: false,
        serialized_name: 'parsed_response',
        type: {
          name: 'String'
        }
      }
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#generatevpnclientpackage(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ String

Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



453
454
455
456
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 453

def generatevpnclientpackage(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  response = generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

gateway. virtual network gateway VPN client package operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

  • 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
487
488
489
490
491
492
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 470

def generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
  # Send request
  promise = begin_generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        required: false,
        serialized_name: 'parsed_response',
        type: {
          name: 'String'
        }
      }
      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, virtual_network_gateway_name, custom_headers = nil) ⇒ VirtualNetworkGateway

Gets the specified virtual network gateway by resource group.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



86
87
88
89
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 86

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

#get_advertised_routes(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil) ⇒ GatewayRouteListResult

This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



805
806
807
808
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 805

def get_advertised_routes(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil)
  response = get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers).value!
  response.body unless response.nil?
end

#get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil) ⇒ Concurrent::Promise

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 821

def get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers = nil)
  # Send request
  promise = begin_get_advertised_routes_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::GatewayRouteListResult.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_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets the specified virtual network gateway by resource group.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 117

def get_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGateway.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_bgp_peer_status(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil) ⇒ BgpPeerStatusListResult

The GetBgpPeerStatus operation retrieves the status of all BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

    The IP address of the peer to retrieve the status of.

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

    A hash of custom headers that

Returns:

  • (BgpPeerStatusListResult)

    operation results.



613
614
615
616
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 613

def get_bgp_peer_status(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil)
  response = get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers).value!
  response.body unless response.nil?
end

#get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil) ⇒ Concurrent::Promise

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

    The IP address of the peer to retrieve the status of.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 629

def get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer = nil, custom_headers = nil)
  # Send request
  promise = begin_get_bgp_peer_status_async(resource_group_name, virtual_network_gateway_name, peer, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::BgpPeerStatusListResult.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_learned_routes(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ GatewayRouteListResult

This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



759
760
761
762
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 759

def get_learned_routes(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  response = get_learned_routes_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
  response.body unless response.nil?
end

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 774

def get_learned_routes_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  # Send request
  promise = begin_get_learned_routes_async(resource_group_name, virtual_network_gateway_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::GatewayRouteListResult.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_vpn_profile_package_url(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ String

Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



562
563
564
565
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 562

def get_vpn_profile_package_url(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  response = get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
  response.body unless response.nil?
end

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 577

def get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  # Send request
  promise = begin_get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        required: false,
        serialized_name: 'parsed_response',
        type: {
          name: 'String'
        }
      }
      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_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the specified virtual network gateway by resource group.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



102
103
104
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 102

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

#list(resource_group_name, custom_headers = nil) ⇒ Array<VirtualNetworkGateway>

Gets all virtual network gateways by resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (Array<VirtualNetworkGateway>)

    operation results.



218
219
220
221
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 218

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

#list_as_lazy(resource_group_name, custom_headers = nil) ⇒ VirtualNetworkGatewayListResult

Gets all virtual network gateways by resource group.

will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGatewayListResult)

    which provide lazy access to pages



2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2087

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

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

Gets all virtual network gateways by resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 245

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

  # 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/virtualNetworkGateways'

  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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGatewayListResult.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_connections(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ Array<VirtualNetworkGatewayConnectionListEntity>

Gets all the connections in a virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Array<VirtualNetworkGatewayConnectionListEntity>)

    operation results.



307
308
309
310
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 307

def list_connections(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  first_page = list_connections_as_lazy(resource_group_name, virtual_network_gateway_name, custom_headers)
  first_page.get_all_items
end

#list_connections_as_lazy(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ VirtualNetworkGatewayListConnectionsResult

Gets all the connections in a virtual network gateway.

gateway. will be added to the HTTP request.

access to pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGatewayListConnectionsResult)

    which provide lazy



2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2110

def list_connections_as_lazy(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  response = list_connections_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_connections_next_async(next_page_link, custom_headers)
    end
    page
  end
end

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

Gets all the connections in a virtual network gateway.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 338

def list_connections_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGatewayListConnectionsResult.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_connections_next(next_page_link, custom_headers = nil) ⇒ VirtualNetworkGatewayListConnectionsResult

Gets all the connections in a virtual network gateway.

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:

  • (VirtualNetworkGatewayListConnectionsResult)

    operation results.



2000
2001
2002
2003
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2000

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

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

Gets all the connections in a virtual network gateway.

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.



2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2029

def list_connections_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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGatewayListConnectionsResult.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_connections_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all the connections in a virtual network gateway.

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.



2015
2016
2017
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2015

def list_connections_next_with_http_info(next_page_link, custom_headers = nil)
  list_connections_next_async(next_page_link, custom_headers).value!
end

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

Gets all the connections in a virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



323
324
325
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 323

def list_connections_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  list_connections_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
end

#list_next(next_page_link, custom_headers = nil) ⇒ VirtualNetworkGatewayListResult

Gets all virtual network gateways by resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGatewayListResult)

    operation results.



1913
1914
1915
1916
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1913

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

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

Gets all virtual network gateways by resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1942

def list_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2017_09_01::Models::VirtualNetworkGatewayListResult.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) ⇒ MsRestAzure::AzureOperationResponse

Gets all virtual network gateways by resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1928
1929
1930
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1928

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

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

Gets all virtual network gateways by resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



232
233
234
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 232

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

#reset(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil) ⇒ VirtualNetworkGateway

Resets the primary of the virtual network gateway in the specified resource group.

gateway. the begin reset of the active-active feature enabled gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



404
405
406
407
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 404

def reset(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
  response = reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers).value!
  response.body unless response.nil?
end

#reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil) ⇒ Concurrent::Promise

gateway. the begin reset of the active-active feature enabled gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 421

def reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
  # Send request
  promise = begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers)

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

#supported_vpn_devices(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ String

Gets a xml format representation for supported vpn devices.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



658
659
660
661
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 658

def supported_vpn_devices(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  response = supported_vpn_devices_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
  response.body unless response.nil?
end

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

Gets a xml format representation for supported vpn devices.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 689

def supported_vpn_devices_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_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 = {}

  # 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/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        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

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

Gets a xml format representation for supported vpn devices.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



674
675
676
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 674

def supported_vpn_devices_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
  supported_vpn_devices_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
end

#vpn_device_configuration_script(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ String

Gets a xml format representation for vpn device configuration script.

virtual network gateway connection for which the configuration script is generated. generate vpn device script operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_connection_name (String)

    The name of the

  • parameters (VpnDeviceScriptParameters)

    Parameters supplied to the

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



853
854
855
856
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 853

def vpn_device_configuration_script(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil)
  response = vpn_device_configuration_script_async(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#vpn_device_configuration_script_async(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Gets a xml format representation for vpn device configuration script.

virtual network gateway connection for which the configuration script is generated. generate vpn device script operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_connection_name (String)

    The name of the

  • parameters (VpnDeviceScriptParameters)

    Parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 890

def vpn_device_configuration_script_async(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_network_gateway_connection_name is nil' if virtual_network_gateway_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 = {}

  # 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::Network::Mgmt::V2017_09_01::Models::VpnDeviceScriptParameters.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/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayConnectionName' => virtual_network_gateway_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(: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 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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        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

#vpn_device_configuration_script_with_http_info(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a xml format representation for vpn device configuration script.

virtual network gateway connection for which the configuration script is generated. generate vpn device script operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_connection_name (String)

    The name of the

  • parameters (VpnDeviceScriptParameters)

    Parameters supplied to the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



872
873
874
# File 'lib/2017-09-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 872

def vpn_device_configuration_script_with_http_info(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers = nil)
  vpn_device_configuration_script_async(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers).value!
end