azure_mgmt_network 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_network.rb +59 -52
  3. data/lib/generated/azure_mgmt_network/application_gateways.rb +426 -308
  4. data/lib/generated/azure_mgmt_network/express_route_circuit_authorizations.rb +181 -199
  5. data/lib/generated/azure_mgmt_network/express_route_circuit_peerings.rb +175 -193
  6. data/lib/generated/azure_mgmt_network/express_route_circuits.rb +458 -497
  7. data/lib/generated/azure_mgmt_network/express_route_service_providers.rb +36 -43
  8. data/lib/generated/azure_mgmt_network/load_balancers.rb +225 -242
  9. data/lib/generated/azure_mgmt_network/local_network_gateways.rb +168 -191
  10. data/lib/generated/azure_mgmt_network/models/address_space.rb +4 -4
  11. data/lib/generated/azure_mgmt_network/models/application_gateway.rb +42 -28
  12. data/lib/generated/azure_mgmt_network/models/application_gateway_authentication_certificate.rb +6 -6
  13. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address.rb +4 -4
  14. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +6 -6
  15. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health.rb +52 -0
  16. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_http_settings.rb +66 -0
  17. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_pool.rb +65 -0
  18. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_server.rb +67 -0
  19. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_server_health.rb +18 -0
  20. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +16 -13
  21. data/lib/generated/azure_mgmt_network/models/application_gateway_cookie_based_affinity.rb +1 -1
  22. data/lib/generated/azure_mgmt_network/models/application_gateway_firewall_mode.rb +16 -0
  23. data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_ipconfiguration.rb +13 -12
  24. data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_port.rb +6 -6
  25. data/lib/generated/azure_mgmt_network/models/application_gateway_http_listener.rb +16 -14
  26. data/lib/generated/azure_mgmt_network/models/application_gateway_ipconfiguration.rb +7 -6
  27. data/lib/generated/azure_mgmt_network/models/application_gateway_list_result.rb +4 -4
  28. data/lib/generated/azure_mgmt_network/models/application_gateway_operational_state.rb +1 -1
  29. data/lib/generated/azure_mgmt_network/models/application_gateway_path_rule.rb +9 -9
  30. data/lib/generated/azure_mgmt_network/models/application_gateway_probe.rb +19 -12
  31. data/lib/generated/azure_mgmt_network/models/application_gateway_protocol.rb +1 -1
  32. data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +14 -11
  33. data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule_type.rb +1 -1
  34. data/lib/generated/azure_mgmt_network/models/application_gateway_sku.rb +11 -8
  35. data/lib/generated/azure_mgmt_network/models/application_gateway_sku_name.rb +3 -1
  36. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +12 -9
  37. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_policy.rb +4 -3
  38. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_protocol.rb +1 -1
  39. data/lib/generated/azure_mgmt_network/models/application_gateway_tier.rb +2 -1
  40. data/lib/generated/azure_mgmt_network/models/application_gateway_url_path_map.rb +10 -9
  41. data/lib/generated/azure_mgmt_network/models/application_gateway_web_application_firewall_configuration.rb +57 -0
  42. data/lib/generated/azure_mgmt_network/models/authorization_list_result.rb +6 -6
  43. data/lib/generated/azure_mgmt_network/models/authorization_use_status.rb +1 -1
  44. data/lib/generated/azure_mgmt_network/models/azure_async_operation_result.rb +4 -3
  45. data/lib/generated/azure_mgmt_network/models/backend_address_pool.rb +11 -11
  46. data/lib/generated/azure_mgmt_network/models/bgp_settings.rb +7 -6
  47. data/lib/generated/azure_mgmt_network/models/connection_reset_shared_key.rb +8 -3
  48. data/lib/generated/azure_mgmt_network/models/connection_shared_key.rb +4 -4
  49. data/lib/generated/azure_mgmt_network/models/dhcp_options.rb +4 -4
  50. data/lib/generated/azure_mgmt_network/models/dns_name_availability_result.rb +3 -3
  51. data/lib/generated/azure_mgmt_network/models/effective_network_security_group.rb +5 -6
  52. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_association.rb +4 -4
  53. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_list_result.rb +5 -5
  54. data/lib/generated/azure_mgmt_network/models/effective_network_security_rule.rb +20 -17
  55. data/lib/generated/azure_mgmt_network/models/effective_route.rb +16 -13
  56. data/lib/generated/azure_mgmt_network/models/effective_route_list_result.rb +4 -4
  57. data/lib/generated/azure_mgmt_network/models/effective_route_source.rb +1 -1
  58. data/lib/generated/azure_mgmt_network/models/effective_route_state.rb +1 -1
  59. data/lib/generated/azure_mgmt_network/models/error.rb +2 -1
  60. data/lib/generated/azure_mgmt_network/models/error_details.rb +2 -1
  61. data/lib/generated/azure_mgmt_network/models/express_route_circuit.rb +20 -21
  62. data/lib/generated/azure_mgmt_network/models/express_route_circuit_arp_table.rb +6 -6
  63. data/lib/generated/azure_mgmt_network/models/express_route_circuit_authorization.rb +10 -9
  64. data/lib/generated/azure_mgmt_network/models/express_route_circuit_list_result.rb +5 -5
  65. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering.rb +26 -24
  66. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_advertised_public_prefix_state.rb +1 -1
  67. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_config.rb +10 -10
  68. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +6 -6
  69. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_state.rb +1 -1
  70. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_type.rb +1 -1
  71. data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table.rb +4 -4
  72. data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table_summary.rb +5 -5
  73. data/lib/generated/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +5 -5
  74. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku.rb +9 -7
  75. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku_family.rb +1 -1
  76. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku_tier.rb +1 -1
  77. data/lib/generated/azure_mgmt_network/models/express_route_circuit_stats.rb +2 -2
  78. data/lib/generated/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +5 -4
  79. data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +5 -5
  80. data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_summary_list_result.rb +5 -5
  81. data/lib/generated/azure_mgmt_network/models/express_route_service_provider.rb +6 -6
  82. data/lib/generated/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +4 -4
  83. data/lib/generated/azure_mgmt_network/models/express_route_service_provider_list_result.rb +5 -5
  84. data/lib/generated/azure_mgmt_network/models/frontend_ipconfiguration.rb +18 -19
  85. data/lib/generated/azure_mgmt_network/models/inbound_nat_pool.rb +19 -27
  86. data/lib/generated/azure_mgmt_network/models/inbound_nat_rule.rb +25 -33
  87. data/lib/generated/azure_mgmt_network/models/ipaddress_availability_result.rb +4 -4
  88. data/lib/generated/azure_mgmt_network/models/ipallocation_method.rb +1 -1
  89. data/lib/generated/azure_mgmt_network/models/ipconfiguration.rb +12 -13
  90. data/lib/generated/azure_mgmt_network/models/ipversion.rb +1 -1
  91. data/lib/generated/azure_mgmt_network/models/load_balancer.rb +31 -16
  92. data/lib/generated/azure_mgmt_network/models/load_balancer_list_result.rb +5 -5
  93. data/lib/generated/azure_mgmt_network/models/load_balancing_rule.rb +29 -38
  94. data/lib/generated/azure_mgmt_network/models/load_distribution.rb +1 -1
  95. data/lib/generated/azure_mgmt_network/models/local_network_gateway.rb +11 -10
  96. data/lib/generated/azure_mgmt_network/models/local_network_gateway_list_result.rb +5 -5
  97. data/lib/generated/azure_mgmt_network/models/network_interface.rb +31 -20
  98. data/lib/generated/azure_mgmt_network/models/network_interface_dns_settings.rb +18 -8
  99. data/lib/generated/azure_mgmt_network/models/network_interface_ipconfiguration.rb +19 -16
  100. data/lib/generated/azure_mgmt_network/models/network_interface_list_result.rb +5 -5
  101. data/lib/generated/azure_mgmt_network/models/network_operation_status.rb +1 -1
  102. data/lib/generated/azure_mgmt_network/models/network_security_group.rb +15 -15
  103. data/lib/generated/azure_mgmt_network/models/network_security_group_list_result.rb +5 -5
  104. data/lib/generated/azure_mgmt_network/models/outbound_nat_rule.rb +12 -14
  105. data/lib/generated/azure_mgmt_network/models/probe.rb +27 -28
  106. data/lib/generated/azure_mgmt_network/models/probe_protocol.rb +1 -1
  107. data/lib/generated/azure_mgmt_network/models/processor_architecture.rb +1 -1
  108. data/lib/generated/azure_mgmt_network/models/public_ipaddress.rb +15 -15
  109. data/lib/generated/azure_mgmt_network/models/public_ipaddress_dns_settings.rb +15 -14
  110. data/lib/generated/azure_mgmt_network/models/public_ipaddress_list_result.rb +5 -5
  111. data/lib/generated/azure_mgmt_network/models/resource_navigation_link.rb +6 -6
  112. data/lib/generated/azure_mgmt_network/models/route.rb +13 -13
  113. data/lib/generated/azure_mgmt_network/models/route_list_result.rb +4 -4
  114. data/lib/generated/azure_mgmt_network/models/route_next_hop_type.rb +1 -1
  115. data/lib/generated/azure_mgmt_network/models/route_table.rb +8 -7
  116. data/lib/generated/azure_mgmt_network/models/route_table_list_result.rb +5 -5
  117. data/lib/generated/azure_mgmt_network/models/security_rule.rb +33 -36
  118. data/lib/generated/azure_mgmt_network/models/security_rule_access.rb +1 -1
  119. data/lib/generated/azure_mgmt_network/models/security_rule_direction.rb +1 -1
  120. data/lib/generated/azure_mgmt_network/models/security_rule_list_result.rb +6 -6
  121. data/lib/generated/azure_mgmt_network/models/security_rule_protocol.rb +1 -1
  122. data/lib/generated/azure_mgmt_network/models/service_provider_provisioning_state.rb +1 -1
  123. data/lib/generated/azure_mgmt_network/models/subnet.rb +14 -15
  124. data/lib/generated/azure_mgmt_network/models/subnet_list_result.rb +4 -4
  125. data/lib/generated/azure_mgmt_network/models/transport_protocol.rb +1 -1
  126. data/lib/generated/azure_mgmt_network/models/tunnel_connection_health.rb +92 -0
  127. data/lib/generated/azure_mgmt_network/models/usage.rb +7 -7
  128. data/lib/generated/azure_mgmt_network/models/usage_name.rb +4 -5
  129. data/lib/generated/azure_mgmt_network/models/usages_list_result.rb +3 -3
  130. data/lib/generated/azure_mgmt_network/models/virtual_network.rb +15 -16
  131. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway.rb +26 -23
  132. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection.rb +45 -18
  133. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +6 -5
  134. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_status.rb +1 -1
  135. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_type.rb +1 -1
  136. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_ipconfiguration.rb +15 -14
  137. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +5 -5
  138. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku.rb +12 -10
  139. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku_name.rb +1 -1
  140. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku_tier.rb +1 -1
  141. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_type.rb +1 -1
  142. data/lib/generated/azure_mgmt_network/models/virtual_network_list_result.rb +5 -5
  143. data/lib/generated/azure_mgmt_network/models/virtual_network_peering.rb +21 -23
  144. data/lib/generated/azure_mgmt_network/models/virtual_network_peering_list_result.rb +6 -6
  145. data/lib/generated/azure_mgmt_network/models/virtual_network_peering_state.rb +1 -1
  146. data/lib/generated/azure_mgmt_network/models/vpn_client_configuration.rb +5 -5
  147. data/lib/generated/azure_mgmt_network/models/vpn_client_parameters.rb +5 -4
  148. data/lib/generated/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +10 -9
  149. data/lib/generated/azure_mgmt_network/models/vpn_client_root_certificate.rb +10 -8
  150. data/lib/generated/azure_mgmt_network/models/vpn_type.rb +1 -1
  151. data/lib/generated/azure_mgmt_network/module_definition.rb +1 -1
  152. data/lib/generated/azure_mgmt_network/network_interfaces.rb +443 -478
  153. data/lib/generated/azure_mgmt_network/network_management_client.rb +20 -7
  154. data/lib/generated/azure_mgmt_network/network_security_groups.rb +224 -249
  155. data/lib/generated/azure_mgmt_network/public_ipaddresses.rb +220 -241
  156. data/lib/generated/azure_mgmt_network/route_tables.rb +219 -226
  157. data/lib/generated/azure_mgmt_network/routes.rb +171 -181
  158. data/lib/generated/azure_mgmt_network/security_rules.rb +175 -193
  159. data/lib/generated/azure_mgmt_network/subnets.rb +177 -181
  160. data/lib/generated/azure_mgmt_network/usages.rb +34 -34
  161. data/lib/generated/azure_mgmt_network/version.rb +2 -2
  162. data/lib/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +335 -358
  163. data/lib/generated/azure_mgmt_network/virtual_network_gateways.rb +246 -289
  164. data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +177 -191
  165. data/lib/generated/azure_mgmt_network/virtual_networks.rb +242 -249
  166. metadata +12 -5
  167. data/lib/generated/azure_mgmt_network/models/connection_shared_key_result.rb +0 -44
@@ -1,14 +1,14 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Network
7
7
  #
8
8
  # The Microsoft Azure Network management API provides a RESTful set of web
9
- # services that interact with Microsoft Azure Networks service to manage
10
- # your network resources. The API has entities that capture the
11
- # relationship between an end user and the Microsoft Azure Networks service.
9
+ # services that interact with Microsoft Azure Networks service to manage your
10
+ # network resources. The API has entities that capture the relationship
11
+ # between an end user and the Microsoft Azure Networks service.
12
12
  #
13
13
  class VirtualNetworkGateways
14
14
  include Azure::ARM::Network::Models
@@ -26,15 +26,13 @@ module Azure::ARM::Network
26
26
  attr_reader :client
27
27
 
28
28
  #
29
- # The Put VirtualNetworkGateway operation creates/updates a virtual network
30
- # gateway in the specified resource group through Network resource provider.
29
+ # Creates or updates a virtual network gateway in the specified resource group.
31
30
  #
32
31
  # @param resource_group_name [String] The name of the resource group.
33
32
  # @param virtual_network_gateway_name [String] The name of the virtual network
34
33
  # gateway.
35
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
36
- # Create or update Virtual Network Gateway operation through Network resource
37
- # provider.
34
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to create or
35
+ # update virtual network gateway operation.
38
36
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
37
  # will be added to the HTTP request.
40
38
  #
@@ -49,9 +47,8 @@ module Azure::ARM::Network
49
47
  # @param resource_group_name [String] The name of the resource group.
50
48
  # @param virtual_network_gateway_name [String] The name of the virtual network
51
49
  # gateway.
52
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
53
- # Create or update Virtual Network Gateway operation through Network resource
54
- # provider.
50
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to create or
51
+ # update virtual network gateway operation.
55
52
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
53
  # will be added to the HTTP request.
57
54
  #
@@ -77,63 +74,50 @@ module Azure::ARM::Network
77
74
  end
78
75
 
79
76
  #
80
- # The Put VirtualNetworkGateway operation creates/updates a virtual network
81
- # gateway in the specified resource group through Network resource provider.
77
+ # Gets the specified virtual network gateway by resource group.
82
78
  #
83
79
  # @param resource_group_name [String] The name of the resource group.
84
80
  # @param virtual_network_gateway_name [String] The name of the virtual network
85
81
  # gateway.
86
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
87
- # Create or update Virtual Network Gateway operation through Network resource
88
- # provider.
89
82
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
90
83
  # will be added to the HTTP request.
91
84
  #
92
85
  # @return [VirtualNetworkGateway] operation results.
93
86
  #
94
- def begin_create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
95
- response = begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
87
+ def get(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
88
+ response = get_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
96
89
  response.body unless response.nil?
97
90
  end
98
91
 
99
92
  #
100
- # The Put VirtualNetworkGateway operation creates/updates a virtual network
101
- # gateway in the specified resource group through Network resource provider.
93
+ # Gets the specified virtual network gateway by resource group.
102
94
  #
103
95
  # @param resource_group_name [String] The name of the resource group.
104
96
  # @param virtual_network_gateway_name [String] The name of the virtual network
105
97
  # gateway.
106
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
107
- # Create or update Virtual Network Gateway operation through Network resource
108
- # provider.
109
98
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
110
99
  # will be added to the HTTP request.
111
100
  #
112
101
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
113
102
  #
114
- def begin_create_or_update_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
115
- begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
103
+ def get_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
104
+ get_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
116
105
  end
117
106
 
118
107
  #
119
- # The Put VirtualNetworkGateway operation creates/updates a virtual network
120
- # gateway in the specified resource group through Network resource provider.
108
+ # Gets the specified virtual network gateway by resource group.
121
109
  #
122
110
  # @param resource_group_name [String] The name of the resource group.
123
111
  # @param virtual_network_gateway_name [String] The name of the virtual network
124
112
  # gateway.
125
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
126
- # Create or update Virtual Network Gateway operation through Network resource
127
- # provider.
128
113
  # @param [Hash{String => String}] A hash of custom headers that will be added
129
114
  # to the HTTP request.
130
115
  #
131
116
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
132
117
  #
133
- def begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
118
+ def get_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
134
119
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
135
120
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
136
- fail ArgumentError, 'parameters is nil' if parameters.nil?
137
121
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
138
122
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
139
123
 
@@ -143,14 +127,6 @@ module Azure::ARM::Network
143
127
  # Set Headers
144
128
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
145
129
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
146
-
147
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
148
-
149
- # Serialize Request
150
- request_mapper = VirtualNetworkGateway.mapper()
151
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
152
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
153
-
154
130
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
155
131
 
156
132
  request_url = @base_url || @client.base_url
@@ -159,17 +135,16 @@ module Azure::ARM::Network
159
135
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
160
136
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
161
137
  query_params: {'api-version' => @client.api_version},
162
- body: request_content,
163
138
  headers: request_headers.merge(custom_headers || {}),
164
139
  base_url: request_url
165
140
  }
166
- promise = @client.make_request_async(:put, path_template, options)
141
+ promise = @client.make_request_async(:get, path_template, options)
167
142
 
168
143
  promise = promise.then do |result|
169
144
  http_response = result.response
170
145
  status_code = http_response.status
171
146
  response_content = http_response.body
172
- unless status_code == 200 || status_code == 201
147
+ unless status_code == 200
173
148
  error_model = JSON.load(response_content)
174
149
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
175
150
  end
@@ -185,16 +160,6 @@ module Azure::ARM::Network
185
160
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
186
161
  end
187
162
  end
188
- # Deserialize Response
189
- if status_code == 201
190
- begin
191
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
192
- result_mapper = VirtualNetworkGateway.mapper()
193
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
194
- rescue Exception => e
195
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
196
- end
197
- end
198
163
 
199
164
  result
200
165
  end
@@ -203,8 +168,7 @@ module Azure::ARM::Network
203
168
  end
204
169
 
205
170
  #
206
- # The Get VirtualNetworkGateway operation retrieves information about the
207
- # specified virtual network gateway through Network resource provider.
171
+ # Deletes the specified virtual network gateway.
208
172
  #
209
173
  # @param resource_group_name [String] The name of the resource group.
210
174
  # @param virtual_network_gateway_name [String] The name of the virtual network
@@ -212,16 +176,11 @@ module Azure::ARM::Network
212
176
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
213
177
  # will be added to the HTTP request.
214
178
  #
215
- # @return [VirtualNetworkGateway] operation results.
216
- #
217
- def get(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
218
- response = get_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
219
- response.body unless response.nil?
179
+ def delete(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
180
+ response = delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
181
+ nil
220
182
  end
221
183
 
222
- #
223
- # The Get VirtualNetworkGateway operation retrieves information about the
224
- # specified virtual network gateway through Network resource provider.
225
184
  #
226
185
  # @param resource_group_name [String] The name of the resource group.
227
186
  # @param virtual_network_gateway_name [String] The name of the virtual network
@@ -229,27 +188,63 @@ module Azure::ARM::Network
229
188
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
230
189
  # will be added to the HTTP request.
231
190
  #
191
+ # @return [Concurrent::Promise] promise which provides async access to http
192
+ # response.
193
+ #
194
+ def delete_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
195
+ # Send request
196
+ promise = begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers)
197
+
198
+ promise = promise.then do |response|
199
+ # Defining deserialization method.
200
+ deserialize_method = lambda do |parsed_response|
201
+ end
202
+
203
+ # Waiting for response.
204
+ @client.get_long_running_operation_result(response, deserialize_method)
205
+ end
206
+
207
+ promise
208
+ end
209
+
210
+ #
211
+ # Gets all virtual network gateways by resource group.
212
+ #
213
+ # @param resource_group_name [String] The name of the resource group.
214
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
215
+ # will be added to the HTTP request.
216
+ #
217
+ # @return [Array<VirtualNetworkGateway>] operation results.
218
+ #
219
+ def list(resource_group_name, custom_headers = nil)
220
+ first_page = list_as_lazy(resource_group_name, custom_headers)
221
+ first_page.get_all_items
222
+ end
223
+
224
+ #
225
+ # Gets all virtual network gateways by resource group.
226
+ #
227
+ # @param resource_group_name [String] The name of the resource group.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
232
231
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
233
232
  #
234
- def get_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
235
- get_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
233
+ def list_with_http_info(resource_group_name, custom_headers = nil)
234
+ list_async(resource_group_name, custom_headers).value!
236
235
  end
237
236
 
238
237
  #
239
- # The Get VirtualNetworkGateway operation retrieves information about the
240
- # specified virtual network gateway through Network resource provider.
238
+ # Gets all virtual network gateways by resource group.
241
239
  #
242
240
  # @param resource_group_name [String] The name of the resource group.
243
- # @param virtual_network_gateway_name [String] The name of the virtual network
244
- # gateway.
245
241
  # @param [Hash{String => String}] A hash of custom headers that will be added
246
242
  # to the HTTP request.
247
243
  #
248
244
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
249
245
  #
250
- def get_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
246
+ def list_async(resource_group_name, custom_headers = nil)
251
247
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
252
- fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
253
248
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
254
249
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
255
250
 
@@ -259,13 +254,13 @@ module Azure::ARM::Network
259
254
  # Set Headers
260
255
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
261
256
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
262
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
257
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'
263
258
 
264
259
  request_url = @base_url || @client.base_url
265
260
 
266
261
  options = {
267
262
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
268
- path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
263
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
269
264
  query_params: {'api-version' => @client.api_version},
270
265
  headers: request_headers.merge(custom_headers || {}),
271
266
  base_url: request_url
@@ -286,7 +281,7 @@ module Azure::ARM::Network
286
281
  if status_code == 200
287
282
  begin
288
283
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
289
- result_mapper = VirtualNetworkGateway.mapper()
284
+ result_mapper = VirtualNetworkGatewayListResult.mapper()
290
285
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
291
286
  rescue Exception => e
292
287
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -300,37 +295,45 @@ module Azure::ARM::Network
300
295
  end
301
296
 
302
297
  #
303
- # The Delete VirtualNetworkGateway operation deletes the specified virtual
304
- # network Gateway through Network resource provider.
298
+ # Resets the primary of the virtual network gateway in the specified resource
299
+ # group.
305
300
  #
306
301
  # @param resource_group_name [String] The name of the resource group.
307
302
  # @param virtual_network_gateway_name [String] The name of the virtual network
308
303
  # gateway.
304
+ # @param gateway_vip [String] Virtual network gateway vip address supplied to
305
+ # the begin reset of the active-active feature enabled gateway.
309
306
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
307
  # will be added to the HTTP request.
311
308
  #
312
- def delete(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
313
- response = delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
314
- nil
309
+ # @return [VirtualNetworkGateway] operation results.
310
+ #
311
+ def reset(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
312
+ response = reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers).value!
313
+ response.body unless response.nil?
315
314
  end
316
315
 
317
316
  #
318
317
  # @param resource_group_name [String] The name of the resource group.
319
318
  # @param virtual_network_gateway_name [String] The name of the virtual network
320
319
  # gateway.
320
+ # @param gateway_vip [String] Virtual network gateway vip address supplied to
321
+ # the begin reset of the active-active feature enabled gateway.
321
322
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
322
323
  # will be added to the HTTP request.
323
324
  #
324
325
  # @return [Concurrent::Promise] promise which provides async access to http
325
326
  # response.
326
327
  #
327
- def delete_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
328
+ def reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
328
329
  # Send request
329
- promise = begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers)
330
+ promise = begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers)
330
331
 
331
332
  promise = promise.then do |response|
332
333
  # Defining deserialization method.
333
334
  deserialize_method = lambda do |parsed_response|
335
+ result_mapper = VirtualNetworkGateway.mapper()
336
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
334
337
  end
335
338
 
336
339
  # Waiting for response.
@@ -341,52 +344,60 @@ module Azure::ARM::Network
341
344
  end
342
345
 
343
346
  #
344
- # The Delete VirtualNetworkGateway operation deletes the specified virtual
345
- # network Gateway through Network resource provider.
347
+ # Generates VPN client package for P2S client of the virtual network gateway in
348
+ # the specified resource group.
346
349
  #
347
350
  # @param resource_group_name [String] The name of the resource group.
348
351
  # @param virtual_network_gateway_name [String] The name of the virtual network
349
352
  # gateway.
353
+ # @param parameters [VpnClientParameters] Parameters supplied to the generate
354
+ # virtual network gateway VPN client package operation.
350
355
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
351
356
  # will be added to the HTTP request.
352
357
  #
358
+ # @return [String] operation results.
353
359
  #
354
- def begin_delete(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
355
- response = begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
356
- nil
360
+ def generatevpnclientpackage(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
361
+ response = generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
362
+ response.body unless response.nil?
357
363
  end
358
364
 
359
365
  #
360
- # The Delete VirtualNetworkGateway operation deletes the specified virtual
361
- # network Gateway through Network resource provider.
366
+ # Generates VPN client package for P2S client of the virtual network gateway in
367
+ # the specified resource group.
362
368
  #
363
369
  # @param resource_group_name [String] The name of the resource group.
364
370
  # @param virtual_network_gateway_name [String] The name of the virtual network
365
371
  # gateway.
372
+ # @param parameters [VpnClientParameters] Parameters supplied to the generate
373
+ # virtual network gateway VPN client package operation.
366
374
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
367
375
  # will be added to the HTTP request.
368
376
  #
369
377
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
370
378
  #
371
- def begin_delete_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
372
- begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
379
+ def generatevpnclientpackage_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
380
+ generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
373
381
  end
374
382
 
375
383
  #
376
- # The Delete VirtualNetworkGateway operation deletes the specified virtual
377
- # network Gateway through Network resource provider.
384
+ # Generates VPN client package for P2S client of the virtual network gateway in
385
+ # the specified resource group.
378
386
  #
379
387
  # @param resource_group_name [String] The name of the resource group.
380
388
  # @param virtual_network_gateway_name [String] The name of the virtual network
381
389
  # gateway.
390
+ # @param parameters [VpnClientParameters] Parameters supplied to the generate
391
+ # virtual network gateway VPN client package operation.
382
392
  # @param [Hash{String => String}] A hash of custom headers that will be added
383
393
  # to the HTTP request.
384
394
  #
385
395
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
386
396
  #
387
- def begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
397
+ def generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
388
398
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
389
399
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
400
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
390
401
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
391
402
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
392
403
 
@@ -396,7 +407,15 @@ module Azure::ARM::Network
396
407
  # Set Headers
397
408
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
398
409
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
399
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
410
+
411
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
412
+
413
+ # Serialize Request
414
+ request_mapper = VpnClientParameters.mapper()
415
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
416
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
417
+
418
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'
400
419
 
401
420
  request_url = @base_url || @client.base_url
402
421
 
@@ -404,21 +423,38 @@ module Azure::ARM::Network
404
423
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
405
424
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
406
425
  query_params: {'api-version' => @client.api_version},
426
+ body: request_content,
407
427
  headers: request_headers.merge(custom_headers || {}),
408
428
  base_url: request_url
409
429
  }
410
- promise = @client.make_request_async(:delete, path_template, options)
430
+ promise = @client.make_request_async(:post, path_template, options)
411
431
 
412
432
  promise = promise.then do |result|
413
433
  http_response = result.response
414
434
  status_code = http_response.status
415
435
  response_content = http_response.body
416
- unless status_code == 204 || status_code == 202 || status_code == 200
436
+ unless status_code == 202
417
437
  error_model = JSON.load(response_content)
418
438
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
419
439
  end
420
440
 
421
441
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
442
+ # Deserialize Response
443
+ if status_code == 202
444
+ begin
445
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
446
+ result_mapper = {
447
+ required: false,
448
+ serialized_name: 'parsed_response',
449
+ type: {
450
+ name: 'String'
451
+ }
452
+ }
453
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
454
+ rescue Exception => e
455
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
456
+ end
457
+ end
422
458
 
423
459
  result
424
460
  end
@@ -427,68 +463,57 @@ module Azure::ARM::Network
427
463
  end
428
464
 
429
465
  #
430
- # The List VirtualNetworkGateways operation retrieves all the virtual network
431
- # gateways stored.
432
- #
433
- # @param resource_group_name [String] The name of the resource group.
434
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
- # will be added to the HTTP request.
436
- #
437
- # @return [VirtualNetworkGatewayListResult] which provide lazy access to pages
438
- # of the response.
439
- #
440
- def list_as_lazy(resource_group_name, custom_headers = nil)
441
- response = list_async(resource_group_name, custom_headers).value!
442
- unless response.nil?
443
- page = response.body
444
- page.next_method = Proc.new do |next_page_link|
445
- list_next_async(next_page_link, custom_headers)
446
- end
447
- page
448
- end
449
- end
450
-
451
- #
452
- # The List VirtualNetworkGateways operation retrieves all the virtual network
453
- # gateways stored.
466
+ # Creates or updates a virtual network gateway in the specified resource group.
454
467
  #
455
468
  # @param resource_group_name [String] The name of the resource group.
469
+ # @param virtual_network_gateway_name [String] The name of the virtual network
470
+ # gateway.
471
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to create or
472
+ # update virtual network gateway operation.
456
473
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
457
474
  # will be added to the HTTP request.
458
475
  #
459
- # @return [Array<VirtualNetworkGateway>] operation results.
476
+ # @return [VirtualNetworkGateway] operation results.
460
477
  #
461
- def list(resource_group_name, custom_headers = nil)
462
- first_page = list_as_lazy(resource_group_name, custom_headers)
463
- first_page.get_all_items
478
+ def begin_create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
479
+ response = begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
480
+ response.body unless response.nil?
464
481
  end
465
482
 
466
483
  #
467
- # The List VirtualNetworkGateways operation retrieves all the virtual network
468
- # gateways stored.
484
+ # Creates or updates a virtual network gateway in the specified resource group.
469
485
  #
470
486
  # @param resource_group_name [String] The name of the resource group.
487
+ # @param virtual_network_gateway_name [String] The name of the virtual network
488
+ # gateway.
489
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to create or
490
+ # update virtual network gateway operation.
471
491
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
472
492
  # will be added to the HTTP request.
473
493
  #
474
494
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
475
495
  #
476
- def list_with_http_info(resource_group_name, custom_headers = nil)
477
- list_async(resource_group_name, custom_headers).value!
496
+ def begin_create_or_update_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
497
+ begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
478
498
  end
479
499
 
480
500
  #
481
- # The List VirtualNetworkGateways operation retrieves all the virtual network
482
- # gateways stored.
501
+ # Creates or updates a virtual network gateway in the specified resource group.
483
502
  #
484
503
  # @param resource_group_name [String] The name of the resource group.
504
+ # @param virtual_network_gateway_name [String] The name of the virtual network
505
+ # gateway.
506
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to create or
507
+ # update virtual network gateway operation.
485
508
  # @param [Hash{String => String}] A hash of custom headers that will be added
486
509
  # to the HTTP request.
487
510
  #
488
511
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
489
512
  #
490
- def list_async(resource_group_name, custom_headers = nil)
513
+ def begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
491
514
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
515
+ fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
516
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
492
517
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
493
518
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
494
519
 
@@ -498,24 +523,33 @@ module Azure::ARM::Network
498
523
  # Set Headers
499
524
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
500
525
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
501
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'
526
+
527
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
528
+
529
+ # Serialize Request
530
+ request_mapper = VirtualNetworkGateway.mapper()
531
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
532
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
533
+
534
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
502
535
 
503
536
  request_url = @base_url || @client.base_url
504
537
 
505
538
  options = {
506
539
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
507
- path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
540
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
508
541
  query_params: {'api-version' => @client.api_version},
542
+ body: request_content,
509
543
  headers: request_headers.merge(custom_headers || {}),
510
544
  base_url: request_url
511
545
  }
512
- promise = @client.make_request_async(:get, path_template, options)
546
+ promise = @client.make_request_async(:put, path_template, options)
513
547
 
514
548
  promise = promise.then do |result|
515
549
  http_response = result.response
516
550
  status_code = http_response.status
517
551
  response_content = http_response.body
518
- unless status_code == 200
552
+ unless status_code == 200 || status_code == 201
519
553
  error_model = JSON.load(response_content)
520
554
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
521
555
  end
@@ -525,7 +559,17 @@ module Azure::ARM::Network
525
559
  if status_code == 200
526
560
  begin
527
561
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
528
- result_mapper = VirtualNetworkGatewayListResult.mapper()
562
+ result_mapper = VirtualNetworkGateway.mapper()
563
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
564
+ rescue Exception => e
565
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
566
+ end
567
+ end
568
+ # Deserialize Response
569
+ if status_code == 201
570
+ begin
571
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
572
+ result_mapper = VirtualNetworkGateway.mapper()
529
573
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
530
574
  rescue Exception => e
531
575
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -539,113 +583,49 @@ module Azure::ARM::Network
539
583
  end
540
584
 
541
585
  #
542
- # The Reset VirtualNetworkGateway operation resets the primary of the virtual
543
- # network gateway in the specified resource group through Network resource
544
- # provider.
545
- #
546
- # @param resource_group_name [String] The name of the resource group.
547
- # @param virtual_network_gateway_name [String] The name of the virtual network
548
- # gateway.
549
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
550
- # Reset Virtual Network Gateway operation through Network resource provider.
551
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
- # will be added to the HTTP request.
553
- #
554
- # @return [VirtualNetworkGateway] operation results.
555
- #
556
- def reset(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
557
- response = reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
558
- response.body unless response.nil?
559
- end
560
-
586
+ # Deletes the specified virtual network gateway.
561
587
  #
562
588
  # @param resource_group_name [String] The name of the resource group.
563
589
  # @param virtual_network_gateway_name [String] The name of the virtual network
564
590
  # gateway.
565
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
566
- # Reset Virtual Network Gateway operation through Network resource provider.
567
591
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
568
592
  # will be added to the HTTP request.
569
593
  #
570
- # @return [Concurrent::Promise] promise which provides async access to http
571
- # response.
572
594
  #
573
- def reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
574
- # Send request
575
- promise = begin_reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers)
576
-
577
- promise = promise.then do |response|
578
- # Defining deserialization method.
579
- deserialize_method = lambda do |parsed_response|
580
- result_mapper = VirtualNetworkGateway.mapper()
581
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
582
- end
583
-
584
- # Waiting for response.
585
- @client.get_long_running_operation_result(response, deserialize_method)
586
- end
587
-
588
- promise
589
- end
590
-
591
- #
592
- # The Reset VirtualNetworkGateway operation resets the primary of the virtual
593
- # network gateway in the specified resource group through Network resource
594
- # provider.
595
- #
596
- # @param resource_group_name [String] The name of the resource group.
597
- # @param virtual_network_gateway_name [String] The name of the virtual network
598
- # gateway.
599
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
600
- # Reset Virtual Network Gateway operation through Network resource provider.
601
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
602
- # will be added to the HTTP request.
603
- #
604
- # @return [VirtualNetworkGateway] operation results.
605
- #
606
- def begin_reset(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
607
- response = begin_reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
608
- response.body unless response.nil?
595
+ def begin_delete(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
596
+ response = begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
597
+ nil
609
598
  end
610
599
 
611
600
  #
612
- # The Reset VirtualNetworkGateway operation resets the primary of the virtual
613
- # network gateway in the specified resource group through Network resource
614
- # provider.
601
+ # Deletes the specified virtual network gateway.
615
602
  #
616
603
  # @param resource_group_name [String] The name of the resource group.
617
604
  # @param virtual_network_gateway_name [String] The name of the virtual network
618
605
  # gateway.
619
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
620
- # Reset Virtual Network Gateway operation through Network resource provider.
621
606
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
622
607
  # will be added to the HTTP request.
623
608
  #
624
609
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
625
610
  #
626
- def begin_reset_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
627
- begin_reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
611
+ def begin_delete_with_http_info(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
612
+ begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
628
613
  end
629
614
 
630
615
  #
631
- # The Reset VirtualNetworkGateway operation resets the primary of the virtual
632
- # network gateway in the specified resource group through Network resource
633
- # provider.
616
+ # Deletes the specified virtual network gateway.
634
617
  #
635
618
  # @param resource_group_name [String] The name of the resource group.
636
619
  # @param virtual_network_gateway_name [String] The name of the virtual network
637
620
  # gateway.
638
- # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
639
- # Reset Virtual Network Gateway operation through Network resource provider.
640
621
  # @param [Hash{String => String}] A hash of custom headers that will be added
641
622
  # to the HTTP request.
642
623
  #
643
624
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
644
625
  #
645
- def begin_reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
626
+ def begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
646
627
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
647
628
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
648
- fail ArgumentError, 'parameters is nil' if parameters.nil?
649
629
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
650
630
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
651
631
 
@@ -655,15 +635,7 @@ module Azure::ARM::Network
655
635
  # Set Headers
656
636
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
657
637
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
658
-
659
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
660
-
661
- # Serialize Request
662
- request_mapper = VirtualNetworkGateway.mapper()
663
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
664
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
665
-
666
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'
638
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
667
639
 
668
640
  request_url = @base_url || @client.base_url
669
641
 
@@ -671,32 +643,21 @@ module Azure::ARM::Network
671
643
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
672
644
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
673
645
  query_params: {'api-version' => @client.api_version},
674
- body: request_content,
675
646
  headers: request_headers.merge(custom_headers || {}),
676
647
  base_url: request_url
677
648
  }
678
- promise = @client.make_request_async(:post, path_template, options)
649
+ promise = @client.make_request_async(:delete, path_template, options)
679
650
 
680
651
  promise = promise.then do |result|
681
652
  http_response = result.response
682
653
  status_code = http_response.status
683
654
  response_content = http_response.body
684
- unless status_code == 202 || status_code == 200
655
+ unless status_code == 204 || status_code == 202 || status_code == 200
685
656
  error_model = JSON.load(response_content)
686
657
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
687
658
  end
688
659
 
689
660
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
690
- # Deserialize Response
691
- if status_code == 200
692
- begin
693
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
694
- result_mapper = VirtualNetworkGateway.mapper()
695
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
696
- rescue Exception => e
697
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
698
- end
699
- end
700
661
 
701
662
  result
702
663
  end
@@ -705,66 +666,59 @@ module Azure::ARM::Network
705
666
  end
706
667
 
707
668
  #
708
- # The Generatevpnclientpackage operation generates Vpn client package for P2S
709
- # client of the virtual network gateway in the specified resource group
710
- # through Network resource provider.
669
+ # Resets the primary of the virtual network gateway in the specified resource
670
+ # group.
711
671
  #
712
672
  # @param resource_group_name [String] The name of the resource group.
713
673
  # @param virtual_network_gateway_name [String] The name of the virtual network
714
674
  # gateway.
715
- # @param parameters [VpnClientParameters] Parameters supplied to the Begin
716
- # Generating Virtual Network Gateway Vpn client package operation through
717
- # Network resource provider.
675
+ # @param gateway_vip [String] Virtual network gateway vip address supplied to
676
+ # the begin reset of the active-active feature enabled gateway.
718
677
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
719
678
  # will be added to the HTTP request.
720
679
  #
721
- # @return [String] operation results.
680
+ # @return [VirtualNetworkGateway] operation results.
722
681
  #
723
- def generatevpnclientpackage(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
724
- response = generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
682
+ def begin_reset(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
683
+ response = begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers).value!
725
684
  response.body unless response.nil?
726
685
  end
727
686
 
728
687
  #
729
- # The Generatevpnclientpackage operation generates Vpn client package for P2S
730
- # client of the virtual network gateway in the specified resource group
731
- # through Network resource provider.
688
+ # Resets the primary of the virtual network gateway in the specified resource
689
+ # group.
732
690
  #
733
691
  # @param resource_group_name [String] The name of the resource group.
734
692
  # @param virtual_network_gateway_name [String] The name of the virtual network
735
693
  # gateway.
736
- # @param parameters [VpnClientParameters] Parameters supplied to the Begin
737
- # Generating Virtual Network Gateway Vpn client package operation through
738
- # Network resource provider.
694
+ # @param gateway_vip [String] Virtual network gateway vip address supplied to
695
+ # the begin reset of the active-active feature enabled gateway.
739
696
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
697
  # will be added to the HTTP request.
741
698
  #
742
699
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
743
700
  #
744
- def generatevpnclientpackage_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
745
- generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
701
+ def begin_reset_with_http_info(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
702
+ begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip, custom_headers).value!
746
703
  end
747
704
 
748
705
  #
749
- # The Generatevpnclientpackage operation generates Vpn client package for P2S
750
- # client of the virtual network gateway in the specified resource group
751
- # through Network resource provider.
706
+ # Resets the primary of the virtual network gateway in the specified resource
707
+ # group.
752
708
  #
753
709
  # @param resource_group_name [String] The name of the resource group.
754
710
  # @param virtual_network_gateway_name [String] The name of the virtual network
755
711
  # gateway.
756
- # @param parameters [VpnClientParameters] Parameters supplied to the Begin
757
- # Generating Virtual Network Gateway Vpn client package operation through
758
- # Network resource provider.
712
+ # @param gateway_vip [String] Virtual network gateway vip address supplied to
713
+ # the begin reset of the active-active feature enabled gateway.
759
714
  # @param [Hash{String => String}] A hash of custom headers that will be added
760
715
  # to the HTTP request.
761
716
  #
762
717
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
763
718
  #
764
- def generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
719
+ def begin_reset_async(resource_group_name, virtual_network_gateway_name, gateway_vip = nil, custom_headers = nil)
765
720
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
766
721
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
767
- fail ArgumentError, 'parameters is nil' if parameters.nil?
768
722
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
769
723
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
770
724
 
@@ -774,23 +728,14 @@ module Azure::ARM::Network
774
728
  # Set Headers
775
729
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
776
730
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
777
-
778
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
779
-
780
- # Serialize Request
781
- request_mapper = VpnClientParameters.mapper()
782
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
783
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
784
-
785
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'
731
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'
786
732
 
787
733
  request_url = @base_url || @client.base_url
788
734
 
789
735
  options = {
790
736
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
791
737
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
792
- query_params: {'api-version' => @client.api_version},
793
- body: request_content,
738
+ query_params: {'gatewayVip' => gateway_vip,'api-version' => @client.api_version},
794
739
  headers: request_headers.merge(custom_headers || {}),
795
740
  base_url: request_url
796
741
  }
@@ -800,23 +745,17 @@ module Azure::ARM::Network
800
745
  http_response = result.response
801
746
  status_code = http_response.status
802
747
  response_content = http_response.body
803
- unless status_code == 202
748
+ unless status_code == 202 || status_code == 200
804
749
  error_model = JSON.load(response_content)
805
750
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
806
751
  end
807
752
 
808
753
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
809
754
  # Deserialize Response
810
- if status_code == 202
755
+ if status_code == 200
811
756
  begin
812
757
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
813
- result_mapper = {
814
- required: false,
815
- serialized_name: 'parsed_response',
816
- type: {
817
- name: 'String'
818
- }
819
- }
758
+ result_mapper = VirtualNetworkGateway.mapper()
820
759
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
821
760
  rescue Exception => e
822
761
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -830,11 +769,10 @@ module Azure::ARM::Network
830
769
  end
831
770
 
832
771
  #
833
- # The List VirtualNetworkGateways operation retrieves all the virtual network
834
- # gateways stored.
772
+ # Gets all virtual network gateways by resource group.
835
773
  #
836
- # @param next_page_link [String] The NextLink from the previous successful
837
- # call to List operation.
774
+ # @param next_page_link [String] The NextLink from the previous successful call
775
+ # to List operation.
838
776
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
839
777
  # will be added to the HTTP request.
840
778
  #
@@ -846,11 +784,10 @@ module Azure::ARM::Network
846
784
  end
847
785
 
848
786
  #
849
- # The List VirtualNetworkGateways operation retrieves all the virtual network
850
- # gateways stored.
787
+ # Gets all virtual network gateways by resource group.
851
788
  #
852
- # @param next_page_link [String] The NextLink from the previous successful
853
- # call to List operation.
789
+ # @param next_page_link [String] The NextLink from the previous successful call
790
+ # to List operation.
854
791
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
855
792
  # will be added to the HTTP request.
856
793
  #
@@ -861,11 +798,10 @@ module Azure::ARM::Network
861
798
  end
862
799
 
863
800
  #
864
- # The List VirtualNetworkGateways operation retrieves all the virtual network
865
- # gateways stored.
801
+ # Gets all virtual network gateways by resource group.
866
802
  #
867
- # @param next_page_link [String] The NextLink from the previous successful
868
- # call to List operation.
803
+ # @param next_page_link [String] The NextLink from the previous successful call
804
+ # to List operation.
869
805
  # @param [Hash{String => String}] A hash of custom headers that will be added
870
806
  # to the HTTP request.
871
807
  #
@@ -919,5 +855,26 @@ module Azure::ARM::Network
919
855
  promise.execute
920
856
  end
921
857
 
858
+ #
859
+ # Gets all virtual network gateways by resource group.
860
+ #
861
+ # @param resource_group_name [String] The name of the resource group.
862
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
863
+ # will be added to the HTTP request.
864
+ #
865
+ # @return [VirtualNetworkGatewayListResult] which provide lazy access to pages
866
+ # of the response.
867
+ #
868
+ def list_as_lazy(resource_group_name, custom_headers = nil)
869
+ response = list_async(resource_group_name, custom_headers).value!
870
+ unless response.nil?
871
+ page = response.body
872
+ page.next_method = Proc.new do |next_page_link|
873
+ list_next_async(next_page_link, custom_headers)
874
+ end
875
+ page
876
+ end
877
+ end
878
+
922
879
  end
923
880
  end