你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Packet Captures - Get

按名称获取数据包捕获会话。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}?api-version=2023-09-01

URI 参数

名称 必需 类型 说明
networkWatcherName
path True

string

网络观察程序的名称。

packetCaptureName
path True

string

数据包捕获会话的名称。

resourceGroupName
path True

string

资源组的名称。

subscriptionId
path True

string

可以唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。

api-version
query True

string

客户端 API 版本。

响应

名称 类型 说明
200 OK

PacketCaptureResult

请求成功。 该操作返回数据包捕获会话。

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

Get packet capture

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1?api-version=2023-09-01

Sample Response

{
  "name": "pc1",
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1",
  "etag": "W/\"00000000-0000-0000-0000-000000000000\"",
  "properties": {
    "provisioningState": "Updating",
    "target": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1",
    "bytesToCapturePerPacket": 10000,
    "totalBytesPerSession": 100000,
    "timeLimitInSeconds": 100,
    "storageLocation": {
      "storageId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore",
      "storagePath": "https://mytestaccountname.blob.core.windows.net/capture/pc1.cap",
      "filePath": "D:\\capture\\pc1.cap"
    },
    "filters": [
      {
        "protocol": "TCP",
        "localIPAddress": "10.0.0.4",
        "localPort": "80"
      }
    ]
  }
}

定义

名称 说明
ErrorDetails

常见错误详细信息表示形式。

ErrorResponse

错误对象。

PacketCaptureFilter

应用于数据包捕获请求的筛选器。 可以应用多个筛选器。

PacketCaptureMachineScope

可以包含或排除以运行数据包捕获的 AzureVMSS 实例的列表。 如果包含和排除的都是空的,则数据包捕获将在 AzureVMSS 的所有实例上运行。

PacketCaptureResult

有关数据包捕获会话的信息。

PacketCaptureStorageLocation

数据包捕获会话的存储位置。

PacketCaptureTargetType

提供的资源的目标类型。

PcProtocol

要筛选的协议。

ProvisioningState

当前预配状态。

ErrorDetails

常见错误详细信息表示形式。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误对象。

名称 类型 说明
error

ErrorDetails

错误
错误详细信息对象。

PacketCaptureFilter

应用于数据包捕获请求的筛选器。 可以应用多个筛选器。

名称 类型 默认值 说明
localIPAddress

string

要筛选的本地 IP 地址。 表示法:单个地址条目的“127.0.0.1”。 范围为“127.0.0.1-127.0.0.255”。 "127.0.0.1;127.0.0.5"? 用于多个条目。 当前不支持多个范围。 当前不支持混合具有多个条目的范围。 默认值 = null。

localPort

string

要筛选的本地端口。 表示法:“80”表示单个端口输入。”范围为 80-85 英寸。 "80;443;“,用于多个条目。 当前不支持多个范围。 当前不支持混合具有多个条目的范围。 默认值 = null。

protocol

PcProtocol

Any

要筛选的协议。

remoteIPAddress

string

要筛选的本地 IP 地址。 表示法:单个地址条目的“127.0.0.1”。 范围为“127.0.0.1-127.0.0.255”。 "127.0.0.1;127.0.0.5;“对于多个条目。 当前不支持多个范围。 当前不支持混合具有多个条目的范围。 默认值 = null。

remotePort

string

要筛选的远程端口。 表示法:“80”表示单个端口输入。”范围为 80-85 英寸。 "80;443;“,用于多个条目。 当前不支持多个范围。 当前不支持混合具有多个条目的范围。 默认值 = null。

PacketCaptureMachineScope

可以包含或排除以运行数据包捕获的 AzureVMSS 实例的列表。 如果包含和排除的都是空的,则数据包捕获将在 AzureVMSS 的所有实例上运行。

名称 类型 说明
exclude

string[]

必须从 AzureVMSS 中排除运行数据包捕获的 AzureVMSS 实例的列表。

include

string[]

要运行数据包捕获的 AzureVMSS 实例的列表。

PacketCaptureResult

有关数据包捕获会话的信息。

名称 类型 默认值 说明
etag

string

一个唯一的只读字符串,每当资源更新时都会更改。

id

string

数据包捕获操作的 ID。

name

string

数据包捕获会话的名称。

properties.bytesToCapturePerPacket

integer

0

每个数据包捕获的字节数,其余字节将被截断。

properties.filters

PacketCaptureFilter[]

数据包捕获筛选器的列表。

properties.provisioningState

ProvisioningState

数据包捕获会话的预配状态。

properties.scope

PacketCaptureMachineScope

可以包含或排除以运行数据包捕获的 AzureVMSS 实例的列表。 如果包含和排除的都是空的,则数据包捕获将在 AzureVMSS 的所有实例上运行。

properties.storageLocation

PacketCaptureStorageLocation

数据包捕获会话的存储位置。

properties.target

string

当前仅支持将 AzureVM 和 AzureVMSS 作为目标类型的目标资源的 ID。

properties.targetType

PacketCaptureTargetType

提供的资源的目标类型。

properties.timeLimitInSeconds

integer

18000

捕获会话的最大持续时间(以秒为单位)。

properties.totalBytesPerSession

integer

1073741824

捕获输出的最大大小。

PacketCaptureStorageLocation

数据包捕获会话的存储位置。

名称 类型 说明
filePath

string

目标 VM 上的有效本地路径。 必须包含捕获文件的名称 (*.cap) 。 对于 Linux 虚拟机,它必须以 /var/captures 开头。 如果未提供存储 ID,则为必需;否则为可选。

storageId

string

用于保存数据包捕获会话的存储帐户的 ID。 如果未提供本地文件路径,则为必需。

storagePath

string

用于保存数据包捕获的存储路径的 URI。 必须是格式正确的 URI,用于描述保存数据包捕获的位置。

PacketCaptureTargetType

提供的资源的目标类型。

名称 类型 说明
AzureVM

string

AzureVMSS

string

PcProtocol

要筛选的协议。

名称 类型 说明
Any

string

TCP

string

UDP

string

ProvisioningState

当前预配状态。

名称 类型 说明
Deleting

string

Failed

string

Succeeded

string

Updating

string