azure_mgmt_network 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_network.rb +129 -78
  3. data/lib/generated/azure_mgmt_network/application_gateways.rb +9 -9
  4. data/lib/generated/azure_mgmt_network/bgp_service_communities.rb +1 -1
  5. data/lib/generated/azure_mgmt_network/express_route_circuit_authorizations.rb +1 -1
  6. data/lib/generated/azure_mgmt_network/express_route_circuit_peerings.rb +1 -1
  7. data/lib/generated/azure_mgmt_network/express_route_circuits.rb +1 -1
  8. data/lib/generated/azure_mgmt_network/express_route_service_providers.rb +1 -1
  9. data/lib/generated/azure_mgmt_network/load_balancers.rb +6 -6
  10. data/lib/generated/azure_mgmt_network/local_network_gateways.rb +5 -5
  11. data/lib/generated/azure_mgmt_network/models/access.rb +1 -1
  12. data/lib/generated/azure_mgmt_network/models/address_space.rb +1 -1
  13. data/lib/generated/azure_mgmt_network/models/application_gateway.rb +1 -1
  14. data/lib/generated/azure_mgmt_network/models/application_gateway_authentication_certificate.rb +1 -1
  15. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address.rb +1 -1
  16. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +1 -1
  17. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health.rb +1 -1
  18. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_http_settings.rb +1 -1
  19. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_pool.rb +1 -1
  20. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_server.rb +1 -1
  21. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_server_health.rb +1 -1
  22. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +13 -1
  23. data/lib/generated/azure_mgmt_network/models/application_gateway_connection_draining.rb +61 -0
  24. data/lib/generated/azure_mgmt_network/models/application_gateway_cookie_based_affinity.rb +1 -1
  25. data/lib/generated/azure_mgmt_network/models/application_gateway_firewall_mode.rb +1 -1
  26. data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_ipconfiguration.rb +1 -1
  27. data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_port.rb +1 -1
  28. data/lib/generated/azure_mgmt_network/models/application_gateway_http_listener.rb +1 -1
  29. data/lib/generated/azure_mgmt_network/models/application_gateway_ipconfiguration.rb +1 -1
  30. data/lib/generated/azure_mgmt_network/models/application_gateway_list_result.rb +1 -1
  31. data/lib/generated/azure_mgmt_network/models/application_gateway_operational_state.rb +1 -1
  32. data/lib/generated/azure_mgmt_network/models/application_gateway_path_rule.rb +1 -1
  33. data/lib/generated/azure_mgmt_network/models/application_gateway_probe.rb +1 -1
  34. data/lib/generated/azure_mgmt_network/models/application_gateway_protocol.rb +1 -1
  35. data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +1 -1
  36. data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule_type.rb +1 -1
  37. data/lib/generated/azure_mgmt_network/models/application_gateway_sku.rb +1 -1
  38. data/lib/generated/azure_mgmt_network/models/application_gateway_sku_name.rb +1 -1
  39. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +1 -1
  40. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_policy.rb +1 -1
  41. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_protocol.rb +1 -1
  42. data/lib/generated/azure_mgmt_network/models/application_gateway_tier.rb +1 -1
  43. data/lib/generated/azure_mgmt_network/models/application_gateway_url_path_map.rb +1 -1
  44. data/lib/generated/azure_mgmt_network/models/application_gateway_web_application_firewall_configuration.rb +3 -2
  45. data/lib/generated/azure_mgmt_network/models/association_type.rb +16 -0
  46. data/lib/generated/azure_mgmt_network/models/authorization_list_result.rb +1 -1
  47. data/lib/generated/azure_mgmt_network/models/authorization_use_status.rb +1 -1
  48. data/lib/generated/azure_mgmt_network/models/azure_async_operation_result.rb +64 -0
  49. data/lib/generated/azure_mgmt_network/models/backend_address_pool.rb +1 -1
  50. data/lib/generated/azure_mgmt_network/models/bgp_peer_state.rb +19 -0
  51. data/lib/generated/azure_mgmt_network/models/bgp_peer_status.rb +124 -0
  52. data/lib/generated/azure_mgmt_network/models/bgp_peer_status_list_result.rb +52 -0
  53. data/lib/generated/azure_mgmt_network/models/bgp_service_community.rb +1 -1
  54. data/lib/generated/azure_mgmt_network/models/bgp_service_community_list_result.rb +1 -1
  55. data/lib/generated/azure_mgmt_network/models/bgp_settings.rb +1 -1
  56. data/lib/generated/azure_mgmt_network/models/bgpcommunity.rb +1 -1
  57. data/lib/generated/azure_mgmt_network/models/connection_reset_shared_key.rb +1 -1
  58. data/lib/generated/azure_mgmt_network/models/connection_shared_key.rb +1 -1
  59. data/lib/generated/azure_mgmt_network/models/dhcp_options.rb +1 -1
  60. data/lib/generated/azure_mgmt_network/models/direction.rb +16 -0
  61. data/lib/generated/azure_mgmt_network/models/dns_name_availability_result.rb +1 -1
  62. data/lib/generated/azure_mgmt_network/models/effective_network_security_group.rb +1 -1
  63. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_association.rb +1 -1
  64. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_list_result.rb +1 -1
  65. data/lib/generated/azure_mgmt_network/models/effective_network_security_rule.rb +1 -1
  66. data/lib/generated/azure_mgmt_network/models/effective_route.rb +1 -1
  67. data/lib/generated/azure_mgmt_network/models/effective_route_list_result.rb +1 -1
  68. data/lib/generated/azure_mgmt_network/models/effective_route_source.rb +1 -1
  69. data/lib/generated/azure_mgmt_network/models/effective_route_state.rb +1 -1
  70. data/lib/generated/azure_mgmt_network/models/error.rb +93 -0
  71. data/lib/generated/azure_mgmt_network/models/error_details.rb +65 -0
  72. data/lib/generated/azure_mgmt_network/models/express_route_circuit.rb +1 -1
  73. data/lib/generated/azure_mgmt_network/models/express_route_circuit_arp_table.rb +1 -1
  74. data/lib/generated/azure_mgmt_network/models/express_route_circuit_authorization.rb +1 -1
  75. data/lib/generated/azure_mgmt_network/models/express_route_circuit_list_result.rb +1 -1
  76. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering.rb +12 -12
  77. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_advertised_public_prefix_state.rb +1 -1
  78. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_config.rb +1 -1
  79. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +1 -1
  80. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_state.rb +1 -1
  81. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_type.rb +1 -1
  82. data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table.rb +1 -1
  83. data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table_summary.rb +1 -1
  84. data/lib/generated/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +1 -1
  85. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku.rb +1 -1
  86. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku_family.rb +1 -1
  87. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku_tier.rb +1 -1
  88. data/lib/generated/azure_mgmt_network/models/express_route_circuit_stats.rb +1 -1
  89. data/lib/generated/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +1 -1
  90. data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +1 -1
  91. data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_summary_list_result.rb +1 -1
  92. data/lib/generated/azure_mgmt_network/models/express_route_service_provider.rb +1 -1
  93. data/lib/generated/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +1 -1
  94. data/lib/generated/azure_mgmt_network/models/express_route_service_provider_list_result.rb +1 -1
  95. data/lib/generated/azure_mgmt_network/models/flow_log_information.rb +76 -0
  96. data/lib/generated/azure_mgmt_network/models/flow_log_status_parameters.rb +45 -0
  97. data/lib/generated/azure_mgmt_network/models/frontend_ipconfiguration.rb +1 -1
  98. data/lib/generated/azure_mgmt_network/models/gateway_route.rb +112 -0
  99. data/lib/generated/azure_mgmt_network/models/gateway_route_list_result.rb +52 -0
  100. data/lib/generated/azure_mgmt_network/models/inbound_nat_pool.rb +1 -1
  101. data/lib/generated/azure_mgmt_network/models/inbound_nat_rule.rb +1 -1
  102. data/lib/generated/azure_mgmt_network/models/ipaddress_availability_result.rb +1 -1
  103. data/lib/generated/azure_mgmt_network/models/ipallocation_method.rb +1 -1
  104. data/lib/generated/azure_mgmt_network/models/ipconfiguration.rb +1 -1
  105. data/lib/generated/azure_mgmt_network/models/ipversion.rb +1 -1
  106. data/lib/generated/azure_mgmt_network/models/load_balancer.rb +1 -1
  107. data/lib/generated/azure_mgmt_network/models/load_balancer_list_result.rb +1 -1
  108. data/lib/generated/azure_mgmt_network/models/load_balancing_rule.rb +1 -1
  109. data/lib/generated/azure_mgmt_network/models/load_distribution.rb +1 -1
  110. data/lib/generated/azure_mgmt_network/models/local_network_gateway.rb +1 -1
  111. data/lib/generated/azure_mgmt_network/models/local_network_gateway_list_result.rb +1 -1
  112. data/lib/generated/azure_mgmt_network/models/network_interface.rb +1 -1
  113. data/lib/generated/azure_mgmt_network/models/network_interface_association.rb +63 -0
  114. data/lib/generated/azure_mgmt_network/models/network_interface_dns_settings.rb +1 -1
  115. data/lib/generated/azure_mgmt_network/models/network_interface_ipconfiguration.rb +1 -1
  116. data/lib/generated/azure_mgmt_network/models/network_interface_list_result.rb +1 -1
  117. data/lib/generated/azure_mgmt_network/models/network_operation_status.rb +17 -0
  118. data/lib/generated/azure_mgmt_network/models/network_security_group.rb +1 -1
  119. data/lib/generated/azure_mgmt_network/models/network_security_group_list_result.rb +1 -1
  120. data/lib/generated/azure_mgmt_network/models/network_watcher.rb +101 -0
  121. data/lib/generated/azure_mgmt_network/models/network_watcher_list_result.rb +52 -0
  122. data/lib/generated/azure_mgmt_network/models/next_hop_parameters.rb +77 -0
  123. data/lib/generated/azure_mgmt_network/models/next_hop_result.rb +69 -0
  124. data/lib/generated/azure_mgmt_network/models/next_hop_type.rb +20 -0
  125. data/lib/generated/azure_mgmt_network/models/outbound_nat_rule.rb +1 -1
  126. data/lib/generated/azure_mgmt_network/models/packet_capture.rb +110 -0
  127. data/lib/generated/azure_mgmt_network/models/packet_capture_filter.rb +101 -0
  128. data/lib/generated/azure_mgmt_network/models/packet_capture_list_result.rb +53 -0
  129. data/lib/generated/azure_mgmt_network/models/packet_capture_parameters.rb +110 -0
  130. data/lib/generated/azure_mgmt_network/models/packet_capture_query_status_result.rb +103 -0
  131. data/lib/generated/azure_mgmt_network/models/packet_capture_result.rb +156 -0
  132. data/lib/generated/azure_mgmt_network/models/packet_capture_storage_location.rb +70 -0
  133. data/lib/generated/azure_mgmt_network/models/patch_route_filter.rb +1 -1
  134. data/lib/generated/azure_mgmt_network/models/patch_route_filter_rule.rb +1 -1
  135. data/lib/generated/azure_mgmt_network/models/pc_error.rb +19 -0
  136. data/lib/generated/azure_mgmt_network/models/pc_protocol.rb +17 -0
  137. data/lib/generated/azure_mgmt_network/models/pc_status.rb +19 -0
  138. data/lib/generated/azure_mgmt_network/models/probe.rb +1 -1
  139. data/lib/generated/azure_mgmt_network/models/probe_protocol.rb +1 -1
  140. data/lib/generated/azure_mgmt_network/models/processor_architecture.rb +1 -1
  141. data/lib/generated/azure_mgmt_network/models/protocol.rb +16 -0
  142. data/lib/generated/azure_mgmt_network/models/provisioning_state.rb +18 -0
  143. data/lib/generated/azure_mgmt_network/models/public_ipaddress.rb +1 -1
  144. data/lib/generated/azure_mgmt_network/models/public_ipaddress_dns_settings.rb +1 -1
  145. data/lib/generated/azure_mgmt_network/models/public_ipaddress_list_result.rb +1 -1
  146. data/lib/generated/azure_mgmt_network/models/query_troubleshooting_parameters.rb +45 -0
  147. data/lib/generated/azure_mgmt_network/models/resource_navigation_link.rb +1 -1
  148. data/lib/generated/azure_mgmt_network/models/retention_policy_parameters.rb +58 -0
  149. data/lib/generated/azure_mgmt_network/models/route.rb +1 -1
  150. data/lib/generated/azure_mgmt_network/models/route_filter.rb +1 -1
  151. data/lib/generated/azure_mgmt_network/models/route_filter_list_result.rb +1 -1
  152. data/lib/generated/azure_mgmt_network/models/route_filter_rule.rb +1 -1
  153. data/lib/generated/azure_mgmt_network/models/route_filter_rule_list_result.rb +1 -1
  154. data/lib/generated/azure_mgmt_network/models/route_list_result.rb +1 -1
  155. data/lib/generated/azure_mgmt_network/models/route_next_hop_type.rb +1 -1
  156. data/lib/generated/azure_mgmt_network/models/route_table.rb +1 -1
  157. data/lib/generated/azure_mgmt_network/models/route_table_list_result.rb +1 -1
  158. data/lib/generated/azure_mgmt_network/models/security_group_network_interface.rb +55 -0
  159. data/lib/generated/azure_mgmt_network/models/security_group_view_parameters.rb +44 -0
  160. data/lib/generated/azure_mgmt_network/models/security_group_view_result.rb +53 -0
  161. data/lib/generated/azure_mgmt_network/models/security_rule.rb +1 -1
  162. data/lib/generated/azure_mgmt_network/models/security_rule_access.rb +1 -1
  163. data/lib/generated/azure_mgmt_network/models/security_rule_associations.rb +94 -0
  164. data/lib/generated/azure_mgmt_network/models/security_rule_direction.rb +1 -1
  165. data/lib/generated/azure_mgmt_network/models/security_rule_list_result.rb +1 -1
  166. data/lib/generated/azure_mgmt_network/models/security_rule_protocol.rb +1 -1
  167. data/lib/generated/azure_mgmt_network/models/service_provider_provisioning_state.rb +1 -1
  168. data/lib/generated/azure_mgmt_network/models/subnet.rb +1 -1
  169. data/lib/generated/azure_mgmt_network/models/subnet_association.rb +63 -0
  170. data/lib/generated/azure_mgmt_network/models/subnet_list_result.rb +1 -1
  171. data/lib/generated/azure_mgmt_network/models/topology.rb +86 -0
  172. data/lib/generated/azure_mgmt_network/models/topology_association.rb +67 -0
  173. data/lib/generated/azure_mgmt_network/models/topology_parameters.rb +45 -0
  174. data/lib/generated/azure_mgmt_network/models/topology_resource.rb +83 -0
  175. data/lib/generated/azure_mgmt_network/models/transport_protocol.rb +1 -1
  176. data/lib/generated/azure_mgmt_network/models/troubleshooting_details.rb +93 -0
  177. data/lib/generated/azure_mgmt_network/models/troubleshooting_parameters.rb +66 -0
  178. data/lib/generated/azure_mgmt_network/models/troubleshooting_recommended_actions.rb +76 -0
  179. data/lib/generated/azure_mgmt_network/models/troubleshooting_result.rb +83 -0
  180. data/lib/generated/azure_mgmt_network/models/tunnel_connection_health.rb +1 -1
  181. data/lib/generated/azure_mgmt_network/models/usage.rb +1 -1
  182. data/lib/generated/azure_mgmt_network/models/usage_name.rb +1 -1
  183. data/lib/generated/azure_mgmt_network/models/usages_list_result.rb +1 -1
  184. data/lib/generated/azure_mgmt_network/models/verification_ipflow_parameters.rb +124 -0
  185. data/lib/generated/azure_mgmt_network/models/verification_ipflow_result.rb +56 -0
  186. data/lib/generated/azure_mgmt_network/models/virtual_network.rb +1 -1
  187. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway.rb +1 -1
  188. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection.rb +1 -1
  189. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +1 -1
  190. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_status.rb +1 -1
  191. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_type.rb +1 -1
  192. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_ipconfiguration.rb +1 -1
  193. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +1 -1
  194. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku.rb +1 -1
  195. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku_name.rb +1 -1
  196. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku_tier.rb +1 -1
  197. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_type.rb +1 -1
  198. data/lib/generated/azure_mgmt_network/models/virtual_network_list_result.rb +1 -1
  199. data/lib/generated/azure_mgmt_network/models/virtual_network_peering.rb +1 -1
  200. data/lib/generated/azure_mgmt_network/models/virtual_network_peering_list_result.rb +1 -1
  201. data/lib/generated/azure_mgmt_network/models/virtual_network_peering_state.rb +1 -1
  202. data/lib/generated/azure_mgmt_network/models/vpn_client_configuration.rb +1 -1
  203. data/lib/generated/azure_mgmt_network/models/vpn_client_parameters.rb +1 -1
  204. data/lib/generated/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +1 -1
  205. data/lib/generated/azure_mgmt_network/models/vpn_client_root_certificate.rb +1 -1
  206. data/lib/generated/azure_mgmt_network/models/vpn_type.rb +1 -1
  207. data/lib/generated/azure_mgmt_network/module_definition.rb +1 -1
  208. data/lib/generated/azure_mgmt_network/network_interfaces.rb +8 -8
  209. data/lib/generated/azure_mgmt_network/network_management_client.rb +59 -51
  210. data/lib/generated/azure_mgmt_network/network_security_groups.rb +6 -6
  211. data/lib/generated/azure_mgmt_network/network_watchers.rb +1804 -0
  212. data/lib/generated/azure_mgmt_network/packet_captures.rb +781 -0
  213. data/lib/generated/azure_mgmt_network/public_ipaddresses.rb +6 -6
  214. data/lib/generated/azure_mgmt_network/route_filter_rules.rb +1 -1
  215. data/lib/generated/azure_mgmt_network/route_filters.rb +1 -1
  216. data/lib/generated/azure_mgmt_network/route_tables.rb +6 -6
  217. data/lib/generated/azure_mgmt_network/routes.rb +5 -5
  218. data/lib/generated/azure_mgmt_network/security_rules.rb +5 -5
  219. data/lib/generated/azure_mgmt_network/subnets.rb +5 -5
  220. data/lib/generated/azure_mgmt_network/usages.rb +2 -2
  221. data/lib/generated/azure_mgmt_network/version.rb +2 -2
  222. data/lib/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +8 -8
  223. data/lib/generated/azure_mgmt_network/virtual_network_gateways.rb +440 -7
  224. data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +5 -5
  225. data/lib/generated/azure_mgmt_network/virtual_networks.rb +7 -7
  226. metadata +53 -2
@@ -0,0 +1,781 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.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
+ # Composite Swagger for Network Client
9
+ #
10
+ class PacketCaptures
11
+ include Azure::ARM::Network::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the PacketCaptures class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [NetworkManagementClient] reference to the NetworkManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Create and start a packet capture on the specified VM.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param network_watcher_name [String] The name of the network watcher.
30
+ # @param packet_capture_name [String] The name of the packet capture session.
31
+ # @param parameters [PacketCapture] Parameters that define the create packet
32
+ # capture operation.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [PacketCaptureResult] operation results.
37
+ #
38
+ def create(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers = nil)
39
+ response = create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group.
45
+ # @param network_watcher_name [String] The name of the network watcher.
46
+ # @param packet_capture_name [String] The name of the packet capture session.
47
+ # @param parameters [PacketCapture] Parameters that define the create packet
48
+ # capture operation.
49
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
+ # will be added to the HTTP request.
51
+ #
52
+ # @return [Concurrent::Promise] promise which provides async access to http
53
+ # response.
54
+ #
55
+ def create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers = nil)
56
+ # Send request
57
+ promise = begin_create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers)
58
+
59
+ promise = promise.then do |response|
60
+ # Defining deserialization method.
61
+ deserialize_method = lambda do |parsed_response|
62
+ result_mapper = PacketCaptureResult.mapper()
63
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
64
+ end
65
+
66
+ # Waiting for response.
67
+ @client.get_long_running_operation_result(response, deserialize_method)
68
+ end
69
+
70
+ promise
71
+ end
72
+
73
+ #
74
+ # Gets a packet capture session by name.
75
+ #
76
+ # @param resource_group_name [String] The name of the resource group.
77
+ # @param network_watcher_name [String] The name of the network watcher.
78
+ # @param packet_capture_name [String] The name of the packet capture session.
79
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
80
+ # will be added to the HTTP request.
81
+ #
82
+ # @return [PacketCaptureResult] operation results.
83
+ #
84
+ def get(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
85
+ response = get_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
86
+ response.body unless response.nil?
87
+ end
88
+
89
+ #
90
+ # Gets a packet capture session by name.
91
+ #
92
+ # @param resource_group_name [String] The name of the resource group.
93
+ # @param network_watcher_name [String] The name of the network watcher.
94
+ # @param packet_capture_name [String] The name of the packet capture session.
95
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
96
+ # will be added to the HTTP request.
97
+ #
98
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
99
+ #
100
+ def get_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
101
+ get_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
102
+ end
103
+
104
+ #
105
+ # Gets a packet capture session by name.
106
+ #
107
+ # @param resource_group_name [String] The name of the resource group.
108
+ # @param network_watcher_name [String] The name of the network watcher.
109
+ # @param packet_capture_name [String] The name of the packet capture session.
110
+ # @param [Hash{String => String}] A hash of custom headers that will be added
111
+ # to the HTTP request.
112
+ #
113
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
114
+ #
115
+ def get_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
116
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
117
+ fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
118
+ fail ArgumentError, 'packet_capture_name is nil' if packet_capture_name.nil?
119
+ api_version = '2016-12-01'
120
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
121
+
122
+
123
+ request_headers = {}
124
+
125
+ # Set Headers
126
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
127
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
128
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'
129
+
130
+ request_url = @base_url || @client.base_url
131
+
132
+ options = {
133
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
134
+ path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'packetCaptureName' => packet_capture_name,'subscriptionId' => @client.subscription_id},
135
+ query_params: {'api-version' => api_version},
136
+ headers: request_headers.merge(custom_headers || {}),
137
+ base_url: request_url
138
+ }
139
+ promise = @client.make_request_async(:get, path_template, options)
140
+
141
+ promise = promise.then do |result|
142
+ http_response = result.response
143
+ status_code = http_response.status
144
+ response_content = http_response.body
145
+ unless status_code == 200
146
+ error_model = JSON.load(response_content)
147
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
148
+ end
149
+
150
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
151
+ # Deserialize Response
152
+ if status_code == 200
153
+ begin
154
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
155
+ result_mapper = PacketCaptureResult.mapper()
156
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
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
+ # Deletes the specified packet capture session.
170
+ #
171
+ # @param resource_group_name [String] The name of the resource group.
172
+ # @param network_watcher_name [String] The name of the network watcher.
173
+ # @param packet_capture_name [String] The name of the packet capture session.
174
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
175
+ # will be added to the HTTP request.
176
+ #
177
+ def delete(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
178
+ response = delete_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
179
+ nil
180
+ end
181
+
182
+ #
183
+ # @param resource_group_name [String] The name of the resource group.
184
+ # @param network_watcher_name [String] The name of the network watcher.
185
+ # @param packet_capture_name [String] The name of the packet capture session.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] promise which provides async access to http
190
+ # response.
191
+ #
192
+ def delete_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
193
+ # Send request
194
+ promise = begin_delete_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers)
195
+
196
+ promise = promise.then do |response|
197
+ # Defining deserialization method.
198
+ deserialize_method = lambda do |parsed_response|
199
+ end
200
+
201
+ # Waiting for response.
202
+ @client.get_long_running_operation_result(response, deserialize_method)
203
+ end
204
+
205
+ promise
206
+ end
207
+
208
+ #
209
+ # Stops a specified packet capture session.
210
+ #
211
+ # @param resource_group_name [String] The name of the resource group.
212
+ # @param network_watcher_name [String] The name of the network watcher.
213
+ # @param packet_capture_name [String] The name of the packet capture session.
214
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
215
+ # will be added to the HTTP request.
216
+ #
217
+ def stop(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
218
+ response = stop_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
219
+ nil
220
+ end
221
+
222
+ #
223
+ # @param resource_group_name [String] The name of the resource group.
224
+ # @param network_watcher_name [String] The name of the network watcher.
225
+ # @param packet_capture_name [String] The name of the packet capture session.
226
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
227
+ # will be added to the HTTP request.
228
+ #
229
+ # @return [Concurrent::Promise] promise which provides async access to http
230
+ # response.
231
+ #
232
+ def stop_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
233
+ # Send request
234
+ promise = begin_stop_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers)
235
+
236
+ promise = promise.then do |response|
237
+ # Defining deserialization method.
238
+ deserialize_method = lambda do |parsed_response|
239
+ end
240
+
241
+ # Waiting for response.
242
+ @client.get_long_running_operation_result(response, deserialize_method)
243
+ end
244
+
245
+ promise
246
+ end
247
+
248
+ #
249
+ # Query the status of a running packet capture session.
250
+ #
251
+ # @param resource_group_name [String] The name of the resource group.
252
+ # @param network_watcher_name [String] The name of the Network Watcher
253
+ # resource.
254
+ # @param packet_capture_name [String] The name given to the packet capture
255
+ # session.
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [PacketCaptureQueryStatusResult] operation results.
260
+ #
261
+ def get_status(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
262
+ response = get_status_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
263
+ response.body unless response.nil?
264
+ end
265
+
266
+ #
267
+ # @param resource_group_name [String] The name of the resource group.
268
+ # @param network_watcher_name [String] The name of the Network Watcher
269
+ # resource.
270
+ # @param packet_capture_name [String] The name given to the packet capture
271
+ # session.
272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
273
+ # will be added to the HTTP request.
274
+ #
275
+ # @return [Concurrent::Promise] promise which provides async access to http
276
+ # response.
277
+ #
278
+ def get_status_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
279
+ # Send request
280
+ promise = begin_get_status_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers)
281
+
282
+ promise = promise.then do |response|
283
+ # Defining deserialization method.
284
+ deserialize_method = lambda do |parsed_response|
285
+ result_mapper = PacketCaptureQueryStatusResult.mapper()
286
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
287
+ end
288
+
289
+ # Waiting for response.
290
+ @client.get_long_running_operation_result(response, deserialize_method)
291
+ end
292
+
293
+ promise
294
+ end
295
+
296
+ #
297
+ # Lists all packet capture sessions within the specified resource group.
298
+ #
299
+ # @param resource_group_name [String] The name of the resource group.
300
+ # @param network_watcher_name [String] The name of the Network Watcher
301
+ # resource.
302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
303
+ # will be added to the HTTP request.
304
+ #
305
+ # @return [PacketCaptureListResult] operation results.
306
+ #
307
+ def list(resource_group_name, network_watcher_name, custom_headers = nil)
308
+ response = list_async(resource_group_name, network_watcher_name, custom_headers).value!
309
+ response.body unless response.nil?
310
+ end
311
+
312
+ #
313
+ # Lists all packet capture sessions within the specified resource group.
314
+ #
315
+ # @param resource_group_name [String] The name of the resource group.
316
+ # @param network_watcher_name [String] The name of the Network Watcher
317
+ # resource.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
322
+ #
323
+ def list_with_http_info(resource_group_name, network_watcher_name, custom_headers = nil)
324
+ list_async(resource_group_name, network_watcher_name, custom_headers).value!
325
+ end
326
+
327
+ #
328
+ # Lists all packet capture sessions within the specified resource group.
329
+ #
330
+ # @param resource_group_name [String] The name of the resource group.
331
+ # @param network_watcher_name [String] The name of the Network Watcher
332
+ # resource.
333
+ # @param [Hash{String => String}] A hash of custom headers that will be added
334
+ # to the HTTP request.
335
+ #
336
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
337
+ #
338
+ def list_async(resource_group_name, network_watcher_name, custom_headers = nil)
339
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
340
+ fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
341
+ api_version = '2016-12-01'
342
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
343
+
344
+
345
+ request_headers = {}
346
+
347
+ # Set Headers
348
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
349
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
350
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'
351
+
352
+ request_url = @base_url || @client.base_url
353
+
354
+ options = {
355
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
356
+ path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
357
+ query_params: {'api-version' => api_version},
358
+ headers: request_headers.merge(custom_headers || {}),
359
+ base_url: request_url
360
+ }
361
+ promise = @client.make_request_async(:get, path_template, options)
362
+
363
+ promise = promise.then do |result|
364
+ http_response = result.response
365
+ status_code = http_response.status
366
+ response_content = http_response.body
367
+ unless status_code == 200
368
+ error_model = JSON.load(response_content)
369
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
370
+ end
371
+
372
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
373
+ # Deserialize Response
374
+ if status_code == 200
375
+ begin
376
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
377
+ result_mapper = PacketCaptureListResult.mapper()
378
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
379
+ rescue Exception => e
380
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
381
+ end
382
+ end
383
+
384
+ result
385
+ end
386
+
387
+ promise.execute
388
+ end
389
+
390
+ #
391
+ # Create and start a packet capture on the specified VM.
392
+ #
393
+ # @param resource_group_name [String] The name of the resource group.
394
+ # @param network_watcher_name [String] The name of the network watcher.
395
+ # @param packet_capture_name [String] The name of the packet capture session.
396
+ # @param parameters [PacketCapture] Parameters that define the create packet
397
+ # capture operation.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ # @return [PacketCaptureResult] operation results.
402
+ #
403
+ def begin_create(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers = nil)
404
+ response = begin_create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers).value!
405
+ response.body unless response.nil?
406
+ end
407
+
408
+ #
409
+ # Create and start a packet capture on the specified VM.
410
+ #
411
+ # @param resource_group_name [String] The name of the resource group.
412
+ # @param network_watcher_name [String] The name of the network watcher.
413
+ # @param packet_capture_name [String] The name of the packet capture session.
414
+ # @param parameters [PacketCapture] Parameters that define the create packet
415
+ # capture operation.
416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
417
+ # will be added to the HTTP request.
418
+ #
419
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
420
+ #
421
+ def begin_create_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers = nil)
422
+ begin_create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers).value!
423
+ end
424
+
425
+ #
426
+ # Create and start a packet capture on the specified VM.
427
+ #
428
+ # @param resource_group_name [String] The name of the resource group.
429
+ # @param network_watcher_name [String] The name of the network watcher.
430
+ # @param packet_capture_name [String] The name of the packet capture session.
431
+ # @param parameters [PacketCapture] Parameters that define the create packet
432
+ # capture operation.
433
+ # @param [Hash{String => String}] A hash of custom headers that will be added
434
+ # to the HTTP request.
435
+ #
436
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
437
+ #
438
+ def begin_create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers = nil)
439
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
440
+ fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
441
+ fail ArgumentError, 'packet_capture_name is nil' if packet_capture_name.nil?
442
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
443
+ api_version = '2016-12-01'
444
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
445
+
446
+
447
+ request_headers = {}
448
+
449
+ # Set Headers
450
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
451
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
452
+
453
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
454
+
455
+ # Serialize Request
456
+ request_mapper = PacketCapture.mapper()
457
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
458
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
459
+
460
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'
461
+
462
+ request_url = @base_url || @client.base_url
463
+
464
+ options = {
465
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
466
+ path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'packetCaptureName' => packet_capture_name,'subscriptionId' => @client.subscription_id},
467
+ query_params: {'api-version' => api_version},
468
+ body: request_content,
469
+ headers: request_headers.merge(custom_headers || {}),
470
+ base_url: request_url
471
+ }
472
+ promise = @client.make_request_async(:put, path_template, options)
473
+
474
+ promise = promise.then do |result|
475
+ http_response = result.response
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 201
479
+ error_model = JSON.load(response_content)
480
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
481
+ end
482
+
483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
+ # Deserialize Response
485
+ if status_code == 201
486
+ begin
487
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
488
+ result_mapper = PacketCaptureResult.mapper()
489
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
490
+ rescue Exception => e
491
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
492
+ end
493
+ end
494
+
495
+ result
496
+ end
497
+
498
+ promise.execute
499
+ end
500
+
501
+ #
502
+ # Deletes the specified packet capture session.
503
+ #
504
+ # @param resource_group_name [String] The name of the resource group.
505
+ # @param network_watcher_name [String] The name of the network watcher.
506
+ # @param packet_capture_name [String] The name of the packet capture session.
507
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
508
+ # will be added to the HTTP request.
509
+ #
510
+ #
511
+ def begin_delete(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
512
+ response = begin_delete_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
513
+ nil
514
+ end
515
+
516
+ #
517
+ # Deletes the specified packet capture session.
518
+ #
519
+ # @param resource_group_name [String] The name of the resource group.
520
+ # @param network_watcher_name [String] The name of the network watcher.
521
+ # @param packet_capture_name [String] The name of the packet capture session.
522
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
523
+ # will be added to the HTTP request.
524
+ #
525
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
526
+ #
527
+ def begin_delete_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
528
+ begin_delete_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
529
+ end
530
+
531
+ #
532
+ # Deletes the specified packet capture session.
533
+ #
534
+ # @param resource_group_name [String] The name of the resource group.
535
+ # @param network_watcher_name [String] The name of the network watcher.
536
+ # @param packet_capture_name [String] The name of the packet capture session.
537
+ # @param [Hash{String => String}] A hash of custom headers that will be added
538
+ # to the HTTP request.
539
+ #
540
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
541
+ #
542
+ def begin_delete_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
543
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
544
+ fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
545
+ fail ArgumentError, 'packet_capture_name is nil' if packet_capture_name.nil?
546
+ api_version = '2016-12-01'
547
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
548
+
549
+
550
+ request_headers = {}
551
+
552
+ # Set Headers
553
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
554
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
555
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'
556
+
557
+ request_url = @base_url || @client.base_url
558
+
559
+ options = {
560
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
561
+ path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'packetCaptureName' => packet_capture_name,'subscriptionId' => @client.subscription_id},
562
+ query_params: {'api-version' => api_version},
563
+ headers: request_headers.merge(custom_headers || {}),
564
+ base_url: request_url
565
+ }
566
+ promise = @client.make_request_async(:delete, path_template, options)
567
+
568
+ promise = promise.then do |result|
569
+ http_response = result.response
570
+ status_code = http_response.status
571
+ response_content = http_response.body
572
+ unless status_code == 204 || status_code == 202
573
+ error_model = JSON.load(response_content)
574
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
575
+ end
576
+
577
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
578
+
579
+ result
580
+ end
581
+
582
+ promise.execute
583
+ end
584
+
585
+ #
586
+ # Stops a specified packet capture session.
587
+ #
588
+ # @param resource_group_name [String] The name of the resource group.
589
+ # @param network_watcher_name [String] The name of the network watcher.
590
+ # @param packet_capture_name [String] The name of the packet capture session.
591
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
592
+ # will be added to the HTTP request.
593
+ #
594
+ #
595
+ def begin_stop(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
596
+ response = begin_stop_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
597
+ nil
598
+ end
599
+
600
+ #
601
+ # Stops a specified packet capture session.
602
+ #
603
+ # @param resource_group_name [String] The name of the resource group.
604
+ # @param network_watcher_name [String] The name of the network watcher.
605
+ # @param packet_capture_name [String] The name of the packet capture session.
606
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
607
+ # will be added to the HTTP request.
608
+ #
609
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
610
+ #
611
+ def begin_stop_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
612
+ begin_stop_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
613
+ end
614
+
615
+ #
616
+ # Stops a specified packet capture session.
617
+ #
618
+ # @param resource_group_name [String] The name of the resource group.
619
+ # @param network_watcher_name [String] The name of the network watcher.
620
+ # @param packet_capture_name [String] The name of the packet capture session.
621
+ # @param [Hash{String => String}] A hash of custom headers that will be added
622
+ # to the HTTP request.
623
+ #
624
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
625
+ #
626
+ def begin_stop_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
627
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
628
+ fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
629
+ fail ArgumentError, 'packet_capture_name is nil' if packet_capture_name.nil?
630
+ api_version = '2016-12-01'
631
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
632
+
633
+
634
+ request_headers = {}
635
+
636
+ # Set Headers
637
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
638
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
639
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'
640
+
641
+ request_url = @base_url || @client.base_url
642
+
643
+ options = {
644
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
645
+ path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'packetCaptureName' => packet_capture_name,'subscriptionId' => @client.subscription_id},
646
+ query_params: {'api-version' => api_version},
647
+ headers: request_headers.merge(custom_headers || {}),
648
+ base_url: request_url
649
+ }
650
+ promise = @client.make_request_async(:post, path_template, options)
651
+
652
+ promise = promise.then do |result|
653
+ http_response = result.response
654
+ status_code = http_response.status
655
+ response_content = http_response.body
656
+ unless status_code == 200 || status_code == 202
657
+ error_model = JSON.load(response_content)
658
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
659
+ end
660
+
661
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
662
+
663
+ result
664
+ end
665
+
666
+ promise.execute
667
+ end
668
+
669
+ #
670
+ # Query the status of a running packet capture session.
671
+ #
672
+ # @param resource_group_name [String] The name of the resource group.
673
+ # @param network_watcher_name [String] The name of the Network Watcher
674
+ # resource.
675
+ # @param packet_capture_name [String] The name given to the packet capture
676
+ # session.
677
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
678
+ # will be added to the HTTP request.
679
+ #
680
+ # @return [PacketCaptureQueryStatusResult] operation results.
681
+ #
682
+ def begin_get_status(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
683
+ response = begin_get_status_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
684
+ response.body unless response.nil?
685
+ end
686
+
687
+ #
688
+ # Query the status of a running packet capture session.
689
+ #
690
+ # @param resource_group_name [String] The name of the resource group.
691
+ # @param network_watcher_name [String] The name of the Network Watcher
692
+ # resource.
693
+ # @param packet_capture_name [String] The name given to the packet capture
694
+ # session.
695
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
696
+ # will be added to the HTTP request.
697
+ #
698
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
699
+ #
700
+ def begin_get_status_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
701
+ begin_get_status_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers).value!
702
+ end
703
+
704
+ #
705
+ # Query the status of a running packet capture session.
706
+ #
707
+ # @param resource_group_name [String] The name of the resource group.
708
+ # @param network_watcher_name [String] The name of the Network Watcher
709
+ # resource.
710
+ # @param packet_capture_name [String] The name given to the packet capture
711
+ # session.
712
+ # @param [Hash{String => String}] A hash of custom headers that will be added
713
+ # to the HTTP request.
714
+ #
715
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
716
+ #
717
+ def begin_get_status_async(resource_group_name, network_watcher_name, packet_capture_name, custom_headers = nil)
718
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
719
+ fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
720
+ fail ArgumentError, 'packet_capture_name is nil' if packet_capture_name.nil?
721
+ api_version = '2016-12-01'
722
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
723
+
724
+
725
+ request_headers = {}
726
+
727
+ # Set Headers
728
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
729
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
730
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'
731
+
732
+ request_url = @base_url || @client.base_url
733
+
734
+ options = {
735
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
736
+ path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'packetCaptureName' => packet_capture_name,'subscriptionId' => @client.subscription_id},
737
+ query_params: {'api-version' => api_version},
738
+ headers: request_headers.merge(custom_headers || {}),
739
+ base_url: request_url
740
+ }
741
+ promise = @client.make_request_async(:post, path_template, options)
742
+
743
+ promise = promise.then do |result|
744
+ http_response = result.response
745
+ status_code = http_response.status
746
+ response_content = http_response.body
747
+ unless status_code == 200 || status_code == 202
748
+ error_model = JSON.load(response_content)
749
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
750
+ end
751
+
752
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
753
+ # Deserialize Response
754
+ if status_code == 200
755
+ begin
756
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
757
+ result_mapper = PacketCaptureQueryStatusResult.mapper()
758
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
759
+ rescue Exception => e
760
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
761
+ end
762
+ end
763
+ # Deserialize Response
764
+ if status_code == 202
765
+ begin
766
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
767
+ result_mapper = PacketCaptureQueryStatusResult.mapper()
768
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
769
+ rescue Exception => e
770
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
771
+ end
772
+ end
773
+
774
+ result
775
+ end
776
+
777
+ promise.execute
778
+ end
779
+
780
+ end
781
+ end