# 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_g7UNt': {
                'EXAMPLE_KEY_3BsoB': 'EXAMPLE--Value'}},
        display_name="EXAMPLE-displayName-Value",
        vtap_capture_filter_rules=[
            oci.core.models.VtapCaptureFilterRuleDetails(
                traffic_direction="INGRESS",
                rule_action="INCLUDE",
                source_cidr="EXAMPLE-sourceCidr-Value",
                destination_cidr="EXAMPLE-destinationCidr-Value",
                protocol="EXAMPLE-protocol-Value",
                icmp_options=oci.core.models.IcmpOptions(
                            type=219,
                            code=15),
                tcp_options=oci.core.models.TcpOptions(
                    destination_port_range=oci.core.models.PortRange(
                        max=38017,
                        min=44539),
                    source_port_range=oci.core.models.PortRange(
                        max=57591,
                        min=23176)),
                udp_options=oci.core.models.UdpOptions(
                    destination_port_range=oci.core.models.PortRange(
                        max=49203,
                        min=42307),
                    source_port_range=oci.core.models.PortRange(
                        max=6615,
                        min=5471)))],
        flow_log_capture_filter_rules=[
            oci.core.models.FlowLogCaptureFilterRuleDetails(
                is_enabled=True,
                priority=7,
                sampling_rate=97617,
                source_cidr="EXAMPLE-sourceCidr-Value",
                destination_cidr="EXAMPLE-destinationCidr-Value",
                protocol="EXAMPLE-protocol-Value",
                icmp_options=oci.core.models.IcmpOptions(
                    type=70,
                    code=3),
                tcp_options=oci.core.models.TcpOptions(
                    destination_port_range=oci.core.models.PortRange(
                        max=36129,
                        min=44092),
                    source_port_range=oci.core.models.PortRange(
                        max=13041,
                        min=39854)),
                udp_options=oci.core.models.UdpOptions(
                    destination_port_range=oci.core.models.PortRange(
                        max=41899,
                        min=13757),
                    source_port_range=oci.core.models.PortRange(
                        max=65386,
                        min=47164)),
                flow_log_type="ACCEPT",
                rule_action="INCLUDE")],
        freeform_tags={
            'EXAMPLE_KEY_Wy2Ey': 'EXAMPLE_VALUE_Khz7moZFtmHfVWnMveFo'}),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="PEP1ONGQLRCLP5OZGS3G<unique_ID>")

# Get the data from response
print(update_capture_filter_response.data)