# 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).

import oci
from datetime import datetime

# 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=625),
        configuration_details=oci.data_integration.models.ConfigurationDetails(
            data_asset=oci.data_integration.models.DataAssetFromHdfsDetails(
                model_type="HDFS_DATA_ASSET",
                host="EXAMPLE-host-Value",
                port="EXAMPLE-port-Value",
                protocol="EXAMPLE-protocol-Value",
                default_connection=oci.data_integration.models.ConnectionFromHdfsDetails(
                    model_type="HDFS_CONNECTION",
                    hdfs_principal="EXAMPLE-hdfsPrincipal-Value",
                    data_node_principal="EXAMPLE-dataNodePrincipal-Value",
                    name_node_principal="EXAMPLE-nameNodePrincipal-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=545,
                    object_status=380,
                    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=860,
                        external_key="EXAMPLE-externalKey-Value",
                        is_has_containers=False,
                        default_connection="EXAMPLE-defaultConnection-Value",
                        object_status=857,
                        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(
                                            "2026-11-26T14:58:26.605Z",
                                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                            time_updated=datetime.strptime(
                                "2029-09-17T23:28:45.347Z",
                                "%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_ofHEe': 'EXAMPLE_VALUE_d1jQuJTayXhpmm8NX4iV'},
                            registry_version=968,
                            labels=["EXAMPLE--Value"],
                            is_favorite=False,
                            count_statistics=oci.data_integration.models.CountStatistic(
                                object_type_count_list=[
                                    oci.data_integration.models.CountStatisticSummary(
                                        object_type="APPLICATION",
                                        object_count=954)]))),
                    connection_properties=[
                        oci.data_integration.models.ConnectionProperty(
                            name="EXAMPLE-name-Value",
                            value="EXAMPLE-value-Value")],
                    is_default=True,
                    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(
                            "2047-08-18T02:25:10.594Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2025-11-30T17:34:24.767Z",
                            "%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_3R9xU': 'EXAMPLE_VALUE_gKEliDCGezykfIS1bZRt'},
                        registry_version=868,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False,
                        count_statistics=oci.data_integration.models.CountStatistic(
                            object_type_count_list=[
                                oci.data_integration.models.CountStatisticSummary(
                                    object_type="USER_DEFINED_FUNCTION",
                                    object_count=80)])),
                    realm="EXAMPLE-realm-Value",
                    key_distribution_center="EXAMPLE-keyDistributionCenter-Value",
                    key_tab_content=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")),
                key="EXAMPLE-key-Value",
                model_version="EXAMPLE-modelVersion-Value",
                name="EXAMPLE-name-Value",
                description="EXAMPLE-description-Value",
                object_status=500,
                identifier="EXAMPLE-identifier-Value",
                external_key="EXAMPLE-externalKey-Value",
                asset_properties={
                    'EXAMPLE_KEY_ZKxuv': 'EXAMPLE_VALUE_Vju2vY9pd0gI3abpfOcQ'},
                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=472,
                    type_mapping_to={
                        'EXAMPLE_KEY_2I48a': 'EXAMPLE_VALUE_aZtlsyc5mXcQakHkNXDy'},
                    type_mapping_from={
                        'EXAMPLE_KEY_n4qkP': 'EXAMPLE_VALUE_IRsL2IzLRbcRVKgmy5Cs'},
                    object_status=21,
                    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=355,
                            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=False,
                                    object_status=818,
                                    config_parameter_definitions={
                                        'EXAMPLE_KEY_fhkvM': {
                                            'parameterType': {
                                                'modelType': 'CONFIGURED_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': 451,
                                                'description': 'EXAMPLE-description-Value',
                                                'wrappedType': 'EXAMPLE-wrappedType-Value',
                                                'configValues': {
                                                    'configParamValues': {
                                                        'EXAMPLE_KEY_NHrck': {
                                                            'stringValue': 'EXAMPLE-stringValue-Value',
                                                            'intValue': 191,
                                                            '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'}}},
                                            'parameterName': 'EXAMPLE-parameterName-Value',
                                            'description': 'EXAMPLE-description-Value',
                                            'defaultValue': 'EXAMPLE-defaultValue-Value',
                                            'classFieldName': 'EXAMPLE-classFieldName-Value',
                                            'isStatic': False,
                                            'isClassFieldValue': False}}))]),
                object_version=897,
                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(
                        "2034-04-25T23:13:47.691Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2023-09-21T12:26:33.424Z",
                        "%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_mcAxg': 'EXAMPLE_VALUE_9frSBpuqZkSDtOGtzEsh'},
                    registry_version=84,
                    labels=["EXAMPLE--Value"],
                    is_favorite=True,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="APPLICATION",
                                object_count=316)])),
                key_map={
                    'EXAMPLE_KEY_xQ5fs': 'EXAMPLE_VALUE_LTTp41ExYJhOnyyZbI7u'},
                validate_certificate=True),
            connection=oci.data_integration.models.ConnectionFromOracleSiebel(
                model_type="ORACLE_SIEBEL_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=25,
                object_status=727,
                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=296,
                    external_key="EXAMPLE-externalKey-Value",
                    is_has_containers=True,
                    default_connection="EXAMPLE-defaultConnection-Value",
                    object_status=837,
                    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(
                                "2022-03-23T11:12:23.307Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2041-12-18T15:33:11.762Z",
                            "%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_fz63b': 'EXAMPLE_VALUE_zxZ2xGEOBbHhuVSsNGqL'},
                        registry_version=607,
                        labels=["EXAMPLE--Value"],
                        is_favorite=False,
                        count_statistics=oci.data_integration.models.CountStatistic(
                            object_type_count_list=[
                                oci.data_integration.models.CountStatisticSummary(
                                    object_type="APPLICATION",
                                    object_count=596)]))),
                connection_properties=[
                    oci.data_integration.models.ConnectionProperty(
                        name="EXAMPLE-name-Value",
                        value="EXAMPLE-value-Value")],
                is_default=True,
                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(
                        "2005-08-20T17:01:40.203Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2027-08-29T07:02:34.161Z",
                        "%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_yRzvm': 'EXAMPLE_VALUE_1wLRXZuxsAHUDNLfeecE'},
                    registry_version=96,
                    labels=["EXAMPLE--Value"],
                    is_favorite=False,
                    count_statistics=oci.data_integration.models.CountStatistic(
                        object_type_count_list=[
                            oci.data_integration.models.CountStatisticSummary(
                                object_type="APPLICATION",
                                object_count=681)])),
                key_map={
                    'EXAMPLE_KEY_BV8fO': 'EXAMPLE_VALUE_et1ZFRuttffdBaxS9Fjo'},
                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=565,
                external_key="EXAMPLE-externalKey-Value",
                is_has_containers=True,
                default_connection="EXAMPLE-defaultConnection-Value",
                object_status=691,
                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(
                            "2047-03-19T06:18:47.014Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2001-11-23T08:15:53.741Z",
                        "%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_L3gY4': 'EXAMPLE_VALUE_iNVK78JttQERSvyfGlrk'},
                    registry_version=979,
                    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_ASSET",
                                object_count=173)]))))),
    opc_request_id="WU7XUF5V5OTPQGF3BAKG<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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

Was this article helpful?