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.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_network.rb +129 -78
- data/lib/generated/azure_mgmt_network/application_gateways.rb +9 -9
- data/lib/generated/azure_mgmt_network/bgp_service_communities.rb +1 -1
- data/lib/generated/azure_mgmt_network/express_route_circuit_authorizations.rb +1 -1
- data/lib/generated/azure_mgmt_network/express_route_circuit_peerings.rb +1 -1
- data/lib/generated/azure_mgmt_network/express_route_circuits.rb +1 -1
- data/lib/generated/azure_mgmt_network/express_route_service_providers.rb +1 -1
- data/lib/generated/azure_mgmt_network/load_balancers.rb +6 -6
- data/lib/generated/azure_mgmt_network/local_network_gateways.rb +5 -5
- data/lib/generated/azure_mgmt_network/models/access.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/address_space.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_authentication_certificate.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_http_settings.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_pool.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_server.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_health_server_health.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +13 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_connection_draining.rb +61 -0
- data/lib/generated/azure_mgmt_network/models/application_gateway_cookie_based_affinity.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_firewall_mode.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_ipconfiguration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_port.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_http_listener.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_ipconfiguration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_operational_state.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_path_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_probe.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_protocol.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule_type.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_sku.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_sku_name.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_policy.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_protocol.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_tier.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_url_path_map.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/application_gateway_web_application_firewall_configuration.rb +3 -2
- data/lib/generated/azure_mgmt_network/models/association_type.rb +16 -0
- data/lib/generated/azure_mgmt_network/models/authorization_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/authorization_use_status.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/azure_async_operation_result.rb +64 -0
- data/lib/generated/azure_mgmt_network/models/backend_address_pool.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/bgp_peer_state.rb +19 -0
- data/lib/generated/azure_mgmt_network/models/bgp_peer_status.rb +124 -0
- data/lib/generated/azure_mgmt_network/models/bgp_peer_status_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_network/models/bgp_service_community.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/bgp_service_community_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/bgp_settings.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/bgpcommunity.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/connection_reset_shared_key.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/connection_shared_key.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/dhcp_options.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/direction.rb +16 -0
- data/lib/generated/azure_mgmt_network/models/dns_name_availability_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_network_security_group.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_network_security_group_association.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_network_security_group_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_network_security_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_route.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_route_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_route_source.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/effective_route_state.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/error.rb +93 -0
- data/lib/generated/azure_mgmt_network/models/error_details.rb +65 -0
- data/lib/generated/azure_mgmt_network/models/express_route_circuit.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_arp_table.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_authorization.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering.rb +12 -12
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_advertised_public_prefix_state.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_config.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_state.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_type.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table_summary.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku_family.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku_tier.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuit_stats.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_summary_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_service_provider.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/express_route_service_provider_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/flow_log_information.rb +76 -0
- data/lib/generated/azure_mgmt_network/models/flow_log_status_parameters.rb +45 -0
- data/lib/generated/azure_mgmt_network/models/frontend_ipconfiguration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/gateway_route.rb +112 -0
- data/lib/generated/azure_mgmt_network/models/gateway_route_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_network/models/inbound_nat_pool.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/inbound_nat_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/ipaddress_availability_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/ipallocation_method.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/ipconfiguration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/ipversion.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/load_balancer.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/load_balancer_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/load_balancing_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/load_distribution.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/local_network_gateway.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/local_network_gateway_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_interface.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_interface_association.rb +63 -0
- data/lib/generated/azure_mgmt_network/models/network_interface_dns_settings.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_interface_ipconfiguration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_interface_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_operation_status.rb +17 -0
- data/lib/generated/azure_mgmt_network/models/network_security_group.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_security_group_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/network_watcher.rb +101 -0
- data/lib/generated/azure_mgmt_network/models/network_watcher_list_result.rb +52 -0
- data/lib/generated/azure_mgmt_network/models/next_hop_parameters.rb +77 -0
- data/lib/generated/azure_mgmt_network/models/next_hop_result.rb +69 -0
- data/lib/generated/azure_mgmt_network/models/next_hop_type.rb +20 -0
- data/lib/generated/azure_mgmt_network/models/outbound_nat_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/packet_capture.rb +110 -0
- data/lib/generated/azure_mgmt_network/models/packet_capture_filter.rb +101 -0
- data/lib/generated/azure_mgmt_network/models/packet_capture_list_result.rb +53 -0
- data/lib/generated/azure_mgmt_network/models/packet_capture_parameters.rb +110 -0
- data/lib/generated/azure_mgmt_network/models/packet_capture_query_status_result.rb +103 -0
- data/lib/generated/azure_mgmt_network/models/packet_capture_result.rb +156 -0
- data/lib/generated/azure_mgmt_network/models/packet_capture_storage_location.rb +70 -0
- data/lib/generated/azure_mgmt_network/models/patch_route_filter.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/patch_route_filter_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/pc_error.rb +19 -0
- data/lib/generated/azure_mgmt_network/models/pc_protocol.rb +17 -0
- data/lib/generated/azure_mgmt_network/models/pc_status.rb +19 -0
- data/lib/generated/azure_mgmt_network/models/probe.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/probe_protocol.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/processor_architecture.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/protocol.rb +16 -0
- data/lib/generated/azure_mgmt_network/models/provisioning_state.rb +18 -0
- data/lib/generated/azure_mgmt_network/models/public_ipaddress.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/public_ipaddress_dns_settings.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/public_ipaddress_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/query_troubleshooting_parameters.rb +45 -0
- data/lib/generated/azure_mgmt_network/models/resource_navigation_link.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/retention_policy_parameters.rb +58 -0
- data/lib/generated/azure_mgmt_network/models/route.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_filter.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_filter_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_filter_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_filter_rule_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_next_hop_type.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_table.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/route_table_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/security_group_network_interface.rb +55 -0
- data/lib/generated/azure_mgmt_network/models/security_group_view_parameters.rb +44 -0
- data/lib/generated/azure_mgmt_network/models/security_group_view_result.rb +53 -0
- data/lib/generated/azure_mgmt_network/models/security_rule.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/security_rule_access.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/security_rule_associations.rb +94 -0
- data/lib/generated/azure_mgmt_network/models/security_rule_direction.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/security_rule_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/security_rule_protocol.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/service_provider_provisioning_state.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/subnet.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/subnet_association.rb +63 -0
- data/lib/generated/azure_mgmt_network/models/subnet_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/topology.rb +86 -0
- data/lib/generated/azure_mgmt_network/models/topology_association.rb +67 -0
- data/lib/generated/azure_mgmt_network/models/topology_parameters.rb +45 -0
- data/lib/generated/azure_mgmt_network/models/topology_resource.rb +83 -0
- data/lib/generated/azure_mgmt_network/models/transport_protocol.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/troubleshooting_details.rb +93 -0
- data/lib/generated/azure_mgmt_network/models/troubleshooting_parameters.rb +66 -0
- data/lib/generated/azure_mgmt_network/models/troubleshooting_recommended_actions.rb +76 -0
- data/lib/generated/azure_mgmt_network/models/troubleshooting_result.rb +83 -0
- data/lib/generated/azure_mgmt_network/models/tunnel_connection_health.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/usage.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/usage_name.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/usages_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/verification_ipflow_parameters.rb +124 -0
- data/lib/generated/azure_mgmt_network/models/verification_ipflow_result.rb +56 -0
- data/lib/generated/azure_mgmt_network/models/virtual_network.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_status.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_type.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_ipconfiguration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku_name.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku_tier.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_type.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_peering.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_peering_list_result.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/virtual_network_peering_state.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/vpn_client_configuration.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/vpn_client_parameters.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/vpn_client_root_certificate.rb +1 -1
- data/lib/generated/azure_mgmt_network/models/vpn_type.rb +1 -1
- data/lib/generated/azure_mgmt_network/module_definition.rb +1 -1
- data/lib/generated/azure_mgmt_network/network_interfaces.rb +8 -8
- data/lib/generated/azure_mgmt_network/network_management_client.rb +59 -51
- data/lib/generated/azure_mgmt_network/network_security_groups.rb +6 -6
- data/lib/generated/azure_mgmt_network/network_watchers.rb +1804 -0
- data/lib/generated/azure_mgmt_network/packet_captures.rb +781 -0
- data/lib/generated/azure_mgmt_network/public_ipaddresses.rb +6 -6
- data/lib/generated/azure_mgmt_network/route_filter_rules.rb +1 -1
- data/lib/generated/azure_mgmt_network/route_filters.rb +1 -1
- data/lib/generated/azure_mgmt_network/route_tables.rb +6 -6
- data/lib/generated/azure_mgmt_network/routes.rb +5 -5
- data/lib/generated/azure_mgmt_network/security_rules.rb +5 -5
- data/lib/generated/azure_mgmt_network/subnets.rb +5 -5
- data/lib/generated/azure_mgmt_network/usages.rb +2 -2
- data/lib/generated/azure_mgmt_network/version.rb +2 -2
- data/lib/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +8 -8
- data/lib/generated/azure_mgmt_network/virtual_network_gateways.rb +440 -7
- data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +5 -5
- data/lib/generated/azure_mgmt_network/virtual_networks.rb +7 -7
- metadata +53 -2
@@ -0,0 +1,1804 @@
|
|
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 NetworkWatchers
|
11
|
+
include Azure::ARM::Network::Models
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the NetworkWatchers 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
|
+
# Creates or updates a network watcher in the specified resource group.
|
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 parameters [NetworkWatcher] Parameters that define the network watcher
|
31
|
+
# resource.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [NetworkWatcher] operation results.
|
36
|
+
#
|
37
|
+
def create_or_update(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
38
|
+
response = create_or_update_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Creates or updates a network watcher in the specified resource group.
|
44
|
+
#
|
45
|
+
# @param resource_group_name [String] The name of the resource group.
|
46
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
47
|
+
# @param parameters [NetworkWatcher] Parameters that define the network watcher
|
48
|
+
# resource.
|
49
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
50
|
+
# will be added to the HTTP request.
|
51
|
+
#
|
52
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
53
|
+
#
|
54
|
+
def create_or_update_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
55
|
+
create_or_update_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Creates or updates a network watcher in the specified resource group.
|
60
|
+
#
|
61
|
+
# @param resource_group_name [String] The name of the resource group.
|
62
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
63
|
+
# @param parameters [NetworkWatcher] Parameters that define the network watcher
|
64
|
+
# resource.
|
65
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
66
|
+
# to the HTTP request.
|
67
|
+
#
|
68
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
69
|
+
#
|
70
|
+
def create_or_update_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
71
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
72
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
73
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
74
|
+
api_version = '2016-12-01'
|
75
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
76
|
+
|
77
|
+
|
78
|
+
request_headers = {}
|
79
|
+
|
80
|
+
# Set Headers
|
81
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
82
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
83
|
+
|
84
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
85
|
+
|
86
|
+
# Serialize Request
|
87
|
+
request_mapper = NetworkWatcher.mapper()
|
88
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
89
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
90
|
+
|
91
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'
|
92
|
+
|
93
|
+
request_url = @base_url || @client.base_url
|
94
|
+
|
95
|
+
options = {
|
96
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
97
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
98
|
+
query_params: {'api-version' => api_version},
|
99
|
+
body: request_content,
|
100
|
+
headers: request_headers.merge(custom_headers || {}),
|
101
|
+
base_url: request_url
|
102
|
+
}
|
103
|
+
promise = @client.make_request_async(:put, path_template, options)
|
104
|
+
|
105
|
+
promise = promise.then do |result|
|
106
|
+
http_response = result.response
|
107
|
+
status_code = http_response.status
|
108
|
+
response_content = http_response.body
|
109
|
+
unless status_code == 200 || status_code == 201
|
110
|
+
error_model = JSON.load(response_content)
|
111
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
112
|
+
end
|
113
|
+
|
114
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
115
|
+
# Deserialize Response
|
116
|
+
if status_code == 200
|
117
|
+
begin
|
118
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
119
|
+
result_mapper = NetworkWatcher.mapper()
|
120
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
121
|
+
rescue Exception => e
|
122
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
# Deserialize Response
|
126
|
+
if status_code == 201
|
127
|
+
begin
|
128
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
129
|
+
result_mapper = NetworkWatcher.mapper()
|
130
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
131
|
+
rescue Exception => e
|
132
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
result
|
137
|
+
end
|
138
|
+
|
139
|
+
promise.execute
|
140
|
+
end
|
141
|
+
|
142
|
+
#
|
143
|
+
# Gets the specified network watcher by resource group.
|
144
|
+
#
|
145
|
+
# @param resource_group_name [String] The name of the resource group.
|
146
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
147
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
148
|
+
# will be added to the HTTP request.
|
149
|
+
#
|
150
|
+
# @return [NetworkWatcher] operation results.
|
151
|
+
#
|
152
|
+
def get(resource_group_name, network_watcher_name, custom_headers = nil)
|
153
|
+
response = get_async(resource_group_name, network_watcher_name, custom_headers).value!
|
154
|
+
response.body unless response.nil?
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Gets the specified network watcher by resource group.
|
159
|
+
#
|
160
|
+
# @param resource_group_name [String] The name of the resource group.
|
161
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
162
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
163
|
+
# will be added to the HTTP request.
|
164
|
+
#
|
165
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
166
|
+
#
|
167
|
+
def get_with_http_info(resource_group_name, network_watcher_name, custom_headers = nil)
|
168
|
+
get_async(resource_group_name, network_watcher_name, custom_headers).value!
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# Gets the specified network watcher by resource group.
|
173
|
+
#
|
174
|
+
# @param resource_group_name [String] The name of the resource group.
|
175
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
176
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
177
|
+
# to the HTTP request.
|
178
|
+
#
|
179
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
180
|
+
#
|
181
|
+
def get_async(resource_group_name, network_watcher_name, custom_headers = nil)
|
182
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
183
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
184
|
+
api_version = '2016-12-01'
|
185
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
186
|
+
|
187
|
+
|
188
|
+
request_headers = {}
|
189
|
+
|
190
|
+
# Set Headers
|
191
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
192
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
193
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'
|
194
|
+
|
195
|
+
request_url = @base_url || @client.base_url
|
196
|
+
|
197
|
+
options = {
|
198
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
199
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
200
|
+
query_params: {'api-version' => api_version},
|
201
|
+
headers: request_headers.merge(custom_headers || {}),
|
202
|
+
base_url: request_url
|
203
|
+
}
|
204
|
+
promise = @client.make_request_async(:get, path_template, options)
|
205
|
+
|
206
|
+
promise = promise.then do |result|
|
207
|
+
http_response = result.response
|
208
|
+
status_code = http_response.status
|
209
|
+
response_content = http_response.body
|
210
|
+
unless status_code == 200
|
211
|
+
error_model = JSON.load(response_content)
|
212
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
213
|
+
end
|
214
|
+
|
215
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
216
|
+
# Deserialize Response
|
217
|
+
if status_code == 200
|
218
|
+
begin
|
219
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
220
|
+
result_mapper = NetworkWatcher.mapper()
|
221
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
222
|
+
rescue Exception => e
|
223
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
result
|
228
|
+
end
|
229
|
+
|
230
|
+
promise.execute
|
231
|
+
end
|
232
|
+
|
233
|
+
#
|
234
|
+
# Deletes the specified network watcher resource.
|
235
|
+
#
|
236
|
+
# @param resource_group_name [String] The name of the resource group.
|
237
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
238
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
239
|
+
# will be added to the HTTP request.
|
240
|
+
#
|
241
|
+
def delete(resource_group_name, network_watcher_name, custom_headers = nil)
|
242
|
+
response = delete_async(resource_group_name, network_watcher_name, custom_headers).value!
|
243
|
+
nil
|
244
|
+
end
|
245
|
+
|
246
|
+
#
|
247
|
+
# @param resource_group_name [String] The name of the resource group.
|
248
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
249
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
250
|
+
# will be added to the HTTP request.
|
251
|
+
#
|
252
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
253
|
+
# response.
|
254
|
+
#
|
255
|
+
def delete_async(resource_group_name, network_watcher_name, custom_headers = nil)
|
256
|
+
# Send request
|
257
|
+
promise = begin_delete_async(resource_group_name, network_watcher_name, custom_headers)
|
258
|
+
|
259
|
+
promise = promise.then do |response|
|
260
|
+
# Defining deserialization method.
|
261
|
+
deserialize_method = lambda do |parsed_response|
|
262
|
+
end
|
263
|
+
|
264
|
+
# Waiting for response.
|
265
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
266
|
+
end
|
267
|
+
|
268
|
+
promise
|
269
|
+
end
|
270
|
+
|
271
|
+
#
|
272
|
+
# Gets all network watchers by resource group.
|
273
|
+
#
|
274
|
+
# @param resource_group_name [String] The name of the resource group.
|
275
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
276
|
+
# will be added to the HTTP request.
|
277
|
+
#
|
278
|
+
# @return [NetworkWatcherListResult] operation results.
|
279
|
+
#
|
280
|
+
def list(resource_group_name, custom_headers = nil)
|
281
|
+
response = list_async(resource_group_name, custom_headers).value!
|
282
|
+
response.body unless response.nil?
|
283
|
+
end
|
284
|
+
|
285
|
+
#
|
286
|
+
# Gets all network watchers by resource group.
|
287
|
+
#
|
288
|
+
# @param resource_group_name [String] The name of the resource group.
|
289
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
290
|
+
# will be added to the HTTP request.
|
291
|
+
#
|
292
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
293
|
+
#
|
294
|
+
def list_with_http_info(resource_group_name, custom_headers = nil)
|
295
|
+
list_async(resource_group_name, custom_headers).value!
|
296
|
+
end
|
297
|
+
|
298
|
+
#
|
299
|
+
# Gets all network watchers by resource group.
|
300
|
+
#
|
301
|
+
# @param resource_group_name [String] The name of the resource group.
|
302
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
303
|
+
# to the HTTP request.
|
304
|
+
#
|
305
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
306
|
+
#
|
307
|
+
def list_async(resource_group_name, custom_headers = nil)
|
308
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
309
|
+
api_version = '2016-12-01'
|
310
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
311
|
+
|
312
|
+
|
313
|
+
request_headers = {}
|
314
|
+
|
315
|
+
# Set Headers
|
316
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
317
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
318
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'
|
319
|
+
|
320
|
+
request_url = @base_url || @client.base_url
|
321
|
+
|
322
|
+
options = {
|
323
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
324
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
325
|
+
query_params: {'api-version' => api_version},
|
326
|
+
headers: request_headers.merge(custom_headers || {}),
|
327
|
+
base_url: request_url
|
328
|
+
}
|
329
|
+
promise = @client.make_request_async(:get, path_template, options)
|
330
|
+
|
331
|
+
promise = promise.then do |result|
|
332
|
+
http_response = result.response
|
333
|
+
status_code = http_response.status
|
334
|
+
response_content = http_response.body
|
335
|
+
unless status_code == 200
|
336
|
+
error_model = JSON.load(response_content)
|
337
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
338
|
+
end
|
339
|
+
|
340
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
341
|
+
# Deserialize Response
|
342
|
+
if status_code == 200
|
343
|
+
begin
|
344
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
345
|
+
result_mapper = NetworkWatcherListResult.mapper()
|
346
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
347
|
+
rescue Exception => e
|
348
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
result
|
353
|
+
end
|
354
|
+
|
355
|
+
promise.execute
|
356
|
+
end
|
357
|
+
|
358
|
+
#
|
359
|
+
# Gets all network watchers by subscription.
|
360
|
+
#
|
361
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
362
|
+
# will be added to the HTTP request.
|
363
|
+
#
|
364
|
+
# @return [NetworkWatcherListResult] operation results.
|
365
|
+
#
|
366
|
+
def list_all(custom_headers = nil)
|
367
|
+
response = list_all_async(custom_headers).value!
|
368
|
+
response.body unless response.nil?
|
369
|
+
end
|
370
|
+
|
371
|
+
#
|
372
|
+
# Gets all network watchers by subscription.
|
373
|
+
#
|
374
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
375
|
+
# will be added to the HTTP request.
|
376
|
+
#
|
377
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
378
|
+
#
|
379
|
+
def list_all_with_http_info(custom_headers = nil)
|
380
|
+
list_all_async(custom_headers).value!
|
381
|
+
end
|
382
|
+
|
383
|
+
#
|
384
|
+
# Gets all network watchers by subscription.
|
385
|
+
#
|
386
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
387
|
+
# to the HTTP request.
|
388
|
+
#
|
389
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
390
|
+
#
|
391
|
+
def list_all_async(custom_headers = nil)
|
392
|
+
api_version = '2016-12-01'
|
393
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
394
|
+
|
395
|
+
|
396
|
+
request_headers = {}
|
397
|
+
|
398
|
+
# Set Headers
|
399
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
400
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
401
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'
|
402
|
+
|
403
|
+
request_url = @base_url || @client.base_url
|
404
|
+
|
405
|
+
options = {
|
406
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
407
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
408
|
+
query_params: {'api-version' => api_version},
|
409
|
+
headers: request_headers.merge(custom_headers || {}),
|
410
|
+
base_url: request_url
|
411
|
+
}
|
412
|
+
promise = @client.make_request_async(:get, path_template, options)
|
413
|
+
|
414
|
+
promise = promise.then do |result|
|
415
|
+
http_response = result.response
|
416
|
+
status_code = http_response.status
|
417
|
+
response_content = http_response.body
|
418
|
+
unless status_code == 200
|
419
|
+
error_model = JSON.load(response_content)
|
420
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
421
|
+
end
|
422
|
+
|
423
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
424
|
+
# Deserialize Response
|
425
|
+
if status_code == 200
|
426
|
+
begin
|
427
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
428
|
+
result_mapper = NetworkWatcherListResult.mapper()
|
429
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
430
|
+
rescue Exception => e
|
431
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
result
|
436
|
+
end
|
437
|
+
|
438
|
+
promise.execute
|
439
|
+
end
|
440
|
+
|
441
|
+
#
|
442
|
+
# Gets the current network topology by resource group.
|
443
|
+
#
|
444
|
+
# @param resource_group_name [String] The name of the resource group.
|
445
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
446
|
+
# @param parameters [TopologyParameters] Parameters that define the
|
447
|
+
# representation of topology.
|
448
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
449
|
+
# will be added to the HTTP request.
|
450
|
+
#
|
451
|
+
# @return [Topology] operation results.
|
452
|
+
#
|
453
|
+
def get_topology(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
454
|
+
response = get_topology_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
455
|
+
response.body unless response.nil?
|
456
|
+
end
|
457
|
+
|
458
|
+
#
|
459
|
+
# Gets the current network topology by resource group.
|
460
|
+
#
|
461
|
+
# @param resource_group_name [String] The name of the resource group.
|
462
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
463
|
+
# @param parameters [TopologyParameters] Parameters that define the
|
464
|
+
# representation of topology.
|
465
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
466
|
+
# will be added to the HTTP request.
|
467
|
+
#
|
468
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
469
|
+
#
|
470
|
+
def get_topology_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
471
|
+
get_topology_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
472
|
+
end
|
473
|
+
|
474
|
+
#
|
475
|
+
# Gets the current network topology by resource group.
|
476
|
+
#
|
477
|
+
# @param resource_group_name [String] The name of the resource group.
|
478
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
479
|
+
# @param parameters [TopologyParameters] Parameters that define the
|
480
|
+
# representation of topology.
|
481
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
482
|
+
# to the HTTP request.
|
483
|
+
#
|
484
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
485
|
+
#
|
486
|
+
def get_topology_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
487
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
488
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
489
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
490
|
+
api_version = '2016-12-01'
|
491
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
492
|
+
|
493
|
+
|
494
|
+
request_headers = {}
|
495
|
+
|
496
|
+
# Set Headers
|
497
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
498
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
499
|
+
|
500
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
501
|
+
|
502
|
+
# Serialize Request
|
503
|
+
request_mapper = TopologyParameters.mapper()
|
504
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
505
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
506
|
+
|
507
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'
|
508
|
+
|
509
|
+
request_url = @base_url || @client.base_url
|
510
|
+
|
511
|
+
options = {
|
512
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
513
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
514
|
+
query_params: {'api-version' => api_version},
|
515
|
+
body: request_content,
|
516
|
+
headers: request_headers.merge(custom_headers || {}),
|
517
|
+
base_url: request_url
|
518
|
+
}
|
519
|
+
promise = @client.make_request_async(:post, path_template, options)
|
520
|
+
|
521
|
+
promise = promise.then do |result|
|
522
|
+
http_response = result.response
|
523
|
+
status_code = http_response.status
|
524
|
+
response_content = http_response.body
|
525
|
+
unless status_code == 200
|
526
|
+
error_model = JSON.load(response_content)
|
527
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
528
|
+
end
|
529
|
+
|
530
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
531
|
+
# Deserialize Response
|
532
|
+
if status_code == 200
|
533
|
+
begin
|
534
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
535
|
+
result_mapper = Topology.mapper()
|
536
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
537
|
+
rescue Exception => e
|
538
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
539
|
+
end
|
540
|
+
end
|
541
|
+
|
542
|
+
result
|
543
|
+
end
|
544
|
+
|
545
|
+
promise.execute
|
546
|
+
end
|
547
|
+
|
548
|
+
#
|
549
|
+
# Verify IP flow from the specified VM to a location given the currently
|
550
|
+
# configured NSG rules.
|
551
|
+
#
|
552
|
+
# @param resource_group_name [String] The name of the resource group.
|
553
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
554
|
+
# @param parameters [VerificationIPFlowParameters] Parameters that define the
|
555
|
+
# IP flow to be verified.
|
556
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
557
|
+
# will be added to the HTTP request.
|
558
|
+
#
|
559
|
+
# @return [VerificationIPFlowResult] operation results.
|
560
|
+
#
|
561
|
+
def verify_ipflow(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
562
|
+
response = verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
563
|
+
response.body unless response.nil?
|
564
|
+
end
|
565
|
+
|
566
|
+
#
|
567
|
+
# @param resource_group_name [String] The name of the resource group.
|
568
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
569
|
+
# @param parameters [VerificationIPFlowParameters] Parameters that define the
|
570
|
+
# IP flow to be verified.
|
571
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
572
|
+
# will be added to the HTTP request.
|
573
|
+
#
|
574
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
575
|
+
# response.
|
576
|
+
#
|
577
|
+
def verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
578
|
+
# Send request
|
579
|
+
promise = begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
580
|
+
|
581
|
+
promise = promise.then do |response|
|
582
|
+
# Defining deserialization method.
|
583
|
+
deserialize_method = lambda do |parsed_response|
|
584
|
+
result_mapper = VerificationIPFlowResult.mapper()
|
585
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
586
|
+
end
|
587
|
+
|
588
|
+
# Waiting for response.
|
589
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
590
|
+
end
|
591
|
+
|
592
|
+
promise
|
593
|
+
end
|
594
|
+
|
595
|
+
#
|
596
|
+
# Gets the next hop from the specified VM.
|
597
|
+
#
|
598
|
+
# @param resource_group_name [String] The name of the resource group.
|
599
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
600
|
+
# @param parameters [NextHopParameters] Parameters that define the source and
|
601
|
+
# destination endpoint.
|
602
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
603
|
+
# will be added to the HTTP request.
|
604
|
+
#
|
605
|
+
# @return [NextHopResult] operation results.
|
606
|
+
#
|
607
|
+
def get_next_hop(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
608
|
+
response = get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
609
|
+
response.body unless response.nil?
|
610
|
+
end
|
611
|
+
|
612
|
+
#
|
613
|
+
# @param resource_group_name [String] The name of the resource group.
|
614
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
615
|
+
# @param parameters [NextHopParameters] Parameters that define the source and
|
616
|
+
# destination endpoint.
|
617
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
618
|
+
# will be added to the HTTP request.
|
619
|
+
#
|
620
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
621
|
+
# response.
|
622
|
+
#
|
623
|
+
def get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
624
|
+
# Send request
|
625
|
+
promise = begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
626
|
+
|
627
|
+
promise = promise.then do |response|
|
628
|
+
# Defining deserialization method.
|
629
|
+
deserialize_method = lambda do |parsed_response|
|
630
|
+
result_mapper = NextHopResult.mapper()
|
631
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
632
|
+
end
|
633
|
+
|
634
|
+
# Waiting for response.
|
635
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
636
|
+
end
|
637
|
+
|
638
|
+
promise
|
639
|
+
end
|
640
|
+
|
641
|
+
#
|
642
|
+
# Gets the configured and effective security group rules on the specified VM.
|
643
|
+
#
|
644
|
+
# @param resource_group_name [String] The name of the resource group.
|
645
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
646
|
+
# @param parameters [SecurityGroupViewParameters] Parameters that define the VM
|
647
|
+
# to check security groups for.
|
648
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
649
|
+
# will be added to the HTTP request.
|
650
|
+
#
|
651
|
+
# @return [SecurityGroupViewResult] operation results.
|
652
|
+
#
|
653
|
+
def get_vmsecurity_rules(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
654
|
+
response = get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
655
|
+
response.body unless response.nil?
|
656
|
+
end
|
657
|
+
|
658
|
+
#
|
659
|
+
# @param resource_group_name [String] The name of the resource group.
|
660
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
661
|
+
# @param parameters [SecurityGroupViewParameters] Parameters that define the VM
|
662
|
+
# to check security groups for.
|
663
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
664
|
+
# will be added to the HTTP request.
|
665
|
+
#
|
666
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
667
|
+
# response.
|
668
|
+
#
|
669
|
+
def get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
670
|
+
# Send request
|
671
|
+
promise = begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
672
|
+
|
673
|
+
promise = promise.then do |response|
|
674
|
+
# Defining deserialization method.
|
675
|
+
deserialize_method = lambda do |parsed_response|
|
676
|
+
result_mapper = SecurityGroupViewResult.mapper()
|
677
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
678
|
+
end
|
679
|
+
|
680
|
+
# Waiting for response.
|
681
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
682
|
+
end
|
683
|
+
|
684
|
+
promise
|
685
|
+
end
|
686
|
+
|
687
|
+
#
|
688
|
+
# Initiate troubleshooting on a specified resource
|
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 parameters [TroubleshootingParameters] Parameters that define the
|
694
|
+
# resource to troubleshoot.
|
695
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
696
|
+
# will be added to the HTTP request.
|
697
|
+
#
|
698
|
+
# @return [TroubleshootingResult] operation results.
|
699
|
+
#
|
700
|
+
def get_troubleshooting(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
701
|
+
response = get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
702
|
+
response.body unless response.nil?
|
703
|
+
end
|
704
|
+
|
705
|
+
#
|
706
|
+
# @param resource_group_name [String] The name of the resource group.
|
707
|
+
# @param network_watcher_name [String] The name of the network watcher
|
708
|
+
# resource.
|
709
|
+
# @param parameters [TroubleshootingParameters] Parameters that define the
|
710
|
+
# resource to troubleshoot.
|
711
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
712
|
+
# will be added to the HTTP request.
|
713
|
+
#
|
714
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
715
|
+
# response.
|
716
|
+
#
|
717
|
+
def get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
718
|
+
# Send request
|
719
|
+
promise = begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
720
|
+
|
721
|
+
promise = promise.then do |response|
|
722
|
+
# Defining deserialization method.
|
723
|
+
deserialize_method = lambda do |parsed_response|
|
724
|
+
result_mapper = TroubleshootingResult.mapper()
|
725
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
726
|
+
end
|
727
|
+
|
728
|
+
# Waiting for response.
|
729
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
730
|
+
end
|
731
|
+
|
732
|
+
promise
|
733
|
+
end
|
734
|
+
|
735
|
+
#
|
736
|
+
# Get the last completed troubleshooting result on a specified resource
|
737
|
+
#
|
738
|
+
# @param resource_group_name [String] The name of the resource group.
|
739
|
+
# @param network_watcher_name [String] The name of the network watcher
|
740
|
+
# resource.
|
741
|
+
# @param parameters [QueryTroubleshootingParameters] Parameters that define the
|
742
|
+
# resource to query the troubleshooting result.
|
743
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
744
|
+
# will be added to the HTTP request.
|
745
|
+
#
|
746
|
+
# @return [TroubleshootingResult] operation results.
|
747
|
+
#
|
748
|
+
def get_troubleshooting_result(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
749
|
+
response = get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
750
|
+
response.body unless response.nil?
|
751
|
+
end
|
752
|
+
|
753
|
+
#
|
754
|
+
# @param resource_group_name [String] The name of the resource group.
|
755
|
+
# @param network_watcher_name [String] The name of the network watcher
|
756
|
+
# resource.
|
757
|
+
# @param parameters [QueryTroubleshootingParameters] Parameters that define the
|
758
|
+
# resource to query the troubleshooting result.
|
759
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
760
|
+
# will be added to the HTTP request.
|
761
|
+
#
|
762
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
763
|
+
# response.
|
764
|
+
#
|
765
|
+
def get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
766
|
+
# Send request
|
767
|
+
promise = begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
768
|
+
|
769
|
+
promise = promise.then do |response|
|
770
|
+
# Defining deserialization method.
|
771
|
+
deserialize_method = lambda do |parsed_response|
|
772
|
+
result_mapper = TroubleshootingResult.mapper()
|
773
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
774
|
+
end
|
775
|
+
|
776
|
+
# Waiting for response.
|
777
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
778
|
+
end
|
779
|
+
|
780
|
+
promise
|
781
|
+
end
|
782
|
+
|
783
|
+
#
|
784
|
+
# Configures flow log on a specified resource.
|
785
|
+
#
|
786
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
787
|
+
# group.
|
788
|
+
# @param network_watcher_name [String] The name of the network watcher
|
789
|
+
# resource.
|
790
|
+
# @param parameters [FlowLogInformation] Parameters that define the
|
791
|
+
# configuration of flow log.
|
792
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
793
|
+
# will be added to the HTTP request.
|
794
|
+
#
|
795
|
+
# @return [FlowLogInformation] operation results.
|
796
|
+
#
|
797
|
+
def set_flow_log_configuration(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
798
|
+
response = set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
799
|
+
response.body unless response.nil?
|
800
|
+
end
|
801
|
+
|
802
|
+
#
|
803
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
804
|
+
# group.
|
805
|
+
# @param network_watcher_name [String] The name of the network watcher
|
806
|
+
# resource.
|
807
|
+
# @param parameters [FlowLogInformation] Parameters that define the
|
808
|
+
# configuration of flow log.
|
809
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
810
|
+
# will be added to the HTTP request.
|
811
|
+
#
|
812
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
813
|
+
# response.
|
814
|
+
#
|
815
|
+
def set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
816
|
+
# Send request
|
817
|
+
promise = begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
818
|
+
|
819
|
+
promise = promise.then do |response|
|
820
|
+
# Defining deserialization method.
|
821
|
+
deserialize_method = lambda do |parsed_response|
|
822
|
+
result_mapper = FlowLogInformation.mapper()
|
823
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
824
|
+
end
|
825
|
+
|
826
|
+
# Waiting for response.
|
827
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
828
|
+
end
|
829
|
+
|
830
|
+
promise
|
831
|
+
end
|
832
|
+
|
833
|
+
#
|
834
|
+
# Queries status of flow log on a specified resource.
|
835
|
+
#
|
836
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
837
|
+
# group.
|
838
|
+
# @param network_watcher_name [String] The name of the network watcher
|
839
|
+
# resource.
|
840
|
+
# @param parameters [FlowLogStatusParameters] Parameters that define a resource
|
841
|
+
# to query flow log status.
|
842
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
843
|
+
# will be added to the HTTP request.
|
844
|
+
#
|
845
|
+
# @return [FlowLogInformation] operation results.
|
846
|
+
#
|
847
|
+
def get_flow_log_status(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
848
|
+
response = get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
849
|
+
response.body unless response.nil?
|
850
|
+
end
|
851
|
+
|
852
|
+
#
|
853
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
854
|
+
# group.
|
855
|
+
# @param network_watcher_name [String] The name of the network watcher
|
856
|
+
# resource.
|
857
|
+
# @param parameters [FlowLogStatusParameters] Parameters that define a resource
|
858
|
+
# to query flow log status.
|
859
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
860
|
+
# will be added to the HTTP request.
|
861
|
+
#
|
862
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
863
|
+
# response.
|
864
|
+
#
|
865
|
+
def get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
866
|
+
# Send request
|
867
|
+
promise = begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers)
|
868
|
+
|
869
|
+
promise = promise.then do |response|
|
870
|
+
# Defining deserialization method.
|
871
|
+
deserialize_method = lambda do |parsed_response|
|
872
|
+
result_mapper = FlowLogInformation.mapper()
|
873
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
874
|
+
end
|
875
|
+
|
876
|
+
# Waiting for response.
|
877
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
878
|
+
end
|
879
|
+
|
880
|
+
promise
|
881
|
+
end
|
882
|
+
|
883
|
+
#
|
884
|
+
# Deletes the specified network watcher resource.
|
885
|
+
#
|
886
|
+
# @param resource_group_name [String] The name of the resource group.
|
887
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
888
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
889
|
+
# will be added to the HTTP request.
|
890
|
+
#
|
891
|
+
#
|
892
|
+
def begin_delete(resource_group_name, network_watcher_name, custom_headers = nil)
|
893
|
+
response = begin_delete_async(resource_group_name, network_watcher_name, custom_headers).value!
|
894
|
+
nil
|
895
|
+
end
|
896
|
+
|
897
|
+
#
|
898
|
+
# Deletes the specified network watcher resource.
|
899
|
+
#
|
900
|
+
# @param resource_group_name [String] The name of the resource group.
|
901
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
902
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
903
|
+
# will be added to the HTTP request.
|
904
|
+
#
|
905
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
906
|
+
#
|
907
|
+
def begin_delete_with_http_info(resource_group_name, network_watcher_name, custom_headers = nil)
|
908
|
+
begin_delete_async(resource_group_name, network_watcher_name, custom_headers).value!
|
909
|
+
end
|
910
|
+
|
911
|
+
#
|
912
|
+
# Deletes the specified network watcher resource.
|
913
|
+
#
|
914
|
+
# @param resource_group_name [String] The name of the resource group.
|
915
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
916
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
917
|
+
# to the HTTP request.
|
918
|
+
#
|
919
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
920
|
+
#
|
921
|
+
def begin_delete_async(resource_group_name, network_watcher_name, custom_headers = nil)
|
922
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
923
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
924
|
+
api_version = '2016-12-01'
|
925
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
926
|
+
|
927
|
+
|
928
|
+
request_headers = {}
|
929
|
+
|
930
|
+
# Set Headers
|
931
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
932
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
933
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'
|
934
|
+
|
935
|
+
request_url = @base_url || @client.base_url
|
936
|
+
|
937
|
+
options = {
|
938
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
939
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
940
|
+
query_params: {'api-version' => api_version},
|
941
|
+
headers: request_headers.merge(custom_headers || {}),
|
942
|
+
base_url: request_url
|
943
|
+
}
|
944
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
945
|
+
|
946
|
+
promise = promise.then do |result|
|
947
|
+
http_response = result.response
|
948
|
+
status_code = http_response.status
|
949
|
+
response_content = http_response.body
|
950
|
+
unless status_code == 202 || status_code == 204
|
951
|
+
error_model = JSON.load(response_content)
|
952
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
953
|
+
end
|
954
|
+
|
955
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
956
|
+
|
957
|
+
result
|
958
|
+
end
|
959
|
+
|
960
|
+
promise.execute
|
961
|
+
end
|
962
|
+
|
963
|
+
#
|
964
|
+
# Verify IP flow from the specified VM to a location given the currently
|
965
|
+
# configured NSG rules.
|
966
|
+
#
|
967
|
+
# @param resource_group_name [String] The name of the resource group.
|
968
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
969
|
+
# @param parameters [VerificationIPFlowParameters] Parameters that define the
|
970
|
+
# IP flow to be verified.
|
971
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
972
|
+
# will be added to the HTTP request.
|
973
|
+
#
|
974
|
+
# @return [VerificationIPFlowResult] operation results.
|
975
|
+
#
|
976
|
+
def begin_verify_ipflow(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
977
|
+
response = begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
978
|
+
response.body unless response.nil?
|
979
|
+
end
|
980
|
+
|
981
|
+
#
|
982
|
+
# Verify IP flow from the specified VM to a location given the currently
|
983
|
+
# configured NSG rules.
|
984
|
+
#
|
985
|
+
# @param resource_group_name [String] The name of the resource group.
|
986
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
987
|
+
# @param parameters [VerificationIPFlowParameters] Parameters that define the
|
988
|
+
# IP flow to be verified.
|
989
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
990
|
+
# will be added to the HTTP request.
|
991
|
+
#
|
992
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
993
|
+
#
|
994
|
+
def begin_verify_ipflow_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
995
|
+
begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
996
|
+
end
|
997
|
+
|
998
|
+
#
|
999
|
+
# Verify IP flow from the specified VM to a location given the currently
|
1000
|
+
# configured NSG rules.
|
1001
|
+
#
|
1002
|
+
# @param resource_group_name [String] The name of the resource group.
|
1003
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1004
|
+
# @param parameters [VerificationIPFlowParameters] Parameters that define the
|
1005
|
+
# IP flow to be verified.
|
1006
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1007
|
+
# to the HTTP request.
|
1008
|
+
#
|
1009
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1010
|
+
#
|
1011
|
+
def begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1012
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1013
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1014
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1015
|
+
api_version = '2016-12-01'
|
1016
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1017
|
+
|
1018
|
+
|
1019
|
+
request_headers = {}
|
1020
|
+
|
1021
|
+
# Set Headers
|
1022
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1023
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1024
|
+
|
1025
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1026
|
+
|
1027
|
+
# Serialize Request
|
1028
|
+
request_mapper = VerificationIPFlowParameters.mapper()
|
1029
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1030
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1031
|
+
|
1032
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'
|
1033
|
+
|
1034
|
+
request_url = @base_url || @client.base_url
|
1035
|
+
|
1036
|
+
options = {
|
1037
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1038
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1039
|
+
query_params: {'api-version' => api_version},
|
1040
|
+
body: request_content,
|
1041
|
+
headers: request_headers.merge(custom_headers || {}),
|
1042
|
+
base_url: request_url
|
1043
|
+
}
|
1044
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1045
|
+
|
1046
|
+
promise = promise.then do |result|
|
1047
|
+
http_response = result.response
|
1048
|
+
status_code = http_response.status
|
1049
|
+
response_content = http_response.body
|
1050
|
+
unless status_code == 200 || status_code == 202
|
1051
|
+
error_model = JSON.load(response_content)
|
1052
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1056
|
+
# Deserialize Response
|
1057
|
+
if status_code == 200
|
1058
|
+
begin
|
1059
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1060
|
+
result_mapper = VerificationIPFlowResult.mapper()
|
1061
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1062
|
+
rescue Exception => e
|
1063
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1064
|
+
end
|
1065
|
+
end
|
1066
|
+
# Deserialize Response
|
1067
|
+
if status_code == 202
|
1068
|
+
begin
|
1069
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1070
|
+
result_mapper = VerificationIPFlowResult.mapper()
|
1071
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1072
|
+
rescue Exception => e
|
1073
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1074
|
+
end
|
1075
|
+
end
|
1076
|
+
|
1077
|
+
result
|
1078
|
+
end
|
1079
|
+
|
1080
|
+
promise.execute
|
1081
|
+
end
|
1082
|
+
|
1083
|
+
#
|
1084
|
+
# Gets the next hop from the specified VM.
|
1085
|
+
#
|
1086
|
+
# @param resource_group_name [String] The name of the resource group.
|
1087
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1088
|
+
# @param parameters [NextHopParameters] Parameters that define the source and
|
1089
|
+
# destination endpoint.
|
1090
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1091
|
+
# will be added to the HTTP request.
|
1092
|
+
#
|
1093
|
+
# @return [NextHopResult] operation results.
|
1094
|
+
#
|
1095
|
+
def begin_get_next_hop(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1096
|
+
response = begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1097
|
+
response.body unless response.nil?
|
1098
|
+
end
|
1099
|
+
|
1100
|
+
#
|
1101
|
+
# Gets the next hop from the specified VM.
|
1102
|
+
#
|
1103
|
+
# @param resource_group_name [String] The name of the resource group.
|
1104
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1105
|
+
# @param parameters [NextHopParameters] Parameters that define the source and
|
1106
|
+
# destination endpoint.
|
1107
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1108
|
+
# will be added to the HTTP request.
|
1109
|
+
#
|
1110
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1111
|
+
#
|
1112
|
+
def begin_get_next_hop_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1113
|
+
begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1114
|
+
end
|
1115
|
+
|
1116
|
+
#
|
1117
|
+
# Gets the next hop from the specified VM.
|
1118
|
+
#
|
1119
|
+
# @param resource_group_name [String] The name of the resource group.
|
1120
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1121
|
+
# @param parameters [NextHopParameters] Parameters that define the source and
|
1122
|
+
# destination endpoint.
|
1123
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1124
|
+
# to the HTTP request.
|
1125
|
+
#
|
1126
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1127
|
+
#
|
1128
|
+
def begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1129
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1130
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1131
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1132
|
+
api_version = '2016-12-01'
|
1133
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1134
|
+
|
1135
|
+
|
1136
|
+
request_headers = {}
|
1137
|
+
|
1138
|
+
# Set Headers
|
1139
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1140
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1141
|
+
|
1142
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1143
|
+
|
1144
|
+
# Serialize Request
|
1145
|
+
request_mapper = NextHopParameters.mapper()
|
1146
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1147
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1148
|
+
|
1149
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'
|
1150
|
+
|
1151
|
+
request_url = @base_url || @client.base_url
|
1152
|
+
|
1153
|
+
options = {
|
1154
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1155
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1156
|
+
query_params: {'api-version' => api_version},
|
1157
|
+
body: request_content,
|
1158
|
+
headers: request_headers.merge(custom_headers || {}),
|
1159
|
+
base_url: request_url
|
1160
|
+
}
|
1161
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1162
|
+
|
1163
|
+
promise = promise.then do |result|
|
1164
|
+
http_response = result.response
|
1165
|
+
status_code = http_response.status
|
1166
|
+
response_content = http_response.body
|
1167
|
+
unless status_code == 200 || status_code == 202
|
1168
|
+
error_model = JSON.load(response_content)
|
1169
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1173
|
+
# Deserialize Response
|
1174
|
+
if status_code == 200
|
1175
|
+
begin
|
1176
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1177
|
+
result_mapper = NextHopResult.mapper()
|
1178
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1179
|
+
rescue Exception => e
|
1180
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1181
|
+
end
|
1182
|
+
end
|
1183
|
+
# Deserialize Response
|
1184
|
+
if status_code == 202
|
1185
|
+
begin
|
1186
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1187
|
+
result_mapper = NextHopResult.mapper()
|
1188
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1189
|
+
rescue Exception => e
|
1190
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1191
|
+
end
|
1192
|
+
end
|
1193
|
+
|
1194
|
+
result
|
1195
|
+
end
|
1196
|
+
|
1197
|
+
promise.execute
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
#
|
1201
|
+
# Gets the configured and effective security group rules on the specified VM.
|
1202
|
+
#
|
1203
|
+
# @param resource_group_name [String] The name of the resource group.
|
1204
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1205
|
+
# @param parameters [SecurityGroupViewParameters] Parameters that define the VM
|
1206
|
+
# to check security groups for.
|
1207
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1208
|
+
# will be added to the HTTP request.
|
1209
|
+
#
|
1210
|
+
# @return [SecurityGroupViewResult] operation results.
|
1211
|
+
#
|
1212
|
+
def begin_get_vmsecurity_rules(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1213
|
+
response = begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1214
|
+
response.body unless response.nil?
|
1215
|
+
end
|
1216
|
+
|
1217
|
+
#
|
1218
|
+
# Gets the configured and effective security group rules on the specified VM.
|
1219
|
+
#
|
1220
|
+
# @param resource_group_name [String] The name of the resource group.
|
1221
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1222
|
+
# @param parameters [SecurityGroupViewParameters] Parameters that define the VM
|
1223
|
+
# to check security groups for.
|
1224
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1225
|
+
# will be added to the HTTP request.
|
1226
|
+
#
|
1227
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1228
|
+
#
|
1229
|
+
def begin_get_vmsecurity_rules_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1230
|
+
begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1231
|
+
end
|
1232
|
+
|
1233
|
+
#
|
1234
|
+
# Gets the configured and effective security group rules on the specified VM.
|
1235
|
+
#
|
1236
|
+
# @param resource_group_name [String] The name of the resource group.
|
1237
|
+
# @param network_watcher_name [String] The name of the network watcher.
|
1238
|
+
# @param parameters [SecurityGroupViewParameters] Parameters that define the VM
|
1239
|
+
# to check security groups for.
|
1240
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1241
|
+
# to the HTTP request.
|
1242
|
+
#
|
1243
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1244
|
+
#
|
1245
|
+
def begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1246
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1247
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1248
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1249
|
+
api_version = '2016-12-01'
|
1250
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1251
|
+
|
1252
|
+
|
1253
|
+
request_headers = {}
|
1254
|
+
|
1255
|
+
# Set Headers
|
1256
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1257
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1258
|
+
|
1259
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1260
|
+
|
1261
|
+
# Serialize Request
|
1262
|
+
request_mapper = SecurityGroupViewParameters.mapper()
|
1263
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1264
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1265
|
+
|
1266
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'
|
1267
|
+
|
1268
|
+
request_url = @base_url || @client.base_url
|
1269
|
+
|
1270
|
+
options = {
|
1271
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1272
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1273
|
+
query_params: {'api-version' => api_version},
|
1274
|
+
body: request_content,
|
1275
|
+
headers: request_headers.merge(custom_headers || {}),
|
1276
|
+
base_url: request_url
|
1277
|
+
}
|
1278
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1279
|
+
|
1280
|
+
promise = promise.then do |result|
|
1281
|
+
http_response = result.response
|
1282
|
+
status_code = http_response.status
|
1283
|
+
response_content = http_response.body
|
1284
|
+
unless status_code == 200 || status_code == 202
|
1285
|
+
error_model = JSON.load(response_content)
|
1286
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1290
|
+
# Deserialize Response
|
1291
|
+
if status_code == 200
|
1292
|
+
begin
|
1293
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1294
|
+
result_mapper = SecurityGroupViewResult.mapper()
|
1295
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1296
|
+
rescue Exception => e
|
1297
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1298
|
+
end
|
1299
|
+
end
|
1300
|
+
# Deserialize Response
|
1301
|
+
if status_code == 202
|
1302
|
+
begin
|
1303
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1304
|
+
result_mapper = SecurityGroupViewResult.mapper()
|
1305
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1306
|
+
rescue Exception => e
|
1307
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1308
|
+
end
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
result
|
1312
|
+
end
|
1313
|
+
|
1314
|
+
promise.execute
|
1315
|
+
end
|
1316
|
+
|
1317
|
+
#
|
1318
|
+
# Initiate troubleshooting on a specified resource
|
1319
|
+
#
|
1320
|
+
# @param resource_group_name [String] The name of the resource group.
|
1321
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1322
|
+
# resource.
|
1323
|
+
# @param parameters [TroubleshootingParameters] Parameters that define the
|
1324
|
+
# resource to troubleshoot.
|
1325
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1326
|
+
# will be added to the HTTP request.
|
1327
|
+
#
|
1328
|
+
# @return [TroubleshootingResult] operation results.
|
1329
|
+
#
|
1330
|
+
def begin_get_troubleshooting(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1331
|
+
response = begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1332
|
+
response.body unless response.nil?
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
#
|
1336
|
+
# Initiate troubleshooting on a specified resource
|
1337
|
+
#
|
1338
|
+
# @param resource_group_name [String] The name of the resource group.
|
1339
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1340
|
+
# resource.
|
1341
|
+
# @param parameters [TroubleshootingParameters] Parameters that define the
|
1342
|
+
# resource to troubleshoot.
|
1343
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1344
|
+
# will be added to the HTTP request.
|
1345
|
+
#
|
1346
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1347
|
+
#
|
1348
|
+
def begin_get_troubleshooting_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1349
|
+
begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1350
|
+
end
|
1351
|
+
|
1352
|
+
#
|
1353
|
+
# Initiate troubleshooting on a specified resource
|
1354
|
+
#
|
1355
|
+
# @param resource_group_name [String] The name of the resource group.
|
1356
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1357
|
+
# resource.
|
1358
|
+
# @param parameters [TroubleshootingParameters] Parameters that define the
|
1359
|
+
# resource to troubleshoot.
|
1360
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1361
|
+
# to the HTTP request.
|
1362
|
+
#
|
1363
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1364
|
+
#
|
1365
|
+
def begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1366
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1367
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1368
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1369
|
+
api_version = '2016-12-01'
|
1370
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1371
|
+
|
1372
|
+
|
1373
|
+
request_headers = {}
|
1374
|
+
|
1375
|
+
# Set Headers
|
1376
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1377
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1378
|
+
|
1379
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1380
|
+
|
1381
|
+
# Serialize Request
|
1382
|
+
request_mapper = TroubleshootingParameters.mapper()
|
1383
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1384
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1385
|
+
|
1386
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'
|
1387
|
+
|
1388
|
+
request_url = @base_url || @client.base_url
|
1389
|
+
|
1390
|
+
options = {
|
1391
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1392
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1393
|
+
query_params: {'api-version' => api_version},
|
1394
|
+
body: request_content,
|
1395
|
+
headers: request_headers.merge(custom_headers || {}),
|
1396
|
+
base_url: request_url
|
1397
|
+
}
|
1398
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1399
|
+
|
1400
|
+
promise = promise.then do |result|
|
1401
|
+
http_response = result.response
|
1402
|
+
status_code = http_response.status
|
1403
|
+
response_content = http_response.body
|
1404
|
+
unless status_code == 200 || status_code == 202
|
1405
|
+
error_model = JSON.load(response_content)
|
1406
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1407
|
+
end
|
1408
|
+
|
1409
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1410
|
+
# Deserialize Response
|
1411
|
+
if status_code == 200
|
1412
|
+
begin
|
1413
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1414
|
+
result_mapper = TroubleshootingResult.mapper()
|
1415
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1416
|
+
rescue Exception => e
|
1417
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1418
|
+
end
|
1419
|
+
end
|
1420
|
+
# Deserialize Response
|
1421
|
+
if status_code == 202
|
1422
|
+
begin
|
1423
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1424
|
+
result_mapper = TroubleshootingResult.mapper()
|
1425
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1426
|
+
rescue Exception => e
|
1427
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1428
|
+
end
|
1429
|
+
end
|
1430
|
+
|
1431
|
+
result
|
1432
|
+
end
|
1433
|
+
|
1434
|
+
promise.execute
|
1435
|
+
end
|
1436
|
+
|
1437
|
+
#
|
1438
|
+
# Get the last completed troubleshooting result on a specified resource
|
1439
|
+
#
|
1440
|
+
# @param resource_group_name [String] The name of the resource group.
|
1441
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1442
|
+
# resource.
|
1443
|
+
# @param parameters [QueryTroubleshootingParameters] Parameters that define the
|
1444
|
+
# resource to query the troubleshooting result.
|
1445
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1446
|
+
# will be added to the HTTP request.
|
1447
|
+
#
|
1448
|
+
# @return [TroubleshootingResult] operation results.
|
1449
|
+
#
|
1450
|
+
def begin_get_troubleshooting_result(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1451
|
+
response = begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1452
|
+
response.body unless response.nil?
|
1453
|
+
end
|
1454
|
+
|
1455
|
+
#
|
1456
|
+
# Get the last completed troubleshooting result on a specified resource
|
1457
|
+
#
|
1458
|
+
# @param resource_group_name [String] The name of the resource group.
|
1459
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1460
|
+
# resource.
|
1461
|
+
# @param parameters [QueryTroubleshootingParameters] Parameters that define the
|
1462
|
+
# resource to query the troubleshooting result.
|
1463
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1464
|
+
# will be added to the HTTP request.
|
1465
|
+
#
|
1466
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1467
|
+
#
|
1468
|
+
def begin_get_troubleshooting_result_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1469
|
+
begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1470
|
+
end
|
1471
|
+
|
1472
|
+
#
|
1473
|
+
# Get the last completed troubleshooting result on a specified resource
|
1474
|
+
#
|
1475
|
+
# @param resource_group_name [String] The name of the resource group.
|
1476
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1477
|
+
# resource.
|
1478
|
+
# @param parameters [QueryTroubleshootingParameters] Parameters that define the
|
1479
|
+
# resource to query the troubleshooting result.
|
1480
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1481
|
+
# to the HTTP request.
|
1482
|
+
#
|
1483
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1484
|
+
#
|
1485
|
+
def begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1486
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1487
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1488
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1489
|
+
api_version = '2016-12-01'
|
1490
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1491
|
+
|
1492
|
+
|
1493
|
+
request_headers = {}
|
1494
|
+
|
1495
|
+
# Set Headers
|
1496
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1497
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1498
|
+
|
1499
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1500
|
+
|
1501
|
+
# Serialize Request
|
1502
|
+
request_mapper = QueryTroubleshootingParameters.mapper()
|
1503
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1504
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1505
|
+
|
1506
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'
|
1507
|
+
|
1508
|
+
request_url = @base_url || @client.base_url
|
1509
|
+
|
1510
|
+
options = {
|
1511
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1512
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1513
|
+
query_params: {'api-version' => api_version},
|
1514
|
+
body: request_content,
|
1515
|
+
headers: request_headers.merge(custom_headers || {}),
|
1516
|
+
base_url: request_url
|
1517
|
+
}
|
1518
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1519
|
+
|
1520
|
+
promise = promise.then do |result|
|
1521
|
+
http_response = result.response
|
1522
|
+
status_code = http_response.status
|
1523
|
+
response_content = http_response.body
|
1524
|
+
unless status_code == 200 || status_code == 202
|
1525
|
+
error_model = JSON.load(response_content)
|
1526
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1527
|
+
end
|
1528
|
+
|
1529
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1530
|
+
# Deserialize Response
|
1531
|
+
if status_code == 200
|
1532
|
+
begin
|
1533
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1534
|
+
result_mapper = TroubleshootingResult.mapper()
|
1535
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1536
|
+
rescue Exception => e
|
1537
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1538
|
+
end
|
1539
|
+
end
|
1540
|
+
# Deserialize Response
|
1541
|
+
if status_code == 202
|
1542
|
+
begin
|
1543
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1544
|
+
result_mapper = TroubleshootingResult.mapper()
|
1545
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1546
|
+
rescue Exception => e
|
1547
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1548
|
+
end
|
1549
|
+
end
|
1550
|
+
|
1551
|
+
result
|
1552
|
+
end
|
1553
|
+
|
1554
|
+
promise.execute
|
1555
|
+
end
|
1556
|
+
|
1557
|
+
#
|
1558
|
+
# Configures flow log on a specified resource.
|
1559
|
+
#
|
1560
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
1561
|
+
# group.
|
1562
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1563
|
+
# resource.
|
1564
|
+
# @param parameters [FlowLogInformation] Parameters that define the
|
1565
|
+
# configuration of flow log.
|
1566
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1567
|
+
# will be added to the HTTP request.
|
1568
|
+
#
|
1569
|
+
# @return [FlowLogInformation] operation results.
|
1570
|
+
#
|
1571
|
+
def begin_set_flow_log_configuration(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1572
|
+
response = begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1573
|
+
response.body unless response.nil?
|
1574
|
+
end
|
1575
|
+
|
1576
|
+
#
|
1577
|
+
# Configures flow log on a specified resource.
|
1578
|
+
#
|
1579
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
1580
|
+
# group.
|
1581
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1582
|
+
# resource.
|
1583
|
+
# @param parameters [FlowLogInformation] Parameters that define the
|
1584
|
+
# configuration of flow log.
|
1585
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1586
|
+
# will be added to the HTTP request.
|
1587
|
+
#
|
1588
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1589
|
+
#
|
1590
|
+
def begin_set_flow_log_configuration_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1591
|
+
begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1592
|
+
end
|
1593
|
+
|
1594
|
+
#
|
1595
|
+
# Configures flow log on a specified resource.
|
1596
|
+
#
|
1597
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
1598
|
+
# group.
|
1599
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1600
|
+
# resource.
|
1601
|
+
# @param parameters [FlowLogInformation] Parameters that define the
|
1602
|
+
# configuration of flow log.
|
1603
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1604
|
+
# to the HTTP request.
|
1605
|
+
#
|
1606
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1607
|
+
#
|
1608
|
+
def begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1609
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1610
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1611
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1612
|
+
api_version = '2016-12-01'
|
1613
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1614
|
+
|
1615
|
+
|
1616
|
+
request_headers = {}
|
1617
|
+
|
1618
|
+
# Set Headers
|
1619
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1620
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1621
|
+
|
1622
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1623
|
+
|
1624
|
+
# Serialize Request
|
1625
|
+
request_mapper = FlowLogInformation.mapper()
|
1626
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1627
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1628
|
+
|
1629
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'
|
1630
|
+
|
1631
|
+
request_url = @base_url || @client.base_url
|
1632
|
+
|
1633
|
+
options = {
|
1634
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1635
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1636
|
+
query_params: {'api-version' => api_version},
|
1637
|
+
body: request_content,
|
1638
|
+
headers: request_headers.merge(custom_headers || {}),
|
1639
|
+
base_url: request_url
|
1640
|
+
}
|
1641
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1642
|
+
|
1643
|
+
promise = promise.then do |result|
|
1644
|
+
http_response = result.response
|
1645
|
+
status_code = http_response.status
|
1646
|
+
response_content = http_response.body
|
1647
|
+
unless status_code == 200 || status_code == 202
|
1648
|
+
error_model = JSON.load(response_content)
|
1649
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1653
|
+
# Deserialize Response
|
1654
|
+
if status_code == 200
|
1655
|
+
begin
|
1656
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1657
|
+
result_mapper = FlowLogInformation.mapper()
|
1658
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1659
|
+
rescue Exception => e
|
1660
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1661
|
+
end
|
1662
|
+
end
|
1663
|
+
# Deserialize Response
|
1664
|
+
if status_code == 202
|
1665
|
+
begin
|
1666
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1667
|
+
result_mapper = FlowLogInformation.mapper()
|
1668
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1669
|
+
rescue Exception => e
|
1670
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1671
|
+
end
|
1672
|
+
end
|
1673
|
+
|
1674
|
+
result
|
1675
|
+
end
|
1676
|
+
|
1677
|
+
promise.execute
|
1678
|
+
end
|
1679
|
+
|
1680
|
+
#
|
1681
|
+
# Queries status of flow log on a specified resource.
|
1682
|
+
#
|
1683
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
1684
|
+
# group.
|
1685
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1686
|
+
# resource.
|
1687
|
+
# @param parameters [FlowLogStatusParameters] Parameters that define a resource
|
1688
|
+
# to query flow log status.
|
1689
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1690
|
+
# will be added to the HTTP request.
|
1691
|
+
#
|
1692
|
+
# @return [FlowLogInformation] operation results.
|
1693
|
+
#
|
1694
|
+
def begin_get_flow_log_status(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1695
|
+
response = begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1696
|
+
response.body unless response.nil?
|
1697
|
+
end
|
1698
|
+
|
1699
|
+
#
|
1700
|
+
# Queries status of flow log on a specified resource.
|
1701
|
+
#
|
1702
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
1703
|
+
# group.
|
1704
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1705
|
+
# resource.
|
1706
|
+
# @param parameters [FlowLogStatusParameters] Parameters that define a resource
|
1707
|
+
# to query flow log status.
|
1708
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1709
|
+
# will be added to the HTTP request.
|
1710
|
+
#
|
1711
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1712
|
+
#
|
1713
|
+
def begin_get_flow_log_status_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1714
|
+
begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers).value!
|
1715
|
+
end
|
1716
|
+
|
1717
|
+
#
|
1718
|
+
# Queries status of flow log on a specified resource.
|
1719
|
+
#
|
1720
|
+
# @param resource_group_name [String] The name of the network watcher resource
|
1721
|
+
# group.
|
1722
|
+
# @param network_watcher_name [String] The name of the network watcher
|
1723
|
+
# resource.
|
1724
|
+
# @param parameters [FlowLogStatusParameters] Parameters that define a resource
|
1725
|
+
# to query flow log status.
|
1726
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1727
|
+
# to the HTTP request.
|
1728
|
+
#
|
1729
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1730
|
+
#
|
1731
|
+
def begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers = nil)
|
1732
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1733
|
+
fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil?
|
1734
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1735
|
+
api_version = '2016-12-01'
|
1736
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1737
|
+
|
1738
|
+
|
1739
|
+
request_headers = {}
|
1740
|
+
|
1741
|
+
# Set Headers
|
1742
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1743
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1744
|
+
|
1745
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1746
|
+
|
1747
|
+
# Serialize Request
|
1748
|
+
request_mapper = FlowLogStatusParameters.mapper()
|
1749
|
+
request_content = @client.serialize(request_mapper, parameters, 'parameters')
|
1750
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1751
|
+
|
1752
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'
|
1753
|
+
|
1754
|
+
request_url = @base_url || @client.base_url
|
1755
|
+
|
1756
|
+
options = {
|
1757
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1758
|
+
path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id},
|
1759
|
+
query_params: {'api-version' => api_version},
|
1760
|
+
body: request_content,
|
1761
|
+
headers: request_headers.merge(custom_headers || {}),
|
1762
|
+
base_url: request_url
|
1763
|
+
}
|
1764
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1765
|
+
|
1766
|
+
promise = promise.then do |result|
|
1767
|
+
http_response = result.response
|
1768
|
+
status_code = http_response.status
|
1769
|
+
response_content = http_response.body
|
1770
|
+
unless status_code == 200 || status_code == 202
|
1771
|
+
error_model = JSON.load(response_content)
|
1772
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1773
|
+
end
|
1774
|
+
|
1775
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1776
|
+
# Deserialize Response
|
1777
|
+
if status_code == 200
|
1778
|
+
begin
|
1779
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1780
|
+
result_mapper = FlowLogInformation.mapper()
|
1781
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1782
|
+
rescue Exception => e
|
1783
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1784
|
+
end
|
1785
|
+
end
|
1786
|
+
# Deserialize Response
|
1787
|
+
if status_code == 202
|
1788
|
+
begin
|
1789
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1790
|
+
result_mapper = FlowLogInformation.mapper()
|
1791
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
1792
|
+
rescue Exception => e
|
1793
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1794
|
+
end
|
1795
|
+
end
|
1796
|
+
|
1797
|
+
result
|
1798
|
+
end
|
1799
|
+
|
1800
|
+
promise.execute
|
1801
|
+
end
|
1802
|
+
|
1803
|
+
end
|
1804
|
+
end
|