class Azure::Network::Mgmt::V2018_01_01::NetworkWatchers
Network Client
Attributes
@return [NetworkManagementClient] reference to the NetworkManagementClient
Public Class Methods
Creates and initializes a new instance of the NetworkWatchers class. @param client service class for accessing basic functionality.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 16 def initialize(client) @client = client end
Public Instance Methods
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [ConnectivityParameters] Parameters that determine how the connectivity check will be performed. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ConnectivityInformation] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2103 def begin_check_connectivity(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [ConnectivityParameters] Parameters that determine how the connectivity check will be performed. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2144 def begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::ConnectivityParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::ConnectivityInformation.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::ConnectivityInformation.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [ConnectivityParameters] Parameters that determine how the connectivity check will be performed. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2124 def begin_check_connectivity_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Deletes the specified network watcher resource.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1163 def begin_delete(resource_group_name, network_watcher_name, custom_headers:nil) response = begin_delete_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! nil end
Deletes the specified network watcher resource.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1192 def begin_delete_async(resource_group_name, network_watcher_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 || status_code == 204 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end
Deletes the specified network watcher resource.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1178 def begin_delete_with_http_info(resource_group_name, network_watcher_name, custom_headers:nil) begin_delete_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! end
Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AzureReachabilityReportParameters] Parameters that determine Azure reachability report configuration. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [AzureReachabilityReport] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2232 def begin_get_azure_reachability_report(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AzureReachabilityReportParameters] Parameters that determine Azure reachability report configuration. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2271 def begin_get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AzureReachabilityReportParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AzureReachabilityReport.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AzureReachabilityReport.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AzureReachabilityReportParameters] Parameters that determine Azure reachability report configuration. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2252 def begin_get_azure_reachability_report_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Queries status of flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogStatusParameters] Parameters that define a resource to query flow log and traffic analytics (optional) status. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FlowLogInformation] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1975 def begin_get_flow_log_status(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Queries status of flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogStatusParameters] Parameters that define a resource to query flow log and traffic analytics (optional) status. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2014 def begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogStatusParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Queries status of flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogStatusParameters] Parameters that define a resource to query flow log and traffic analytics (optional) status. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1995 def begin_get_flow_log_status_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Gets the next hop from the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NextHopParameters] Parameters that define the source and destination endpoint. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NextHopResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1370 def begin_get_next_hop(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the next hop from the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NextHopParameters] Parameters that define the source and destination endpoint. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1403 def begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NextHopParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NextHopResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NextHopResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the next hop from the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NextHopParameters] Parameters that define the source and destination endpoint. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1387 def begin_get_next_hop_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Initiate troubleshooting on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [TroubleshootingParameters] Parameters that define the resource to troubleshoot. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [TroubleshootingResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1607 def begin_get_troubleshooting(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Initiate troubleshooting on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [TroubleshootingParameters] Parameters that define the resource to troubleshoot. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1642 def begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get the last completed troubleshooting result on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [QueryTroubleshootingParameters] Parameters that define the resource to query the troubleshooting result. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [TroubleshootingResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1728 def begin_get_troubleshooting_result(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Get the last completed troubleshooting result on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [QueryTroubleshootingParameters] Parameters that define the resource to query the troubleshooting result. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1763 def begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::QueryTroubleshootingParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get the last completed troubleshooting result on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [QueryTroubleshootingParameters] Parameters that define the resource to query the troubleshooting result. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1746 def begin_get_troubleshooting_result_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Initiate troubleshooting on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [TroubleshootingParameters] Parameters that define the resource to troubleshoot. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1625 def begin_get_troubleshooting_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Gets the configured and effective security group rules on the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [SecurityGroupViewParameters] Parameters that define the VM to check security groups for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecurityGroupViewResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1488 def begin_get_vmsecurity_rules(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the configured and effective security group rules on the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [SecurityGroupViewParameters] Parameters that define the VM to check security groups for. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1521 def begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::SecurityGroupViewParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::SecurityGroupViewResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::SecurityGroupViewResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the configured and effective security group rules on the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [SecurityGroupViewParameters] Parameters that define the VM to check security groups for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1505 def begin_get_vmsecurity_rules_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Lists all available internet service providers for a specified Azure region.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AvailableProvidersListParameters] Parameters that scope the list of available providers. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [AvailableProvidersList] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2358 def begin_list_available_providers(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_list_available_providers_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists all available internet service providers for a specified Azure region.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AvailableProvidersListParameters] Parameters that scope the list of available providers. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2395 def begin_list_available_providers_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AvailableProvidersListParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AvailableProvidersList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AvailableProvidersList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists all available internet service providers for a specified Azure region.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AvailableProvidersListParameters] Parameters that scope the list of available providers. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 2377 def begin_list_available_providers_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_list_available_providers_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Configures flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogInformation] Parameters that define the configuration of flow log. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FlowLogInformation] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1850 def begin_set_flow_log_configuration(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Configures flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogInformation] Parameters that define the configuration of flow log. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1887 def begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Configures flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogInformation] Parameters that define the configuration of flow log. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1869 def begin_set_flow_log_configuration_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Verify IP flow from the specified VM to a location given the currently configured NSG rules.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [VerificationIPFlowParameters] Parameters that define the IP flow to be verified. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [VerificationIPFlowResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1250 def begin_verify_ipflow(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Verify IP flow from the specified VM to a location given the currently configured NSG rules.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [VerificationIPFlowParameters] Parameters that define the IP flow to be verified. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1285 def begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::VerificationIPFlowParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::VerificationIPFlowResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::VerificationIPFlowResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Verify IP flow from the specified VM to a location given the currently configured NSG rules.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [VerificationIPFlowParameters] Parameters that define the IP flow to be verified. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1268 def begin_verify_ipflow_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [ConnectivityParameters] Parameters that determine how the connectivity check will be performed. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ConnectivityInformation] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1017 def check_connectivity(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [ConnectivityParameters] Parameters that determine how the connectivity check will be performed. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1035 def check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::ConnectivityInformation.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Creates or updates a network watcher in the specified resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NetworkWatcher] Parameters that define the network watcher resource. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NetworkWatcher] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 35 def create_or_update(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates or updates a network watcher in the specified resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NetworkWatcher] Parameters that define the network watcher resource. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 68 def create_or_update_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NetworkWatcher.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 201 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NetworkWatcher.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NetworkWatcher.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates or updates a network watcher in the specified resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NetworkWatcher] Parameters that define the network watcher resource. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 52 def create_or_update_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) create_or_update_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Deletes the specified network watcher resource.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 243 def delete(resource_group_name, network_watcher_name, custom_headers:nil) response = delete_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! nil end
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 257 def delete_async(resource_group_name, network_watcher_name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, network_watcher_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Gets the specified network watcher by resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NetworkWatcher] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 151 def get(resource_group_name, network_watcher_name, custom_headers:nil) response = get_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the specified network watcher by resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 180 def get_async(resource_group_name, network_watcher_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NetworkWatcher.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AzureReachabilityReportParameters] Parameters that determine Azure reachability report configuration. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [AzureReachabilityReport] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1068 def get_azure_reachability_report(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AzureReachabilityReportParameters] Parameters that determine Azure reachability report configuration. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1086 def get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AzureReachabilityReport.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Queries status of flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogStatusParameters] Parameters that define a resource to query flow log and traffic analytics (optional) status. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FlowLogInformation] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 965 def get_flow_log_status(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogStatusParameters] Parameters that define a resource to query flow log and traffic analytics (optional) status. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 983 def get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Gets the next hop from the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NextHopParameters] Parameters that define the source and destination endpoint. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NextHopResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 724 def get_next_hop(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NextHopParameters] Parameters that define the source and destination endpoint. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 740 def get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NextHopResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Gets the current network topology by resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [TopologyParameters] Parameters that define the representation of topology. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Topology] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 569 def get_topology(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_topology_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the current network topology by resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [TopologyParameters] Parameters that define the representation of topology. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 602 def get_topology_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TopologyParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::Topology.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the current network topology by resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [TopologyParameters] Parameters that define the representation of topology. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 586 def get_topology_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) get_topology_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
Initiate troubleshooting on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [TroubleshootingParameters] Parameters that define the resource to troubleshoot. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [TroubleshootingResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 817 def get_troubleshooting(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [TroubleshootingParameters] Parameters that define the resource to troubleshoot. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 834 def get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Get the last completed troubleshooting result on a specified resource
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [QueryTroubleshootingParameters] Parameters that define the resource to query the troubleshooting result. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [TroubleshootingResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 865 def get_troubleshooting_result(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [QueryTroubleshootingParameters] Parameters that define the resource to query the troubleshooting result. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 882 def get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::TroubleshootingResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Gets the configured and effective security group rules on the specified VM.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [SecurityGroupViewParameters] Parameters that define the VM to check security groups for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [SecurityGroupViewResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 770 def get_vmsecurity_rules(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [SecurityGroupViewParameters] Parameters that define the VM to check security groups for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 786 def get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::SecurityGroupViewResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Gets the specified network watcher by resource group.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 166 def get_with_http_info(resource_group_name, network_watcher_name, custom_headers:nil) get_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! end
Gets all network watchers by resource group.
@param resource_group_name [String] The name of the resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NetworkWatcherListResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 390 def list(resource_group_name, custom_headers:nil) response = list_async(resource_group_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets all network watchers by subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NetworkWatcherListResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 479 def list_all(custom_headers:nil) response = list_all_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Gets all network watchers by subscription.
@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 504 def list_all_async(custom_headers:nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NetworkWatcherListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets all network watchers by subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 492 def list_all_with_http_info(custom_headers:nil) list_all_async(custom_headers:custom_headers).value! end
Gets all network watchers by resource group.
@param resource_group_name [String] The name of the resource group. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 417 def list_async(resource_group_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::NetworkWatcherListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists all available internet service providers for a specified Azure region.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AvailableProvidersListParameters] Parameters that scope the list of available providers. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [AvailableProvidersList] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1118 def list_available_providers(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = list_available_providers_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [AvailableProvidersListParameters] Parameters that scope the list of available providers. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 1136 def list_available_providers_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_list_available_providers_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::AvailableProvidersList.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Gets all network watchers by resource group.
@param resource_group_name [String] The name of the resource group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 404 def list_with_http_info(resource_group_name, custom_headers:nil) list_async(resource_group_name, custom_headers:custom_headers).value! end
Configures flow log and traffic analytics (optional) on a specified resource.
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogInformation] Parameters that define the configuration of flow log. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FlowLogInformation] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 914 def set_flow_log_configuration(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [FlowLogInformation] Parameters that define the configuration of flow log. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 932 def set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::FlowLogInformation.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
Verify IP flow from the specified VM to a location given the currently configured NSG rules.
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [VerificationIPFlowParameters] Parameters that define the IP flow to be verified. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [VerificationIPFlowResult] operation results.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 678 def verify_ipflow(resource_group_name, network_watcher_name, parameters, custom_headers:nil) response = verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [VerificationIPFlowParameters] Parameters that define the IP flow to be verified. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2018-01-01/generated/azure_mgmt_network/network_watchers.rb, line 694 def verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil) # Send request promise = begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_01_01::Models::VerificationIPFlowResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end