19.5.1 Create an Oracle Business Intelligence Cloud Connector (BICC) Connection
Create a BI Cloud Connector (BICC) connection by selecting ConnectionTypes.ORACLE_BI_CLOUD_CONNECTOR and setting the BICC service and external object storage properties. The example uses ORACLE_BI_CLOUD_CONNECTOR property constants so connector field names do not need to be hard-coded.
"""Create and test a BICC connection with the Data Transforms SDK.
Replace the placeholder values with settings from the BICC and object storage
environments before running this example. Keep credentials outside source
control.
"""
from getpass import getpass
from datatransforms.connection import Connection
from datatransforms.connection_properties import ORACLE_BI_CLOUD_CONNECTOR as BICC
from datatransforms.connection_types import ConnectionTypes
from datatransforms.workbench import DataTransformsWorkbench, WorkbenchConfig
def create_bicc_connection(deployment_password):
"""Create or update a BICC connection and test its connectivity."""
connect_params = WorkbenchConfig.get_workbench_config(deployment_password)
workbench = DataTransformsWorkbench()
workbench.connect_workbench(connect_params)
bicc_connection = (
Connection()
.connection_name("Demo BICC")
.of_type(ConnectionTypes.ORACLE_BI_CLOUD_CONNECTOR)
.with_credentials(
"<bicc-user>",
Connection.encode_pwd(getpass("BICC password: ")),
)
.property(BICC.serviceURL, "https://<fusion-service-host>")
.property(BICC.proxyHost, "<proxy-host-or-empty>")
.property(BICC.proxyPort, "<proxy-port-or-empty>")
.property(BICC.externalStorageBICCName, "<bicc-external-storage-name>")
.property(BICC.externalStorageBucket, "<object-storage-bucket>")
.property(BICC.externalStorageNameSpace, "<object-storage-namespace>")
.property(BICC.externalStorageRegion, "<object-storage-region>")
.property(BICC.externalStorageTechnology, "ORACLE_OBJECT_STORAGE")
.property(BICC.externalStorageUser, "<object-storage-user>")
)
workbench.save_connection(bicc_connection)
connection_is_valid = workbench.test_connection(bicc_connection)
print("BICC connection test:", connection_is_valid)
return bicc_connection
if __name__ == "__main__":
create_bicc_connection(getpass("Data Transforms deployment password: "))
Replace the placeholder values with the settings for your BICC and object storage environments. Connection.encode_pwd base64-encodes the BICC password to match the SDK connection payload contract; do not hard-code the password or commit it to source control.
save_connection creates the connection when the name is new and updates it when the name already exists. Use workbench.test_connection after saving to verify connectivity.
WARNING:
Never check-in or manage the production code with plain text passwords.Testing connectivity
To test the connection, use test_connection method from Workbench. Returns True if the connection could be established.
#Assuming workbench is connected already...
test_connection = Connection().connection_name("connection-name")
connection_status = workbench.test_connection(test_connection)
logging.debug("Test connection is %s" , connection_status)Parent topic: Create Connections