New-AzNetworkWatcherProtocolConfiguration
Cria um novo objeto de configuração de protocolo.
Sintaxe
New-AzNetworkWatcherProtocolConfiguration
-Protocol <String>
[-Method <String>]
[-Header <IDictionary>]
[-ValidStatusCode <Int32[]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
O cmdlet New-AzNetworkWatcherProtocolConfiguration cria um novo objeto de configuração de protocolo. Este objeto é usado para restringir a configuração do protocolo durante uma sessão de verificação de conectividade usando os critérios especificados.
Exemplos
Exemplo 1: Testar a conectividade do Inspetor de Rede de uma VM para um site com configuração de protocolo
$config = New-AzNetworkWatcherProtocolConfiguration -Protocol Http -Method Get -Header @{"accept"="application/json"} -ValidStatusCode @(200,202,204)
Test-AzNetworkWatcherConnectivity -NetworkWatcherName NetworkWatcher -ResourceGroupName NetworkWatcherRG -SourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/providers/Microsoft.Compute/virtualMachines/MultiTierApp0" -DestinationAddress "bing.com" -DestinationPort 80 -ProtocolConfiguration $config
ConnectionStatus : Reachable
AvgLatencyInMs : 4
MinLatencyInMs : 2
MaxLatencyInMs : 15
ProbesSent : 15
ProbesFailed : 0
Hops : [
{
"Type": "Source",
"Id": "f8cff464-e13f-457f-a09e-4dcd53d38a85",
"Address": "10.1.1.4",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/provi iders/Microsoft.Network/networkInterfaces/appNic0/ipConfigurations/ipconfig1",
"NextHopIds": [
"1034b1bf-0b1b-4f0a-93b2-900477f45485"
],
"Issues": []
},
{
"Type": "Internet",
"Id": "1034b1bf-0b1b-4f0a-93b2-900477f45485",
"Address": "13.107.21.200",
"ResourceId": "Internet",
"NextHopIds": [],
"Issues": []
}
]
Neste exemplo, testamos a conectividade de uma VM no Azure para www.bing.com.
Parâmetros
-DefaultProfile
As credenciais, a conta, o locatário e a assinatura usados para comunicação com o Azure.
Tipo: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Header
lista de cabeçalhos HTTP
Tipo: | IDictionary |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Method
Método HTTP
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Protocol
Tipo de protocolo
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ValidStatusCode
códigos de status válidos
Tipo: | Int32[] |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
Entradas
None
Saídas
PSNetworkWatcherProtocolConfiguration
Notas
Palavras-chave: azure, azurerm, arm, resource, management, manager, network, networking, watcher, packet, capture, traffic, filter
Ligações Relacionadas
- Novo-AzNetworkWatcher
- Get-AzNetworkWatcher
- Remover-AzNetworkWatcher
- Get-AzNetworkWatcherNextHop
- Get-AzNetworkWatcherSecurityGroupView
- Get-AzNetworkWatcherTopology
- Start-AzNetworkWatcherResourceTroubleshooting
- New-AzNetworkWatcherPacketCapture
- New-AzPacketCaptureFilterConfig
- Get-AzNetworkWatcherPacketCapture
- Remove-AzNetworkWatcherPacketCapture
- Stop-AzNetworkWatcherPacketCapture
- New-AzNetworkWatcherProtocolConfiguration
- Test-AzNetworkWatcherIPFlow
- Test-AzNetworkWatcherConnectivity
- Stop-AzNetworkWatcherConnectionMonitor
- Start-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConfigFlowLog
- Remove-AzNetworkWatcherConnectionMonitor
- New-AzNetworkWatcherConnectionMonitor
- Get-AzNetworkWatcherSolução de problemasResultado
- Get-AzNetworkWatcherReachabilityReport
- Get-AzNetworkWatcherReachabilityProvidersList
- Get-AzNetworkWatcherFlowLogStatus
- Get-AzNetworkWatcherConnectionMonitorReport
- Get-AzNetworkWatcherConnectionMonitor