# 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
summarize_indicators_response = threat_intelligence_client.summarize_indicators(
    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
    summarize_indicators_details=oci.threat_intelligence.models.SummarizeIndicatorsDetails(
        indicator_type="MD5_HASH",
        indicator_value="EXAMPLE-indicatorValue-Value",
        threat_types=["EXAMPLE--Value"],
        confidence_greater_than_or_equal_to=7,
        time_updated_greater_than_or_equal_to=datetime.strptime(
            "2012-05-09T05:20:09.248Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_updated_less_than=datetime.strptime(
            "2002-10-29T21:33:32.107Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_last_seen_greater_than_or_equal_to=datetime.strptime(
            "2041-09-29T14:05:37.235Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_last_seen_less_than=datetime.strptime(
            "2009-05-01T02:48:33.049Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_created_greater_than_or_equal_to=datetime.strptime(
            "2041-02-26T20:33:43.733Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        time_created_less_than=datetime.strptime(
            "2030-02-18T13:32:12.763Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        indicator_seen_by="EXAMPLE-indicatorSeenBy-Value",
        malware="EXAMPLE-malware-Value",
        threat_actor="EXAMPLE-threatActor-Value",
        sort_order="ASC",
        sort_by="TIMECREATED"),
    opc_request_id="UFWJMWQN8PFUMYUVL5QQ<unique_ID>",
    limit=436,
    page="EXAMPLE-page-Value")

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

Was this article helpful?