# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).
import oci
# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()
# Initialize service client with default config file
core_client = oci.core.VirtualNetworkClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_capture_filter_response = core_client.update_capture_filter(
capture_filter_id="ocid1.test.oc1..<unique_ID>EXAMPLE-captureFilterId-Value",
update_capture_filter_details=oci.core.models.UpdateCaptureFilterDetails(
defined_tags={
'EXAMPLE_KEY_409kw': {
'EXAMPLE_KEY_IzTpJ': 'EXAMPLE--Value'}},
display_name="EXAMPLE-displayName-Value",
vtap_capture_filter_rules=[
oci.core.models.VtapCaptureFilterRuleDetails(
traffic_direction="EGRESS",
rule_action="EXCLUDE",
source_cidr="EXAMPLE-sourceCidr-Value",
destination_cidr="EXAMPLE-destinationCidr-Value",
protocol="EXAMPLE-protocol-Value",
icmp_options=oci.core.models.IcmpOptions(
type=206,
code=13),
tcp_options=oci.core.models.TcpOptions(
destination_port_range=oci.core.models.PortRange(
max=17971,
min=44196),
source_port_range=oci.core.models.PortRange(
max=37323,
min=44706)),
udp_options=oci.core.models.UdpOptions(
destination_port_range=oci.core.models.PortRange(
max=8251,
min=57161),
source_port_range=oci.core.models.PortRange(
max=52320,
min=31716)))],
flow_log_capture_filter_rules=[
oci.core.models.FlowLogCaptureFilterRuleDetails(
is_enabled=False,
priority=6,
sampling_rate=86872,
source_cidr="EXAMPLE-sourceCidr-Value",
destination_cidr="EXAMPLE-destinationCidr-Value",
protocol="EXAMPLE-protocol-Value",
icmp_options=oci.core.models.IcmpOptions(
type=220,
code=7),
tcp_options=oci.core.models.TcpOptions(
destination_port_range=oci.core.models.PortRange(
max=58937,
min=39404),
source_port_range=oci.core.models.PortRange(
max=1994,
min=21654)),
udp_options=oci.core.models.UdpOptions(
destination_port_range=oci.core.models.PortRange(
max=17621,
min=15614),
source_port_range=oci.core.models.PortRange(
max=24838,
min=43762)),
flow_log_type="REJECT",
rule_action="INCLUDE")],
freeform_tags={
'EXAMPLE_KEY_8giUI': 'EXAMPLE_VALUE_krYrq73vZXh8bmbHSBhk'}),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="YCKTZOHD6SQSNFMGF9JB<unique_ID>")
# Get the data from response
print(update_capture_filter_response.data)