# 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_data_asset_response = data_integration_client.create_data_asset(
    workspace_id="ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
    create_data_asset_details=oci.data_integration.models.CreateDataAssetFromAdwc(
        model_type="ORACLE_ADWC_DATA_ASSET",
        name="EXAMPLE-name-Value",
        identifier="EXAMPLE-identifier-Value",
        key="EXAMPLE-key-Value",
        model_version="EXAMPLE-modelVersion-Value",
        description="EXAMPLE-description-Value",
        object_status=187,
        external_key="EXAMPLE-externalKey-Value",
        asset_properties={
            'EXAMPLE_KEY_8um6E': 'EXAMPLE_VALUE_6Eipo4wbjW1im2AgxEi4'},
        registry_metadata=oci.data_integration.models.RegistryMetadata(
            aggregator_key="EXAMPLE-aggregatorKey-Value",
            labels=["EXAMPLE--Value"],
            registry_version=624,
            key="EXAMPLE-key-Value",
            is_favorite=False),
        service_name="EXAMPLE-serviceName-Value",
        driver_class="EXAMPLE-driverClass-Value",
        credential_file_content="EXAMPLE-credentialFileContent-Value",
        wallet_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"),
        wallet_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"),
        region_id="ocid1.test.oc1..<unique_ID>EXAMPLE-regionId-Value",
        tenancy_id="ocid1.test.oc1..<unique_ID>EXAMPLE-tenancyId-Value",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        autonomous_db_id="ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDbId-Value",
        default_connection=oci.data_integration.models.CreateConnectionFromAdwc(
            model_type="ORACLE_ADWC_CONNECTION",
            name="EXAMPLE-name-Value",
            identifier="EXAMPLE-identifier-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"),
            description="EXAMPLE-description-Value",
            object_status=396,
            connection_properties=[
                oci.data_integration.models.ConnectionProperty(
                    name="EXAMPLE-name-Value",
                    value="EXAMPLE-value-Value")],
            registry_metadata=oci.data_integration.models.RegistryMetadata(
                aggregator_key="EXAMPLE-aggregatorKey-Value",
                labels=["EXAMPLE--Value"],
                registry_version=305,
                key="EXAMPLE-key-Value",
                is_favorite=True),
            tns_alias="EXAMPLE-tnsAlias-Value",
            tns_names=["EXAMPLE--Value"],
            username="EXAMPLE-username-Value",
            password="EXAMPLE-password-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")),
        staging_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=919,
            identifier="EXAMPLE-identifier-Value",
            external_key="EXAMPLE-externalKey-Value",
            asset_properties={
                'EXAMPLE_KEY_FeH6o': 'EXAMPLE_VALUE_K1F6oXJuMOGYwmGwx6CD'},
            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=601,
                type_mapping_to={
                    'EXAMPLE_KEY_6opFI': 'EXAMPLE_VALUE_8L0dR25FzPA4MHEHg2wg'},
                type_mapping_from={
                    'EXAMPLE_KEY_BCFDi': 'EXAMPLE_VALUE_loiKliMOkoyBy73cCHUW'},
                object_status=678,
                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=793,
                        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=332,
                            config_parameter_definitions={
                                'EXAMPLE_KEY_zVJiK': {
                                    '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': 475,
                                        '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=657,
            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(
                    "2004-08-12T12:23:22.471Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                time_updated=datetime.strptime(
                    "2022-07-11T06:22:17.622Z",
                    "%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_0DGr6': 'EXAMPLE_VALUE_pmRlHODJoPdOtEvzBlbU'},
                registry_version=789,
                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=652)])),
            key_map={
                'EXAMPLE_KEY_u6ypc': 'EXAMPLE_VALUE_nExsyAwioJe3E8DWKh9I'},
            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=76,
                object_status=715,
                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=646,
                    external_key="EXAMPLE-externalKey-Value",
                    is_has_containers=False,
                    default_connection="EXAMPLE-defaultConnection-Value",
                    object_status=826,
                    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(
                            "2012-01-09T18:31:14.708Z",
                            "%Y-%m-%dT%H:%M:%S.%fZ"),
                        time_updated=datetime.strptime(
                            "2009-11-05T22:01:38.219Z",
                            "%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_eql54': 'EXAMPLE_VALUE_2ZhvGb1oWdN3jx8Fzcwb'},
                        registry_version=107,
                        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=22)]))),
                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(
                        "2030-08-14T01:23:26.757Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2027-09-20T01:31:04.096Z",
                        "%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_3pu70': 'EXAMPLE_VALUE_GNv5IlLmOYWxQdCxOVD6'},
                    registry_version=618,
                    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=810)])),
                username="EXAMPLE-username-Value")),
        staging_connection=oci.data_integration.models.ConnectionFromRestNoAuth(
            model_type="REST_NO_AUTH_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=364,
            object_status=273,
            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=105,
                external_key="EXAMPLE-externalKey-Value",
                is_has_containers=False,
                default_connection="EXAMPLE-defaultConnection-Value",
                object_status=155,
                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(
                        "2010-12-28T20:56:32.428Z",
                        "%Y-%m-%dT%H:%M:%S.%fZ"),
                    time_updated=datetime.strptime(
                        "2005-07-02T20:36:50.852Z",
                        "%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_XFI7d': 'EXAMPLE_VALUE_1HtktF0QDHdM88w5noah'},
                    registry_version=652,
                    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=990)]))),
            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(
                    "2023-09-10T13:05:32.505Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                time_updated=datetime.strptime(
                    "2011-01-22T13:06:11.872Z",
                    "%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_pTw4b': 'EXAMPLE_VALUE_jTTU4zE5IaKs063W1hGM'},
                registry_version=900,
                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=429)])),
            key_map={
                'EXAMPLE_KEY_1P0oF': 'EXAMPLE_VALUE_Mu64Cof44HxuLkOfkWYF'}),
        bucket_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=489,
            external_key="EXAMPLE-externalKey-Value",
            is_has_containers=True,
            default_connection="EXAMPLE-defaultConnection-Value",
            object_status=735,
            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-10-19T08:07:24.343Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                time_updated=datetime.strptime(
                    "2036-01-07T02:36:10.103Z",
                    "%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_szTle': 'EXAMPLE_VALUE_oXSBmhQgjSNJU6vINz84'},
                registry_version=339,
                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=510)])))),
    opc_request_id="BH1MAWNVKODA6CKZYCKC<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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

Was this article helpful?