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
@@ -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
- # Subnets
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 Subnets
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 subnet operation deletes the specified subnet.
30
+ #
27
31
  # @param resource_group_name [String] The name of the resource group.
28
32
  # @param virtual_network_name [String] The name of the virtual network.
29
33
  # @param subnet_name [String] The name of the subnet.
@@ -40,7 +44,7 @@ module Azure::ARM::Network
40
44
  end
41
45
 
42
46
  # Waiting for response.
43
- @client.get_post_or_delete_operation_result(response, nil, deserialize_method)
47
+ @client.get_post_or_delete_operation_result(response, deserialize_method)
44
48
  end
45
49
 
46
50
  promise
@@ -48,6 +52,7 @@ module Azure::ARM::Network
48
52
 
49
53
  #
50
54
  # The delete subnet operation deletes the specified subnet.
55
+ #
51
56
  # @param resource_group_name [String] The name of the resource group.
52
57
  # @param virtual_network_name [String] The name of the virtual network.
53
58
  # @param subnet_name [String] The name of the subnet.
@@ -63,61 +68,33 @@ module Azure::ARM::Network
63
68
  fail ArgumentError, 'subnet_name is nil' if subnet_name.nil?
64
69
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
70
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
- # Construct URL
67
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"
68
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
69
- path['{virtualNetworkName}'] = ERB::Util.url_encode(virtual_network_name) if path.include?('{virtualNetworkName}')
70
- path['{subnetName}'] = ERB::Util.url_encode(subnet_name) if path.include?('{subnetName}')
71
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
72
- url = URI.join(@client.base_url, path)
73
- properties = {}
74
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
75
- unless url.query.nil?
76
- url.query.split('&').each do |url_item|
77
- url_items_parts = url_item.split('=')
78
- properties[url_items_parts[0]] = url_items_parts[1]
79
- end
80
- end
81
- properties.reject!{ |key, value| value.nil? }
82
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
83
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
84
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
85
- url = URI.parse(corrected_url)
86
-
87
- connection = Faraday.new(:url => url) do |faraday|
88
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
89
- faraday.use :cookie_jar
90
- faraday.adapter Faraday.default_adapter
91
- end
92
- request_headers = Hash.new
71
+ request_headers = {}
93
72
 
94
73
  # Set Headers
95
74
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
96
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
97
-
98
- unless custom_headers.nil?
99
- custom_headers.each do |key, value|
100
- request_headers[key] = value
101
- end
102
- end
103
-
104
- # Send Request
105
- promise = Concurrent::Promise.new do
106
- connection.delete do |request|
107
- request.headers = request_headers
108
- @client.credentials.sign_request(request) unless @client.credentials.nil?
109
- end
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}'
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
80
+ query_params: {'api-version' => @client.api_version},
81
+ headers: request_headers.merge(custom_headers || {})
82
+ }
83
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
84
+ promise = request.run_promise do |req|
85
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
110
86
  end
111
87
 
112
88
  promise = promise.then do |http_response|
113
89
  status_code = http_response.status
114
90
  response_content = http_response.body
115
- unless (status_code == 204 || status_code == 202 || status_code == 200)
116
- fail MsRestAzure::AzureOperationError.new(connection, http_response)
91
+ unless status_code == 200 || status_code == 204 || status_code == 202
92
+ error_model = JSON.load(response_content)
93
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
117
94
  end
118
95
 
119
96
  # Create Result
120
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
97
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
121
98
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
122
99
 
123
100
  result
@@ -128,88 +105,61 @@ module Azure::ARM::Network
128
105
 
129
106
  #
130
107
  # The Get subnet operation retreives information about the specified subnet.
108
+ #
131
109
  # @param resource_group_name [String] The name of the resource group.
132
110
  # @param virtual_network_name [String] The name of the virtual network.
133
111
  # @param subnet_name [String] The name of the subnet.
112
+ # @param expand [String] expand references resources.
134
113
  # @param [Hash{String => String}] The hash of custom headers need to be
135
114
  # applied to HTTP request.
136
115
  #
137
116
  # @return [Concurrent::Promise] Promise object which allows to get HTTP
138
117
  # response.
139
118
  #
140
- def get(resource_group_name, virtual_network_name, subnet_name, custom_headers = nil)
119
+ def get(resource_group_name, virtual_network_name, subnet_name, expand = nil, custom_headers = nil)
141
120
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
142
121
  fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
143
122
  fail ArgumentError, 'subnet_name is nil' if subnet_name.nil?
144
123
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
145
124
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
146
- # Construct URL
147
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"
148
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
149
- path['{virtualNetworkName}'] = ERB::Util.url_encode(virtual_network_name) if path.include?('{virtualNetworkName}')
150
- path['{subnetName}'] = ERB::Util.url_encode(subnet_name) if path.include?('{subnetName}')
151
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
152
- url = URI.join(@client.base_url, path)
153
- properties = {}
154
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
155
- unless url.query.nil?
156
- url.query.split('&').each do |url_item|
157
- url_items_parts = url_item.split('=')
158
- properties[url_items_parts[0]] = url_items_parts[1]
159
- end
160
- end
161
- properties.reject!{ |key, value| value.nil? }
162
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
163
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
164
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
165
- url = URI.parse(corrected_url)
166
-
167
- connection = Faraday.new(:url => url) do |faraday|
168
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
169
- faraday.use :cookie_jar
170
- faraday.adapter Faraday.default_adapter
171
- end
172
- request_headers = Hash.new
125
+ request_headers = {}
173
126
 
174
127
  # Set Headers
175
128
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
176
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
177
-
178
- unless custom_headers.nil?
179
- custom_headers.each do |key, value|
180
- request_headers[key] = value
181
- end
182
- end
183
-
184
- # Send Request
185
- promise = Concurrent::Promise.new do
186
- connection.get do |request|
187
- request.headers = request_headers
188
- @client.credentials.sign_request(request) unless @client.credentials.nil?
189
- end
129
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
130
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}'
131
+ options = {
132
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
133
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
134
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
135
+ headers: request_headers.merge(custom_headers || {})
136
+ }
137
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
138
+ promise = request.run_promise do |req|
139
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
190
140
  end
191
141
 
192
142
  promise = promise.then do |http_response|
193
143
  status_code = http_response.status
194
144
  response_content = http_response.body
195
- unless (status_code == 200)
145
+ unless status_code == 200
196
146
  error_model = JSON.load(response_content)
197
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
147
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
198
148
  end
199
149
 
200
150
  # Create Result
201
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
151
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
202
152
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
203
153
  # Deserialize Response
204
154
  if status_code == 200
205
155
  begin
206
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
156
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
207
157
  unless parsed_response.nil?
208
158
  parsed_response = Subnet.deserialize_object(parsed_response)
209
159
  end
210
160
  result.body = parsed_response
211
161
  rescue Exception => e
212
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
162
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
213
163
  end
214
164
  end
215
165
 
@@ -222,6 +172,7 @@ module Azure::ARM::Network
222
172
  #
223
173
  # The Put Subnet operation creates/updates a subnet in thespecified virtual
224
174
  # network
175
+ #
225
176
  # @param resource_group_name [String] The name of the resource group.
226
177
  # @param virtual_network_name [String] The name of the virtual network.
227
178
  # @param subnet_name [String] The name of the subnet.
@@ -250,7 +201,7 @@ module Azure::ARM::Network
250
201
  end
251
202
 
252
203
  # Waiting for response.
253
- @client.get_put_operation_result(response, custom_headers, deserialize_method)
204
+ @client.get_put_operation_result(response, deserialize_method)
254
205
  end
255
206
 
256
207
  promise
@@ -259,6 +210,7 @@ module Azure::ARM::Network
259
210
  #
260
211
  # The Put Subnet operation creates/updates a subnet in thespecified virtual
261
212
  # network
213
+ #
262
214
  # @param resource_group_name [String] The name of the resource group.
263
215
  # @param virtual_network_name [String] The name of the virtual network.
264
216
  # @param subnet_name [String] The name of the subnet.
@@ -278,93 +230,64 @@ module Azure::ARM::Network
278
230
  subnet_parameters.validate unless subnet_parameters.nil?
279
231
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
280
232
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
281
- # Construct URL
282
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"
283
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
284
- path['{virtualNetworkName}'] = ERB::Util.url_encode(virtual_network_name) if path.include?('{virtualNetworkName}')
285
- path['{subnetName}'] = ERB::Util.url_encode(subnet_name) if path.include?('{subnetName}')
286
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
287
- url = URI.join(@client.base_url, path)
288
- properties = {}
289
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
290
- unless url.query.nil?
291
- url.query.split('&').each do |url_item|
292
- url_items_parts = url_item.split('=')
293
- properties[url_items_parts[0]] = url_items_parts[1]
294
- end
295
- end
296
- properties.reject!{ |key, value| value.nil? }
297
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
298
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
299
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
300
- url = URI.parse(corrected_url)
301
-
302
- connection = Faraday.new(:url => url) do |faraday|
303
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
304
- faraday.use :cookie_jar
305
- faraday.adapter Faraday.default_adapter
306
- end
307
- request_headers = Hash.new
233
+ request_headers = {}
308
234
 
309
235
  # Set Headers
310
236
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
311
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
312
-
313
- unless custom_headers.nil?
314
- custom_headers.each do |key, value|
315
- request_headers[key] = value
316
- end
317
- end
237
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
318
238
 
319
239
  # Serialize Request
320
- request_headers['Content-Type'] = 'application/json'
240
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
321
241
  unless subnet_parameters.nil?
322
242
  subnet_parameters = Subnet.serialize_object(subnet_parameters)
323
243
  end
324
244
  request_content = JSON.generate(subnet_parameters, quirks_mode: true)
325
-
326
- # Send Request
327
- promise = Concurrent::Promise.new do
328
- connection.put do |request|
329
- request.headers = request_headers
330
- request.body = request_content
331
- @client.credentials.sign_request(request) unless @client.credentials.nil?
332
- end
245
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}'
246
+ options = {
247
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
248
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subnetName' => subnet_name,'subscriptionId' => @client.subscription_id},
249
+ query_params: {'api-version' => @client.api_version},
250
+ body: request_content,
251
+ headers: request_headers.merge(custom_headers || {})
252
+ }
253
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
254
+ promise = request.run_promise do |req|
255
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
333
256
  end
334
257
 
335
258
  promise = promise.then do |http_response|
336
259
  status_code = http_response.status
337
260
  response_content = http_response.body
338
- unless (status_code == 200 || status_code == 201)
261
+ unless status_code == 200 || status_code == 201
339
262
  error_model = JSON.load(response_content)
340
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
263
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
341
264
  end
342
265
 
343
266
  # Create Result
344
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
267
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
345
268
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
346
269
  # Deserialize Response
347
270
  if status_code == 200
348
271
  begin
349
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
272
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
350
273
  unless parsed_response.nil?
351
274
  parsed_response = Subnet.deserialize_object(parsed_response)
352
275
  end
353
276
  result.body = parsed_response
354
277
  rescue Exception => e
355
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
278
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
356
279
  end
357
280
  end
358
281
  # Deserialize Response
359
282
  if status_code == 201
360
283
  begin
361
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
284
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
362
285
  unless parsed_response.nil?
363
286
  parsed_response = Subnet.deserialize_object(parsed_response)
364
287
  end
365
288
  result.body = parsed_response
366
289
  rescue Exception => e
367
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
290
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
368
291
  end
369
292
  end
370
293
 
@@ -376,6 +299,7 @@ module Azure::ARM::Network
376
299
 
377
300
  #
378
301
  # The List subnets opertion retrieves all the subnets in a virtual network.
302
+ #
379
303
  # @param resource_group_name [String] The name of the resource group.
380
304
  # @param virtual_network_name [String] The name of the virtual network.
381
305
  # @param [Hash{String => String}] The hash of custom headers need to be
@@ -389,72 +313,44 @@ module Azure::ARM::Network
389
313
  fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
390
314
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
391
315
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
392
- # Construct URL
393
- path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets"
394
- path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
395
- path['{virtualNetworkName}'] = ERB::Util.url_encode(virtual_network_name) if path.include?('{virtualNetworkName}')
396
- path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
397
- url = URI.join(@client.base_url, path)
398
- properties = {}
399
- properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
400
- unless url.query.nil?
401
- url.query.split('&').each do |url_item|
402
- url_items_parts = url_item.split('=')
403
- properties[url_items_parts[0]] = url_items_parts[1]
404
- end
405
- end
406
- properties.reject!{ |key, value| value.nil? }
407
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
408
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
409
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
410
- url = URI.parse(corrected_url)
411
-
412
- connection = Faraday.new(:url => url) do |faraday|
413
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
414
- faraday.use :cookie_jar
415
- faraday.adapter Faraday.default_adapter
416
- end
417
- request_headers = Hash.new
316
+ request_headers = {}
418
317
 
419
318
  # Set Headers
420
319
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
421
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
422
-
423
- unless custom_headers.nil?
424
- custom_headers.each do |key, value|
425
- request_headers[key] = value
426
- end
427
- end
428
-
429
- # Send Request
430
- promise = Concurrent::Promise.new do
431
- connection.get do |request|
432
- request.headers = request_headers
433
- @client.credentials.sign_request(request) unless @client.credentials.nil?
434
- end
320
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
321
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets'
322
+ options = {
323
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
324
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subscriptionId' => @client.subscription_id},
325
+ query_params: {'api-version' => @client.api_version},
326
+ headers: request_headers.merge(custom_headers || {})
327
+ }
328
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
329
+ promise = request.run_promise do |req|
330
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
435
331
  end
436
332
 
437
333
  promise = promise.then do |http_response|
438
334
  status_code = http_response.status
439
335
  response_content = http_response.body
440
- unless (status_code == 200)
336
+ unless status_code == 200
441
337
  error_model = JSON.load(response_content)
442
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
338
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
443
339
  end
444
340
 
445
341
  # Create Result
446
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
342
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
447
343
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
448
344
  # Deserialize Response
449
345
  if status_code == 200
450
346
  begin
451
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
347
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
452
348
  unless parsed_response.nil?
453
349
  parsed_response = SubnetListResult.deserialize_object(parsed_response)
454
350
  end
455
351
  result.body = parsed_response
456
352
  rescue Exception => e
457
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
353
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
458
354
  end
459
355
  end
460
356
 
@@ -466,6 +362,7 @@ module Azure::ARM::Network
466
362
 
467
363
  #
468
364
  # The List subnets opertion retrieves all the subnets in a virtual network.
365
+ #
469
366
  # @param next_page_link [String] The NextLink from the previous successful
470
367
  # call to List operation.
471
368
  # @param [Hash{String => String}] The hash of custom headers need to be
@@ -476,69 +373,43 @@ module Azure::ARM::Network
476
373
  #
477
374
  def list_next(next_page_link, custom_headers = nil)
478
375
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
479
- # Construct URL
480
- path = "{nextLink}"
481
- path['{nextLink}'] = next_page_link if path.include?('{nextLink}')
482
- url = URI.parse(path)
483
- properties = {}
484
- unless url.query.nil?
485
- url.query.split('&').each do |url_item|
486
- url_items_parts = url_item.split('=')
487
- properties[url_items_parts[0]] = url_items_parts[1]
488
- end
489
- end
490
- properties.reject!{ |key, value| value.nil? }
491
- url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
492
- fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
493
- corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
494
- url = URI.parse(corrected_url)
495
-
496
- connection = Faraday.new(:url => url) do |faraday|
497
- faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
498
- faraday.use :cookie_jar
499
- faraday.adapter Faraday.default_adapter
500
- end
501
- request_headers = Hash.new
376
+ request_headers = {}
502
377
 
503
378
  # Set Headers
504
379
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
505
- request_headers["accept-language"] = @client.accept_language unless @client.accept_language.nil?
506
-
507
- unless custom_headers.nil?
508
- custom_headers.each do |key, value|
509
- request_headers[key] = value
510
- end
511
- end
512
-
513
- # Send Request
514
- promise = Concurrent::Promise.new do
515
- connection.get do |request|
516
- request.headers = request_headers
517
- @client.credentials.sign_request(request) unless @client.credentials.nil?
518
- end
380
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
381
+ path_template = '{nextLink}'
382
+ options = {
383
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
384
+ skip_encoding_path_params: {'nextLink' => next_page_link},
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?
519
390
  end
520
391
 
521
392
  promise = promise.then do |http_response|
522
393
  status_code = http_response.status
523
394
  response_content = http_response.body
524
- unless (status_code == 200)
395
+ unless status_code == 200
525
396
  error_model = JSON.load(response_content)
526
- fail MsRestAzure::AzureOperationError.new(connection, http_response, error_model)
397
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
527
398
  end
528
399
 
529
400
  # Create Result
530
- result = MsRestAzure::AzureOperationResponse.new(connection, http_response)
401
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
531
402
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
532
403
  # Deserialize Response
533
404
  if status_code == 200
534
405
  begin
535
- parsed_response = JSON.load(response_content) unless response_content.to_s.empty?
406
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
536
407
  unless parsed_response.nil?
537
408
  parsed_response = SubnetListResult.deserialize_object(parsed_response)
538
409
  end
539
410
  result.body = parsed_response
540
411
  rescue Exception => e
541
- fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, response_content)
412
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
542
413
  end
543
414
  end
544
415