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,69 @@
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
+ module Models
8
+ #
9
+ # Properties of the revoked VPN client certificate of virtual network
10
+ # gateway
11
+ #
12
+ class VpnClientRevokedCertificatePropertiesFormat
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] Gets or sets the revoked Vpn client certificate
17
+ # thumbprint
18
+ attr_accessor :thumbprint
19
+
20
+ # @return [String] Gets or sets Provisioning state of the VPN client
21
+ # revoked certificate resource Updating/Deleting/Failed
22
+ attr_accessor :provisioning_state
23
+
24
+ #
25
+ # Validate the object. Throws ValidationError if validation fails.
26
+ #
27
+ def validate
28
+ # Nothing to validate
29
+ end
30
+
31
+ #
32
+ # Serializes given Model object into Ruby Hash.
33
+ # @param object Model object to serialize.
34
+ # @return [Hash] Serialized object in form of Ruby Hash.
35
+ #
36
+ def self.serialize_object(object)
37
+ object.validate
38
+ output_object = {}
39
+
40
+ serialized_property = object.thumbprint
41
+ output_object['thumbprint'] = serialized_property unless serialized_property.nil?
42
+
43
+ serialized_property = object.provisioning_state
44
+ output_object['provisioningState'] = serialized_property unless serialized_property.nil?
45
+
46
+ output_object
47
+ end
48
+
49
+ #
50
+ # Deserializes given Ruby Hash into Model object.
51
+ # @param object [Hash] Ruby Hash object to deserialize.
52
+ # @return [VpnClientRevokedCertificatePropertiesFormat] Deserialized
53
+ # object.
54
+ #
55
+ def self.deserialize_object(object)
56
+ return if object.nil?
57
+ output_object = VpnClientRevokedCertificatePropertiesFormat.new
58
+
59
+ deserialized_property = object['thumbprint']
60
+ output_object.thumbprint = deserialized_property
61
+
62
+ deserialized_property = object['provisioningState']
63
+ output_object.provisioning_state = deserialized_property
64
+
65
+ output_object
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,88 @@
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
+ module Models
8
+ #
9
+ # VPN client root certificate of virtual network gateway
10
+ #
11
+ class VpnClientRootCertificate < MsRestAzure::SubResource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [VpnClientRootCertificatePropertiesFormat]
16
+ attr_accessor :properties
17
+
18
+ # @return [String] Gets name of the resource that is unique within a
19
+ # resource group. This name can be used to access the resource
20
+ attr_accessor :name
21
+
22
+ # @return [String] A unique read-only string that changes whenever the
23
+ # resource is updated
24
+ attr_accessor :etag
25
+
26
+ #
27
+ # Validate the object. Throws ValidationError if validation fails.
28
+ #
29
+ def validate
30
+ @properties.validate unless @properties.nil?
31
+ end
32
+
33
+ #
34
+ # Serializes given Model object into Ruby Hash.
35
+ # @param object Model object to serialize.
36
+ # @return [Hash] Serialized object in form of Ruby Hash.
37
+ #
38
+ def self.serialize_object(object)
39
+ object.validate
40
+ output_object = {}
41
+
42
+ serialized_property = object.id
43
+ output_object['id'] = serialized_property unless serialized_property.nil?
44
+
45
+ serialized_property = object.properties
46
+ unless serialized_property.nil?
47
+ serialized_property = VpnClientRootCertificatePropertiesFormat.serialize_object(serialized_property)
48
+ end
49
+ output_object['properties'] = serialized_property unless serialized_property.nil?
50
+
51
+ serialized_property = object.name
52
+ output_object['name'] = serialized_property unless serialized_property.nil?
53
+
54
+ serialized_property = object.etag
55
+ output_object['etag'] = serialized_property unless serialized_property.nil?
56
+
57
+ output_object
58
+ end
59
+
60
+ #
61
+ # Deserializes given Ruby Hash into Model object.
62
+ # @param object [Hash] Ruby Hash object to deserialize.
63
+ # @return [VpnClientRootCertificate] Deserialized object.
64
+ #
65
+ def self.deserialize_object(object)
66
+ return if object.nil?
67
+ output_object = VpnClientRootCertificate.new
68
+
69
+ deserialized_property = object['id']
70
+ output_object.id = deserialized_property
71
+
72
+ deserialized_property = object['properties']
73
+ unless deserialized_property.nil?
74
+ deserialized_property = VpnClientRootCertificatePropertiesFormat.deserialize_object(deserialized_property)
75
+ end
76
+ output_object.properties = deserialized_property
77
+
78
+ deserialized_property = object['name']
79
+ output_object.name = deserialized_property
80
+
81
+ deserialized_property = object['etag']
82
+ output_object.etag = deserialized_property
83
+
84
+ output_object
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,66 @@
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
+ module Models
8
+ #
9
+ # Properties of SSL certificates of application gateway
10
+ #
11
+ class VpnClientRootCertificatePropertiesFormat
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Gets or sets the certificate public data
16
+ attr_accessor :public_cert_data
17
+
18
+ # @return [String] Gets or sets Provisioning state of the VPN client
19
+ # root certificate resource Updating/Deleting/Failed
20
+ attr_accessor :provisioning_state
21
+
22
+ #
23
+ # Validate the object. Throws ValidationError if validation fails.
24
+ #
25
+ def validate
26
+ # Nothing to validate
27
+ end
28
+
29
+ #
30
+ # Serializes given Model object into Ruby Hash.
31
+ # @param object Model object to serialize.
32
+ # @return [Hash] Serialized object in form of Ruby Hash.
33
+ #
34
+ def self.serialize_object(object)
35
+ object.validate
36
+ output_object = {}
37
+
38
+ serialized_property = object.public_cert_data
39
+ output_object['publicCertData'] = serialized_property unless serialized_property.nil?
40
+
41
+ serialized_property = object.provisioning_state
42
+ output_object['provisioningState'] = serialized_property unless serialized_property.nil?
43
+
44
+ output_object
45
+ end
46
+
47
+ #
48
+ # Deserializes given Ruby Hash into Model object.
49
+ # @param object [Hash] Ruby Hash object to deserialize.
50
+ # @return [VpnClientRootCertificatePropertiesFormat] Deserialized object.
51
+ #
52
+ def self.deserialize_object(object)
53
+ return if object.nil?
54
+ output_object = VpnClientRootCertificatePropertiesFormat.new
55
+
56
+ deserialized_property = object['publicCertData']
57
+ output_object.public_cert_data = deserialized_property
58
+
59
+ deserialized_property = object['provisioningState']
60
+ output_object.provisioning_state = deserialized_property
61
+
62
+ output_object
63
+ end
64
+ end
65
+ end
66
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,6 +1,8 @@
1
- # Copyright (c) Microsoft Corporation. All rights reserved.
2
- # Licensed under the MIT License. See License.txt in the project root for license information.
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.
3
5
 
4
6
  module Azure end
5
7
  module Azure::ARM end
6
- module Azure::ARM::Network end
8
+ module Azure::ARM::Network end
@@ -1,11 +1,14 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Network
7
7
  #
8
- # NetworkInterfaces
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.
9
12
  #
10
13
  class NetworkInterfaces
11
14
  include Azure::ARM::Network::Models
@@ -19,11 +22,12 @@ module Azure::ARM::Network
19
22
  @client = client
20
23
  end
21
24
 
22
- # @return reference to the NetworkResourceProviderClient
25
+ # @return reference to the NetworkManagementClient
23
26
  attr_reader :client
24
27
 
25
28
  #
26
29
  # The delete netwokInterface operation deletes the specified netwokInterface.
30
+ #
27
31
  # @param resource_group_name [String] The name of the resource group.
28
32
  # @param network_interface_name [String] The name of the network interface.
29
33
  # @return [Concurrent::Promise] promise which provides async access to http
@@ -39,7 +43,7 @@ module Azure::ARM::Network
39
43
  end
40
44
 
41
45
  # Waiting for response.
42
- @client.get_post_or_delete_operation_result(response, nil, deserialize_method)
46
+ @client.get_post_or_delete_operation_result(response, deserialize_method)
43
47
  end
44
48
 
45
49
  promise
@@ -47,6 +51,7 @@ module Azure::ARM::Network
47
51
 
48
52
  #
49
53
  # The delete netwokInterface operation deletes the specified netwokInterface.
54
+ #
50
55
  # @param resource_group_name [String] The name of the resource group.
51
56
  # @param network_interface_name [String] The name of the network interface.
52
57
  # @param [Hash{String => String}] The hash of custom headers need to be
@@ -60,60 +65,33 @@ module Azure::ARM::Network
60
65
  fail ArgumentError, 'network_interface_name is nil' if network_interface_name.nil?
61
66
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
67
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
63
- # Construct URL
64
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"
65
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
66
- path['{networkInterfaceName}'] = ERB::Util.url_encode(network_interface_name) if path.include?('{networkInterfaceName}')
67
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
68
- url = URI.join(@client.base_url, path)
69
- properties = {}
70
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
71
- unless url.query.nil?
72
- url.query.split('&').each do |url_item|
73
- url_items_parts = url_item.split('=')
74
- properties[url_items_parts[0]] = url_items_parts[1]
75
- end
76
- end
77
- properties.reject!{ |key, value| value.nil? }
78
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
79
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
80
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
81
- url = URI.parse(corrected_url)
82
-
83
- connection = Faraday.new(:url => url) do |faraday|
84
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
85
- faraday.use :cookie_jar
86
- faraday.adapter Faraday.default_adapter
87
- end
88
- request_headers = Hash.new
68
+ request_headers = {}
89
69
 
90
70
  # Set Headers
91
71
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
93
-
94
- unless custom_headers.nil?
95
- custom_headers.each do |key, value|
96
- request_headers[key] = value
97
- end
98
- end
99
-
100
- # Send Request
101
- promise = Concurrent::Promise.new do
102
- connection.delete do |request|
103
- request.headers = request_headers
104
- @client.credentials.sign_request(request) unless @client.credentials.nil?
105
- end
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ path_params: {'resourceGroupName' => resource_group_name,'networkInterfaceName' => network_interface_name,'subscriptionId' => @client.subscription_id},
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {})
79
+ }
80
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
81
+ promise = request.run_promise do |req|
82
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
106
83
  end
107
84
 
108
85
  promise = promise.then do |http_response|
109
86
  status_code = http_response.status
110
87
  response_content = http_response.body
111
- unless (status_code == 200 || status_code == 204 || status_code == 202)
112
- fail MsRestAzure::AzureOperationError.new(connection, http_response)
88
+ unless status_code == 204 || status_code == 202 || status_code == 200
89
+ error_model = JSON.load(response_content)
90
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
113
91
  end
114
92
 
115
93
  # Create Result
116
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
94
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
117
95
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
96
 
119
97
  result
@@ -125,85 +103,59 @@ module Azure::ARM::Network
125
103
  #
126
104
  # The Get ntework interface operation retreives information about the
127
105
  # specified network interface.
106
+ #
128
107
  # @param resource_group_name [String] The name of the resource group.
129
108
  # @param network_interface_name [String] The name of the network interface.
109
+ # @param expand [String] expand references resources.
130
110
  # @param [Hash{String => String}] The hash of custom headers need to be
131
111
  # applied to HTTP request.
132
112
  #
133
113
  # @return [Concurrent::Promise] Promise object which allows to get HTTP
134
114
  # response.
135
115
  #
136
- def get(resource_group_name, network_interface_name, custom_headers = nil)
116
+ def get(resource_group_name, network_interface_name, expand = nil, custom_headers = nil)
137
117
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
138
118
  fail ArgumentError, 'network_interface_name is nil' if network_interface_name.nil?
139
119
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
140
120
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
141
- # Construct URL
142
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"
143
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
144
- path['{networkInterfaceName}'] = ERB::Util.url_encode(network_interface_name) if path.include?('{networkInterfaceName}')
145
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
146
- url = URI.join(@client.base_url, path)
147
- properties = {}
148
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
149
- unless url.query.nil?
150
- url.query.split('&').each do |url_item|
151
- url_items_parts = url_item.split('=')
152
- properties[url_items_parts[0]] = url_items_parts[1]
153
- end
154
- end
155
- properties.reject!{ |key, value| value.nil? }
156
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
157
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
158
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
159
- url = URI.parse(corrected_url)
160
-
161
- connection = Faraday.new(:url => url) do |faraday|
162
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
163
- faraday.use :cookie_jar
164
- faraday.adapter Faraday.default_adapter
165
- end
166
- request_headers = Hash.new
121
+ request_headers = {}
167
122
 
168
123
  # Set Headers
169
124
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
170
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
171
-
172
- unless custom_headers.nil?
173
- custom_headers.each do |key, value|
174
- request_headers[key] = value
175
- end
176
- end
177
-
178
- # Send Request
179
- promise = Concurrent::Promise.new do
180
- connection.get do |request|
181
- request.headers = request_headers
182
- @client.credentials.sign_request(request) unless @client.credentials.nil?
183
- end
125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
126
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'
127
+ options = {
128
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
129
+ path_params: {'resourceGroupName' => resource_group_name,'networkInterfaceName' => network_interface_name,'subscriptionId' => @client.subscription_id},
130
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
131
+ headers: request_headers.merge(custom_headers || {})
132
+ }
133
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
134
+ promise = request.run_promise do |req|
135
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
184
136
  end
185
137
 
186
138
  promise = promise.then do |http_response|
187
139
  status_code = http_response.status
188
140
  response_content = http_response.body
189
- unless (status_code == 200)
141
+ unless status_code == 200
190
142
  error_model = JSON.load(response_content)
191
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
143
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
192
144
  end
193
145
 
194
146
  # Create Result
195
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
147
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
196
148
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
197
149
  # Deserialize Response
198
150
  if status_code == 200
199
151
  begin
200
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
152
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
201
153
  unless parsed_response.nil?
202
154
  parsed_response = NetworkInterface.deserialize_object(parsed_response)
203
155
  end
204
156
  result.body = parsed_response
205
157
  rescue Exception => e
206
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
158
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
207
159
  end
208
160
  end
209
161
 
@@ -215,6 +167,7 @@ module Azure::ARM::Network
215
167
 
216
168
  #
217
169
  # The Put NetworkInterface operation creates/updates a networkInterface
170
+ #
218
171
  # @param resource_group_name [String] The name of the resource group.
219
172
  # @param network_interface_name [String] The name of the network interface.
220
173
  # @param parameters [NetworkInterface] Parameters supplied to the
@@ -242,7 +195,7 @@ module Azure::ARM::Network
242
195
  end
243
196
 
244
197
  # Waiting for response.
245
- @client.get_put_operation_result(response, custom_headers, deserialize_method)
198
+ @client.get_put_operation_result(response, deserialize_method)
246
199
  end
247
200
 
248
201
  promise
@@ -250,6 +203,7 @@ module Azure::ARM::Network
250
203
 
251
204
  #
252
205
  # The Put NetworkInterface operation creates/updates a networkInterface
206
+ #
253
207
  # @param resource_group_name [String] The name of the resource group.
254
208
  # @param network_interface_name [String] The name of the network interface.
255
209
  # @param parameters [NetworkInterface] Parameters supplied to the
@@ -267,92 +221,64 @@ module Azure::ARM::Network
267
221
  parameters.validate unless parameters.nil?
268
222
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
269
223
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
270
- # Construct URL
271
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"
272
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
273
- path['{networkInterfaceName}'] = ERB::Util.url_encode(network_interface_name) if path.include?('{networkInterfaceName}')
274
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
275
- url = URI.join(@client.base_url, path)
276
- properties = {}
277
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
278
- unless url.query.nil?
279
- url.query.split('&').each do |url_item|
280
- url_items_parts = url_item.split('=')
281
- properties[url_items_parts[0]] = url_items_parts[1]
282
- end
283
- end
284
- properties.reject!{ |key, value| value.nil? }
285
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
286
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
287
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
288
- url = URI.parse(corrected_url)
289
-
290
- connection = Faraday.new(:url => url) do |faraday|
291
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
292
- faraday.use :cookie_jar
293
- faraday.adapter Faraday.default_adapter
294
- end
295
- request_headers = Hash.new
224
+ request_headers = {}
296
225
 
297
226
  # Set Headers
298
227
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
299
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
300
-
301
- unless custom_headers.nil?
302
- custom_headers.each do |key, value|
303
- request_headers[key] = value
304
- end
305
- end
228
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
306
229
 
307
230
  # Serialize Request
308
- request_headers['Content-Type'] = 'application/json'
231
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
309
232
  unless parameters.nil?
310
233
  parameters = NetworkInterface.serialize_object(parameters)
311
234
  end
312
235
  request_content = JSON.generate(parameters, quirks_mode: true)
313
-
314
- # Send Request
315
- promise = Concurrent::Promise.new do
316
- connection.put do |request|
317
- request.headers = request_headers
318
- request.body = request_content
319
- @client.credentials.sign_request(request) unless @client.credentials.nil?
320
- end
236
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'
237
+ options = {
238
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
239
+ path_params: {'resourceGroupName' => resource_group_name,'networkInterfaceName' => network_interface_name,'subscriptionId' => @client.subscription_id},
240
+ query_params: {'api-version' => @client.api_version},
241
+ body: request_content,
242
+ headers: request_headers.merge(custom_headers || {})
243
+ }
244
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
245
+ promise = request.run_promise do |req|
246
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
321
247
  end
322
248
 
323
249
  promise = promise.then do |http_response|
324
250
  status_code = http_response.status
325
251
  response_content = http_response.body
326
- unless (status_code == 201 || status_code == 200)
252
+ unless status_code == 201 || status_code == 200
327
253
  error_model = JSON.load(response_content)
328
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
254
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
329
255
  end
330
256
 
331
257
  # Create Result
332
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
258
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
333
259
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
334
260
  # Deserialize Response
335
261
  if status_code == 201
336
262
  begin
337
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
263
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
338
264
  unless parsed_response.nil?
339
265
  parsed_response = NetworkInterface.deserialize_object(parsed_response)
340
266
  end
341
267
  result.body = parsed_response
342
268
  rescue Exception => e
343
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
269
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
344
270
  end
345
271
  end
346
272
  # Deserialize Response
347
273
  if status_code == 200
348
274
  begin
349
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
275
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
350
276
  unless parsed_response.nil?
351
277
  parsed_response = NetworkInterface.deserialize_object(parsed_response)
352
278
  end
353
279
  result.body = parsed_response
354
280
  rescue Exception => e
355
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
281
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
356
282
  end
357
283
  end
358
284
 
@@ -363,81 +289,258 @@ module Azure::ARM::Network
363
289
  end
364
290
 
365
291
  #
366
- # The List networkInterfaces opertion retrieves all the networkInterfaces in a
367
- # subscription.
292
+ # The list network interface operation retrieves information about all network
293
+ # interfaces in a virtual machine from a virtual machine scale set.
294
+ #
295
+ # @param resource_group_name [String] The name of the resource group.
296
+ # @param virtual_machine_scale_set_name [String] The name of the virtual
297
+ # machine scale set.
298
+ # @param virtualmachine_index [String] The virtual machine index.
368
299
  # @param [Hash{String => String}] The hash of custom headers need to be
369
300
  # applied to HTTP request.
370
301
  #
371
302
  # @return [Concurrent::Promise] Promise object which allows to get HTTP
372
303
  # response.
373
304
  #
374
- def list_all(custom_headers = nil)
305
+ def list_virtual_machine_scale_set_vmnetwork_interfaces(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers = nil)
306
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
307
+ fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
308
+ fail ArgumentError, 'virtualmachine_index is nil' if virtualmachine_index.nil?
375
309
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
376
310
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
377
- # Construct URL
378
- path = "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces"
379
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
380
- url = URI.join(@client.base_url, path)
381
- properties = {}
382
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
383
- unless url.query.nil?
384
- url.query.split('&').each do |url_item|
385
- url_items_parts = url_item.split('=')
386
- properties[url_items_parts[0]] = url_items_parts[1]
387
- end
311
+ request_headers = {}
312
+
313
+ # Set Headers
314
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
315
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
316
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'
317
+ options = {
318
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
319
+ path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'virtualmachineIndex' => virtualmachine_index,'subscriptionId' => @client.subscription_id},
320
+ query_params: {'api-version' => @client.api_version},
321
+ headers: request_headers.merge(custom_headers || {})
322
+ }
323
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
324
+ promise = request.run_promise do |req|
325
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
388
326
  end
389
- properties.reject!{ |key, value| value.nil? }
390
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
391
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
392
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
393
- url = URI.parse(corrected_url)
394
-
395
- connection = Faraday.new(:url => url) do |faraday|
396
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
397
- faraday.use :cookie_jar
398
- faraday.adapter Faraday.default_adapter
327
+
328
+ promise = promise.then do |http_response|
329
+ status_code = http_response.status
330
+ response_content = http_response.body
331
+ unless status_code == 200
332
+ error_model = JSON.load(response_content)
333
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
334
+ end
335
+
336
+ # Create Result
337
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
338
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
339
+ # Deserialize Response
340
+ if status_code == 200
341
+ begin
342
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
343
+ unless parsed_response.nil?
344
+ parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
345
+ end
346
+ result.body = parsed_response
347
+ rescue Exception => e
348
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
349
+ end
350
+ end
351
+
352
+ result
399
353
  end
400
- request_headers = Hash.new
354
+
355
+ promise.execute
356
+ end
357
+
358
+ #
359
+ # The list network interface operation retrieves information about all network
360
+ # interfaces in a virtual machine scale set.
361
+ #
362
+ # @param resource_group_name [String] The name of the resource group.
363
+ # @param virtual_machine_scale_set_name [String] The name of the virtual
364
+ # machine scale set.
365
+ # @param [Hash{String => String}] The hash of custom headers need to be
366
+ # applied to HTTP request.
367
+ #
368
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
369
+ # response.
370
+ #
371
+ def list_virtual_machine_scale_set_network_interfaces(resource_group_name, virtual_machine_scale_set_name, custom_headers = nil)
372
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
373
+ fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
374
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
375
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
376
+ request_headers = {}
401
377
 
402
378
  # Set Headers
403
379
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
404
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
380
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
381
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'
382
+ options = {
383
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
384
+ path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'subscriptionId' => @client.subscription_id},
385
+ query_params: {'api-version' => @client.api_version},
386
+ headers: request_headers.merge(custom_headers || {})
387
+ }
388
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
389
+ promise = request.run_promise do |req|
390
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
391
+ end
392
+
393
+ promise = promise.then do |http_response|
394
+ status_code = http_response.status
395
+ response_content = http_response.body
396
+ unless status_code == 200
397
+ error_model = JSON.load(response_content)
398
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
399
+ end
405
400
 
406
- unless custom_headers.nil?
407
- custom_headers.each do |key, value|
408
- request_headers[key] = value
401
+ # Create Result
402
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
403
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
404
+ # Deserialize Response
405
+ if status_code == 200
406
+ begin
407
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
408
+ unless parsed_response.nil?
409
+ parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
410
+ end
411
+ result.body = parsed_response
412
+ rescue Exception => e
413
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
414
+ end
409
415
  end
416
+
417
+ result
410
418
  end
411
419
 
412
- # Send Request
413
- promise = Concurrent::Promise.new do
414
- connection.get do |request|
415
- request.headers = request_headers
416
- @client.credentials.sign_request(request) unless @client.credentials.nil?
420
+ promise.execute
421
+ end
422
+
423
+ #
424
+ # The Get ntework interface operation retreives information about the
425
+ # specified network interface in a virtual machine scale set.
426
+ #
427
+ # @param resource_group_name [String] The name of the resource group.
428
+ # @param virtual_machine_scale_set_name [String] The name of the virtual
429
+ # machine scale set.
430
+ # @param virtualmachine_index [String] The virtual machine index.
431
+ # @param network_interface_name [String] The name of the network interface.
432
+ # @param expand [String] expand references resources.
433
+ # @param [Hash{String => String}] The hash of custom headers need to be
434
+ # applied to HTTP request.
435
+ #
436
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
437
+ # response.
438
+ #
439
+ def get_virtual_machine_scale_set_network_interface(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand = nil, custom_headers = nil)
440
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
441
+ fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
442
+ fail ArgumentError, 'virtualmachine_index is nil' if virtualmachine_index.nil?
443
+ fail ArgumentError, 'network_interface_name is nil' if network_interface_name.nil?
444
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
445
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
446
+ request_headers = {}
447
+
448
+ # Set Headers
449
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
450
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
451
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'
452
+ options = {
453
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
454
+ path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'virtualmachineIndex' => virtualmachine_index,'networkInterfaceName' => network_interface_name,'subscriptionId' => @client.subscription_id},
455
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
456
+ headers: request_headers.merge(custom_headers || {})
457
+ }
458
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
459
+ promise = request.run_promise do |req|
460
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
461
+ end
462
+
463
+ promise = promise.then do |http_response|
464
+ status_code = http_response.status
465
+ response_content = http_response.body
466
+ unless status_code == 200
467
+ error_model = JSON.load(response_content)
468
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
417
469
  end
470
+
471
+ # Create Result
472
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
473
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
474
+ # Deserialize Response
475
+ if status_code == 200
476
+ begin
477
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
478
+ unless parsed_response.nil?
479
+ parsed_response = NetworkInterface.deserialize_object(parsed_response)
480
+ end
481
+ result.body = parsed_response
482
+ rescue Exception => e
483
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
484
+ end
485
+ end
486
+
487
+ result
488
+ end
489
+
490
+ promise.execute
491
+ end
492
+
493
+ #
494
+ # The List networkInterfaces opertion retrieves all the networkInterfaces in a
495
+ # subscription.
496
+ #
497
+ # @param [Hash{String => String}] The hash of custom headers need to be
498
+ # applied to HTTP request.
499
+ #
500
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
501
+ # response.
502
+ #
503
+ def list_all(custom_headers = nil)
504
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
505
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
506
+ request_headers = {}
507
+
508
+ # Set Headers
509
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
510
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
511
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'
512
+ options = {
513
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
514
+ path_params: {'subscriptionId' => @client.subscription_id},
515
+ query_params: {'api-version' => @client.api_version},
516
+ headers: request_headers.merge(custom_headers || {})
517
+ }
518
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
519
+ promise = request.run_promise do |req|
520
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
418
521
  end
419
522
 
420
523
  promise = promise.then do |http_response|
421
524
  status_code = http_response.status
422
525
  response_content = http_response.body
423
- unless (status_code == 200)
526
+ unless status_code == 200
424
527
  error_model = JSON.load(response_content)
425
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
528
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
426
529
  end
427
530
 
428
531
  # Create Result
429
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
532
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
430
533
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
431
534
  # Deserialize Response
432
535
  if status_code == 200
433
536
  begin
434
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
537
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
435
538
  unless parsed_response.nil?
436
539
  parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
437
540
  end
438
541
  result.body = parsed_response
439
542
  rescue Exception => e
440
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
543
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
441
544
  end
442
545
  end
443
546
 
@@ -450,6 +553,7 @@ module Azure::ARM::Network
450
553
  #
451
554
  # The List networkInterfaces opertion retrieves all the networkInterfaces in a
452
555
  # resource group.
556
+ #
453
557
  # @param resource_group_name [String] The name of the resource group.
454
558
  # @param [Hash{String => String}] The hash of custom headers need to be
455
559
  # applied to HTTP request.
@@ -461,71 +565,164 @@ module Azure::ARM::Network
461
565
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
462
566
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
463
567
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
464
- # Construct URL
465
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces"
466
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
467
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
468
- url = URI.join(@client.base_url, path)
469
- properties = {}
470
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
471
- unless url.query.nil?
472
- url.query.split('&').each do |url_item|
473
- url_items_parts = url_item.split('=')
474
- properties[url_items_parts[0]] = url_items_parts[1]
475
- end
568
+ request_headers = {}
569
+
570
+ # Set Headers
571
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
572
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
573
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'
574
+ options = {
575
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
576
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
577
+ query_params: {'api-version' => @client.api_version},
578
+ headers: request_headers.merge(custom_headers || {})
579
+ }
580
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
581
+ promise = request.run_promise do |req|
582
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
476
583
  end
477
- properties.reject!{ |key, value| value.nil? }
478
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
479
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
480
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
481
- url = URI.parse(corrected_url)
482
-
483
- connection = Faraday.new(:url => url) do |faraday|
484
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
485
- faraday.use :cookie_jar
486
- faraday.adapter Faraday.default_adapter
584
+
585
+ promise = promise.then do |http_response|
586
+ status_code = http_response.status
587
+ response_content = http_response.body
588
+ unless status_code == 200
589
+ error_model = JSON.load(response_content)
590
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
591
+ end
592
+
593
+ # Create Result
594
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
595
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
596
+ # Deserialize Response
597
+ if status_code == 200
598
+ begin
599
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
600
+ unless parsed_response.nil?
601
+ parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
602
+ end
603
+ result.body = parsed_response
604
+ rescue Exception => e
605
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
606
+ end
607
+ end
608
+
609
+ result
487
610
  end
488
- request_headers = Hash.new
611
+
612
+ promise.execute
613
+ end
614
+
615
+ #
616
+ # The list network interface operation retrieves information about all network
617
+ # interfaces in a virtual machine from a virtual machine scale set.
618
+ #
619
+ # @param next_page_link [String] The NextLink from the previous successful
620
+ # call to List operation.
621
+ # @param [Hash{String => String}] The hash of custom headers need to be
622
+ # applied to HTTP request.
623
+ #
624
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
625
+ # response.
626
+ #
627
+ def list_virtual_machine_scale_set_vmnetwork_interfaces_next(next_page_link, custom_headers = nil)
628
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
629
+ request_headers = {}
489
630
 
490
631
  # Set Headers
491
632
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
492
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
633
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
634
+ path_template = '{nextLink}'
635
+ options = {
636
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
637
+ skip_encoding_path_params: {'nextLink' => next_page_link},
638
+ headers: request_headers.merge(custom_headers || {})
639
+ }
640
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
641
+ promise = request.run_promise do |req|
642
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
643
+ end
493
644
 
494
- unless custom_headers.nil?
495
- custom_headers.each do |key, value|
496
- request_headers[key] = value
645
+ promise = promise.then do |http_response|
646
+ status_code = http_response.status
647
+ response_content = http_response.body
648
+ unless status_code == 200
649
+ error_model = JSON.load(response_content)
650
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
497
651
  end
498
- end
499
652
 
500
- # Send Request
501
- promise = Concurrent::Promise.new do
502
- connection.get do |request|
503
- request.headers = request_headers
504
- @client.credentials.sign_request(request) unless @client.credentials.nil?
653
+ # Create Result
654
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
655
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
656
+ # Deserialize Response
657
+ if status_code == 200
658
+ begin
659
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
660
+ unless parsed_response.nil?
661
+ parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
662
+ end
663
+ result.body = parsed_response
664
+ rescue Exception => e
665
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
666
+ end
505
667
  end
668
+
669
+ result
670
+ end
671
+
672
+ promise.execute
673
+ end
674
+
675
+ #
676
+ # The list network interface operation retrieves information about all network
677
+ # interfaces in a virtual machine scale set.
678
+ #
679
+ # @param next_page_link [String] The NextLink from the previous successful
680
+ # call to List operation.
681
+ # @param [Hash{String => String}] The hash of custom headers need to be
682
+ # applied to HTTP request.
683
+ #
684
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
685
+ # response.
686
+ #
687
+ def list_virtual_machine_scale_set_network_interfaces_next(next_page_link, custom_headers = nil)
688
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
689
+ request_headers = {}
690
+
691
+ # Set Headers
692
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
693
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
694
+ path_template = '{nextLink}'
695
+ options = {
696
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
697
+ skip_encoding_path_params: {'nextLink' => next_page_link},
698
+ headers: request_headers.merge(custom_headers || {})
699
+ }
700
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
701
+ promise = request.run_promise do |req|
702
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
506
703
  end
507
704
 
508
705
  promise = promise.then do |http_response|
509
706
  status_code = http_response.status
510
707
  response_content = http_response.body
511
- unless (status_code == 200)
708
+ unless status_code == 200
512
709
  error_model = JSON.load(response_content)
513
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
710
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
514
711
  end
515
712
 
516
713
  # Create Result
517
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
714
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
518
715
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
519
716
  # Deserialize Response
520
717
  if status_code == 200
521
718
  begin
522
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
719
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
523
720
  unless parsed_response.nil?
524
721
  parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
525
722
  end
526
723
  result.body = parsed_response
527
724
  rescue Exception => e
528
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
725
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
529
726
  end
530
727
  end
531
728
 
@@ -538,6 +735,7 @@ module Azure::ARM::Network
538
735
  #
539
736
  # The List networkInterfaces opertion retrieves all the networkInterfaces in a
540
737
  # subscription.
738
+ #
541
739
  # @param next_page_link [String] The NextLink from the previous successful
542
740
  # call to List operation.
543
741
  # @param [Hash{String => String}] The hash of custom headers need to be
@@ -548,69 +746,43 @@ module Azure::ARM::Network
548
746
  #
549
747
  def list_all_next(next_page_link, custom_headers = nil)
550
748
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
551
- # Construct URL
552
- path = "{nextLink}"
553
- path['{nextLink}'] = next_page_link if path.include?('{nextLink}')
554
- url = URI.parse(path)
555
- properties = {}
556
- unless url.query.nil?
557
- url.query.split('&').each do |url_item|
558
- url_items_parts = url_item.split('=')
559
- properties[url_items_parts[0]] = url_items_parts[1]
560
- end
561
- end
562
- properties.reject!{ |key, value| value.nil? }
563
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
564
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
565
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
566
- url = URI.parse(corrected_url)
567
-
568
- connection = Faraday.new(:url => url) do |faraday|
569
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
570
- faraday.use :cookie_jar
571
- faraday.adapter Faraday.default_adapter
572
- end
573
- request_headers = Hash.new
749
+ request_headers = {}
574
750
 
575
751
  # Set Headers
576
752
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
577
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
578
-
579
- unless custom_headers.nil?
580
- custom_headers.each do |key, value|
581
- request_headers[key] = value
582
- end
583
- end
584
-
585
- # Send Request
586
- promise = Concurrent::Promise.new do
587
- connection.get do |request|
588
- request.headers = request_headers
589
- @client.credentials.sign_request(request) unless @client.credentials.nil?
590
- end
753
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
754
+ path_template = '{nextLink}'
755
+ options = {
756
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
757
+ skip_encoding_path_params: {'nextLink' => next_page_link},
758
+ headers: request_headers.merge(custom_headers || {})
759
+ }
760
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
761
+ promise = request.run_promise do |req|
762
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
591
763
  end
592
764
 
593
765
  promise = promise.then do |http_response|
594
766
  status_code = http_response.status
595
767
  response_content = http_response.body
596
- unless (status_code == 200)
768
+ unless status_code == 200
597
769
  error_model = JSON.load(response_content)
598
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
770
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
599
771
  end
600
772
 
601
773
  # Create Result
602
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
774
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
603
775
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
604
776
  # Deserialize Response
605
777
  if status_code == 200
606
778
  begin
607
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
779
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
608
780
  unless parsed_response.nil?
609
781
  parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
610
782
  end
611
783
  result.body = parsed_response
612
784
  rescue Exception => e
613
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
785
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
614
786
  end
615
787
  end
616
788
 
@@ -623,6 +795,7 @@ module Azure::ARM::Network
623
795
  #
624
796
  # The List networkInterfaces opertion retrieves all the networkInterfaces in a
625
797
  # resource group.
798
+ #
626
799
  # @param next_page_link [String] The NextLink from the previous successful
627
800
  # call to List operation.
628
801
  # @param [Hash{String => String}] The hash of custom headers need to be
@@ -633,69 +806,43 @@ module Azure::ARM::Network
633
806
  #
634
807
  def list_next(next_page_link, custom_headers = nil)
635
808
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
636
- # Construct URL
637
- path = "{nextLink}"
638
- path['{nextLink}'] = next_page_link if path.include?('{nextLink}')
639
- url = URI.parse(path)
640
- properties = {}
641
- unless url.query.nil?
642
- url.query.split('&').each do |url_item|
643
- url_items_parts = url_item.split('=')
644
- properties[url_items_parts[0]] = url_items_parts[1]
645
- end
646
- end
647
- properties.reject!{ |key, value| value.nil? }
648
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
649
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
650
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
651
- url = URI.parse(corrected_url)
652
-
653
- connection = Faraday.new(:url => url) do |faraday|
654
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
655
- faraday.use :cookie_jar
656
- faraday.adapter Faraday.default_adapter
657
- end
658
- request_headers = Hash.new
809
+ request_headers = {}
659
810
 
660
811
  # Set Headers
661
812
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
662
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
663
-
664
- unless custom_headers.nil?
665
- custom_headers.each do |key, value|
666
- request_headers[key] = value
667
- end
668
- end
669
-
670
- # Send Request
671
- promise = Concurrent::Promise.new do
672
- connection.get do |request|
673
- request.headers = request_headers
674
- @client.credentials.sign_request(request) unless @client.credentials.nil?
675
- end
813
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
814
+ path_template = '{nextLink}'
815
+ options = {
816
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
817
+ skip_encoding_path_params: {'nextLink' => next_page_link},
818
+ headers: request_headers.merge(custom_headers || {})
819
+ }
820
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
821
+ promise = request.run_promise do |req|
822
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
676
823
  end
677
824
 
678
825
  promise = promise.then do |http_response|
679
826
  status_code = http_response.status
680
827
  response_content = http_response.body
681
- unless (status_code == 200)
828
+ unless status_code == 200
682
829
  error_model = JSON.load(response_content)
683
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
830
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
684
831
  end
685
832
 
686
833
  # Create Result
687
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
834
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
688
835
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
689
836
  # Deserialize Response
690
837
  if status_code == 200
691
838
  begin
692
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
839
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
693
840
  unless parsed_response.nil?
694
841
  parsed_response = NetworkInterfaceListResult.deserialize_object(parsed_response)
695
842
  end
696
843
  result.body = parsed_response
697
844
  rescue Exception => e
698
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
845
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
699
846
  end
700
847
  end
701
848