azure_mgmt_network 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_network.rb +91 -67
  3. data/lib/generated/azure_mgmt_network/application_gateways.rb +12 -12
  4. data/lib/generated/azure_mgmt_network/{available_private_access_services.rb → available_endpoint_services.rb} +21 -25
  5. data/lib/generated/azure_mgmt_network/bgp_service_communities.rb +1 -1
  6. data/lib/generated/azure_mgmt_network/default_security_rules.rb +330 -0
  7. data/lib/generated/azure_mgmt_network/express_route_circuit_authorizations.rb +4 -4
  8. data/lib/generated/azure_mgmt_network/express_route_circuit_peerings.rb +4 -4
  9. data/lib/generated/azure_mgmt_network/express_route_circuits.rb +10 -10
  10. data/lib/generated/azure_mgmt_network/express_route_service_providers.rb +1 -1
  11. data/lib/generated/azure_mgmt_network/inbound_nat_rules.rb +616 -0
  12. data/lib/generated/azure_mgmt_network/load_balancer_backend_address_pools.rb +323 -0
  13. data/lib/generated/azure_mgmt_network/load_balancer_frontend_ipconfigurations.rb +323 -0
  14. data/lib/generated/azure_mgmt_network/load_balancer_load_balancing_rules.rb +320 -0
  15. data/lib/generated/azure_mgmt_network/load_balancer_network_interfaces.rb +225 -0
  16. data/lib/generated/azure_mgmt_network/load_balancer_probes.rb +320 -0
  17. data/lib/generated/azure_mgmt_network/load_balancers.rb +5 -5
  18. data/lib/generated/azure_mgmt_network/local_network_gateways.rb +4 -4
  19. data/lib/generated/azure_mgmt_network/models/effective_network_security_group.rb +2 -1
  20. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_list_result.rb +1 -0
  21. data/lib/generated/azure_mgmt_network/models/effective_network_security_rule.rb +3 -3
  22. data/lib/generated/azure_mgmt_network/models/effective_route_list_result.rb +1 -0
  23. data/lib/generated/azure_mgmt_network/models/effective_security_rule_protocol.rb +17 -0
  24. data/lib/generated/azure_mgmt_network/models/{private_access_service_result.rb → endpoint_service_result.rb} +7 -7
  25. data/lib/generated/azure_mgmt_network/models/{private_access_services_list_result.rb → endpoint_services_list_result.rb} +11 -11
  26. data/lib/generated/azure_mgmt_network/models/inbound_nat_rule.rb +1 -1
  27. data/lib/generated/azure_mgmt_network/models/inbound_nat_rule_list_result.rb +96 -0
  28. data/lib/generated/azure_mgmt_network/models/ipconfiguration.rb +1 -1
  29. data/lib/generated/azure_mgmt_network/models/load_balancer.rb +11 -0
  30. data/lib/generated/azure_mgmt_network/models/load_balancer_backend_address_pool_list_result.rb +97 -0
  31. data/lib/generated/azure_mgmt_network/models/load_balancer_frontend_ipconfiguration_list_result.rb +98 -0
  32. data/lib/generated/azure_mgmt_network/models/load_balancer_list_result.rb +1 -0
  33. data/lib/generated/azure_mgmt_network/models/load_balancer_load_balancing_rule_list_result.rb +97 -0
  34. data/lib/generated/azure_mgmt_network/models/load_balancer_probe_list_result.rb +95 -0
  35. data/lib/generated/azure_mgmt_network/models/load_balancer_sku.rb +46 -0
  36. data/lib/generated/azure_mgmt_network/models/load_balancer_sku_name.rb +16 -0
  37. data/lib/generated/azure_mgmt_network/models/load_balancing_rule.rb +13 -1
  38. data/lib/generated/azure_mgmt_network/models/local_network_gateway_list_result.rb +1 -0
  39. data/lib/generated/azure_mgmt_network/models/network_interface_ipconfiguration.rb +7 -4
  40. data/lib/generated/azure_mgmt_network/models/network_interface_ipconfiguration_list_result.rb +98 -0
  41. data/lib/generated/azure_mgmt_network/models/network_interface_list_result.rb +1 -0
  42. data/lib/generated/azure_mgmt_network/models/network_interface_load_balancer_list_result.rb +96 -0
  43. data/lib/generated/azure_mgmt_network/models/public_ipaddress.rb +15 -2
  44. data/lib/generated/azure_mgmt_network/models/public_ipaddress_sku.rb +46 -0
  45. data/lib/generated/azure_mgmt_network/models/public_ipaddress_sku_name.rb +16 -0
  46. data/lib/generated/azure_mgmt_network/models/security_rule.rb +35 -1
  47. data/lib/generated/azure_mgmt_network/models/{private_access_service_properties_format.rb → service_endpoint_properties_format.rb} +6 -6
  48. data/lib/generated/azure_mgmt_network/models/subnet.rb +7 -7
  49. data/lib/generated/azure_mgmt_network/models/usage.rb +11 -0
  50. data/lib/generated/azure_mgmt_network/models/virtual_network_connection_gateway_reference.rb +46 -0
  51. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway.rb +0 -22
  52. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection.rb +6 -3
  53. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_list_entity.rb +300 -0
  54. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +1 -0
  55. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_list_connections_result.rb +100 -0
  56. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +1 -0
  57. data/lib/generated/azure_mgmt_network/models/vpn_client_configuration.rb +22 -0
  58. data/lib/generated/azure_mgmt_network/network_interface_ipconfigurations.rb +320 -0
  59. data/lib/generated/azure_mgmt_network/network_interface_load_balancers.rb +225 -0
  60. data/lib/generated/azure_mgmt_network/network_interfaces.rb +7 -7
  61. data/lib/generated/azure_mgmt_network/network_management_client.rb +55 -12
  62. data/lib/generated/azure_mgmt_network/network_security_groups.rb +5 -5
  63. data/lib/generated/azure_mgmt_network/network_watchers.rb +14 -14
  64. data/lib/generated/azure_mgmt_network/packet_captures.rb +6 -6
  65. data/lib/generated/azure_mgmt_network/public_ipaddresses.rb +5 -5
  66. data/lib/generated/azure_mgmt_network/route_filter_rules.rb +5 -5
  67. data/lib/generated/azure_mgmt_network/route_filters.rb +6 -6
  68. data/lib/generated/azure_mgmt_network/route_tables.rb +5 -5
  69. data/lib/generated/azure_mgmt_network/routes.rb +4 -4
  70. data/lib/generated/azure_mgmt_network/security_rules.rb +4 -4
  71. data/lib/generated/azure_mgmt_network/subnets.rb +4 -4
  72. data/lib/generated/azure_mgmt_network/usages.rb +8 -8
  73. data/lib/generated/azure_mgmt_network/version.rb +1 -1
  74. data/lib/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +7 -7
  75. data/lib/generated/azure_mgmt_network/virtual_network_gateways.rb +373 -11
  76. data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +4 -4
  77. data/lib/generated/azure_mgmt_network/virtual_networks.rb +7 -7
  78. metadata +32 -8
@@ -0,0 +1,320 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Network
7
+ #
8
+ # Network Client
9
+ #
10
+ class LoadBalancerLoadBalancingRules
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the LoadBalancerLoadBalancingRules class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [NetworkManagementClient] reference to the NetworkManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all the load balancing rules in a load balancer.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param load_balancer_name [String] The name of the load balancer.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<LoadBalancingRule>] operation results.
33
+ #
34
+ def list(resource_group_name, load_balancer_name, custom_headers = nil)
35
+ first_page = list_as_lazy(resource_group_name, load_balancer_name, custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Gets all the load balancing rules in a load balancer.
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group.
43
+ # @param load_balancer_name [String] The name of the load balancer.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(resource_group_name, load_balancer_name, custom_headers = nil)
50
+ list_async(resource_group_name, load_balancer_name, custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets all the load balancing rules in a load balancer.
55
+ #
56
+ # @param resource_group_name [String] The name of the resource group.
57
+ # @param load_balancer_name [String] The name of the load balancer.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(resource_group_name, load_balancer_name, custom_headers = nil)
64
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
65
+ fail ArgumentError, 'load_balancer_name is nil' if load_balancer_name.nil?
66
+ api_version = '2017-08-01'
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+
69
+
70
+ request_headers = {}
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'resourceGroupName' => resource_group_name,'loadBalancerName' => load_balancer_name,'subscriptionId' => @client.subscription_id},
82
+ query_params: {'api-version' => api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ # Deserialize Response
99
+ if status_code == 200
100
+ begin
101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
102
+ result_mapper = Azure::ARM::Network::Models::LoadBalancerLoadBalancingRuleListResult.mapper()
103
+ result.body = @client.deserialize(result_mapper, parsed_response)
104
+ rescue Exception => e
105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
+ end
107
+ end
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ #
116
+ # Gets the specified load balancer load balancing rule.
117
+ #
118
+ # @param resource_group_name [String] The name of the resource group.
119
+ # @param load_balancer_name [String] The name of the load balancer.
120
+ # @param load_balancing_rule_name [String] The name of the load balancing rule.
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ # @return [LoadBalancingRule] operation results.
125
+ #
126
+ def get(resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers = nil)
127
+ response = get_async(resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers).value!
128
+ response.body unless response.nil?
129
+ end
130
+
131
+ #
132
+ # Gets the specified load balancer load balancing rule.
133
+ #
134
+ # @param resource_group_name [String] The name of the resource group.
135
+ # @param load_balancer_name [String] The name of the load balancer.
136
+ # @param load_balancing_rule_name [String] The name of the load balancing rule.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
141
+ #
142
+ def get_with_http_info(resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers = nil)
143
+ get_async(resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers).value!
144
+ end
145
+
146
+ #
147
+ # Gets the specified load balancer load balancing rule.
148
+ #
149
+ # @param resource_group_name [String] The name of the resource group.
150
+ # @param load_balancer_name [String] The name of the load balancer.
151
+ # @param load_balancing_rule_name [String] The name of the load balancing rule.
152
+ # @param [Hash{String => String}] A hash of custom headers that will be added
153
+ # to the HTTP request.
154
+ #
155
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
156
+ #
157
+ def get_async(resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers = nil)
158
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
159
+ fail ArgumentError, 'load_balancer_name is nil' if load_balancer_name.nil?
160
+ fail ArgumentError, 'load_balancing_rule_name is nil' if load_balancing_rule_name.nil?
161
+ api_version = '2017-08-01'
162
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
163
+
164
+
165
+ request_headers = {}
166
+
167
+ # Set Headers
168
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
169
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
170
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'
171
+
172
+ request_url = @base_url || @client.base_url
173
+
174
+ options = {
175
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
176
+ path_params: {'resourceGroupName' => resource_group_name,'loadBalancerName' => load_balancer_name,'loadBalancingRuleName' => load_balancing_rule_name,'subscriptionId' => @client.subscription_id},
177
+ query_params: {'api-version' => api_version},
178
+ headers: request_headers.merge(custom_headers || {}),
179
+ base_url: request_url
180
+ }
181
+ promise = @client.make_request_async(:get, path_template, options)
182
+
183
+ promise = promise.then do |result|
184
+ http_response = result.response
185
+ status_code = http_response.status
186
+ response_content = http_response.body
187
+ unless status_code == 200
188
+ error_model = JSON.load(response_content)
189
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
190
+ end
191
+
192
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
193
+ # Deserialize Response
194
+ if status_code == 200
195
+ begin
196
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
197
+ result_mapper = Azure::ARM::Network::Models::LoadBalancingRule.mapper()
198
+ result.body = @client.deserialize(result_mapper, parsed_response)
199
+ rescue Exception => e
200
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
201
+ end
202
+ end
203
+
204
+ result
205
+ end
206
+
207
+ promise.execute
208
+ end
209
+
210
+ #
211
+ # Gets all the load balancing rules in a load balancer.
212
+ #
213
+ # @param next_page_link [String] The NextLink from the previous successful call
214
+ # to List operation.
215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
+ # will be added to the HTTP request.
217
+ #
218
+ # @return [LoadBalancerLoadBalancingRuleListResult] operation results.
219
+ #
220
+ def list_next(next_page_link, custom_headers = nil)
221
+ response = list_next_async(next_page_link, custom_headers).value!
222
+ response.body unless response.nil?
223
+ end
224
+
225
+ #
226
+ # Gets all the load balancing rules in a load balancer.
227
+ #
228
+ # @param next_page_link [String] The NextLink from the previous successful call
229
+ # to List operation.
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
234
+ #
235
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
236
+ list_next_async(next_page_link, custom_headers).value!
237
+ end
238
+
239
+ #
240
+ # Gets all the load balancing rules in a load balancer.
241
+ #
242
+ # @param next_page_link [String] The NextLink from the previous successful call
243
+ # to List operation.
244
+ # @param [Hash{String => String}] A hash of custom headers that will be added
245
+ # to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
248
+ #
249
+ def list_next_async(next_page_link, custom_headers = nil)
250
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
251
+
252
+
253
+ request_headers = {}
254
+
255
+ # Set Headers
256
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
257
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
258
+ path_template = '{nextLink}'
259
+
260
+ request_url = @base_url || @client.base_url
261
+
262
+ options = {
263
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
264
+ skip_encoding_path_params: {'nextLink' => next_page_link},
265
+ headers: request_headers.merge(custom_headers || {}),
266
+ base_url: request_url
267
+ }
268
+ promise = @client.make_request_async(:get, path_template, options)
269
+
270
+ promise = promise.then do |result|
271
+ http_response = result.response
272
+ status_code = http_response.status
273
+ response_content = http_response.body
274
+ unless status_code == 200
275
+ error_model = JSON.load(response_content)
276
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
277
+ end
278
+
279
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
280
+ # Deserialize Response
281
+ if status_code == 200
282
+ begin
283
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
284
+ result_mapper = Azure::ARM::Network::Models::LoadBalancerLoadBalancingRuleListResult.mapper()
285
+ result.body = @client.deserialize(result_mapper, parsed_response)
286
+ rescue Exception => e
287
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
288
+ end
289
+ end
290
+
291
+ result
292
+ end
293
+
294
+ promise.execute
295
+ end
296
+
297
+ #
298
+ # Gets all the load balancing rules in a load balancer.
299
+ #
300
+ # @param resource_group_name [String] The name of the resource group.
301
+ # @param load_balancer_name [String] The name of the load balancer.
302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
303
+ # will be added to the HTTP request.
304
+ #
305
+ # @return [LoadBalancerLoadBalancingRuleListResult] which provide lazy access
306
+ # to pages of the response.
307
+ #
308
+ def list_as_lazy(resource_group_name, load_balancer_name, custom_headers = nil)
309
+ response = list_async(resource_group_name, load_balancer_name, custom_headers).value!
310
+ unless response.nil?
311
+ page = response.body
312
+ page.next_method = Proc.new do |next_page_link|
313
+ list_next_async(next_page_link, custom_headers)
314
+ end
315
+ page
316
+ end
317
+ end
318
+
319
+ end
320
+ end
@@ -0,0 +1,225 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Network
7
+ #
8
+ # Network Client
9
+ #
10
+ class LoadBalancerNetworkInterfaces
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the LoadBalancerNetworkInterfaces class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [NetworkManagementClient] reference to the NetworkManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets associated load balancer network interfaces.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param load_balancer_name [String] The name of the load balancer.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<NetworkInterface>] operation results.
33
+ #
34
+ def list(resource_group_name, load_balancer_name, custom_headers = nil)
35
+ first_page = list_as_lazy(resource_group_name, load_balancer_name, custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Gets associated load balancer network interfaces.
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group.
43
+ # @param load_balancer_name [String] The name of the load balancer.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(resource_group_name, load_balancer_name, custom_headers = nil)
50
+ list_async(resource_group_name, load_balancer_name, custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets associated load balancer network interfaces.
55
+ #
56
+ # @param resource_group_name [String] The name of the resource group.
57
+ # @param load_balancer_name [String] The name of the load balancer.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(resource_group_name, load_balancer_name, custom_headers = nil)
64
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
65
+ fail ArgumentError, 'load_balancer_name is nil' if load_balancer_name.nil?
66
+ api_version = '2017-08-01'
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+
69
+
70
+ request_headers = {}
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'resourceGroupName' => resource_group_name,'loadBalancerName' => load_balancer_name,'subscriptionId' => @client.subscription_id},
82
+ query_params: {'api-version' => api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ # Deserialize Response
99
+ if status_code == 200
100
+ begin
101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
102
+ result_mapper = Azure::ARM::Network::Models::NetworkInterfaceListResult.mapper()
103
+ result.body = @client.deserialize(result_mapper, parsed_response)
104
+ rescue Exception => e
105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
+ end
107
+ end
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ #
116
+ # Gets associated load balancer network interfaces.
117
+ #
118
+ # @param next_page_link [String] The NextLink from the previous successful call
119
+ # to List operation.
120
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
121
+ # will be added to the HTTP request.
122
+ #
123
+ # @return [NetworkInterfaceListResult] operation results.
124
+ #
125
+ def list_next(next_page_link, custom_headers = nil)
126
+ response = list_next_async(next_page_link, custom_headers).value!
127
+ response.body unless response.nil?
128
+ end
129
+
130
+ #
131
+ # Gets associated load balancer network interfaces.
132
+ #
133
+ # @param next_page_link [String] The NextLink from the previous successful call
134
+ # to List operation.
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
139
+ #
140
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
141
+ list_next_async(next_page_link, custom_headers).value!
142
+ end
143
+
144
+ #
145
+ # Gets associated load balancer network interfaces.
146
+ #
147
+ # @param next_page_link [String] The NextLink from the previous successful call
148
+ # to List operation.
149
+ # @param [Hash{String => String}] A hash of custom headers that will be added
150
+ # to the HTTP request.
151
+ #
152
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
153
+ #
154
+ def list_next_async(next_page_link, custom_headers = nil)
155
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
156
+
157
+
158
+ request_headers = {}
159
+
160
+ # Set Headers
161
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
162
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
163
+ path_template = '{nextLink}'
164
+
165
+ request_url = @base_url || @client.base_url
166
+
167
+ options = {
168
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
169
+ skip_encoding_path_params: {'nextLink' => next_page_link},
170
+ headers: request_headers.merge(custom_headers || {}),
171
+ base_url: request_url
172
+ }
173
+ promise = @client.make_request_async(:get, path_template, options)
174
+
175
+ promise = promise.then do |result|
176
+ http_response = result.response
177
+ status_code = http_response.status
178
+ response_content = http_response.body
179
+ unless status_code == 200
180
+ error_model = JSON.load(response_content)
181
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
182
+ end
183
+
184
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
185
+ # Deserialize Response
186
+ if status_code == 200
187
+ begin
188
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
189
+ result_mapper = Azure::ARM::Network::Models::NetworkInterfaceListResult.mapper()
190
+ result.body = @client.deserialize(result_mapper, parsed_response)
191
+ rescue Exception => e
192
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
193
+ end
194
+ end
195
+
196
+ result
197
+ end
198
+
199
+ promise.execute
200
+ end
201
+
202
+ #
203
+ # Gets associated load balancer network interfaces.
204
+ #
205
+ # @param resource_group_name [String] The name of the resource group.
206
+ # @param load_balancer_name [String] The name of the load balancer.
207
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
208
+ # will be added to the HTTP request.
209
+ #
210
+ # @return [NetworkInterfaceListResult] which provide lazy access to pages of
211
+ # the response.
212
+ #
213
+ def list_as_lazy(resource_group_name, load_balancer_name, custom_headers = nil)
214
+ response = list_async(resource_group_name, load_balancer_name, custom_headers).value!
215
+ unless response.nil?
216
+ page = response.body
217
+ page.next_method = Proc.new do |next_page_link|
218
+ list_next_async(next_page_link, custom_headers)
219
+ end
220
+ page
221
+ end
222
+ end
223
+
224
+ end
225
+ end