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,536 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Network
7
+ #
8
+ # The Microsoft Azure Network management API provides a RESTful set of web
9
+ # services that interact with Microsoft Azure Networks service to manage
10
+ # your network resrources. The API has entities that capture the
11
+ # relationship between an end user and the Microsoft Azure Networks service.
12
+ #
13
+ class PublicIPAddresses
14
+ include Azure::ARM::Network::Models
15
+ include MsRestAzure
16
+
17
+ #
18
+ # Creates and initializes a new instance of the PublicIPAddresses class.
19
+ # @param client service class for accessing basic functionality.
20
+ #
21
+ def initialize(client)
22
+ @client = client
23
+ end
24
+
25
+ # @return reference to the NetworkManagementClient
26
+ attr_reader :client
27
+
28
+ #
29
+ # The delete publicIpAddress operation deletes the specified publicIpAddress.
30
+ #
31
+ # @param resource_group_name [String] The name of the resource group.
32
+ # @param public_ip_address_name [String] The name of the subnet.
33
+ # @return [Concurrent::Promise] promise which provides async access to http
34
+ # response.
35
+ #
36
+ def delete(resource_group_name, public_ip_address_name, custom_headers = nil)
37
+ # Send request
38
+ promise = begin_delete(resource_group_name, public_ip_address_name, custom_headers)
39
+
40
+ promise = promise.then do |response|
41
+ # Defining deserialization method.
42
+ deserialize_method = lambda do |parsed_response|
43
+ end
44
+
45
+ # Waiting for response.
46
+ @client.get_post_or_delete_operation_result(response, deserialize_method)
47
+ end
48
+
49
+ promise
50
+ end
51
+
52
+ #
53
+ # The delete publicIpAddress operation deletes the specified publicIpAddress.
54
+ #
55
+ # @param resource_group_name [String] The name of the resource group.
56
+ # @param public_ip_address_name [String] The name of the subnet.
57
+ # @param [Hash{String => String}] The hash of custom headers need to be
58
+ # applied to HTTP request.
59
+ #
60
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
61
+ # response.
62
+ #
63
+ def begin_delete(resource_group_name, public_ip_address_name, custom_headers = nil)
64
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
65
+ fail ArgumentError, 'public_ip_address_name is nil' if public_ip_address_name.nil?
66
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ request_headers = {}
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ path_params: {'resourceGroupName' => resource_group_name,'publicIpAddressName' => public_ip_address_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?
83
+ end
84
+
85
+ promise = promise.then do |http_response|
86
+ status_code = http_response.status
87
+ response_content = http_response.body
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)
91
+ end
92
+
93
+ # Create Result
94
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
95
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
96
+
97
+ result
98
+ end
99
+
100
+ promise.execute
101
+ end
102
+
103
+ #
104
+ # The Get publicIpAddress operation retreives information about the specified
105
+ # pubicIpAddress
106
+ #
107
+ # @param resource_group_name [String] The name of the resource group.
108
+ # @param public_ip_address_name [String] The name of the subnet.
109
+ # @param expand [String] expand references resources.
110
+ # @param [Hash{String => String}] The hash of custom headers need to be
111
+ # applied to HTTP request.
112
+ #
113
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
114
+ # response.
115
+ #
116
+ def get(resource_group_name, public_ip_address_name, expand = nil, custom_headers = nil)
117
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
118
+ fail ArgumentError, 'public_ip_address_name is nil' if public_ip_address_name.nil?
119
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
120
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
121
+ request_headers = {}
122
+
123
+ # Set Headers
124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
126
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'
127
+ options = {
128
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
129
+ path_params: {'resourceGroupName' => resource_group_name,'publicIpAddressName' => public_ip_address_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?
136
+ end
137
+
138
+ promise = promise.then do |http_response|
139
+ status_code = http_response.status
140
+ response_content = http_response.body
141
+ unless status_code == 200
142
+ error_model = JSON.load(response_content)
143
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
144
+ end
145
+
146
+ # Create Result
147
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
148
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
149
+ # Deserialize Response
150
+ if status_code == 200
151
+ begin
152
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
153
+ unless parsed_response.nil?
154
+ parsed_response = PublicIPAddress.deserialize_object(parsed_response)
155
+ end
156
+ result.body = parsed_response
157
+ rescue Exception => e
158
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
159
+ end
160
+ end
161
+
162
+ result
163
+ end
164
+
165
+ promise.execute
166
+ end
167
+
168
+ #
169
+ # The Put PublicIPAddress operation creates/updates a stable/dynamic PublicIP
170
+ # address
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group.
173
+ # @param public_ip_address_name [String] The name of the publicIpAddress.
174
+ # @param parameters [PublicIPAddress] Parameters supplied to the create/update
175
+ # PublicIPAddress operation
176
+ # @param @client.api_version [String] Client Api Version.
177
+ # @param @client.subscription_id [String] Gets subscription credentials which
178
+ # uniquely identify Microsoft Azure subscription. The subscription ID forms
179
+ # part of the URI for every service call.
180
+ # @param @client.accept_language [String] Gets or sets the preferred language
181
+ # for the response.
182
+ #
183
+ # @return [Concurrent::Promise] promise which provides async access to http
184
+ # response.
185
+ #
186
+ def create_or_update(resource_group_name, public_ip_address_name, parameters, custom_headers = nil)
187
+ # Send request
188
+ promise = begin_create_or_update(resource_group_name, public_ip_address_name, parameters, custom_headers)
189
+
190
+ promise = promise.then do |response|
191
+ # Defining deserialization method.
192
+ deserialize_method = lambda do |parsed_response|
193
+ unless parsed_response.nil?
194
+ parsed_response = PublicIPAddress.deserialize_object(parsed_response)
195
+ end
196
+ end
197
+
198
+ # Waiting for response.
199
+ @client.get_put_operation_result(response, deserialize_method)
200
+ end
201
+
202
+ promise
203
+ end
204
+
205
+ #
206
+ # The Put PublicIPAddress operation creates/updates a stable/dynamic PublicIP
207
+ # address
208
+ #
209
+ # @param resource_group_name [String] The name of the resource group.
210
+ # @param public_ip_address_name [String] The name of the publicIpAddress.
211
+ # @param parameters [PublicIPAddress] Parameters supplied to the create/update
212
+ # PublicIPAddress operation
213
+ # @param [Hash{String => String}] The hash of custom headers need to be
214
+ # applied to HTTP request.
215
+ #
216
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
217
+ # response.
218
+ #
219
+ def begin_create_or_update(resource_group_name, public_ip_address_name, parameters, custom_headers = nil)
220
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
221
+ fail ArgumentError, 'public_ip_address_name is nil' if public_ip_address_name.nil?
222
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
223
+ parameters.validate unless parameters.nil?
224
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
225
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
226
+ request_headers = {}
227
+
228
+ # Set Headers
229
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
230
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
231
+
232
+ # Serialize Request
233
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
234
+ unless parameters.nil?
235
+ parameters = PublicIPAddress.serialize_object(parameters)
236
+ end
237
+ request_content = JSON.generate(parameters, quirks_mode: true)
238
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'
239
+ options = {
240
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
241
+ path_params: {'resourceGroupName' => resource_group_name,'publicIpAddressName' => public_ip_address_name,'subscriptionId' => @client.subscription_id},
242
+ query_params: {'api-version' => @client.api_version},
243
+ body: request_content,
244
+ headers: request_headers.merge(custom_headers || {})
245
+ }
246
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
247
+ promise = request.run_promise do |req|
248
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
249
+ end
250
+
251
+ promise = promise.then do |http_response|
252
+ status_code = http_response.status
253
+ response_content = http_response.body
254
+ unless status_code == 201 || status_code == 200
255
+ error_model = JSON.load(response_content)
256
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
257
+ end
258
+
259
+ # Create Result
260
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
261
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
262
+ # Deserialize Response
263
+ if status_code == 201
264
+ begin
265
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
266
+ unless parsed_response.nil?
267
+ parsed_response = PublicIPAddress.deserialize_object(parsed_response)
268
+ end
269
+ result.body = parsed_response
270
+ rescue Exception => e
271
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
272
+ end
273
+ end
274
+ # Deserialize Response
275
+ if status_code == 200
276
+ begin
277
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
278
+ unless parsed_response.nil?
279
+ parsed_response = PublicIPAddress.deserialize_object(parsed_response)
280
+ end
281
+ result.body = parsed_response
282
+ rescue Exception => e
283
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
284
+ end
285
+ end
286
+
287
+ result
288
+ end
289
+
290
+ promise.execute
291
+ end
292
+
293
+ #
294
+ # The List publicIpAddress opertion retrieves all the publicIpAddresses in a
295
+ # subscription.
296
+ #
297
+ # @param [Hash{String => String}] The hash of custom headers need to be
298
+ # applied to HTTP request.
299
+ #
300
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
301
+ # response.
302
+ #
303
+ def list_all(custom_headers = nil)
304
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
305
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
306
+ request_headers = {}
307
+
308
+ # Set Headers
309
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
310
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
311
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'
312
+ options = {
313
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
314
+ path_params: {'subscriptionId' => @client.subscription_id},
315
+ query_params: {'api-version' => @client.api_version},
316
+ headers: request_headers.merge(custom_headers || {})
317
+ }
318
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
319
+ promise = request.run_promise do |req|
320
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
321
+ end
322
+
323
+ promise = promise.then do |http_response|
324
+ status_code = http_response.status
325
+ response_content = http_response.body
326
+ unless status_code == 200
327
+ error_model = JSON.load(response_content)
328
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
329
+ end
330
+
331
+ # Create Result
332
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
333
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
334
+ # Deserialize Response
335
+ if status_code == 200
336
+ begin
337
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
338
+ unless parsed_response.nil?
339
+ parsed_response = PublicIPAddressListResult.deserialize_object(parsed_response)
340
+ end
341
+ result.body = parsed_response
342
+ rescue Exception => e
343
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
344
+ end
345
+ end
346
+
347
+ result
348
+ end
349
+
350
+ promise.execute
351
+ end
352
+
353
+ #
354
+ # The List publicIpAddress opertion retrieves all the publicIpAddresses in a
355
+ # resource group.
356
+ #
357
+ # @param resource_group_name [String] The name of the resource group.
358
+ # @param [Hash{String => String}] The hash of custom headers need to be
359
+ # applied to HTTP request.
360
+ #
361
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
362
+ # response.
363
+ #
364
+ def list(resource_group_name, custom_headers = nil)
365
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
366
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
367
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
368
+ request_headers = {}
369
+
370
+ # Set Headers
371
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
372
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
373
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'
374
+ options = {
375
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
376
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
377
+ query_params: {'api-version' => @client.api_version},
378
+ headers: request_headers.merge(custom_headers || {})
379
+ }
380
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
381
+ promise = request.run_promise do |req|
382
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
383
+ end
384
+
385
+ promise = promise.then do |http_response|
386
+ status_code = http_response.status
387
+ response_content = http_response.body
388
+ unless status_code == 200
389
+ error_model = JSON.load(response_content)
390
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
391
+ end
392
+
393
+ # Create Result
394
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
395
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
396
+ # Deserialize Response
397
+ if status_code == 200
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ unless parsed_response.nil?
401
+ parsed_response = PublicIPAddressListResult.deserialize_object(parsed_response)
402
+ end
403
+ result.body = parsed_response
404
+ rescue Exception => e
405
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
406
+ end
407
+ end
408
+
409
+ result
410
+ end
411
+
412
+ promise.execute
413
+ end
414
+
415
+ #
416
+ # The List publicIpAddress opertion retrieves all the publicIpAddresses in a
417
+ # subscription.
418
+ #
419
+ # @param next_page_link [String] The NextLink from the previous successful
420
+ # call to List operation.
421
+ # @param [Hash{String => String}] The hash of custom headers need to be
422
+ # applied to HTTP request.
423
+ #
424
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
425
+ # response.
426
+ #
427
+ def list_all_next(next_page_link, custom_headers = nil)
428
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
429
+ request_headers = {}
430
+
431
+ # Set Headers
432
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
433
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
434
+ path_template = '{nextLink}'
435
+ options = {
436
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
437
+ skip_encoding_path_params: {'nextLink' => next_page_link},
438
+ headers: request_headers.merge(custom_headers || {})
439
+ }
440
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
441
+ promise = request.run_promise do |req|
442
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
443
+ end
444
+
445
+ promise = promise.then do |http_response|
446
+ status_code = http_response.status
447
+ response_content = http_response.body
448
+ unless status_code == 200
449
+ error_model = JSON.load(response_content)
450
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
451
+ end
452
+
453
+ # Create Result
454
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
455
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
456
+ # Deserialize Response
457
+ if status_code == 200
458
+ begin
459
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
460
+ unless parsed_response.nil?
461
+ parsed_response = PublicIPAddressListResult.deserialize_object(parsed_response)
462
+ end
463
+ result.body = parsed_response
464
+ rescue Exception => e
465
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
466
+ end
467
+ end
468
+
469
+ result
470
+ end
471
+
472
+ promise.execute
473
+ end
474
+
475
+ #
476
+ # The List publicIpAddress opertion retrieves all the publicIpAddresses in a
477
+ # resource group.
478
+ #
479
+ # @param next_page_link [String] The NextLink from the previous successful
480
+ # call to List operation.
481
+ # @param [Hash{String => String}] The hash of custom headers need to be
482
+ # applied to HTTP request.
483
+ #
484
+ # @return [Concurrent::Promise] Promise object which allows to get HTTP
485
+ # response.
486
+ #
487
+ def list_next(next_page_link, custom_headers = nil)
488
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
489
+ request_headers = {}
490
+
491
+ # Set Headers
492
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
493
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
494
+ path_template = '{nextLink}'
495
+ options = {
496
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
497
+ skip_encoding_path_params: {'nextLink' => next_page_link},
498
+ headers: request_headers.merge(custom_headers || {})
499
+ }
500
+ request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
501
+ promise = request.run_promise do |req|
502
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
503
+ end
504
+
505
+ promise = promise.then do |http_response|
506
+ status_code = http_response.status
507
+ response_content = http_response.body
508
+ unless status_code == 200
509
+ error_model = JSON.load(response_content)
510
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
511
+ end
512
+
513
+ # Create Result
514
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
515
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
516
+ # Deserialize Response
517
+ if status_code == 200
518
+ begin
519
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
520
+ unless parsed_response.nil?
521
+ parsed_response = PublicIPAddressListResult.deserialize_object(parsed_response)
522
+ end
523
+ result.body = parsed_response
524
+ rescue Exception => e
525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
526
+ end
527
+ end
528
+
529
+ result
530
+ end
531
+
532
+ promise.execute
533
+ end
534
+
535
+ end
536
+ end