Reference documentation and code samples for the Compute V1 Client class PacketMirroring.
Represents a Packet Mirroring resource. Packet Mirroring clones the traffic of specified instances in your Virtual Private Cloud (VPC) network and forwards it to a collector destination, such as an instance group of an internal TCP/UDP load balancer, for analysis or examination. For more information about setting up Packet Mirroring, see Using Packet Mirroring.
Generated from protobuf messagegoogle.cloud.compute.v1.PacketMirroring
The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true.
↳ creation_timestamp
string
[Output Only] Creation timestamp in RFC3339 text format.
↳ description
string
An optional description of this resource. Provide this property when you create the resource.
↳ enable
string
Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE. Check the Enable enum for the list of possible values.
PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored.
↳ name
string
Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression[a-z]([-a-z0-9]*[a-z0-9])?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network.
↳ priority
int
The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.
↳ region
string
[Output Only] URI of the region where the packetMirroring resides.
↳ self_link
string
[Output Only] Server-defined URL for the resource.
getCollectorIlb
The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true.
The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true.
[Output Only] Creation timestamp in RFC3339 text format.
Returns
Type
Description
string
hasCreationTimestamp
clearCreationTimestamp
setCreationTimestamp
[Output Only] Creation timestamp in RFC3339 text format.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDescription
An optional description of this resource. Provide this property when you create the resource.
Returns
Type
Description
string
hasDescription
clearDescription
setDescription
An optional description of this resource. Provide this property when you create the resource.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getEnable
Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE.
Check the Enable enum for the list of possible values.
Returns
Type
Description
string
hasEnable
clearEnable
setEnable
Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE.
Check the Enable enum for the list of possible values.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getFilter
Filter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored.
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
Returns
Type
Description
int|string
hasId
clearId
setId
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
Parameter
Name
Description
var
int|string
Returns
Type
Description
$this
getKind
[Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings.
Returns
Type
Description
string
hasKind
clearKind
setKind
[Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getMirroredResources
PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored.
PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored.
Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression[a-z]([-a-z0-9]*[a-z0-9])?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Returns
Type
Description
string
hasName
clearName
setName
Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression[a-z]([-a-z0-9]*[a-z0-9])?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getNetwork
Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network.
Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network.
The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.
Returns
Type
Description
int
hasPriority
clearPriority
setPriority
The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getRegion
[Output Only] URI of the region where the packetMirroring resides.
Returns
Type
Description
string
hasRegion
clearRegion
setRegion
[Output Only] URI of the region where the packetMirroring resides.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSelfLink
[Output Only] Server-defined URL for the resource.
Returns
Type
Description
string
hasSelfLink
clearSelfLink
setSelfLink
[Output Only] Server-defined URL for the resource.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Compute V1 Client - Class PacketMirroring (1.35.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.35.0 (latest)](/php/docs/reference/cloud-compute/latest/V1.PacketMirroring)\n- [1.34.0](/php/docs/reference/cloud-compute/1.34.0/V1.PacketMirroring)\n- [1.33.0](/php/docs/reference/cloud-compute/1.33.0/V1.PacketMirroring)\n- [1.32.0](/php/docs/reference/cloud-compute/1.32.0/V1.PacketMirroring)\n- [1.31.0](/php/docs/reference/cloud-compute/1.31.0/V1.PacketMirroring)\n- [1.30.0](/php/docs/reference/cloud-compute/1.30.0/V1.PacketMirroring)\n- [1.29.0](/php/docs/reference/cloud-compute/1.29.0/V1.PacketMirroring)\n- [1.28.0](/php/docs/reference/cloud-compute/1.28.0/V1.PacketMirroring)\n- [1.27.0](/php/docs/reference/cloud-compute/1.27.0/V1.PacketMirroring)\n- [1.26.0](/php/docs/reference/cloud-compute/1.26.0/V1.PacketMirroring)\n- [1.25.0](/php/docs/reference/cloud-compute/1.25.0/V1.PacketMirroring)\n- [1.24.0](/php/docs/reference/cloud-compute/1.24.0/V1.PacketMirroring)\n- [1.23.0](/php/docs/reference/cloud-compute/1.23.0/V1.PacketMirroring)\n- [1.22.1](/php/docs/reference/cloud-compute/1.22.1/V1.PacketMirroring)\n- [1.21.0](/php/docs/reference/cloud-compute/1.21.0/V1.PacketMirroring)\n- [1.20.0](/php/docs/reference/cloud-compute/1.20.0/V1.PacketMirroring)\n- [1.19.0](/php/docs/reference/cloud-compute/1.19.0/V1.PacketMirroring)\n- [1.18.1](/php/docs/reference/cloud-compute/1.18.1/V1.PacketMirroring)\n- [1.17.0](/php/docs/reference/cloud-compute/1.17.0/V1.PacketMirroring)\n- [1.16.2](/php/docs/reference/cloud-compute/1.16.2/V1.PacketMirroring)\n- [1.14.0](/php/docs/reference/cloud-compute/1.14.0/V1.PacketMirroring)\n- [1.13.0](/php/docs/reference/cloud-compute/1.13.0/V1.PacketMirroring)\n- [1.12.1](/php/docs/reference/cloud-compute/1.12.1/V1.PacketMirroring)\n- [1.11.1](/php/docs/reference/cloud-compute/1.11.1/V1.PacketMirroring)\n- [1.10.1](/php/docs/reference/cloud-compute/1.10.1/V1.PacketMirroring)\n- [1.9.1](/php/docs/reference/cloud-compute/1.9.1/V1.PacketMirroring)\n- [1.8.3](/php/docs/reference/cloud-compute/1.8.3/V1.PacketMirroring)\n- [1.7.1](/php/docs/reference/cloud-compute/1.7.1/V1.PacketMirroring)\n- [1.6.1](/php/docs/reference/cloud-compute/1.6.1/V1.PacketMirroring)\n- [1.5.0](/php/docs/reference/cloud-compute/1.5.0/V1.PacketMirroring) \nReference documentation and code samples for the Compute V1 Client class PacketMirroring.\n\nRepresents a Packet Mirroring resource. Packet Mirroring clones the traffic of specified instances in your Virtual Private Cloud (VPC) network and forwards it to a collector destination, such as an instance group of an internal TCP/UDP load balancer, for analysis or examination. For more information about setting up Packet Mirroring, see Using Packet Mirroring.\n\nGenerated from protobuf message `google.cloud.compute.v1.PacketMirroring`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Compute \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getCollectorIlb\n\nThe Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true.\n\n### hasCollectorIlb\n\n### clearCollectorIlb\n\n### setCollectorIlb\n\nThe Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true.\n\n### getCreationTimestamp\n\n\\[Output Only\\] Creation timestamp in RFC3339 text format.\n\n### hasCreationTimestamp\n\n### clearCreationTimestamp\n\n### setCreationTimestamp\n\n\\[Output Only\\] Creation timestamp in RFC3339 text format.\n\n### getDescription\n\nAn optional description of this resource. Provide this property when you create the resource.\n\n### hasDescription\n\n### clearDescription\n\n### setDescription\n\nAn optional description of this resource. Provide this property when you create the resource.\n\n### getEnable\n\nIndicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE.\n\nCheck the Enable enum for the list of possible values.\n\n### hasEnable\n\n### clearEnable\n\n### setEnable\n\nIndicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE.\n\nCheck the Enable enum for the list of possible values.\n\n### getFilter\n\nFilter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored.\n\n### hasFilter\n\n### clearFilter\n\n### setFilter\n\nFilter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored.\n\n### getId\n\n\\[Output Only\\] The unique identifier for the resource. This identifier is defined by the server.\n\n### hasId\n\n### clearId\n\n### setId\n\n\\[Output Only\\] The unique identifier for the resource. This identifier is defined by the server.\n\n### getKind\n\n\\[Output Only\\] Type of the resource. Always compute#packetMirroring for packet mirrorings.\n\n### hasKind\n\n### clearKind\n\n### setKind\n\n\\[Output Only\\] Type of the resource. Always compute#packetMirroring for packet mirrorings.\n\n### getMirroredResources\n\nPacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored.\n\n### hasMirroredResources\n\n### clearMirroredResources\n\n### setMirroredResources\n\nPacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored.\n\n### getName\n\nName of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.\n\n### hasName\n\n### clearName\n\n### setName\n\nName of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.\n\n### getNetwork\n\nSpecifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network.\n\n### hasNetwork\n\n### clearNetwork\n\n### setNetwork\n\nSpecifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network.\n\n### getPriority\n\nThe priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.\n\n### hasPriority\n\n### clearPriority\n\n### setPriority\n\nThe priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.\n\n### getRegion\n\n\\[Output Only\\] URI of the region where the packetMirroring resides.\n\n### hasRegion\n\n### clearRegion\n\n### setRegion\n\n\\[Output Only\\] URI of the region where the packetMirroring resides.\n\n### getSelfLink\n\n\\[Output Only\\] Server-defined URL for the resource.\n\n### hasSelfLink\n\n### clearSelfLink\n\n### setSelfLink\n\n\\[Output Only\\] Server-defined URL for the resource."]]