# 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=856),
configuration_details=oci.data_integration.models.ConfigurationDetails(
data_asset=oci.data_integration.models.DataAssetFromJdbc(
model_type="GENERIC_JDBC_DATA_ASSET",
key="EXAMPLE-key-Value",
model_version="EXAMPLE-modelVersion-Value",
name="EXAMPLE-name-Value",
description="EXAMPLE-description-Value",
object_status=789,
identifier="EXAMPLE-identifier-Value",
external_key="EXAMPLE-externalKey-Value",
asset_properties={
'EXAMPLE_KEY_BbxEB': 'EXAMPLE_VALUE_asxyw3yKoYhgEEgGASp0'},
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=798,
type_mapping_to={
'EXAMPLE_KEY_WLVA3': 'EXAMPLE_VALUE_62qGCoJNwaydfixNZTnH'},
type_mapping_from={
'EXAMPLE_KEY_wa57S': 'EXAMPLE_VALUE_F74io6TLw2l8kW9Xlk6G'},
object_status=396,
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=796,
description="EXAMPLE-description-Value",
dt_type="PRIMITIVE",
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=True,
object_status=744,
config_parameter_definitions={
'EXAMPLE_KEY_3fumj': {
'parameterType': {
'modelType': 'JAVA_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': 445,
'description': 'EXAMPLE-description-Value',
'javaTypeName': 'EXAMPLE-javaTypeName-Value'},
'parameterName': 'EXAMPLE-parameterName-Value',
'description': 'EXAMPLE-description-Value',
'defaultValue': 'EXAMPLE-defaultValue-Value',
'classFieldName': 'EXAMPLE-classFieldName-Value',
'isStatic': True,
'isClassFieldValue': True}}))]),
object_version=699,
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(
"2033-05-31T12:59:14.785Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2000-06-04T22:07:58.381Z",
"%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_En6XB': 'EXAMPLE_VALUE_JxXEYYAwyDd321mEh0me'},
registry_version=729,
labels=["EXAMPLE--Value"],
is_favorite=True,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="USER_DEFINED_FUNCTION",
object_count=830)])),
key_map={
'EXAMPLE_KEY_0Ak27': 'EXAMPLE_VALUE_fIV7OaYwyehmOH2NQVba'},
host="EXAMPLE-host-Value",
port="EXAMPLE-port-Value",
data_asset_type="EXAMPLE-dataAssetType-Value",
default_connection=oci.data_integration.models.ConnectionFromJdbcDetails(
model_type="GENERIC_JDBC_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=445,
object_status=850,
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=718,
external_key="EXAMPLE-externalKey-Value",
is_has_containers=True,
default_connection="EXAMPLE-defaultConnection-Value",
object_status=731,
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(
"2042-09-10T19:13:35.207Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2033-05-11T05:07:52.351Z",
"%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_JKlHU': 'EXAMPLE_VALUE_JusdHS3AsBZpySfKLpew'},
registry_version=790,
labels=["EXAMPLE--Value"],
is_favorite=True,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="DATA_FLOW",
object_count=159)]))),
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(
"2041-07-20T19:44:08.665Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2005-09-11T02:03:44.417Z",
"%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_5smNk': 'EXAMPLE_VALUE_Zl27gHBJEZXOakG8qOWE'},
registry_version=685,
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=940)])),
username="EXAMPLE-username-Value")),
connection=oci.data_integration.models.ConnectionFromBIP(
model_type="BIP_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=23,
object_status=817,
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=55,
external_key="EXAMPLE-externalKey-Value",
is_has_containers=False,
default_connection="EXAMPLE-defaultConnection-Value",
object_status=384,
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(
"2008-02-04T21:33:33.535Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2007-05-05T19:11:03.461Z",
"%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_KDSVD': 'EXAMPLE_VALUE_4KOf28n5lU3k2B6fkrGY'},
registry_version=741,
labels=["EXAMPLE--Value"],
is_favorite=False,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="TASK",
object_count=200)]))),
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(
"2012-07-04T03:50:12.787Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2042-06-28T22:47:12.382Z",
"%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_OagUm': 'EXAMPLE_VALUE_p65UtSy7bVazxQLC9fXF'},
registry_version=768,
labels=["EXAMPLE--Value"],
is_favorite=True,
count_statistics=oci.data_integration.models.CountStatistic(
object_type_count_list=[
oci.data_integration.models.CountStatisticSummary(
object_type="CONNECTION",
object_count=754)])),
key_map={
'EXAMPLE_KEY_mpYFn': 'EXAMPLE_VALUE_w9pCncL2epGEc0L9RpXb'},
username="EXAMPLE-username-Value",
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=415,
external_key="EXAMPLE-externalKey-Value",
is_has_containers=False,
default_connection="EXAMPLE-defaultConnection-Value",
object_status=726,
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(
"2039-09-06T15:40:10.581Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_updated=datetime.strptime(
"2038-07-12T06:52:15.409Z",
"%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_4iTLb': 'EXAMPLE_VALUE_zMnFZcg8ZYKIibAZomLb'},
registry_version=880,
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=550)]))))),
opc_request_id="ACLISQDR9VMQ6MMTAZK7<unique_ID>",
opc_retry_token="EXAMPLE-opcRetryToken-Value")
# Get the data from response
print(create_external_publication_response.data)