# 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).

from datetime import datetime
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
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="FILE_NAME",
    value="EXAMPLE-value-Value",
    confidence_greater_than_or_equal_to=25,
    time_updated_greater_than_or_equal_to=datetime.strptime(
        "2040-03-01T13:19:25.706Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_updated_less_than=datetime.strptime(
        "2016-11-04T12:44:20.013Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_last_seen_greater_than_or_equal_to=datetime.strptime(
        "2001-08-11T20:45:29.683Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_last_seen_less_than=datetime.strptime(
        "2029-06-27T23:20:56.762Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_created_greater_than_or_equal_to=datetime.strptime(
        "2014-09-27T08:22:02.187Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    time_created_less_than=datetime.strptime(
        "2041-12-09T12:36:05.125Z",
        "%Y-%m-%dT%H:%M:%S.%fZ"),
    limit=992,
    page="EXAMPLE-page-Value",
    sort_order="ASC",
    sort_by="timeUpdated",
    opc_request_id="QQJKXCSJQ2YEPZIJUSMI<unique_ID>")

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

Was this article helpful?