azure_mgmt_network 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/azure_mgmt_network.gemspec +4 -9
  3. data/lib/azure_mgmt_network.rb +100 -39
  4. data/lib/azure_mgmt_network/application_gateways.rb +175 -401
  5. data/lib/azure_mgmt_network/express_route_circuit_authorizations.rb +429 -0
  6. data/lib/azure_mgmt_network/express_route_circuit_peerings.rb +427 -0
  7. data/lib/azure_mgmt_network/express_route_circuits.rb +911 -0
  8. data/lib/azure_mgmt_network/express_route_service_providers.rb +149 -0
  9. data/lib/azure_mgmt_network/load_balancers.rb +139 -314
  10. data/lib/azure_mgmt_network/local_network_gateways.rb +102 -228
  11. data/lib/azure_mgmt_network/models/address_space.rb +1 -3
  12. data/lib/azure_mgmt_network/models/application_gateway.rb +7 -9
  13. data/lib/azure_mgmt_network/models/application_gateway_backend_address.rb +1 -3
  14. data/lib/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +1 -3
  15. data/lib/azure_mgmt_network/models/application_gateway_backend_address_pool_properties_format.rb +16 -18
  16. data/lib/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +1 -3
  17. data/lib/azure_mgmt_network/models/application_gateway_backend_http_settings_properties_format.rb +32 -8
  18. data/lib/azure_mgmt_network/models/application_gateway_cookie_based_affinity.rb +1 -1
  19. data/lib/azure_mgmt_network/models/{application_gateway_frontend_ip_configuration.rb → application_gateway_frontend_ipconfiguration.rb} +7 -9
  20. data/lib/azure_mgmt_network/models/{application_gateway_frontend_ip_configuration_properties_format.rb → application_gateway_frontend_ipconfiguration_properties_format.rb} +12 -15
  21. data/lib/azure_mgmt_network/models/application_gateway_frontend_port.rb +1 -3
  22. data/lib/azure_mgmt_network/models/application_gateway_frontend_port_properties_format.rb +1 -3
  23. data/lib/azure_mgmt_network/models/application_gateway_http_listener.rb +1 -3
  24. data/lib/azure_mgmt_network/models/application_gateway_http_listener_properties_format.rb +34 -17
  25. data/lib/azure_mgmt_network/models/{application_gateway_ip_configuration.rb → application_gateway_ipconfiguration.rb} +7 -9
  26. data/lib/azure_mgmt_network/models/{application_gateway_ip_configuration_properties_format.rb → application_gateway_ipconfiguration_properties_format.rb} +6 -8
  27. data/lib/azure_mgmt_network/models/application_gateway_list_result.rb +4 -6
  28. data/lib/azure_mgmt_network/models/application_gateway_operational_state.rb +1 -1
  29. data/lib/azure_mgmt_network/models/application_gateway_path_rule.rb +88 -0
  30. data/lib/azure_mgmt_network/models/application_gateway_path_rule_properties_format.rb +101 -0
  31. data/lib/azure_mgmt_network/models/application_gateway_probe.rb +88 -0
  32. data/lib/azure_mgmt_network/models/application_gateway_probe_properties_format.rb +118 -0
  33. data/lib/azure_mgmt_network/models/application_gateway_properties_format.rb +151 -81
  34. data/lib/azure_mgmt_network/models/application_gateway_protocol.rb +1 -1
  35. data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +1 -3
  36. data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule_properties_format.rb +26 -11
  37. data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule_type.rb +2 -1
  38. data/lib/azure_mgmt_network/models/application_gateway_sku.rb +6 -8
  39. data/lib/azure_mgmt_network/models/application_gateway_sku_name.rb +1 -1
  40. data/lib/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +1 -3
  41. data/lib/azure_mgmt_network/models/application_gateway_ssl_certificate_properties_format.rb +1 -3
  42. data/lib/azure_mgmt_network/models/application_gateway_tier.rb +1 -1
  43. data/lib/azure_mgmt_network/models/application_gateway_url_path_map.rb +88 -0
  44. data/lib/azure_mgmt_network/models/application_gateway_url_path_map_properties_format.rb +122 -0
  45. data/lib/azure_mgmt_network/models/authorization_list_result.rb +87 -0
  46. data/lib/azure_mgmt_network/models/authorization_properties_format.rb +79 -0
  47. data/lib/azure_mgmt_network/models/authorization_use_status.rb +16 -0
  48. data/lib/azure_mgmt_network/models/azure_async_operation_result.rb +5 -7
  49. data/lib/azure_mgmt_network/models/backend_address_pool.rb +1 -3
  50. data/lib/azure_mgmt_network/models/backend_address_pool_properties_format.rb +30 -15
  51. data/lib/azure_mgmt_network/models/connection_reset_shared_key.rb +10 -16
  52. data/lib/azure_mgmt_network/models/connection_shared_key.rb +1 -3
  53. data/lib/azure_mgmt_network/models/{connection_reset_shared_key_properties_format.rb → connection_shared_key_result.rb} +11 -15
  54. data/lib/azure_mgmt_network/models/dhcp_options.rb +1 -3
  55. data/lib/azure_mgmt_network/models/dns_name_availability_result.rb +1 -3
  56. data/lib/azure_mgmt_network/models/error.rb +4 -6
  57. data/lib/azure_mgmt_network/models/error_details.rb +1 -3
  58. data/lib/azure_mgmt_network/models/express_route_circuit.rb +118 -0
  59. data/lib/azure_mgmt_network/models/express_route_circuit_arp_table.rb +65 -0
  60. data/lib/azure_mgmt_network/models/express_route_circuit_authorization.rb +88 -0
  61. data/lib/azure_mgmt_network/models/express_route_circuit_list_result.rb +86 -0
  62. data/lib/azure_mgmt_network/models/express_route_circuit_peering.rb +88 -0
  63. data/lib/azure_mgmt_network/models/express_route_circuit_peering_advertised_public_prefix_state.rb +18 -0
  64. data/lib/azure_mgmt_network/models/express_route_circuit_peering_config.rb +92 -0
  65. data/lib/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +87 -0
  66. data/lib/azure_mgmt_network/models/express_route_circuit_peering_properties_format.rb +194 -0
  67. data/lib/azure_mgmt_network/models/express_route_circuit_peering_state.rb +16 -0
  68. data/lib/azure_mgmt_network/models/express_route_circuit_peering_type.rb +17 -0
  69. data/lib/azure_mgmt_network/models/express_route_circuit_properties_format.rb +179 -0
  70. data/lib/azure_mgmt_network/models/express_route_circuit_routes_table.rb +89 -0
  71. data/lib/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +76 -0
  72. data/lib/azure_mgmt_network/models/express_route_circuit_sku.rb +83 -0
  73. data/lib/azure_mgmt_network/models/express_route_circuit_sku_family.rb +16 -0
  74. data/lib/azure_mgmt_network/models/express_route_circuit_sku_tier.rb +16 -0
  75. data/lib/azure_mgmt_network/models/express_route_circuit_stats.rb +67 -0
  76. data/lib/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +85 -0
  77. data/lib/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +88 -0
  78. data/lib/azure_mgmt_network/models/express_route_circuits_stats_list_result.rb +85 -0
  79. data/lib/azure_mgmt_network/models/express_route_service_provider.rb +92 -0
  80. data/lib/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +67 -0
  81. data/lib/azure_mgmt_network/models/express_route_service_provider_list_result.rb +86 -0
  82. data/lib/azure_mgmt_network/models/express_route_service_provider_properties_format.rb +97 -0
  83. data/lib/azure_mgmt_network/models/{frontend_ip_configuration.rb → frontend_ipconfiguration.rb} +7 -9
  84. data/lib/azure_mgmt_network/models/{frontend_ip_configuration_properties_format.rb → frontend_ipconfiguration_properties_format.rb} +133 -77
  85. data/lib/azure_mgmt_network/models/inbound_nat_pool.rb +88 -0
  86. data/lib/azure_mgmt_network/models/inbound_nat_pool_properties_format.rb +134 -0
  87. data/lib/azure_mgmt_network/models/inbound_nat_rule.rb +1 -3
  88. data/lib/azure_mgmt_network/models/inbound_nat_rule_properties_format.rb +11 -12
  89. data/lib/azure_mgmt_network/models/{ip_allocation_method.rb → ipallocation_method.rb} +3 -3
  90. data/lib/azure_mgmt_network/models/ipconfiguration.rb +88 -0
  91. data/lib/azure_mgmt_network/models/ipconfiguration_properties_format.rb +113 -0
  92. data/lib/azure_mgmt_network/models/load_balancer.rb +7 -9
  93. data/lib/azure_mgmt_network/models/load_balancer_list_result.rb +4 -6
  94. data/lib/azure_mgmt_network/models/load_balancer_properties_format.rb +103 -35
  95. data/lib/azure_mgmt_network/models/load_balancing_rule.rb +1 -3
  96. data/lib/azure_mgmt_network/models/load_balancing_rule_properties_format.rb +30 -30
  97. data/lib/azure_mgmt_network/models/load_distribution.rb +1 -1
  98. data/lib/azure_mgmt_network/models/local_network_gateway.rb +7 -9
  99. data/lib/azure_mgmt_network/models/local_network_gateway_list_result.rb +4 -6
  100. data/lib/azure_mgmt_network/models/local_network_gateway_properties_format.rb +11 -3
  101. data/lib/azure_mgmt_network/models/network_interface.rb +7 -9
  102. data/lib/azure_mgmt_network/models/network_interface_dns_settings.rb +1 -3
  103. data/lib/azure_mgmt_network/models/{network_interface_ip_configuration.rb → network_interface_ipconfiguration.rb} +7 -9
  104. data/lib/azure_mgmt_network/models/{network_interface_ip_configuration_properties_format.rb → network_interface_ipconfiguration_properties_format.rb} +70 -76
  105. data/lib/azure_mgmt_network/models/network_interface_list_result.rb +4 -6
  106. data/lib/azure_mgmt_network/models/network_interface_properties_format.rb +32 -14
  107. data/lib/azure_mgmt_network/models/{operation_status.rb → network_operation_status.rb} +3 -3
  108. data/lib/azure_mgmt_network/models/network_security_group.rb +7 -9
  109. data/lib/azure_mgmt_network/models/network_security_group_list_result.rb +4 -6
  110. data/lib/azure_mgmt_network/models/network_security_group_properties_format.rb +30 -22
  111. data/lib/azure_mgmt_network/models/outbound_nat_rule.rb +88 -0
  112. data/lib/azure_mgmt_network/models/outbound_nat_rule_properties_format.rb +117 -0
  113. data/lib/azure_mgmt_network/models/probe.rb +1 -3
  114. data/lib/azure_mgmt_network/models/probe_properties_format.rb +25 -26
  115. data/lib/azure_mgmt_network/models/probe_protocol.rb +1 -1
  116. data/lib/azure_mgmt_network/models/processor_architecture.rb +16 -0
  117. data/lib/azure_mgmt_network/models/{public_ip_address.rb → public_ipaddress.rb} +13 -15
  118. data/lib/azure_mgmt_network/models/{public_ip_address_dns_settings.rb → public_ipaddress_dns_settings.rb} +4 -6
  119. data/lib/azure_mgmt_network/models/{public_ip_address_list_result.rb → public_ipaddress_list_result.rb} +10 -12
  120. data/lib/azure_mgmt_network/models/{public_ip_address_properties_format.rb → public_ipaddress_properties_format.rb} +25 -19
  121. data/lib/azure_mgmt_network/models/route.rb +88 -0
  122. data/lib/azure_mgmt_network/models/route_list_result.rb +85 -0
  123. data/lib/azure_mgmt_network/models/route_next_hop_type.rb +19 -0
  124. data/lib/azure_mgmt_network/models/route_properties_format.rb +94 -0
  125. data/lib/azure_mgmt_network/models/route_table.rb +102 -0
  126. data/lib/azure_mgmt_network/models/route_table_list_result.rb +86 -0
  127. data/lib/azure_mgmt_network/models/route_table_properties_format.rb +116 -0
  128. data/lib/azure_mgmt_network/models/security_rule.rb +1 -3
  129. data/lib/azure_mgmt_network/models/security_rule_access.rb +1 -1
  130. data/lib/azure_mgmt_network/models/security_rule_direction.rb +1 -1
  131. data/lib/azure_mgmt_network/models/security_rule_list_result.rb +4 -6
  132. data/lib/azure_mgmt_network/models/security_rule_properties_format.rb +50 -48
  133. data/lib/azure_mgmt_network/models/security_rule_protocol.rb +1 -1
  134. data/lib/azure_mgmt_network/models/service_provider_provisioning_state.rb +18 -0
  135. data/lib/azure_mgmt_network/models/subnet.rb +1 -3
  136. data/lib/azure_mgmt_network/models/subnet_list_result.rb +4 -6
  137. data/lib/azure_mgmt_network/models/subnet_properties_format.rb +28 -13
  138. data/lib/azure_mgmt_network/models/transport_protocol.rb +1 -1
  139. data/lib/azure_mgmt_network/models/usage.rb +7 -5
  140. data/lib/azure_mgmt_network/models/usage_name.rb +1 -3
  141. data/lib/azure_mgmt_network/models/usage_unit.rb +1 -1
  142. data/lib/azure_mgmt_network/models/usages_list_result.rb +4 -6
  143. data/lib/azure_mgmt_network/models/virtual_network.rb +7 -9
  144. data/lib/azure_mgmt_network/models/virtual_network_gateway.rb +7 -9
  145. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection.rb +7 -9
  146. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +4 -6
  147. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_properties_format.rb +74 -6
  148. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_status.rb +18 -0
  149. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_type.rb +1 -1
  150. data/lib/azure_mgmt_network/models/{virtual_network_gateway_ip_configuration.rb → virtual_network_gateway_ipconfiguration.rb} +7 -9
  151. data/lib/azure_mgmt_network/models/{virtual_network_gateway_ip_configuration_properties_format.rb → virtual_network_gateway_ipconfiguration_properties_format.rb} +14 -17
  152. data/lib/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +4 -6
  153. data/lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb +76 -13
  154. data/lib/azure_mgmt_network/models/virtual_network_gateway_sku.rb +86 -0
  155. data/lib/azure_mgmt_network/models/virtual_network_gateway_sku_name.rb +17 -0
  156. data/lib/azure_mgmt_network/models/virtual_network_gateway_sku_tier.rb +17 -0
  157. data/lib/azure_mgmt_network/models/virtual_network_gateway_type.rb +2 -1
  158. data/lib/azure_mgmt_network/models/virtual_network_list_result.rb +4 -6
  159. data/lib/azure_mgmt_network/models/virtual_network_properties_format.rb +14 -6
  160. data/lib/azure_mgmt_network/models/vpn_client_configuration.rb +125 -0
  161. data/lib/azure_mgmt_network/models/vpn_client_parameters.rb +60 -0
  162. data/lib/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +88 -0
  163. data/lib/azure_mgmt_network/models/vpn_client_revoked_certificate_properties_format.rb +69 -0
  164. data/lib/azure_mgmt_network/models/vpn_client_root_certificate.rb +88 -0
  165. data/lib/azure_mgmt_network/models/vpn_client_root_certificate_properties_format.rb +66 -0
  166. data/lib/azure_mgmt_network/models/vpn_type.rb +1 -1
  167. data/lib/azure_mgmt_network/module_definition.rb +5 -3
  168. data/lib/azure_mgmt_network/network_interfaces.rb +451 -304
  169. data/lib/azure_mgmt_network/{network_resource_provider_client.rb → network_management_client.rb} +61 -57
  170. data/lib/azure_mgmt_network/network_security_groups.rb +139 -314
  171. data/lib/azure_mgmt_network/public_ipaddresses.rb +536 -0
  172. data/lib/azure_mgmt_network/route_tables.rb +532 -0
  173. data/lib/azure_mgmt_network/routes.rb +423 -0
  174. data/lib/azure_mgmt_network/security_rules.rb +102 -232
  175. data/lib/azure_mgmt_network/subnets.rb +104 -233
  176. data/lib/azure_mgmt_network/usages.rb +79 -43
  177. data/lib/azure_mgmt_network/version.rb +5 -3
  178. data/lib/azure_mgmt_network/virtual_network_gateway_connections.rb +262 -467
  179. data/lib/azure_mgmt_network/virtual_network_gateways.rb +204 -280
  180. data/lib/azure_mgmt_network/virtual_networks.rb +139 -314
  181. metadata +92 -106
  182. data/.gitignore +0 -10
  183. data/.travis.yml +0 -3
  184. data/Gemfile +0 -15
  185. data/lib/azure_mgmt_network/public_ip_addresses.rb +0 -711
@@ -0,0 +1,911 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.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
+ # 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 resrources. The API has entities that capture the
11
+ # relationship between an end user and the Microsoft Azure Networks service.
12
+ #
13
+ class ExpressRouteCircuits
14
+ include Azure::ARM::Network::Models
15
+ include MsRestAzure
16
+
17
+ #
18
+ # Creates and initializes a new instance of the ExpressRouteCircuits class.
19
+ # @param client service class for accessing basic functionality.
20
+ #
21
+ def initialize(client)
22
+ @client = client
23
+ end
24
+
25
+ # @return reference to the NetworkManagementClient
26
+ attr_reader :client
27
+
28
+ #
29
+ # The delete ExpressRouteCircuit operation deletes the specified
30
+ # ExpressRouteCircuit.
31
+ #
32
+ # @param resource_group_name [String] The name of the resource group.
33
+ # @param circuit_name [String] The name of the express route Circuit.
34
+ # @return [Concurrent::Promise] promise which provides async access to http
35
+ # response.
36
+ #
37
+ def delete(resource_group_name, circuit_name, custom_headers = nil)
38
+ # Send request
39
+ promise = begin_delete(resource_group_name, circuit_name, custom_headers)
40
+
41
+ promise = promise.then do |response|
42
+ # Defining deserialization method.
43
+ deserialize_method = lambda do |parsed_response|
44
+ end
45
+
46
+ # Waiting for response.
47
+ @client.get_post_or_delete_operation_result(response, deserialize_method)
48
+ end
49
+
50
+ promise
51
+ end
52
+
53
+ #
54
+ # The delete ExpressRouteCircuit operation deletes the specified
55
+ # ExpressRouteCircuit.
56
+ #
57
+ # @param resource_group_name [String] The name of the resource group.
58
+ # @param circuit_name [String] The name of the express route Circuit.
59
+ # @param [Hash{String => String}] The hash of custom headers need to be
60
+ # applied to HTTP request.
61
+ #
62
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
63
+ # response.
64
+ #
65
+ def begin_delete(resource_group_name, circuit_name, custom_headers = nil)
66
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
67
+ fail ArgumentError, 'circuit_name is nil' if circuit_name.nil?
68
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
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/expressRouteCircuits/{circuitName}/'
76
+ options = {
77
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
+ path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id},
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {})
81
+ }
82
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
83
+ promise = request.run_promise do |req|
84
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
85
+ end
86
+
87
+ promise = promise.then do |http_response|
88
+ status_code = http_response.status
89
+ response_content = http_response.body
90
+ unless status_code == 204 || status_code == 202 || status_code == 200
91
+ error_model = JSON.load(response_content)
92
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
93
+ end
94
+
95
+ # Create Result
96
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+
99
+ result
100
+ end
101
+
102
+ promise.execute
103
+ end
104
+
105
+ #
106
+ # The Get ExpressRouteCircuit operation retreives information about the
107
+ # specified ExpressRouteCircuit.
108
+ #
109
+ # @param resource_group_name [String] The name of the resource group.
110
+ # @param circuit_name [String] The name of the circuit.
111
+ # @param [Hash{String => String}] The hash of custom headers need to be
112
+ # applied to HTTP request.
113
+ #
114
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
115
+ # response.
116
+ #
117
+ def get(resource_group_name, circuit_name, custom_headers = nil)
118
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
119
+ fail ArgumentError, 'circuit_name is nil' if circuit_name.nil?
120
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
121
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
122
+ request_headers = {}
123
+
124
+ # Set Headers
125
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
126
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
127
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/'
128
+ options = {
129
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
130
+ path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id},
131
+ query_params: {'api-version' => @client.api_version},
132
+ headers: request_headers.merge(custom_headers || {})
133
+ }
134
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
135
+ promise = request.run_promise do |req|
136
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
137
+ end
138
+
139
+ promise = promise.then do |http_response|
140
+ status_code = http_response.status
141
+ response_content = http_response.body
142
+ unless status_code == 200
143
+ error_model = JSON.load(response_content)
144
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
145
+ end
146
+
147
+ # Create Result
148
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
149
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
150
+ # Deserialize Response
151
+ if status_code == 200
152
+ begin
153
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
154
+ unless parsed_response.nil?
155
+ parsed_response = ExpressRouteCircuit.deserialize_object(parsed_response)
156
+ end
157
+ result.body = parsed_response
158
+ rescue Exception => e
159
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
160
+ end
161
+ end
162
+
163
+ result
164
+ end
165
+
166
+ promise.execute
167
+ end
168
+
169
+ #
170
+ # The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group.
173
+ # @param circuit_name [String] The name of the circuit.
174
+ # @param parameters [ExpressRouteCircuit] Parameters supplied to the
175
+ # create/delete ExpressRouteCircuit operation
176
+ # @param @client.api_version [String] Client Api Version.
177
+ # @param @client.subscription_id [String] Gets subscription credentials which
178
+ # uniquely identify Microsoft Azure subscription. The subscription ID forms
179
+ # part of the URI for every service call.
180
+ # @param @client.accept_language [String] Gets or sets the preferred language
181
+ # for the response.
182
+ #
183
+ # @return [Concurrent::Promise] promise which provides async access to http
184
+ # response.
185
+ #
186
+ def create_or_update(resource_group_name, circuit_name, parameters, custom_headers = nil)
187
+ # Send request
188
+ promise = begin_create_or_update(resource_group_name, circuit_name, parameters, custom_headers)
189
+
190
+ promise = promise.then do |response|
191
+ # Defining deserialization method.
192
+ deserialize_method = lambda do |parsed_response|
193
+ unless parsed_response.nil?
194
+ parsed_response = ExpressRouteCircuit.deserialize_object(parsed_response)
195
+ end
196
+ end
197
+
198
+ # Waiting for response.
199
+ @client.get_put_operation_result(response, deserialize_method)
200
+ end
201
+
202
+ promise
203
+ end
204
+
205
+ #
206
+ # The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit
207
+ #
208
+ # @param resource_group_name [String] The name of the resource group.
209
+ # @param circuit_name [String] The name of the circuit.
210
+ # @param parameters [ExpressRouteCircuit] Parameters supplied to the
211
+ # create/delete ExpressRouteCircuit operation
212
+ # @param [Hash{String => String}] The hash of custom headers need to be
213
+ # applied to HTTP request.
214
+ #
215
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
216
+ # response.
217
+ #
218
+ def begin_create_or_update(resource_group_name, circuit_name, parameters, custom_headers = nil)
219
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
220
+ fail ArgumentError, 'circuit_name is nil' if circuit_name.nil?
221
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
222
+ parameters.validate unless parameters.nil?
223
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
224
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
225
+ request_headers = {}
226
+
227
+ # Set Headers
228
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
229
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
230
+
231
+ # Serialize Request
232
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
233
+ unless parameters.nil?
234
+ parameters = ExpressRouteCircuit.serialize_object(parameters)
235
+ end
236
+ request_content = JSON.generate(parameters, quirks_mode: true)
237
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/'
238
+ options = {
239
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
240
+ path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id},
241
+ query_params: {'api-version' => @client.api_version},
242
+ body: request_content,
243
+ headers: request_headers.merge(custom_headers || {})
244
+ }
245
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
246
+ promise = request.run_promise do |req|
247
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
248
+ end
249
+
250
+ promise = promise.then do |http_response|
251
+ status_code = http_response.status
252
+ response_content = http_response.body
253
+ unless status_code == 201 || status_code == 200
254
+ error_model = JSON.load(response_content)
255
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
256
+ end
257
+
258
+ # Create Result
259
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
260
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
261
+ # Deserialize Response
262
+ if status_code == 201
263
+ begin
264
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
265
+ unless parsed_response.nil?
266
+ parsed_response = ExpressRouteCircuit.deserialize_object(parsed_response)
267
+ end
268
+ result.body = parsed_response
269
+ rescue Exception => e
270
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
271
+ end
272
+ end
273
+ # Deserialize Response
274
+ if status_code == 200
275
+ begin
276
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
277
+ unless parsed_response.nil?
278
+ parsed_response = ExpressRouteCircuit.deserialize_object(parsed_response)
279
+ end
280
+ result.body = parsed_response
281
+ rescue Exception => e
282
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
283
+ end
284
+ end
285
+
286
+ result
287
+ end
288
+
289
+ promise.execute
290
+ end
291
+
292
+ #
293
+ # The ListArpTable from ExpressRouteCircuit opertion retrieves the currently
294
+ # advertised arp table associated with the ExpressRouteCircuits in a resource
295
+ # group.
296
+ #
297
+ # @param resource_group_name [String] The name of the resource group.
298
+ # @param circuit_name [String] The name of the circuit.
299
+ # @param [Hash{String => String}] The hash of custom headers need to be
300
+ # applied to HTTP request.
301
+ #
302
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
303
+ # response.
304
+ #
305
+ def list_arp_table(resource_group_name, circuit_name, custom_headers = nil)
306
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
307
+ fail ArgumentError, 'circuit_name is nil' if circuit_name.nil?
308
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
309
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
310
+ request_headers = {}
311
+
312
+ # Set Headers
313
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
314
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
315
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/arpTable'
316
+ options = {
317
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
318
+ path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id},
319
+ query_params: {'api-version' => @client.api_version},
320
+ headers: request_headers.merge(custom_headers || {})
321
+ }
322
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
323
+ promise = request.run_promise do |req|
324
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
325
+ end
326
+
327
+ promise = promise.then do |http_response|
328
+ status_code = http_response.status
329
+ response_content = http_response.body
330
+ unless status_code == 200
331
+ error_model = JSON.load(response_content)
332
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
333
+ end
334
+
335
+ # Create Result
336
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
337
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
338
+ # Deserialize Response
339
+ if status_code == 200
340
+ begin
341
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
342
+ unless parsed_response.nil?
343
+ parsed_response = ExpressRouteCircuitsArpTableListResult.deserialize_object(parsed_response)
344
+ end
345
+ result.body = parsed_response
346
+ rescue Exception => e
347
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
348
+ end
349
+ end
350
+
351
+ result
352
+ end
353
+
354
+ promise.execute
355
+ end
356
+
357
+ #
358
+ # The ListRoutesTable from ExpressRouteCircuit opertion retrieves the
359
+ # currently advertised routes table associated with the ExpressRouteCircuits
360
+ # in a resource group.
361
+ #
362
+ # @param resource_group_name [String] The name of the resource group.
363
+ # @param circuit_name [String] The name of the circuit.
364
+ # @param [Hash{String => String}] The hash of custom headers need to be
365
+ # applied to HTTP request.
366
+ #
367
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
368
+ # response.
369
+ #
370
+ def list_routes_table(resource_group_name, circuit_name, custom_headers = nil)
371
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
372
+ fail ArgumentError, 'circuit_name is nil' if circuit_name.nil?
373
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
374
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
375
+ request_headers = {}
376
+
377
+ # Set Headers
378
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
379
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
380
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/routesTable'
381
+ options = {
382
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
383
+ path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id},
384
+ query_params: {'api-version' => @client.api_version},
385
+ headers: request_headers.merge(custom_headers || {})
386
+ }
387
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
388
+ promise = request.run_promise do |req|
389
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
390
+ end
391
+
392
+ promise = promise.then do |http_response|
393
+ status_code = http_response.status
394
+ response_content = http_response.body
395
+ unless status_code == 200
396
+ error_model = JSON.load(response_content)
397
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
398
+ end
399
+
400
+ # Create Result
401
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
403
+ # Deserialize Response
404
+ if status_code == 200
405
+ begin
406
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
407
+ unless parsed_response.nil?
408
+ parsed_response = ExpressRouteCircuitsRoutesTableListResult.deserialize_object(parsed_response)
409
+ end
410
+ result.body = parsed_response
411
+ rescue Exception => e
412
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
413
+ end
414
+ end
415
+
416
+ result
417
+ end
418
+
419
+ promise.execute
420
+ end
421
+
422
+ #
423
+ # The Liststats ExpressRouteCircuit opertion retrieves all the stats from a
424
+ # ExpressRouteCircuits in a resource group.
425
+ #
426
+ # @param resource_group_name [String] The name of the resource group.
427
+ # @param circuit_name [String] The name of the loadBalancer.
428
+ # @param [Hash{String => String}] The hash of custom headers need to be
429
+ # applied to HTTP request.
430
+ #
431
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
432
+ # response.
433
+ #
434
+ def list_stats(resource_group_name, circuit_name, custom_headers = nil)
435
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
436
+ fail ArgumentError, 'circuit_name is nil' if circuit_name.nil?
437
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
438
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
439
+ request_headers = {}
440
+
441
+ # Set Headers
442
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
443
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
444
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'
445
+ options = {
446
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
447
+ path_params: {'resourceGroupName' => resource_group_name,'circuitName' => circuit_name,'subscriptionId' => @client.subscription_id},
448
+ query_params: {'api-version' => @client.api_version},
449
+ headers: request_headers.merge(custom_headers || {})
450
+ }
451
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
452
+ promise = request.run_promise do |req|
453
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
454
+ end
455
+
456
+ promise = promise.then do |http_response|
457
+ status_code = http_response.status
458
+ response_content = http_response.body
459
+ unless status_code == 200
460
+ error_model = JSON.load(response_content)
461
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
462
+ end
463
+
464
+ # Create Result
465
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
466
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
467
+ # Deserialize Response
468
+ if status_code == 200
469
+ begin
470
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
471
+ unless parsed_response.nil?
472
+ parsed_response = ExpressRouteCircuitsStatsListResult.deserialize_object(parsed_response)
473
+ end
474
+ result.body = parsed_response
475
+ rescue Exception => e
476
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
477
+ end
478
+ end
479
+
480
+ result
481
+ end
482
+
483
+ promise.execute
484
+ end
485
+
486
+ #
487
+ # The List ExpressRouteCircuit opertion retrieves all the ExpressRouteCircuits
488
+ # in a resource group.
489
+ #
490
+ # @param resource_group_name [String] The name of the resource group.
491
+ # @param [Hash{String => String}] The hash of custom headers need to be
492
+ # applied to HTTP request.
493
+ #
494
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
495
+ # response.
496
+ #
497
+ def list(resource_group_name, custom_headers = nil)
498
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
499
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
500
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
501
+ request_headers = {}
502
+
503
+ # Set Headers
504
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
505
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
506
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'
507
+ options = {
508
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
509
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
510
+ query_params: {'api-version' => @client.api_version},
511
+ headers: request_headers.merge(custom_headers || {})
512
+ }
513
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
514
+ promise = request.run_promise do |req|
515
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
516
+ end
517
+
518
+ promise = promise.then do |http_response|
519
+ status_code = http_response.status
520
+ response_content = http_response.body
521
+ unless status_code == 200
522
+ error_model = JSON.load(response_content)
523
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
524
+ end
525
+
526
+ # Create Result
527
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
528
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
529
+ # Deserialize Response
530
+ if status_code == 200
531
+ begin
532
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
533
+ unless parsed_response.nil?
534
+ parsed_response = ExpressRouteCircuitListResult.deserialize_object(parsed_response)
535
+ end
536
+ result.body = parsed_response
537
+ rescue Exception => e
538
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
539
+ end
540
+ end
541
+
542
+ result
543
+ end
544
+
545
+ promise.execute
546
+ end
547
+
548
+ #
549
+ # The List ExpressRouteCircuit opertion retrieves all the ExpressRouteCircuits
550
+ # in a subscription.
551
+ #
552
+ # @param [Hash{String => String}] The hash of custom headers need to be
553
+ # applied to HTTP request.
554
+ #
555
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
556
+ # response.
557
+ #
558
+ def list_all(custom_headers = nil)
559
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
560
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
561
+ request_headers = {}
562
+
563
+ # Set Headers
564
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'
567
+ options = {
568
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
569
+ path_params: {'subscriptionId' => @client.subscription_id},
570
+ query_params: {'api-version' => @client.api_version},
571
+ headers: request_headers.merge(custom_headers || {})
572
+ }
573
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
574
+ promise = request.run_promise do |req|
575
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
576
+ end
577
+
578
+ promise = promise.then do |http_response|
579
+ status_code = http_response.status
580
+ response_content = http_response.body
581
+ unless status_code == 200
582
+ error_model = JSON.load(response_content)
583
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
584
+ end
585
+
586
+ # Create Result
587
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
589
+ # Deserialize Response
590
+ if status_code == 200
591
+ begin
592
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
593
+ unless parsed_response.nil?
594
+ parsed_response = ExpressRouteCircuitListResult.deserialize_object(parsed_response)
595
+ end
596
+ result.body = parsed_response
597
+ rescue Exception => e
598
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
599
+ end
600
+ end
601
+
602
+ result
603
+ end
604
+
605
+ promise.execute
606
+ end
607
+
608
+ #
609
+ # The ListArpTable from ExpressRouteCircuit opertion retrieves the currently
610
+ # advertised arp table associated with the ExpressRouteCircuits in a resource
611
+ # group.
612
+ #
613
+ # @param next_page_link [String] The NextLink from the previous successful
614
+ # call to List operation.
615
+ # @param [Hash{String => String}] The hash of custom headers need to be
616
+ # applied to HTTP request.
617
+ #
618
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
619
+ # response.
620
+ #
621
+ def list_arp_table_next(next_page_link, custom_headers = nil)
622
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
623
+ request_headers = {}
624
+
625
+ # Set Headers
626
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
627
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
628
+ path_template = '{nextLink}'
629
+ options = {
630
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
631
+ skip_encoding_path_params: {'nextLink' => next_page_link},
632
+ headers: request_headers.merge(custom_headers || {})
633
+ }
634
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
635
+ promise = request.run_promise do |req|
636
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
637
+ end
638
+
639
+ promise = promise.then do |http_response|
640
+ status_code = http_response.status
641
+ response_content = http_response.body
642
+ unless status_code == 200
643
+ error_model = JSON.load(response_content)
644
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
645
+ end
646
+
647
+ # Create Result
648
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
649
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
650
+ # Deserialize Response
651
+ if status_code == 200
652
+ begin
653
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
654
+ unless parsed_response.nil?
655
+ parsed_response = ExpressRouteCircuitsArpTableListResult.deserialize_object(parsed_response)
656
+ end
657
+ result.body = parsed_response
658
+ rescue Exception => e
659
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
660
+ end
661
+ end
662
+
663
+ result
664
+ end
665
+
666
+ promise.execute
667
+ end
668
+
669
+ #
670
+ # The ListRoutesTable from ExpressRouteCircuit opertion retrieves the
671
+ # currently advertised routes table associated with the ExpressRouteCircuits
672
+ # in a resource group.
673
+ #
674
+ # @param next_page_link [String] The NextLink from the previous successful
675
+ # call to List operation.
676
+ # @param [Hash{String => String}] The hash of custom headers need to be
677
+ # applied to HTTP request.
678
+ #
679
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
680
+ # response.
681
+ #
682
+ def list_routes_table_next(next_page_link, custom_headers = nil)
683
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
684
+ request_headers = {}
685
+
686
+ # Set Headers
687
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
688
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
689
+ path_template = '{nextLink}'
690
+ options = {
691
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
692
+ skip_encoding_path_params: {'nextLink' => next_page_link},
693
+ headers: request_headers.merge(custom_headers || {})
694
+ }
695
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
696
+ promise = request.run_promise do |req|
697
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
698
+ end
699
+
700
+ promise = promise.then do |http_response|
701
+ status_code = http_response.status
702
+ response_content = http_response.body
703
+ unless status_code == 200
704
+ error_model = JSON.load(response_content)
705
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
706
+ end
707
+
708
+ # Create Result
709
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
710
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
711
+ # Deserialize Response
712
+ if status_code == 200
713
+ begin
714
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
715
+ unless parsed_response.nil?
716
+ parsed_response = ExpressRouteCircuitsRoutesTableListResult.deserialize_object(parsed_response)
717
+ end
718
+ result.body = parsed_response
719
+ rescue Exception => e
720
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
721
+ end
722
+ end
723
+
724
+ result
725
+ end
726
+
727
+ promise.execute
728
+ end
729
+
730
+ #
731
+ # The Liststats ExpressRouteCircuit opertion retrieves all the stats from a
732
+ # ExpressRouteCircuits in a resource group.
733
+ #
734
+ # @param next_page_link [String] The NextLink from the previous successful
735
+ # call to List operation.
736
+ # @param [Hash{String => String}] The hash of custom headers need to be
737
+ # applied to HTTP request.
738
+ #
739
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
740
+ # response.
741
+ #
742
+ def list_stats_next(next_page_link, custom_headers = nil)
743
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
744
+ request_headers = {}
745
+
746
+ # Set Headers
747
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
748
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
749
+ path_template = '{nextLink}'
750
+ options = {
751
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
752
+ skip_encoding_path_params: {'nextLink' => next_page_link},
753
+ headers: request_headers.merge(custom_headers || {})
754
+ }
755
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
756
+ promise = request.run_promise do |req|
757
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
758
+ end
759
+
760
+ promise = promise.then do |http_response|
761
+ status_code = http_response.status
762
+ response_content = http_response.body
763
+ unless status_code == 200
764
+ error_model = JSON.load(response_content)
765
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
766
+ end
767
+
768
+ # Create Result
769
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
770
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
771
+ # Deserialize Response
772
+ if status_code == 200
773
+ begin
774
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
775
+ unless parsed_response.nil?
776
+ parsed_response = ExpressRouteCircuitsStatsListResult.deserialize_object(parsed_response)
777
+ end
778
+ result.body = parsed_response
779
+ rescue Exception => e
780
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
781
+ end
782
+ end
783
+
784
+ result
785
+ end
786
+
787
+ promise.execute
788
+ end
789
+
790
+ #
791
+ # The List ExpressRouteCircuit opertion retrieves all the ExpressRouteCircuits
792
+ # in a resource group.
793
+ #
794
+ # @param next_page_link [String] The NextLink from the previous successful
795
+ # call to List operation.
796
+ # @param [Hash{String => String}] The hash of custom headers need to be
797
+ # applied to HTTP request.
798
+ #
799
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
800
+ # response.
801
+ #
802
+ def list_next(next_page_link, custom_headers = nil)
803
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
804
+ request_headers = {}
805
+
806
+ # Set Headers
807
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
808
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
809
+ path_template = '{nextLink}'
810
+ options = {
811
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
812
+ skip_encoding_path_params: {'nextLink' => next_page_link},
813
+ headers: request_headers.merge(custom_headers || {})
814
+ }
815
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
816
+ promise = request.run_promise do |req|
817
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
818
+ end
819
+
820
+ promise = promise.then do |http_response|
821
+ status_code = http_response.status
822
+ response_content = http_response.body
823
+ unless status_code == 200
824
+ error_model = JSON.load(response_content)
825
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
826
+ end
827
+
828
+ # Create Result
829
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
830
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
831
+ # Deserialize Response
832
+ if status_code == 200
833
+ begin
834
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
835
+ unless parsed_response.nil?
836
+ parsed_response = ExpressRouteCircuitListResult.deserialize_object(parsed_response)
837
+ end
838
+ result.body = parsed_response
839
+ rescue Exception => e
840
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
841
+ end
842
+ end
843
+
844
+ result
845
+ end
846
+
847
+ promise.execute
848
+ end
849
+
850
+ #
851
+ # The List ExpressRouteCircuit opertion retrieves all the ExpressRouteCircuits
852
+ # in a subscription.
853
+ #
854
+ # @param next_page_link [String] The NextLink from the previous successful
855
+ # call to List operation.
856
+ # @param [Hash{String => String}] The hash of custom headers need to be
857
+ # applied to HTTP request.
858
+ #
859
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
860
+ # response.
861
+ #
862
+ def list_all_next(next_page_link, custom_headers = nil)
863
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
864
+ request_headers = {}
865
+
866
+ # Set Headers
867
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
868
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
869
+ path_template = '{nextLink}'
870
+ options = {
871
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
872
+ skip_encoding_path_params: {'nextLink' => next_page_link},
873
+ headers: request_headers.merge(custom_headers || {})
874
+ }
875
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
876
+ promise = request.run_promise do |req|
877
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
878
+ end
879
+
880
+ promise = promise.then do |http_response|
881
+ status_code = http_response.status
882
+ response_content = http_response.body
883
+ unless status_code == 200
884
+ error_model = JSON.load(response_content)
885
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
886
+ end
887
+
888
+ # Create Result
889
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
890
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
891
+ # Deserialize Response
892
+ if status_code == 200
893
+ begin
894
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
895
+ unless parsed_response.nil?
896
+ parsed_response = ExpressRouteCircuitListResult.deserialize_object(parsed_response)
897
+ end
898
+ result.body = parsed_response
899
+ rescue Exception => e
900
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
901
+ end
902
+ end
903
+
904
+ result
905
+ end
906
+
907
+ promise.execute
908
+ end
909
+
910
+ end
911
+ end