# 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
loggingingestion_client = oci.loggingingestion.LoggingClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
put_logs_response = loggingingestion_client.put_logs(
log_id="ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value",
put_logs_details=oci.loggingingestion.models.PutLogsDetails(
specversion="EXAMPLE-specversion-Value",
log_entry_batches=[
oci.loggingingestion.models.LogEntryBatch(
entries=[
oci.loggingingestion.models.LogEntry(
data="EXAMPLE-data-Value",
id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
time=datetime.strptime(
"2044-09-12T12:57:10.178Z",
"%Y-%m-%dT%H:%M:%S.%fZ"))],
source="EXAMPLE-source-Value",
type="EXAMPLE-type-Value",
defaultlogentrytime=datetime.strptime(
"2038-04-28T02:40:07.255Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
subject="EXAMPLE-subject-Value")]),
timestamp_opc_agent_processing=datetime.strptime(
"2036-10-10T11:12:19.676Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
opc_agent_version="EXAMPLE-opcAgentVersion-Value",
opc_request_id="XVORBHLR8W6FWF3GCAEQ<unique_ID>")
# Get the data from response
print(put_logs_response.headers)