azure_mgmt_network 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,323 @@
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 LoadBalancerBackendAddressPools
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the LoadBalancerBackendAddressPools 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 balancer backed address pools.
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<BackendAddressPool>] 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 balancer backed address pools.
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 balancer backed address pools.
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}/backendAddressPools'
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::LoadBalancerBackendAddressPoolListResult.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 load balancer backend address pool.
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 backend_address_pool_name [String] The name of the backend address
121
+ # pool.
122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
123
+ # will be added to the HTTP request.
124
+ #
125
+ # @return [BackendAddressPool] operation results.
126
+ #
127
+ def get(resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers = nil)
128
+ response = get_async(resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers).value!
129
+ response.body unless response.nil?
130
+ end
131
+
132
+ #
133
+ # Gets load balancer backend address pool.
134
+ #
135
+ # @param resource_group_name [String] The name of the resource group.
136
+ # @param load_balancer_name [String] The name of the load balancer.
137
+ # @param backend_address_pool_name [String] The name of the backend address
138
+ # pool.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
143
+ #
144
+ def get_with_http_info(resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers = nil)
145
+ get_async(resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers).value!
146
+ end
147
+
148
+ #
149
+ # Gets load balancer backend address pool.
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group.
152
+ # @param load_balancer_name [String] The name of the load balancer.
153
+ # @param backend_address_pool_name [String] The name of the backend address
154
+ # pool.
155
+ # @param [Hash{String => String}] A hash of custom headers that will be added
156
+ # to the HTTP request.
157
+ #
158
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
159
+ #
160
+ def get_async(resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers = nil)
161
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
162
+ fail ArgumentError, 'load_balancer_name is nil' if load_balancer_name.nil?
163
+ fail ArgumentError, 'backend_address_pool_name is nil' if backend_address_pool_name.nil?
164
+ api_version = '2017-08-01'
165
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
166
+
167
+
168
+ request_headers = {}
169
+
170
+ # Set Headers
171
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
172
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
173
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'
174
+
175
+ request_url = @base_url || @client.base_url
176
+
177
+ options = {
178
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
179
+ path_params: {'resourceGroupName' => resource_group_name,'loadBalancerName' => load_balancer_name,'backendAddressPoolName' => backend_address_pool_name,'subscriptionId' => @client.subscription_id},
180
+ query_params: {'api-version' => api_version},
181
+ headers: request_headers.merge(custom_headers || {}),
182
+ base_url: request_url
183
+ }
184
+ promise = @client.make_request_async(:get, path_template, options)
185
+
186
+ promise = promise.then do |result|
187
+ http_response = result.response
188
+ status_code = http_response.status
189
+ response_content = http_response.body
190
+ unless status_code == 200
191
+ error_model = JSON.load(response_content)
192
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
193
+ end
194
+
195
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
196
+ # Deserialize Response
197
+ if status_code == 200
198
+ begin
199
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
200
+ result_mapper = Azure::ARM::Network::Models::BackendAddressPool.mapper()
201
+ result.body = @client.deserialize(result_mapper, parsed_response)
202
+ rescue Exception => e
203
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
204
+ end
205
+ end
206
+
207
+ result
208
+ end
209
+
210
+ promise.execute
211
+ end
212
+
213
+ #
214
+ # Gets all the load balancer backed address pools.
215
+ #
216
+ # @param next_page_link [String] The NextLink from the previous successful call
217
+ # to List operation.
218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
219
+ # will be added to the HTTP request.
220
+ #
221
+ # @return [LoadBalancerBackendAddressPoolListResult] operation results.
222
+ #
223
+ def list_next(next_page_link, custom_headers = nil)
224
+ response = list_next_async(next_page_link, custom_headers).value!
225
+ response.body unless response.nil?
226
+ end
227
+
228
+ #
229
+ # Gets all the load balancer backed address pools.
230
+ #
231
+ # @param next_page_link [String] The NextLink from the previous successful call
232
+ # to List operation.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
237
+ #
238
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
239
+ list_next_async(next_page_link, custom_headers).value!
240
+ end
241
+
242
+ #
243
+ # Gets all the load balancer backed address pools.
244
+ #
245
+ # @param next_page_link [String] The NextLink from the previous successful call
246
+ # to List operation.
247
+ # @param [Hash{String => String}] A hash of custom headers that will be added
248
+ # to the HTTP request.
249
+ #
250
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
251
+ #
252
+ def list_next_async(next_page_link, custom_headers = nil)
253
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
254
+
255
+
256
+ request_headers = {}
257
+
258
+ # Set Headers
259
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
260
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
261
+ path_template = '{nextLink}'
262
+
263
+ request_url = @base_url || @client.base_url
264
+
265
+ options = {
266
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
267
+ skip_encoding_path_params: {'nextLink' => next_page_link},
268
+ headers: request_headers.merge(custom_headers || {}),
269
+ base_url: request_url
270
+ }
271
+ promise = @client.make_request_async(:get, path_template, options)
272
+
273
+ promise = promise.then do |result|
274
+ http_response = result.response
275
+ status_code = http_response.status
276
+ response_content = http_response.body
277
+ unless status_code == 200
278
+ error_model = JSON.load(response_content)
279
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
280
+ end
281
+
282
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
283
+ # Deserialize Response
284
+ if status_code == 200
285
+ begin
286
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
287
+ result_mapper = Azure::ARM::Network::Models::LoadBalancerBackendAddressPoolListResult.mapper()
288
+ result.body = @client.deserialize(result_mapper, parsed_response)
289
+ rescue Exception => e
290
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
291
+ end
292
+ end
293
+
294
+ result
295
+ end
296
+
297
+ promise.execute
298
+ end
299
+
300
+ #
301
+ # Gets all the load balancer backed address pools.
302
+ #
303
+ # @param resource_group_name [String] The name of the resource group.
304
+ # @param load_balancer_name [String] The name of the load balancer.
305
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
306
+ # will be added to the HTTP request.
307
+ #
308
+ # @return [LoadBalancerBackendAddressPoolListResult] which provide lazy access
309
+ # to pages of the response.
310
+ #
311
+ def list_as_lazy(resource_group_name, load_balancer_name, custom_headers = nil)
312
+ response = list_async(resource_group_name, load_balancer_name, custom_headers).value!
313
+ unless response.nil?
314
+ page = response.body
315
+ page.next_method = Proc.new do |next_page_link|
316
+ list_next_async(next_page_link, custom_headers)
317
+ end
318
+ page
319
+ end
320
+ end
321
+
322
+ end
323
+ end
@@ -0,0 +1,323 @@
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 LoadBalancerFrontendIPConfigurations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the LoadBalancerFrontendIPConfigurations 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 balancer frontend IP configurations.
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<FrontendIPConfiguration>] 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 balancer frontend IP configurations.
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 balancer frontend IP configurations.
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}/frontendIPConfigurations'
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::LoadBalancerFrontendIPConfigurationListResult.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 load balancer frontend IP configuration.
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 frontend_ipconfiguration_name [String] The name of the frontend IP
121
+ # configuration.
122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
123
+ # will be added to the HTTP request.
124
+ #
125
+ # @return [FrontendIPConfiguration] operation results.
126
+ #
127
+ def get(resource_group_name, load_balancer_name, frontend_ipconfiguration_name, custom_headers = nil)
128
+ response = get_async(resource_group_name, load_balancer_name, frontend_ipconfiguration_name, custom_headers).value!
129
+ response.body unless response.nil?
130
+ end
131
+
132
+ #
133
+ # Gets load balancer frontend IP configuration.
134
+ #
135
+ # @param resource_group_name [String] The name of the resource group.
136
+ # @param load_balancer_name [String] The name of the load balancer.
137
+ # @param frontend_ipconfiguration_name [String] The name of the frontend IP
138
+ # configuration.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
143
+ #
144
+ def get_with_http_info(resource_group_name, load_balancer_name, frontend_ipconfiguration_name, custom_headers = nil)
145
+ get_async(resource_group_name, load_balancer_name, frontend_ipconfiguration_name, custom_headers).value!
146
+ end
147
+
148
+ #
149
+ # Gets load balancer frontend IP configuration.
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group.
152
+ # @param load_balancer_name [String] The name of the load balancer.
153
+ # @param frontend_ipconfiguration_name [String] The name of the frontend IP
154
+ # configuration.
155
+ # @param [Hash{String => String}] A hash of custom headers that will be added
156
+ # to the HTTP request.
157
+ #
158
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
159
+ #
160
+ def get_async(resource_group_name, load_balancer_name, frontend_ipconfiguration_name, custom_headers = nil)
161
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
162
+ fail ArgumentError, 'load_balancer_name is nil' if load_balancer_name.nil?
163
+ fail ArgumentError, 'frontend_ipconfiguration_name is nil' if frontend_ipconfiguration_name.nil?
164
+ api_version = '2017-08-01'
165
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
166
+
167
+
168
+ request_headers = {}
169
+
170
+ # Set Headers
171
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
172
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
173
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'
174
+
175
+ request_url = @base_url || @client.base_url
176
+
177
+ options = {
178
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
179
+ path_params: {'resourceGroupName' => resource_group_name,'loadBalancerName' => load_balancer_name,'frontendIPConfigurationName' => frontend_ipconfiguration_name,'subscriptionId' => @client.subscription_id},
180
+ query_params: {'api-version' => api_version},
181
+ headers: request_headers.merge(custom_headers || {}),
182
+ base_url: request_url
183
+ }
184
+ promise = @client.make_request_async(:get, path_template, options)
185
+
186
+ promise = promise.then do |result|
187
+ http_response = result.response
188
+ status_code = http_response.status
189
+ response_content = http_response.body
190
+ unless status_code == 200
191
+ error_model = JSON.load(response_content)
192
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
193
+ end
194
+
195
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
196
+ # Deserialize Response
197
+ if status_code == 200
198
+ begin
199
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
200
+ result_mapper = Azure::ARM::Network::Models::FrontendIPConfiguration.mapper()
201
+ result.body = @client.deserialize(result_mapper, parsed_response)
202
+ rescue Exception => e
203
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
204
+ end
205
+ end
206
+
207
+ result
208
+ end
209
+
210
+ promise.execute
211
+ end
212
+
213
+ #
214
+ # Gets all the load balancer frontend IP configurations.
215
+ #
216
+ # @param next_page_link [String] The NextLink from the previous successful call
217
+ # to List operation.
218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
219
+ # will be added to the HTTP request.
220
+ #
221
+ # @return [LoadBalancerFrontendIPConfigurationListResult] operation results.
222
+ #
223
+ def list_next(next_page_link, custom_headers = nil)
224
+ response = list_next_async(next_page_link, custom_headers).value!
225
+ response.body unless response.nil?
226
+ end
227
+
228
+ #
229
+ # Gets all the load balancer frontend IP configurations.
230
+ #
231
+ # @param next_page_link [String] The NextLink from the previous successful call
232
+ # to List operation.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
237
+ #
238
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
239
+ list_next_async(next_page_link, custom_headers).value!
240
+ end
241
+
242
+ #
243
+ # Gets all the load balancer frontend IP configurations.
244
+ #
245
+ # @param next_page_link [String] The NextLink from the previous successful call
246
+ # to List operation.
247
+ # @param [Hash{String => String}] A hash of custom headers that will be added
248
+ # to the HTTP request.
249
+ #
250
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
251
+ #
252
+ def list_next_async(next_page_link, custom_headers = nil)
253
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
254
+
255
+
256
+ request_headers = {}
257
+
258
+ # Set Headers
259
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
260
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
261
+ path_template = '{nextLink}'
262
+
263
+ request_url = @base_url || @client.base_url
264
+
265
+ options = {
266
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
267
+ skip_encoding_path_params: {'nextLink' => next_page_link},
268
+ headers: request_headers.merge(custom_headers || {}),
269
+ base_url: request_url
270
+ }
271
+ promise = @client.make_request_async(:get, path_template, options)
272
+
273
+ promise = promise.then do |result|
274
+ http_response = result.response
275
+ status_code = http_response.status
276
+ response_content = http_response.body
277
+ unless status_code == 200
278
+ error_model = JSON.load(response_content)
279
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
280
+ end
281
+
282
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
283
+ # Deserialize Response
284
+ if status_code == 200
285
+ begin
286
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
287
+ result_mapper = Azure::ARM::Network::Models::LoadBalancerFrontendIPConfigurationListResult.mapper()
288
+ result.body = @client.deserialize(result_mapper, parsed_response)
289
+ rescue Exception => e
290
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
291
+ end
292
+ end
293
+
294
+ result
295
+ end
296
+
297
+ promise.execute
298
+ end
299
+
300
+ #
301
+ # Gets all the load balancer frontend IP configurations.
302
+ #
303
+ # @param resource_group_name [String] The name of the resource group.
304
+ # @param load_balancer_name [String] The name of the load balancer.
305
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
306
+ # will be added to the HTTP request.
307
+ #
308
+ # @return [LoadBalancerFrontendIPConfigurationListResult] which provide lazy
309
+ # access to pages of the response.
310
+ #
311
+ def list_as_lazy(resource_group_name, load_balancer_name, custom_headers = nil)
312
+ response = list_async(resource_group_name, load_balancer_name, custom_headers).value!
313
+ unless response.nil?
314
+ page = response.body
315
+ page.next_method = Proc.new do |next_page_link|
316
+ list_next_async(next_page_link, custom_headers)
317
+ end
318
+ page
319
+ end
320
+ end
321
+
322
+ end
323
+ end