# 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
data_integration_client = oci.data_integration.DataIntegrationClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_external_publication_response = data_integration_client.create_external_publication(
workspace_id="ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
task_key="EXAMPLE-taskKey-Value",
create_external_publication_details=oci.data_integration.models.CreateExternalPublicationDetails(
application_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value",
display_name="EXAMPLE-displayName-Value",
application_id="ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value",
description="EXAMPLE-description-Value",
resource_configuration=oci.data_integration.models.ResourceConfiguration(
spark_version="EXAMPLE-sparkVersion-Value",
driver_shape="EXAMPLE-driverShape-Value",
executor_shape="EXAMPLE-executorShape-Value",
total_executors=206),
configuration_details=oci.data_integration.models.ConfigurationDetails(
data_asset=oci.data_integration.models.DataAssetFromAmazonS3(
model_type="AMAZON_S3_DATA_ASSET",
key="EXAMPLE-key-Value",
model_version="EXAMPLE-modelVersion-Value",
name="EXAMPLE-name-Value",
description="EXAMPLE-description-Value",
object_status=204,
identifier="EXAMPLE-identifier-Value",
external_key="EXAMPLE-externalKey-Value",
asset_properties={
'EXAMPLE_KEY_J3Sqm': 'EXAMPLE_VALUE_7bcqHaHAiTmcZ5btiw1U'},
native_type_system=oci.data_integration.models.TypeSystem(
key="EXAMPLE-key-Value",
model_type="EXAMPLE-modelType-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
description="EXAMPLE-description-Value",
object_version=953,
type_mapping_to={
'EXAMPLE_KEY_MYDEF': 'EXAMPLE_VALUE_MB7WRB2zS5jh3ThXm9le'},
type_mapping_from={
'EXAMPLE_KEY_eIG9k': 'EXAMPLE_VALUE_9KTitA1oBpeowZnwmh3i'},
object_status=464,
identifier="EXAMPLE-identifier-Value",
types=[
oci.data_integration.models.DataType(
model_type="DATA_TYPE",
key="EXAMPLE-key-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
object_status=341,
description="EXAMPLE-description-Value",
dt_type="STRUCTURED",
type_system_name="EXAMPLE-typeSystemName-Value",
config_definition=oci.data_integration.models.ConfigDefinition(
key="EXAMPLE-key-Value",
model_type="EXAMPLE-modelType-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
is_contained=False,
object_status=548,
config_parameter_definitions={
'EXAMPLE_KEY_VnWXp': {
'parameterType': {
'modelType': 'DYNAMIC_TYPE',
'key': 'EXAMPLE-key-Value',
'modelVersion': 'EXAMPLE-modelVersion-Value',
'parentRef': {
'parent': 'EXAMPLE-parent-Value',
'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
'name': 'EXAMPLE-name-Value',
'objectStatus': 212,
'description': 'EXAMPLE-description-Value',
'typeHandler': {
'modelType': 'RULE_TYPE_CONFIGS',
'key': 'EXAMPLE-key-Value',
'modelVersion': 'EXAMPLE-modelVersion-Value',
'parentRef': {
'parent': 'EXAMPLE-parent-Value',
'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
'scope': 'EXAMPLE-scope-Value',
'scopeReference': {
'referenceObject': 'EXAMPLE-referenceObject-Value',
'referenceType': 'OCI_FUNCTION_OUTPUT_SHAPE',
'refObjectName': 'EXAMPLE-refObjectName-Value'},
'isOrderByRule': False,
'projectionRules': [
{
'modelType': 'NAME_PATTERN_RULE',
'key': 'EXAMPLE-key-Value',
'modelVersion': 'EXAMPLE-modelVersion-Value',
'parentRef': {
'parent': 'EXAMPLE-parent-Value',
'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'},
'isJavaRegexSyntax': False,
'configValues': {
'configParamValues': {
'EXAMPLE_KEY_FgTHy': {
'stringValue': 'EXAMPLE-stringValue-Value',
'intValue': 211,
'objectValue': 'EXAMPLE-objectValue-Value',
'refValue': 'EXAMPLE-refValue-Value',
'parameterValue': 'EXAMPLE-parameterValue-Value',
'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
'parentRef': {
'parent': 'EXAMPLE-parent-Value',
'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'}},
'objectStatus': 156,
'description': 'EXAMPLE-description-Value',
'isSkipRemainingRulesOnMatch': False,
'scope': 'EXAMPLE-scope-Value',
'isCascade': True,
'matchingStrategy': 'NAME_OR_TAGS',
'isCaseSensitive': True,
'ruleType': 'INCLUDE',
'pattern': 'EXAMPLE-pattern-Value'}],
'configValues': {
'configParamValues': {
'EXAMPLE_KEY_gRFKZ': {
'stringValue': 'EXAMPLE-stringValue-Value',
'intValue': 823,
'objectValue': 'EXAMPLE-objectValue-Value',
'refValue': 'EXAMPLE-refValue-Value',
'parameterValue': 'EXAMPLE-parameterValue-Value',
'rootObjectValue': 'EXAMPLE-rootObjectValue-Value'}},
'parentRef': {
'parent': 'EXAMPLE-parent-Value',
'rootDocId': 'ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value'}},
'objectStatus': 264}},
'parameterName': 'EXAMPLE-parameterName-Value',
'description': 'EXAMPLE-description-Value',
'defaultValue': 'EXAMPLE-defaultValue-Value',
'classFieldName': 'EXAMPLE-classFieldName-Value',
'isStatic': True,
'isClassFieldValue': False}}))]),
object_version=90,
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
metadata=oci.data_integration.models.ObjectMetadata(
created_by="EXAMPLE-createdBy-Value",
created_by_name="EXAMPLE-createdByName-Value",
updated_by="EXAMPLE-updatedBy-Value",
updated_by_name="EXAMPLE-updatedByName-Value",
time_created=datetime.strptime(
"2025-03-14T19:48:53.168Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2012-02-07T10:44:56.235Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
aggregator_key="EXAMPLE-aggregatorKey-Value",
aggregator=oci.data_integration.models.AggregatorSummary(
type="EXAMPLE-type-Value",
key="EXAMPLE-key-Value",
name="EXAMPLE-name-Value",
identifier="EXAMPLE-identifier-Value",
description="EXAMPLE-description-Value"),
identifier_path="EXAMPLE-identifierPath-Value",
info_fields={
'EXAMPLE_KEY_Z6Ahu': 'EXAMPLE_VALUE_7ADDpYyzOBA5mBTQjTca'},
registry_version=565,
labels=["EXAMPLE--Value"],
is_favorite=False,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="PROJECT",
object_count=146)])),
key_map={
'EXAMPLE_KEY_bCkOG': 'EXAMPLE_VALUE_fZYLb5X4JDWRT2jDUMnu'},
region="EXAMPLE-region-Value",
default_connection=oci.data_integration.models.ConnectionSummaryFromAmazonS3(
model_type="AMAZON_S3_CONNECTION",
key="EXAMPLE-key-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
description="EXAMPLE-description-Value",
object_version=431,
object_status=493,
identifier="EXAMPLE-identifier-Value",
primary_schema=oci.data_integration.models.Schema(
key="EXAMPLE-key-Value",
model_type="EXAMPLE-modelType-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
resource_name="EXAMPLE-resourceName-Value",
description="EXAMPLE-description-Value",
object_version=429,
external_key="EXAMPLE-externalKey-Value",
is_has_containers=False,
default_connection="EXAMPLE-defaultConnection-Value",
object_status=740,
identifier="EXAMPLE-identifier-Value",
metadata=oci.data_integration.models.ObjectMetadata(
created_by="EXAMPLE-createdBy-Value",
created_by_name="EXAMPLE-createdByName-Value",
updated_by="EXAMPLE-updatedBy-Value",
updated_by_name="EXAMPLE-updatedByName-Value",
time_created=datetime.strptime(
"2049-07-06T17:31:44.321Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2023-04-02T09:00:49.111Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
aggregator_key="EXAMPLE-aggregatorKey-Value",
aggregator=oci.data_integration.models.AggregatorSummary(
type="EXAMPLE-type-Value",
key="EXAMPLE-key-Value",
name="EXAMPLE-name-Value",
identifier="EXAMPLE-identifier-Value",
description="EXAMPLE-description-Value"),
identifier_path="EXAMPLE-identifierPath-Value",
info_fields={
'EXAMPLE_KEY_Lz0TU': 'EXAMPLE_VALUE_14MfXBaOXvlfo1kWpFEx'},
registry_version=35,
labels=["EXAMPLE--Value"],
is_favorite=True,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="PROJECT",
object_count=728)]))),
connection_properties=[
oci.data_integration.models.ConnectionProperty(
name="EXAMPLE-name-Value",
value="EXAMPLE-value-Value")],
is_default=False,
metadata=oci.data_integration.models.ObjectMetadata(
created_by="EXAMPLE-createdBy-Value",
created_by_name="EXAMPLE-createdByName-Value",
updated_by="EXAMPLE-updatedBy-Value",
updated_by_name="EXAMPLE-updatedByName-Value",
time_created=datetime.strptime(
"2035-02-11T01:47:49.804Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2042-06-17T09:09:29.609Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
aggregator_key="EXAMPLE-aggregatorKey-Value",
aggregator=oci.data_integration.models.AggregatorSummary(
type="EXAMPLE-type-Value",
key="EXAMPLE-key-Value",
name="EXAMPLE-name-Value",
identifier="EXAMPLE-identifier-Value",
description="EXAMPLE-description-Value"),
identifier_path="EXAMPLE-identifierPath-Value",
info_fields={
'EXAMPLE_KEY_qM9Wf': 'EXAMPLE_VALUE_PGOn1H3YxiVgprti47OK'},
registry_version=384,
labels=["EXAMPLE--Value"],
is_favorite=False,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="DATA_FLOW",
object_count=790)])),
key_map={
'EXAMPLE_KEY_TJKX9': 'EXAMPLE_VALUE_p4OfW9WjtKp0OSL6Cow1'},
access_key=oci.data_integration.models.SensitiveAttribute(
secret_config=oci.data_integration.models.OciVaultSecretConfig(
model_type="OCI_VAULT_SECRET_CONFIG",
secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
value="EXAMPLE-value-Value"),
secret_key=oci.data_integration.models.SensitiveAttribute(
secret_config=oci.data_integration.models.OciVaultSecretConfig(
model_type="OCI_VAULT_SECRET_CONFIG",
secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
value="EXAMPLE-value-Value"))),
connection=oci.data_integration.models.ConnectionFromOracleEbs(
model_type="ORACLE_EBS_CONNECTION",
username="EXAMPLE-username-Value",
password="EXAMPLE-password-Value",
key="EXAMPLE-key-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
description="EXAMPLE-description-Value",
object_version=659,
object_status=629,
identifier="EXAMPLE-identifier-Value",
primary_schema=oci.data_integration.models.Schema(
key="EXAMPLE-key-Value",
model_type="EXAMPLE-modelType-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
resource_name="EXAMPLE-resourceName-Value",
description="EXAMPLE-description-Value",
object_version=595,
external_key="EXAMPLE-externalKey-Value",
is_has_containers=False,
default_connection="EXAMPLE-defaultConnection-Value",
object_status=883,
identifier="EXAMPLE-identifier-Value",
metadata=oci.data_integration.models.ObjectMetadata(
created_by="EXAMPLE-createdBy-Value",
created_by_name="EXAMPLE-createdByName-Value",
updated_by="EXAMPLE-updatedBy-Value",
updated_by_name="EXAMPLE-updatedByName-Value",
time_created=datetime.strptime(
"2045-08-01T04:38:25.114Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2019-11-14T19:38:46.244Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
aggregator_key="EXAMPLE-aggregatorKey-Value",
aggregator=oci.data_integration.models.AggregatorSummary(
type="EXAMPLE-type-Value",
key="EXAMPLE-key-Value",
name="EXAMPLE-name-Value",
identifier="EXAMPLE-identifier-Value",
description="EXAMPLE-description-Value"),
identifier_path="EXAMPLE-identifierPath-Value",
info_fields={
'EXAMPLE_KEY_j07w1': 'EXAMPLE_VALUE_Z4W6T9cMYUhtV4z3Ge8b'},
registry_version=218,
labels=["EXAMPLE--Value"],
is_favorite=True,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="TASK",
object_count=602)]))),
connection_properties=[
oci.data_integration.models.ConnectionProperty(
name="EXAMPLE-name-Value",
value="EXAMPLE-value-Value")],
is_default=False,
metadata=oci.data_integration.models.ObjectMetadata(
created_by="EXAMPLE-createdBy-Value",
created_by_name="EXAMPLE-createdByName-Value",
updated_by="EXAMPLE-updatedBy-Value",
updated_by_name="EXAMPLE-updatedByName-Value",
time_created=datetime.strptime(
"2022-09-08T23:39:45.204Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2029-08-16T18:28:14.458Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
aggregator_key="EXAMPLE-aggregatorKey-Value",
aggregator=oci.data_integration.models.AggregatorSummary(
type="EXAMPLE-type-Value",
key="EXAMPLE-key-Value",
name="EXAMPLE-name-Value",
identifier="EXAMPLE-identifier-Value",
description="EXAMPLE-description-Value"),
identifier_path="EXAMPLE-identifierPath-Value",
info_fields={
'EXAMPLE_KEY_w3knM': 'EXAMPLE_VALUE_VqoRpjPWEpyNYMaBw8Av'},
registry_version=859,
labels=["EXAMPLE--Value"],
is_favorite=True,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="FOLDER",
object_count=355)])),
key_map={
'EXAMPLE_KEY_y25Gn': 'EXAMPLE_VALUE_JGYWEzDupNzEqY5TlicH'},
password_secret=oci.data_integration.models.SensitiveAttribute(
secret_config=oci.data_integration.models.OciVaultSecretConfig(
model_type="OCI_VAULT_SECRET_CONFIG",
secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
value="EXAMPLE-value-Value")),
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
schema=oci.data_integration.models.Schema(
key="EXAMPLE-key-Value",
model_type="EXAMPLE-modelType-Value",
model_version="EXAMPLE-modelVersion-Value",
parent_ref=oci.data_integration.models.ParentReference(
parent="EXAMPLE-parent-Value",
root_doc_id="ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
name="EXAMPLE-name-Value",
resource_name="EXAMPLE-resourceName-Value",
description="EXAMPLE-description-Value",
object_version=350,
external_key="EXAMPLE-externalKey-Value",
is_has_containers=True,
default_connection="EXAMPLE-defaultConnection-Value",
object_status=557,
identifier="EXAMPLE-identifier-Value",
metadata=oci.data_integration.models.ObjectMetadata(
created_by="EXAMPLE-createdBy-Value",
created_by_name="EXAMPLE-createdByName-Value",
updated_by="EXAMPLE-updatedBy-Value",
updated_by_name="EXAMPLE-updatedByName-Value",
time_created=datetime.strptime(
"2000-05-01T14:24:57.867Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2004-08-14T05:43:14.612Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
aggregator_key="EXAMPLE-aggregatorKey-Value",
aggregator=oci.data_integration.models.AggregatorSummary(
type="EXAMPLE-type-Value",
key="EXAMPLE-key-Value",
name="EXAMPLE-name-Value",
identifier="EXAMPLE-identifier-Value",
description="EXAMPLE-description-Value"),
identifier_path="EXAMPLE-identifierPath-Value",
info_fields={
'EXAMPLE_KEY_SLGwQ': 'EXAMPLE_VALUE_QQE7NG3z4c2LDx2ckKdT'},
registry_version=247,
labels=["EXAMPLE--Value"],
is_favorite=False,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="PROJECT",
object_count=165)]))))),
opc_request_id="PUZXHKLI6MVFJW1H5XML<unique_ID>",
opc_retry_token="EXAMPLE-opcRetryToken-Value")
# Get the data from response
print(create_external_publication_response.data)