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 Subnets
14
14
  include Azure::ARM::Network::Models
@@ -26,7 +26,7 @@ module Azure::ARM::Network
26
26
  attr_reader :client
27
27
 
28
28
  #
29
- # The delete subnet operation deletes the specified subnet.
29
+ # Deletes the specified subnet.
30
30
  #
31
31
  # @param resource_group_name [String] The name of the resource group.
32
32
  # @param virtual_network_name [String] The name of the virtual network.
@@ -66,47 +66,51 @@ module Azure::ARM::Network
66
66
  end
67
67
 
68
68
  #
69
- # The delete subnet operation deletes the specified subnet.
69
+ # Gets the specified subnet by virtual network and resource group.
70
70
  #
71
71
  # @param resource_group_name [String] The name of the resource group.
72
72
  # @param virtual_network_name [String] The name of the virtual network.
73
73
  # @param subnet_name [String] The name of the subnet.
74
+ # @param expand [String] Expands referenced resources.
74
75
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
75
76
  # will be added to the HTTP request.
76
77
  #
78
+ # @return [Subnet] operation results.
77
79
  #
78
- def begin_delete(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
79
- response = begin_delete_async(resource_group_name, virtual_network_name, subnet_name, custom_headers).value!
80
- nil
80
+ def get(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
81
+ response = get_async(resource_group_name, virtual_network_name, subnet_name, expand, custom_headers).value!
82
+ response.body unless response.nil?
81
83
  end
82
84
 
83
85
  #
84
- # The delete subnet operation deletes the specified subnet.
86
+ # Gets the specified subnet by virtual network and resource group.
85
87
  #
86
88
  # @param resource_group_name [String] The name of the resource group.
87
89
  # @param virtual_network_name [String] The name of the virtual network.
88
90
  # @param subnet_name [String] The name of the subnet.
91
+ # @param expand [String] Expands referenced resources.
89
92
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
90
93
  # will be added to the HTTP request.
91
94
  #
92
95
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
93
96
  #
94
- def begin_delete_with_http_info(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
95
- begin_delete_async(resource_group_name, virtual_network_name, subnet_name, custom_headers).value!
97
+ def get_with_http_info(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
98
+ get_async(resource_group_name, virtual_network_name, subnet_name, expand, custom_headers).value!
96
99
  end
97
100
 
98
101
  #
99
- # The delete subnet operation deletes the specified subnet.
102
+ # Gets the specified subnet by virtual network and resource group.
100
103
  #
101
104
  # @param resource_group_name [String] The name of the resource group.
102
105
  # @param virtual_network_name [String] The name of the virtual network.
103
106
  # @param subnet_name [String] The name of the subnet.
107
+ # @param expand [String] Expands referenced resources.
104
108
  # @param [Hash{String => String}] A hash of custom headers that will be added
105
109
  # to the HTTP request.
106
110
  #
107
111
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
108
112
  #
109
- def begin_delete_async(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
113
+ def get_async(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
110
114
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
111
115
  fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
112
116
  fail ArgumentError, 'subnet_name is nil' if subnet_name.nil?
@@ -126,22 +130,32 @@ module Azure::ARM::Network
126
130
  options = {
127
131
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
128
132
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
129
- query_params: {'api-version' => @client.api_version},
133
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
130
134
  headers: request_headers.merge(custom_headers || {}),
131
135
  base_url: request_url
132
136
  }
133
- promise = @client.make_request_async(:delete, path_template, options)
137
+ promise = @client.make_request_async(:get, path_template, options)
134
138
 
135
139
  promise = promise.then do |result|
136
140
  http_response = result.response
137
141
  status_code = http_response.status
138
142
  response_content = http_response.body
139
- unless status_code == 200 || status_code == 204 || status_code == 202
143
+ unless status_code == 200
140
144
  error_model = JSON.load(response_content)
141
145
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
142
146
  end
143
147
 
144
148
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
149
+ # Deserialize Response
150
+ if status_code == 200
151
+ begin
152
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
153
+ result_mapper = Subnet.mapper()
154
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
155
+ rescue Exception => e
156
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
157
+ end
158
+ end
145
159
 
146
160
  result
147
161
  end
@@ -150,54 +164,95 @@ module Azure::ARM::Network
150
164
  end
151
165
 
152
166
  #
153
- # The Get subnet operation retrieves information about the specified subnet.
167
+ # Creates or updates a subnet in the specified virtual network.
154
168
  #
155
169
  # @param resource_group_name [String] The name of the resource group.
156
170
  # @param virtual_network_name [String] The name of the virtual network.
157
171
  # @param subnet_name [String] The name of the subnet.
158
- # @param expand [String] expand references resources.
172
+ # @param subnet_parameters [Subnet] Parameters supplied to the create or update
173
+ # subnet operation.
159
174
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
160
175
  # will be added to the HTTP request.
161
176
  #
162
177
  # @return [Subnet] operation results.
163
178
  #
164
- def get(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
165
- response = get_async(resource_group_name, virtual_network_name, subnet_name, expand, custom_headers).value!
179
+ def create_or_update(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
180
+ response = create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers).value!
166
181
  response.body unless response.nil?
167
182
  end
168
183
 
169
- #
170
- # The Get subnet operation retrieves information about the specified subnet.
171
184
  #
172
185
  # @param resource_group_name [String] The name of the resource group.
173
186
  # @param virtual_network_name [String] The name of the virtual network.
174
187
  # @param subnet_name [String] The name of the subnet.
175
- # @param expand [String] expand references resources.
188
+ # @param subnet_parameters [Subnet] Parameters supplied to the create or update
189
+ # subnet operation.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [Concurrent::Promise] promise which provides async access to http
194
+ # response.
195
+ #
196
+ def create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
197
+ # Send request
198
+ promise = begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers)
199
+
200
+ promise = promise.then do |response|
201
+ # Defining deserialization method.
202
+ deserialize_method = lambda do |parsed_response|
203
+ result_mapper = Subnet.mapper()
204
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
205
+ end
206
+
207
+ # Waiting for response.
208
+ @client.get_long_running_operation_result(response, deserialize_method)
209
+ end
210
+
211
+ promise
212
+ end
213
+
214
+ #
215
+ # Gets all subnets in a virtual network.
216
+ #
217
+ # @param resource_group_name [String] The name of the resource group.
218
+ # @param virtual_network_name [String] The name of the virtual network.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [Array<Subnet>] operation results.
223
+ #
224
+ def list(resource_group_name, virtual_network_name, custom_headers = nil)
225
+ first_page = list_as_lazy(resource_group_name, virtual_network_name, custom_headers)
226
+ first_page.get_all_items
227
+ end
228
+
229
+ #
230
+ # Gets all subnets in a virtual network.
231
+ #
232
+ # @param resource_group_name [String] The name of the resource group.
233
+ # @param virtual_network_name [String] The name of the virtual network.
176
234
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
177
235
  # will be added to the HTTP request.
178
236
  #
179
237
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
180
238
  #
181
- def get_with_http_info(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
182
- get_async(resource_group_name, virtual_network_name, subnet_name, expand, custom_headers).value!
239
+ def list_with_http_info(resource_group_name, virtual_network_name, custom_headers = nil)
240
+ list_async(resource_group_name, virtual_network_name, custom_headers).value!
183
241
  end
184
242
 
185
243
  #
186
- # The Get subnet operation retrieves information about the specified subnet.
244
+ # Gets all subnets in a virtual network.
187
245
  #
188
246
  # @param resource_group_name [String] The name of the resource group.
189
247
  # @param virtual_network_name [String] The name of the virtual network.
190
- # @param subnet_name [String] The name of the subnet.
191
- # @param expand [String] expand references resources.
192
248
  # @param [Hash{String => String}] A hash of custom headers that will be added
193
249
  # to the HTTP request.
194
250
  #
195
251
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
196
252
  #
197
- def get_async(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
253
+ def list_async(resource_group_name, virtual_network_name, custom_headers = nil)
198
254
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
199
255
  fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
200
- fail ArgumentError, 'subnet_name is nil' if subnet_name.nil?
201
256
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
202
257
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
203
258
 
@@ -207,14 +262,14 @@ module Azure::ARM::Network
207
262
  # Set Headers
208
263
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
209
264
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
210
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'
265
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'
211
266
 
212
267
  request_url = @base_url || @client.base_url
213
268
 
214
269
  options = {
215
270
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
216
- path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
217
- query_params: {'api-version' => @client.api_version,'$expand' => expand},
271
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subscriptionId' => @client.subscription_id},
272
+ query_params: {'api-version' => @client.api_version},
218
273
  headers: request_headers.merge(custom_headers || {}),
219
274
  base_url: request_url
220
275
  }
@@ -234,7 +289,7 @@ module Azure::ARM::Network
234
289
  if status_code == 200
235
290
  begin
236
291
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
237
- result_mapper = Subnet.mapper()
292
+ result_mapper = SubnetListResult.mapper()
238
293
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
239
294
  rescue Exception => e
240
295
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -248,110 +303,50 @@ module Azure::ARM::Network
248
303
  end
249
304
 
250
305
  #
251
- # The Put Subnet operation creates/updates a subnet in the specified virtual
252
- # network
253
- #
254
- # @param resource_group_name [String] The name of the resource group.
255
- # @param virtual_network_name [String] The name of the virtual network.
256
- # @param subnet_name [String] The name of the subnet.
257
- # @param subnet_parameters [Subnet] Parameters supplied to the create/update
258
- # Subnet operation
259
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
- # will be added to the HTTP request.
261
- #
262
- # @return [Subnet] operation results.
263
- #
264
- def create_or_update(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
265
- response = create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers).value!
266
- response.body unless response.nil?
267
- end
268
-
269
- #
270
- # @param resource_group_name [String] The name of the resource group.
271
- # @param virtual_network_name [String] The name of the virtual network.
272
- # @param subnet_name [String] The name of the subnet.
273
- # @param subnet_parameters [Subnet] Parameters supplied to the create/update
274
- # Subnet operation
275
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
276
- # will be added to the HTTP request.
277
- #
278
- # @return [Concurrent::Promise] promise which provides async access to http
279
- # response.
280
- #
281
- def create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
282
- # Send request
283
- promise = begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers)
284
-
285
- promise = promise.then do |response|
286
- # Defining deserialization method.
287
- deserialize_method = lambda do |parsed_response|
288
- result_mapper = Subnet.mapper()
289
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
290
- end
291
-
292
- # Waiting for response.
293
- @client.get_long_running_operation_result(response, deserialize_method)
294
- end
295
-
296
- promise
297
- end
298
-
299
- #
300
- # The Put Subnet operation creates/updates a subnet in the specified virtual
301
- # network
306
+ # Deletes the specified subnet.
302
307
  #
303
308
  # @param resource_group_name [String] The name of the resource group.
304
309
  # @param virtual_network_name [String] The name of the virtual network.
305
310
  # @param subnet_name [String] The name of the subnet.
306
- # @param subnet_parameters [Subnet] Parameters supplied to the create/update
307
- # Subnet operation
308
311
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
309
312
  # will be added to the HTTP request.
310
313
  #
311
- # @return [Subnet] operation results.
312
314
  #
313
- def begin_create_or_update(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
314
- response = begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers).value!
315
- response.body unless response.nil?
315
+ def begin_delete(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
316
+ response = begin_delete_async(resource_group_name, virtual_network_name, subnet_name, custom_headers).value!
317
+ nil
316
318
  end
317
319
 
318
320
  #
319
- # The Put Subnet operation creates/updates a subnet in the specified virtual
320
- # network
321
+ # Deletes the specified subnet.
321
322
  #
322
323
  # @param resource_group_name [String] The name of the resource group.
323
324
  # @param virtual_network_name [String] The name of the virtual network.
324
325
  # @param subnet_name [String] The name of the subnet.
325
- # @param subnet_parameters [Subnet] Parameters supplied to the create/update
326
- # Subnet operation
327
326
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
327
  # will be added to the HTTP request.
329
328
  #
330
329
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
331
330
  #
332
- def begin_create_or_update_with_http_info(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
333
- begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers).value!
331
+ def begin_delete_with_http_info(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
332
+ begin_delete_async(resource_group_name, virtual_network_name, subnet_name, custom_headers).value!
334
333
  end
335
334
 
336
335
  #
337
- # The Put Subnet operation creates/updates a subnet in the specified virtual
338
- # network
336
+ # Deletes the specified subnet.
339
337
  #
340
338
  # @param resource_group_name [String] The name of the resource group.
341
339
  # @param virtual_network_name [String] The name of the virtual network.
342
340
  # @param subnet_name [String] The name of the subnet.
343
- # @param subnet_parameters [Subnet] Parameters supplied to the create/update
344
- # Subnet operation
345
341
  # @param [Hash{String => String}] A hash of custom headers that will be added
346
342
  # to the HTTP request.
347
343
  #
348
344
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
349
345
  #
350
- def begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
346
+ def begin_delete_async(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
351
347
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
352
348
  fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
353
349
  fail ArgumentError, 'subnet_name is nil' if subnet_name.nil?
354
- fail ArgumentError, 'subnet_parameters is nil' if subnet_parameters.nil?
355
350
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
356
351
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
357
352
 
@@ -361,14 +356,6 @@ module Azure::ARM::Network
361
356
  # Set Headers
362
357
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
363
358
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
364
-
365
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
366
-
367
- # Serialize Request
368
- request_mapper = Subnet.mapper()
369
- request_content = @client.serialize(request_mapper, subnet_parameters, 'subnet_parameters')
370
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
371
-
372
359
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'
373
360
 
374
361
  request_url = @base_url || @client.base_url
@@ -377,42 +364,21 @@ module Azure::ARM::Network
377
364
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
378
365
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
379
366
  query_params: {'api-version' => @client.api_version},
380
- body: request_content,
381
367
  headers: request_headers.merge(custom_headers || {}),
382
368
  base_url: request_url
383
369
  }
384
- promise = @client.make_request_async(:put, path_template, options)
370
+ promise = @client.make_request_async(:delete, path_template, options)
385
371
 
386
372
  promise = promise.then do |result|
387
373
  http_response = result.response
388
374
  status_code = http_response.status
389
375
  response_content = http_response.body
390
- unless status_code == 200 || status_code == 201
376
+ unless status_code == 200 || status_code == 204 || status_code == 202
391
377
  error_model = JSON.load(response_content)
392
378
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
393
379
  end
394
380
 
395
381
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
396
- # Deserialize Response
397
- if status_code == 200
398
- begin
399
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
- result_mapper = Subnet.mapper()
401
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
402
- rescue Exception => e
403
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
404
- end
405
- end
406
- # Deserialize Response
407
- if status_code == 201
408
- begin
409
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
410
- result_mapper = Subnet.mapper()
411
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
412
- rescue Exception => e
413
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
414
- end
415
- end
416
382
 
417
383
  result
418
384
  end
@@ -421,69 +387,58 @@ module Azure::ARM::Network
421
387
  end
422
388
 
423
389
  #
424
- # The List subnets operation retrieves all the subnets in a virtual network.
425
- #
426
- # @param resource_group_name [String] The name of the resource group.
427
- # @param virtual_network_name [String] The name of the virtual network.
428
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
429
- # will be added to the HTTP request.
430
- #
431
- # @return [SubnetListResult] which provide lazy access to pages of the
432
- # response.
433
- #
434
- def list_as_lazy(resource_group_name, virtual_network_name, custom_headers = nil)
435
- response = list_async(resource_group_name, virtual_network_name, custom_headers).value!
436
- unless response.nil?
437
- page = response.body
438
- page.next_method = Proc.new do |next_page_link|
439
- list_next_async(next_page_link, custom_headers)
440
- end
441
- page
442
- end
443
- end
444
-
445
- #
446
- # The List subnets operation retrieves all the subnets in a virtual network.
390
+ # Creates or updates a subnet in the specified virtual network.
447
391
  #
448
392
  # @param resource_group_name [String] The name of the resource group.
449
393
  # @param virtual_network_name [String] The name of the virtual network.
394
+ # @param subnet_name [String] The name of the subnet.
395
+ # @param subnet_parameters [Subnet] Parameters supplied to the create or update
396
+ # subnet operation.
450
397
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
398
  # will be added to the HTTP request.
452
399
  #
453
- # @return [Array<Subnet>] operation results.
400
+ # @return [Subnet] operation results.
454
401
  #
455
- def list(resource_group_name, virtual_network_name, custom_headers = nil)
456
- first_page = list_as_lazy(resource_group_name, virtual_network_name, custom_headers)
457
- first_page.get_all_items
402
+ def begin_create_or_update(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
403
+ response = begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers).value!
404
+ response.body unless response.nil?
458
405
  end
459
406
 
460
407
  #
461
- # The List subnets operation retrieves all the subnets in a virtual network.
408
+ # Creates or updates a subnet in the specified virtual network.
462
409
  #
463
410
  # @param resource_group_name [String] The name of the resource group.
464
411
  # @param virtual_network_name [String] The name of the virtual network.
412
+ # @param subnet_name [String] The name of the subnet.
413
+ # @param subnet_parameters [Subnet] Parameters supplied to the create or update
414
+ # subnet operation.
465
415
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
466
416
  # will be added to the HTTP request.
467
417
  #
468
418
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
469
419
  #
470
- def list_with_http_info(resource_group_name, virtual_network_name, custom_headers = nil)
471
- list_async(resource_group_name, virtual_network_name, custom_headers).value!
420
+ def begin_create_or_update_with_http_info(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
421
+ begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers).value!
472
422
  end
473
423
 
474
424
  #
475
- # The List subnets operation retrieves all the subnets in a virtual network.
425
+ # Creates or updates a subnet in the specified virtual network.
476
426
  #
477
427
  # @param resource_group_name [String] The name of the resource group.
478
428
  # @param virtual_network_name [String] The name of the virtual network.
429
+ # @param subnet_name [String] The name of the subnet.
430
+ # @param subnet_parameters [Subnet] Parameters supplied to the create or update
431
+ # subnet operation.
479
432
  # @param [Hash{String => String}] A hash of custom headers that will be added
480
433
  # to the HTTP request.
481
434
  #
482
435
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
483
436
  #
484
- def list_async(resource_group_name, virtual_network_name, custom_headers = nil)
437
+ def begin_create_or_update_async(resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers = nil)
485
438
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
486
439
  fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
440
+ fail ArgumentError, 'subnet_name is nil' if subnet_name.nil?
441
+ fail ArgumentError, 'subnet_parameters is nil' if subnet_parameters.nil?
487
442
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
488
443
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
489
444
 
@@ -493,24 +448,33 @@ module Azure::ARM::Network
493
448
  # Set Headers
494
449
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
450
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
496
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'
451
+
452
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
453
+
454
+ # Serialize Request
455
+ request_mapper = Subnet.mapper()
456
+ request_content = @client.serialize(request_mapper, subnet_parameters, 'subnet_parameters')
457
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
458
+
459
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'
497
460
 
498
461
  request_url = @base_url || @client.base_url
499
462
 
500
463
  options = {
501
464
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
502
- path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subscriptionId' => @client.subscription_id},
465
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
503
466
  query_params: {'api-version' => @client.api_version},
467
+ body: request_content,
504
468
  headers: request_headers.merge(custom_headers || {}),
505
469
  base_url: request_url
506
470
  }
507
- promise = @client.make_request_async(:get, path_template, options)
471
+ promise = @client.make_request_async(:put, path_template, options)
508
472
 
509
473
  promise = promise.then do |result|
510
474
  http_response = result.response
511
475
  status_code = http_response.status
512
476
  response_content = http_response.body
513
- unless status_code == 200
477
+ unless status_code == 200 || status_code == 201
514
478
  error_model = JSON.load(response_content)
515
479
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
516
480
  end
@@ -520,7 +484,17 @@ module Azure::ARM::Network
520
484
  if status_code == 200
521
485
  begin
522
486
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
523
- result_mapper = SubnetListResult.mapper()
487
+ result_mapper = Subnet.mapper()
488
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
489
+ rescue Exception => e
490
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
491
+ end
492
+ end
493
+ # Deserialize Response
494
+ if status_code == 201
495
+ begin
496
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
497
+ result_mapper = Subnet.mapper()
524
498
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
525
499
  rescue Exception => e
526
500
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -534,10 +508,10 @@ module Azure::ARM::Network
534
508
  end
535
509
 
536
510
  #
537
- # The List subnets operation retrieves all the subnets in a virtual network.
511
+ # Gets all subnets in a virtual network.
538
512
  #
539
- # @param next_page_link [String] The NextLink from the previous successful
540
- # call to List operation.
513
+ # @param next_page_link [String] The NextLink from the previous successful call
514
+ # to List operation.
541
515
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
542
516
  # will be added to the HTTP request.
543
517
  #
@@ -549,10 +523,10 @@ module Azure::ARM::Network
549
523
  end
550
524
 
551
525
  #
552
- # The List subnets operation retrieves all the subnets in a virtual network.
526
+ # Gets all subnets in a virtual network.
553
527
  #
554
- # @param next_page_link [String] The NextLink from the previous successful
555
- # call to List operation.
528
+ # @param next_page_link [String] The NextLink from the previous successful call
529
+ # to List operation.
556
530
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
557
531
  # will be added to the HTTP request.
558
532
  #
@@ -563,10 +537,10 @@ module Azure::ARM::Network
563
537
  end
564
538
 
565
539
  #
566
- # The List subnets operation retrieves all the subnets in a virtual network.
540
+ # Gets all subnets in a virtual network.
567
541
  #
568
- # @param next_page_link [String] The NextLink from the previous successful
569
- # call to List operation.
542
+ # @param next_page_link [String] The NextLink from the previous successful call
543
+ # to List operation.
570
544
  # @param [Hash{String => String}] A hash of custom headers that will be added
571
545
  # to the HTTP request.
572
546
  #
@@ -620,5 +594,27 @@ module Azure::ARM::Network
620
594
  promise.execute
621
595
  end
622
596
 
597
+ #
598
+ # Gets all subnets in a virtual network.
599
+ #
600
+ # @param resource_group_name [String] The name of the resource group.
601
+ # @param virtual_network_name [String] The name of the virtual network.
602
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
603
+ # will be added to the HTTP request.
604
+ #
605
+ # @return [SubnetListResult] which provide lazy access to pages of the
606
+ # response.
607
+ #
608
+ def list_as_lazy(resource_group_name, virtual_network_name, custom_headers = nil)
609
+ response = list_async(resource_group_name, virtual_network_name, custom_headers).value!
610
+ unless response.nil?
611
+ page = response.body
612
+ page.next_method = Proc.new do |next_page_link|
613
+ list_next_async(next_page_link, custom_headers)
614
+ end
615
+ page
616
+ end
617
+ end
618
+
623
619
  end
624
620
  end