Class: Azure::Network::Mgmt::V2019_06_01::VirtualNetworkGateways

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


1218
1219
1220
1221
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1218

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.


1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1253

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


1236
1237
1238
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1236

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


1336
1337
1338
1339
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1336

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.


1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1367

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.


1352
1353
1354
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1352

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


1853
1854
1855
1856
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1853

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.


1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
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
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1890

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


1872
1873
1874
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1872

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.


1732
1733
1734
1735
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1732

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.


1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1769

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


1751
1752
1753
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1751

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.


2283
2284
2285
2286
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2283

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.


2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2318

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


2301
2302
2303
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2301

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.


2082
2083
2084
2085
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2082

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.


2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2115

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


2099
2100
2101
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2099

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.


2182
2183
2184
2185
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2182

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.


2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2215

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


2199
2200
2201
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2199

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.


1973
1974
1975
1976
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1973

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.


2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2008

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.


1991
1992
1993
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1991

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.


2609
2610
2611
2612
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2609

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.


2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2642

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


2626
2627
2628
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2626

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.


2507
2508
2509
2510
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2507

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.


2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2542

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


2525
2526
2527
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2525

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.


1537
1538
1539
1540
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1537

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.


1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1574

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


1640
1641
1642
1643
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1640

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.


1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1673

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.


1657
1658
1659
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1657

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.


1556
1557
1558
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1556

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.


2390
2391
2392
2393
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2390

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.


2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2431

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


2411
2412
2413
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2411

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


1425
1426
1427
1428
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1425

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.


1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1460

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


1443
1444
1445
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1443

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-06-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-06-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_06_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-06-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-06-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

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


1172
1173
1174
1175
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1172

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


1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1187

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_06_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-06-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-06-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_06_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-06-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-06-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


2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2887

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-06-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_06_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-06-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


2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2910

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


2797
2798
2799
2800
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2797

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.


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
2873
2874
2875
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2826

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


2812
2813
2814
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2812

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


2707
2708
2709
2710
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2707

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.


2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2736

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


2722
2723
2724
# File 'lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb', line 2722

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-06-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-06-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-06-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_06_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-06-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-06-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-06-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-06-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_06_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

#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-06-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-06-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-06-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-06-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-06-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_06_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-06-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-06-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_06_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-06-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