# 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
from datetime import datetime

# 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
threat_intelligence_client = oci.threat_intelligence.ThreatintelClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
list_indicators_response = threat_intelligence_client.list_indicators(
    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
    threat_type_name=["EXAMPLE--Value"],
    type="SHA1_HASH",
    value="EXAMPLE-value-Value",
    confidence_greater_than_or_equal_to=55,
    time_updated_greater_than_or_equal_to=datetime.strptime(
        "2014-06-17T19:08:08.906Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_updated_less_than=datetime.strptime(
        "2032-01-20T17:10:46.328Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_last_seen_greater_than_or_equal_to=datetime.strptime(
        "2028-01-11T16:54:37.302Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_last_seen_less_than=datetime.strptime(
        "2008-01-25T10:28:11.371Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_created_greater_than_or_equal_to=datetime.strptime(
        "2019-12-23T11:02:37.992Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_created_less_than=datetime.strptime(
        "2049-09-05T22:20:00.322Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    limit=211,
    page="EXAMPLE-page-Value",
    sort_order="DESC",
    sort_by="timeCreated",
    opc_request_id="CCXSCBESEYCGAOX0JHMY<unique_ID>")

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

Was this article helpful?