L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Packet Captures - Stop
Servizio:
Network Watcher
Versione API:
2025-03-01
Arresta una sessione di acquisizione pacchetti specificata.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop?api-version=2025-03-01
Parametri dell'URI
Nome
In
Necessario
Tipo
Descrizione
networkWatcherName
path
True
string
Nome dell'osservatore della rete.
packetCaptureName
path
True
string
Nome della sessione di acquisizione dei pacchetti.
resourceGroupName
path
True
string
Nome del gruppo di risorse.
subscriptionId
path
True
string
Credenziali della sottoscrizione che identificano in modo univoco la sottoscrizione di Microsoft Azure. L'ID sottoscrizione fa parte dell'URI per ogni chiamata al servizio.
api-version
query
True
string
Versione dell'API client.
Risposte
Nome
Tipo
Descrizione
200 OK
Richiesta riuscita. L'operazione interrompe la sessione di acquisizione dei pacchetti.
202 Accepted
Accettato e l'operazione verrà completata in modo asincrono.
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1/stop?api-version=2025-03-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python network_watcher_packet_capture_stop.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
client.packet_captures.begin_stop(
resource_group_name="rg1",
network_watcher_name="nw1",
packet_capture_name="pc1",
).result()
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2025-03-01/examples/NetworkWatcherPacketCaptureStop.json
if __name__ == "__main__":
main()
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2025-03-01/examples/NetworkWatcherPacketCaptureStop.json
// this example is just showing the usage of "PacketCaptures_Stop" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this PacketCaptureResource created on azure
// for more information of creating PacketCaptureResource, please refer to the document of PacketCaptureResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string networkWatcherName = "nw1";
string packetCaptureName = "pc1";
ResourceIdentifier packetCaptureResourceId = PacketCaptureResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, networkWatcherName, packetCaptureName);
PacketCaptureResource packetCapture = client.GetPacketCaptureResource(packetCaptureResourceId);
// invoke the operation
await packetCapture.StopAsync(WaitUntil.Completed);
Console.WriteLine("Succeeded");