packet_captures
Creates, updates, deletes, gets or lists a packet_captures resource.
Overview
| Name | packet_captures |
| Type | Resource |
| Id | azure.network.packet_captures |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the packet capture operation. |
name | string | Name of the packet capture session. |
bytesToCapturePerPacket | integer | Number of bytes captured per packet, the remaining bytes are truncated. |
captureSettings | object | The capture setting holds the 'FileCount', 'FileSizeInBytes', 'SessionTimeLimitInSeconds' values. |
continuousCapture | boolean | This continuous capture is a nullable boolean, which can hold 'null', 'true' or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
filters | array | A list of packet capture filters. |
provisioningState | string | The provisioning state of the packet capture session. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
scope | object | A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. |
storageLocation | object | The storage location for a packet capture session. Required. |
target | string | The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. Required. |
targetType | string | Target type of the resource provided. Known values are: "AzureVM" and "AzureVMSS". (AzureVM, AzureVMSS) |
timeLimitInSeconds | integer | Maximum duration of the capture session in seconds. |
totalBytesPerSession | integer | Maximum size of the capture output. |
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the packet capture operation. |
name | string | Name of the packet capture session. |
bytesToCapturePerPacket | integer | Number of bytes captured per packet, the remaining bytes are truncated. |
captureSettings | object | The capture setting holds the 'FileCount', 'FileSizeInBytes', 'SessionTimeLimitInSeconds' values. |
continuousCapture | boolean | This continuous capture is a nullable boolean, which can hold 'null', 'true' or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
filters | array | A list of packet capture filters. |
provisioningState | string | The provisioning state of the packet capture session. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
scope | object | A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. |
storageLocation | object | The storage location for a packet capture session. Required. |
target | string | The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. Required. |
targetType | string | Target type of the resource provided. Known values are: "AzureVM" and "AzureVMSS". (AzureVM, AzureVMSS) |
timeLimitInSeconds | integer | Maximum duration of the capture session in seconds. |
totalBytesPerSession | integer | Maximum size of the capture output. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, network_watcher_name, packet_capture_name, subscription_id | Gets a packet capture session by name. | |
list | select | resource_group_name, network_watcher_name, subscription_id | Lists all packet capture sessions within the specified resource group. | |
create | insert | resource_group_name, network_watcher_name, packet_capture_name, subscription_id, properties | Create and start a packet capture on the specified VM. | |
delete | delete | resource_group_name, network_watcher_name, packet_capture_name, subscription_id | Deletes the specified packet capture session. | |
get_status | exec | resource_group_name, network_watcher_name, packet_capture_name, subscription_id | Query the status of a running packet capture session. | |
stop | exec | resource_group_name, network_watcher_name, packet_capture_name, subscription_id | Stops a specified packet capture session. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
network_watcher_name | string | The name of the network watcher. Required. |
packet_capture_name | string | The name of the packet capture session. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list
Gets a packet capture session by name.
SELECT
id,
name,
bytesToCapturePerPacket,
captureSettings,
continuousCapture,
etag,
filters,
provisioningState,
scope,
storageLocation,
target,
targetType,
timeLimitInSeconds,
totalBytesPerSession
FROM azure.network.packet_captures
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND packet_capture_name = '{{ packet_capture_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all packet capture sessions within the specified resource group.
SELECT
id,
name,
bytesToCapturePerPacket,
captureSettings,
continuousCapture,
etag,
filters,
provisioningState,
scope,
storageLocation,
target,
targetType,
timeLimitInSeconds,
totalBytesPerSession
FROM azure.network.packet_captures
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
Create and start a packet capture on the specified VM.
INSERT INTO azure.network.packet_captures (
properties,
resource_group_name,
network_watcher_name,
packet_capture_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ network_watcher_name }}',
'{{ packet_capture_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties
;
# Description fields are for documentation purposes
- name: packet_captures
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the packet_captures resource.
- name: network_watcher_name
value: "{{ network_watcher_name }}"
description: Required parameter for the packet_captures resource.
- name: packet_capture_name
value: "{{ packet_capture_name }}"
description: Required parameter for the packet_captures resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the packet_captures resource.
- name: properties
description: |
Properties of the packet capture. Required.
value:
target: "{{ target }}"
scope:
include:
- "{{ include }}"
exclude:
- "{{ exclude }}"
targetType: "{{ targetType }}"
bytesToCapturePerPacket: {{ bytesToCapturePerPacket }}
totalBytesPerSession: {{ totalBytesPerSession }}
timeLimitInSeconds: {{ timeLimitInSeconds }}
storageLocation:
storageId: "{{ storageId }}"
storagePath: "{{ storagePath }}"
filePath: "{{ filePath }}"
localPath: "{{ localPath }}"
filters:
- protocol: "{{ protocol }}"
localIPAddress: "{{ localIPAddress }}"
remoteIPAddress: "{{ remoteIPAddress }}"
localPort: "{{ localPort }}"
remotePort: "{{ remotePort }}"
continuousCapture: {{ continuousCapture }}
captureSettings:
fileCount: {{ fileCount }}
fileSizeInBytes: {{ fileSizeInBytes }}
sessionTimeLimitInSeconds: {{ sessionTimeLimitInSeconds }}
DELETE examples
- delete
Deletes the specified packet capture session.
DELETE FROM azure.network.packet_captures
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND packet_capture_name = '{{ packet_capture_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- get_status
- stop
Query the status of a running packet capture session.
EXEC azure.network.packet_captures.get_status
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@packet_capture_name='{{ packet_capture_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Stops a specified packet capture session.
EXEC azure.network.packet_captures.stop
@resource_group_name='{{ resource_group_name }}' --required,
@network_watcher_name='{{ network_watcher_name }}' --required,
@packet_capture_name='{{ packet_capture_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;