Class: Azure::ARM::Network::VirtualNetworkGateways

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

Overview

Network Client

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



749
750
751
752
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 749

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
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
848
849
850
851
852
853
854
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 784

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

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

  # Serialize Request
  request_mapper = Azure::ARM::Network::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' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

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

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



767
768
769
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 767

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

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

Deletes the specified virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that



866
867
868
869
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 866

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

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

Deletes the specified virtual network gateway.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 897

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

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

Deletes the specified virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



882
883
884
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 882

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



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

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1212

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

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

  # Serialize Request
  request_mapper = Azure::ARM::Network::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' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1194
1195
1196
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1194

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



1056
1057
1058
1059
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1056

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1159
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1093

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

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

  # Serialize Request
  request_mapper = Azure::ARM::Network::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' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1075
1076
1077
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1075

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

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

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

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



1593
1594
1595
1596
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1593

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

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

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

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1628

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



1611
1612
1613
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1611

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

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

The GetBgpPeerStatus operation retrieves the status of all BGP peers.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

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

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

    A hash of custom headers that

Returns:

  • (BgpPeerStatusListResult)

    operation results.



1398
1399
1400
1401
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1398

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

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

The GetBgpPeerStatus operation retrieves the status of all BGP peers.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

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

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1431

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



1415
1416
1417
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1415

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

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

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

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



1495
1496
1497
1498
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1495

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

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

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

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1528

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



1512
1513
1514
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1512

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

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

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

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



1293
1294
1295
1296
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1293

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

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

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

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1328

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

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

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1311
1312
1313
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1311

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



953
954
955
956
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 953

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 990

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::ARM::Network::Models::VirtualNetworkGateway.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



972
973
974
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 972

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VirtualNetworkGateway)

    Parameters supplied to create or

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



37
38
39
40
# File 'lib/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).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/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)

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



175
176
177
178
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 175

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

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 190

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

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

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

  promise
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



505
506
507
508
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 505

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 522

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

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

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

  promise
end

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



450
451
452
453
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 450

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • parameters (VpnClientParameters)

    Parameters supplied to the generate

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 467

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

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

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

  promise
end

#get(resource_group_name, virtual_network_gateway_name, custom_headers = nil) ⇒ VirtualNetworkGateway

Gets the specified virtual network gateway by resource group.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



83
84
85
86
# File 'lib/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).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.



702
703
704
705
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 702

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

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String)

    The IP address of the peer

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 718

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

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

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

  promise
end

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

Gets the specified virtual network gateway by resource group.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



610
611
612
613
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 610

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

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • peer (String) (defaults to: nil)

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

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 626

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

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

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

  promise
end

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

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

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (GatewayRouteListResult)

    operation results.



656
657
658
659
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 656

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

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 671

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

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

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

  promise
end

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

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

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (String)

    operation results.



559
560
561
562
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 559

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

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

gateway. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 574

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

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

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

  promise
end

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

Gets the specified virtual network gateway by resource group.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



99
100
101
# File 'lib/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).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.



215
216
217
218
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 215

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

#list_as_lazy(resource_group_name, custom_headers = nil) ⇒ VirtualNetworkGatewayListResult

Gets all virtual network gateways by resource group.

will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGatewayListResult)

    which provide lazy access to pages



1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1865

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

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

Gets all virtual network gateways by resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

def list_async(resource_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



304
305
306
307
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 304

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

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

Gets all the connections in a virtual network gateway.

gateway. will be added to the HTTP request.

access to pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGatewayListConnectionsResult)

    which provide lazy



1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1888

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

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

Gets all the connections in a virtual network gateway.

gateway. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

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?
  api_version = '2017-08-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



1778
1779
1780
1781
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1778

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

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

Gets all the connections in a virtual network gateway.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1807

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


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



1793
1794
1795
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1793

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

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

Gets all the connections in a virtual network gateway.

gateway. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



320
321
322
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 320

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

#list_next(next_page_link, custom_headers = nil) ⇒ VirtualNetworkGatewayListResult

Gets all virtual network gateways by resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGatewayListResult)

    operation results.



1691
1692
1693
1694
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1691

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

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

Gets all virtual network gateways by resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1720

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


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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



1706
1707
1708
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 1706

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

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

Gets all virtual network gateways by resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



229
230
231
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 229

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

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

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

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (VirtualNetworkGateway)

    operation results.



401
402
403
404
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 401

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

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

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

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_network_gateway_name (String)

    The name of the virtual network

  • gateway_vip (String) (defaults to: nil)

    Virtual network gateway vip address supplied to

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/generated/azure_mgmt_network/virtual_network_gateways.rb', line 418

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

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