# 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
database_tools_runtime_client = oci.database_tools_runtime.DatabaseToolsRuntimeClient(
config)
# Send the request to service, some parameters are not required, see API
# doc for more info
execute_sql_database_tools_connection_response = database_tools_runtime_client.execute_sql_database_tools_connection(
database_tools_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseToolsConnectionId-Value",
execute_sql_database_tools_connection_details=oci.database_tools_runtime.models.ExecuteSqlDatabaseToolsConnectionAsynchronousDetails(
type="ASYNCHRONOUS",
input=oci.database_tools_runtime.models.ExecuteSqlAsynchronousInputObjectStorageDetails(
type="OBJECT_STORAGE",
object=oci.database_tools_runtime.models.ExecuteSqlObjectStorageLocation(
namespace="EXAMPLE-namespace-Value",
bucket_name="EXAMPLE-bucketName-Value",
object_name="EXAMPLE-objectName-Value")),
output=oci.database_tools_runtime.models.ExecuteSqlOutputObjectStorageDetails(
type="OBJECT_STORAGE",
object=oci.database_tools_runtime.models.ExecuteSqlObjectStorageLocation(
namespace="EXAMPLE-namespace-Value",
bucket_name="EXAMPLE-bucketName-Value",
object_name="EXAMPLE-objectName-Value"),
result_disposition_templates=[
oci.database_tools_runtime.models.ExecuteSqlOutputResultDispositionTemplate(
statement_type="OTHER",
object_template=oci.database_tools_runtime.models.ExecuteSqlOutputDispositionObjectStorageDetails(
type="OBJECT_STORAGE",
namespace="EXAMPLE-namespace-Value",
bucket_name="EXAMPLE-bucketName-Value",
object_name="EXAMPLE-objectName-Value",
content_type="EXAMPLE-contentType-Value",
content_disposition="EXAMPLE-contentDisposition-Value",
content_encoding="EXAMPLE-contentEncoding-Value",
cache_control="EXAMPLE-cacheControl-Value",
content_language="EXAMPLE-contentLanguage-Value",
opc_meta={
'EXAMPLE_KEY_PbKZs': 'EXAMPLE_VALUE_nGhZIFiz0PqXPR4ZKEf9'},
opc_sse_customer_algorithm="EXAMPLE-opcSseCustomerAlgorithm-Value",
opc_sse_customer_key="EXAMPLE-opcSseCustomerKey-Value",
opc_sse_customer_key_sha256="EXAMPLE-opcSseCustomerKeySha256-Value",
opc_sse_kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-opcSseKmsKeyId-Value",
storage_tier="INFREQUENT_ACCESS"))],
time_of_deletion=datetime.strptime(
"2001-07-18T08:58:21.019Z",
"%Y-%m-%dT%H:%M:%S.%fZ")),
timeout_in_seconds=13899),
opc_request_id="ZOVMYUCVH8AMMBIKETBR<unique_ID>",
if_match="EXAMPLE-ifMatch-Value")
# Get the data from response
print(execute_sql_database_tools_connection_response.data)