Class: Azure::Network::Mgmt::V2019_11_01::VirtualNetworkGateways

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

Overview

VirtualNetworkGateways

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.


17
18
19
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientNetworkManagementClient (readonly)

Returns reference to the NetworkManagementClient.

Returns:


22
23
24
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 22

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.


1375
1376
1377
1378
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1375

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


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

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2019_11_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::V2019_11_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.


1393
1394
1395
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1393

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


1493
1494
1495
1496
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1493

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


1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1524

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, 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.


1509
1510
1511
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1509

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

#begin_disconnect_virtual_network_gateway_vpn_connections(resource_group_name, virtual_network_gateway_name, request, custom_headers: nil) ⇒ Object

Disconnect vpn connections of virtual network gateway in the specified resource group.

gateway. disconnect vpn connections. 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

  • request (P2SVpnConnectionRequest)

    The parameters are supplied to

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

    A hash of custom headers that


3108
3109
3110
3111
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3108

def begin_disconnect_virtual_network_gateway_vpn_connections(resource_group_name, virtual_network_gateway_name, request, custom_headers:nil)
  response = begin_disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers:custom_headers).value!
  nil
end

#begin_disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers: nil) ⇒ Concurrent::Promise

Disconnect vpn connections of virtual network gateway in the specified resource group.

gateway. disconnect vpn connections. 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

  • request (P2SVpnConnectionRequest)

    The parameters are supplied to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.


3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3145

def begin_disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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, 'request is nil' if request.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

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

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_disconnect_virtual_network_gateway_vpn_connections_with_http_info(resource_group_name, virtual_network_gateway_name, request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Disconnect vpn connections of virtual network gateway in the specified resource group.

gateway. disconnect vpn connections. 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

  • request (P2SVpnConnectionRequest)

    The parameters are supplied to

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.


3127
3128
3129
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3127

def begin_disconnect_virtual_network_gateway_vpn_connections_with_http_info(resource_group_name, virtual_network_gateway_name, request, custom_headers:nil)
  begin_disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers: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.


2010
2011
2012
2013
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2010

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


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
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2047

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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.


2029
2030
2031
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2029

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


1889
1890
1891
1892
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1889

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


1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
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
1989
1990
1991
1992
1993
1994
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1926

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_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 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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.


1908
1909
1910
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1908

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


2440
2441
2442
2443
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2440

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


2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2475

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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


2458
2459
2460
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2458

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


2239
2240
2241
2242
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2239

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:peer, custom_headers: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.


2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2272

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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


2256
2257
2258
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2256

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:peer, custom_headers: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.


2339
2340
2341
2342
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2339

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


2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2372

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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


2356
2357
2358
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2356

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


2130
2131
2132
2133
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2130

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


2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2165

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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.


2148
2149
2150
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2148

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

#begin_get_vpnclient_connection_health(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ VpnClientConnectionHealthDetailListResult

Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified 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:

  • (VpnClientConnectionHealthDetailListResult)

    operation results.


3007
3008
3009
3010
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3007

def begin_get_vpnclient_connection_health(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  response = begin_get_vpnclient_connection_health_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified 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.


3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3040

def begin_get_vpnclient_connection_health_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnClientConnectionHealthDetailListResult.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_vpnclient_connection_health_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified 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.


3024
3025
3026
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3024

def begin_get_vpnclient_connection_health_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  begin_get_vpnclient_connection_health_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
end

#begin_get_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ VpnClientIPsecParameters

The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The virtual network gateway

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

    A hash of custom headers that

Returns:

  • (VpnClientIPsecParameters)

    operation results.


2664
2665
2666
2667
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2664

def begin_get_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  response = begin_get_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

name. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The virtual network gateway

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.


2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2699

def begin_get_vpnclient_ipsec_parameters_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnClientIPsecParameters.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_vpnclient_ipsec_parameters_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The virtual network gateway

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.


2682
2683
2684
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2682

def begin_get_vpnclient_ipsec_parameters_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  begin_get_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, custom_headers: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.


1694
1695
1696
1697
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1694

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:gateway_vip, custom_headers: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.


1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
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
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1731

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2019_11_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_vpn_client_shared_key(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ Object

Resets the VPN client shared key of the virtual network gateway in the specified 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


1797
1798
1799
1800
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1797

def begin_reset_vpn_client_shared_key(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  response = begin_reset_vpn_client_shared_key_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
  nil
end

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

Resets the VPN client shared key of the virtual network gateway in the specified 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.


1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1830

def begin_reset_vpn_client_shared_key_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

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

    result
  end

  promise.execute
end

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

Resets the VPN client shared key of the virtual network gateway in the specified 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.


1814
1815
1816
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1814

def begin_reset_vpn_client_shared_key_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  begin_reset_vpn_client_shared_key_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
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.


1713
1714
1715
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1713

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:gateway_vip, custom_headers:custom_headers).value!
end

#begin_set_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers: nil) ⇒ VpnClientIPsecParameters

The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

gateway. to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. 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

  • vpnclient_ipsec_params (VpnClientIPsecParameters)

    Parameters supplied

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

    A hash of custom headers that

Returns:

  • (VpnClientIPsecParameters)

    operation results.


2547
2548
2549
2550
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2547

def begin_set_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:nil)
  response = begin_set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers: nil) ⇒ Concurrent::Promise

The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

gateway. to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. 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

  • vpnclient_ipsec_params (VpnClientIPsecParameters)

    Parameters supplied

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.


2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2588

def begin_set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, 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, 'vpnclient_ipsec_params is nil' if vpnclient_ipsec_params.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


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

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

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

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'

  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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnClientIPsecParameters.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_set_vpnclient_ipsec_parameters_with_http_info(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

gateway. to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. 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

  • vpnclient_ipsec_params (VpnClientIPsecParameters)

    Parameters supplied

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.


2568
2569
2570
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2568

def begin_set_vpnclient_ipsec_parameters_with_http_info(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:nil)
  begin_set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:custom_headers).value!
end

#begin_start_packet_capture(resource_group_name, virtual_network_gateway_name, parameters: nil, custom_headers: nil) ⇒ String

Starts packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to start packet capture on 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

  • parameters (VpnPacketCaptureStartParameters) (defaults to: nil)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.


2768
2769
2770
2771
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2768

def begin_start_packet_capture(resource_group_name, virtual_network_gateway_name, parameters:nil, custom_headers:nil)
  response = begin_start_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters:parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Starts packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to start packet capture on 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

  • parameters (VpnPacketCaptureStartParameters) (defaults to: nil)

    Virtual network gateway

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.


2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2805

def begin_start_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters: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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnPacketCaptureStartParameters.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}/startPacketCapture'

  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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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_start_packet_capture_with_http_info(resource_group_name, virtual_network_gateway_name, parameters: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Starts packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to start packet capture on 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

  • parameters (VpnPacketCaptureStartParameters) (defaults to: nil)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.


2787
2788
2789
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2787

def begin_start_packet_capture_with_http_info(resource_group_name, virtual_network_gateway_name, parameters:nil, custom_headers:nil)
  begin_start_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters:parameters, custom_headers:custom_headers).value!
end

#begin_stop_packet_capture(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: nil) ⇒ String

Stops packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to stop packet capture on 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

  • parameters (VpnPacketCaptureStopParameters)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.


2888
2889
2890
2891
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2888

def begin_stop_packet_capture(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  response = begin_stop_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Stops packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to stop packet capture on 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

  • parameters (VpnPacketCaptureStopParameters)

    Virtual network gateway

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.


2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2925

def begin_stop_packet_capture_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnPacketCaptureStopParameters.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}/stopPacketCapture'

  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 == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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_stop_packet_capture_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Stops packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to stop packet capture on 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

  • parameters (VpnPacketCaptureStopParameters)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.


2907
2908
2909
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2907

def begin_stop_packet_capture_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  begin_stop_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value!
end

#begin_update_tags(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: nil) ⇒ VirtualNetworkGateway

Updates a virtual network gateway tags.

gateway. gateway tags. 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 (TagsObject)

    Parameters supplied to update virtual network

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.


1582
1583
1584
1585
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1582

def begin_update_tags(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  response = begin_update_tags_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Updates a virtual network gateway tags.

gateway. gateway tags. 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 (TagsObject)

    Parameters supplied to update virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.


1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
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
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1617

def begin_update_tags_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_01::Models::TagsObject.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(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Network::Mgmt::V2019_11_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_update_tags_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a virtual network gateway tags.

gateway. gateway tags. 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 (TagsObject)

    Parameters supplied to update virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.


1600
1601
1602
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1600

def begin_update_tags_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  begin_update_tags_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: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.


37
38
39
40
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 37

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


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 54

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_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/2019-11-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: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/2019-11-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: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

#disconnect_virtual_network_gateway_vpn_connections(resource_group_name, virtual_network_gateway_name, request, custom_headers: nil) ⇒ Object

Disconnect vpn connections of virtual network gateway in the specified resource group.

gateway. disconnect vpn connections. 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

  • request (P2SVpnConnectionRequest)

    The parameters are supplied to

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

    A hash of custom headers that


1329
1330
1331
1332
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1329

def disconnect_virtual_network_gateway_vpn_connections(resource_group_name, virtual_network_gateway_name, request, custom_headers:nil)
  response = disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers:custom_headers).value!
  nil
end

#disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers: nil) ⇒ Concurrent::Promise

gateway. disconnect vpn connections. 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

  • request (P2SVpnConnectionRequest)

    The parameters are 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


1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1346

def disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers:nil)
  # Send request
  promise = begin_disconnect_virtual_network_gateway_vpn_connections_async(resource_group_name, virtual_network_gateway_name, request, custom_headers:custom_headers)

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

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
  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.


604
605
606
607
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 604

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


621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 621

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        client_side_validation: true,
        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, FinalStateVia::LOCATION)
  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.


548
549
550
551
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 548

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


565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 565

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        client_side_validation: true,
        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, FinalStateVia::LOCATION)
  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.


83
84
85
86
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 83

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


907
908
909
910
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 907

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


923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 923

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_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, FinalStateVia::LOCATION)
  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.


114
115
116
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/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 114

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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


711
712
713
714
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 711

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:peer, custom_headers: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


727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 727

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:peer, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_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, FinalStateVia::LOCATION)
  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.


861
862
863
864
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 861

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


876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 876

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_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, FinalStateVia::LOCATION)
  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.


659
660
661
662
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 659

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


674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 674

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        client_side_validation: true,
        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, FinalStateVia::LOCATION)
  end

  promise
end

#get_vpnclient_connection_health(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ VpnClientConnectionHealthDetailListResult

Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified 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:

  • (VpnClientConnectionHealthDetailListResult)

    operation results.


1284
1285
1286
1287
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1284

def get_vpnclient_connection_health(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  response = get_vpnclient_connection_health_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_vpnclient_connection_health_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


1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1299

def get_vpnclient_connection_health_async(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  # Send request
  promise = begin_get_vpnclient_connection_health_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnClientConnectionHealthDetailListResult.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#get_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ VpnClientIPsecParameters

The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

name. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The virtual network gateway

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

    A hash of custom headers that

Returns:

  • (VpnClientIPsecParameters)

    operation results.


1006
1007
1008
1009
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1006

def get_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  response = get_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

name. 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 virtual network gateway

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http


1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1021

def get_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  # Send request
  promise = begin_get_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnClientIPsecParameters.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::LOCATION)
  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.


99
100
101
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 99

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


266
267
268
269
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 266

def list(resource_group_name, custom_headers:nil)
  first_page = list_as_lazy(resource_group_name, custom_headers: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


3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3388

def list_as_lazy(resource_group_name, custom_headers:nil)
  response = list_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers: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.


293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 293

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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


358
359
360
361
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 358

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


3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3411

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


389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 389

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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


3298
3299
3300
3301
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3298

def list_connections_next(next_page_link, custom_headers:nil)
  response = list_connections_next_async(next_page_link, custom_headers: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.


3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3327

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  request_url = @base_url || @client.base_url

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

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

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


3313
3314
3315
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3313

def list_connections_next_with_http_info(next_page_link, custom_headers:nil)
  list_connections_next_async(next_page_link, custom_headers: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.


374
375
376
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 374

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


3208
3209
3210
3211
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3208

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

#list_next_async(next_page_link, custom_headers: nil) ⇒ 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.


3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3237

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


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

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

  request_url = @base_url || @client.base_url

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

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

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


3223
3224
3225
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 3223

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

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


280
281
282
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 280

def list_with_http_info(resource_group_name, custom_headers:nil)
  list_async(resource_group_name, custom_headers: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.


458
459
460
461
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 458

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:gateway_vip, custom_headers: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


475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 475

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:gateway_vip, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_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, FinalStateVia::LOCATION)
  end

  promise
end

#reset_vpn_client_shared_key(resource_group_name, virtual_network_gateway_name, custom_headers: nil) ⇒ Object

Resets the VPN client shared key of the virtual network gateway in the specified 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


503
504
505
506
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 503

def reset_vpn_client_shared_key(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  response = reset_vpn_client_shared_key_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
  nil
end

#reset_vpn_client_shared_key_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


518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 518

def reset_vpn_client_shared_key_async(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
  # Send request
  promise = begin_reset_vpn_client_shared_key_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers)

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

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

  promise
end

#set_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers: nil) ⇒ VpnClientIPsecParameters

The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.

gateway. to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. 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

  • vpnclient_ipsec_params (VpnClientIPsecParameters)

    Parameters supplied

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

    A hash of custom headers that

Returns:

  • (VpnClientIPsecParameters)

    operation results.


957
958
959
960
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 957

def set_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:nil)
  response = set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers: nil) ⇒ Concurrent::Promise

gateway. to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client operation through Network resource provider. 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

  • vpnclient_ipsec_params (VpnClientIPsecParameters)

    Parameters supplied

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http


975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 975

def set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:nil)
  # Send request
  promise = begin_set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Network::Mgmt::V2019_11_01::Models::VpnClientIPsecParameters.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#start_packet_capture(resource_group_name, virtual_network_gateway_name, parameters: nil, custom_headers: nil) ⇒ String

Starts packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to start packet capture on 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

  • parameters (VpnPacketCaptureStartParameters) (defaults to: nil)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.


1174
1175
1176
1177
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1174

def start_packet_capture(resource_group_name, virtual_network_gateway_name, parameters:nil, custom_headers:nil)
  response = start_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters:parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

gateway. packet capture parameters supplied to start packet capture on 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

  • parameters (VpnPacketCaptureStartParameters) (defaults to: nil)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http


1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1191

def start_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters:nil, custom_headers:nil)
  # Send request
  promise = begin_start_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters:parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        client_side_validation: true,
        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, FinalStateVia::LOCATION)
  end

  promise
end

#stop_packet_capture(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: nil) ⇒ String

Stops packet capture on virtual network gateway in the specified resource group.

gateway. packet capture parameters supplied to stop packet capture on 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

  • parameters (VpnPacketCaptureStopParameters)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.


1230
1231
1232
1233
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1230

def stop_packet_capture(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  response = stop_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

gateway. packet capture parameters supplied to stop packet capture on 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

  • parameters (VpnPacketCaptureStopParameters)

    Virtual network gateway

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http


1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1247

def stop_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_stop_packet_capture_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        client_side_validation: true,
        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, FinalStateVia::LOCATION)
  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.


756
757
758
759
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 756

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


787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 787

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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.


772
773
774
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 772

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

#update_tags(resource_group_name, virtual_network_gateway_name, parameters, custom_headers: nil) ⇒ VirtualNetworkGateway

Updates a virtual network gateway tags.

gateway. gateway tags. 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 (TagsObject)

    Parameters supplied to update virtual network

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.


222
223
224
225
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 222

def update_tags(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  response = update_tags_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

gateway. gateway tags. 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 (TagsObject)

    Parameters supplied to update 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


239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 239

def update_tags_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_update_tags_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers)

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

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


1053
1054
1055
1056
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1053

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


1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1090

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  # Serialize Request
  request_mapper = Azure::Network::Mgmt::V2019_11_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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          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.


1072
1073
1074
# File 'lib/2019-11-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1072

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