Getting Started
Relevant source files
The following files were used as context for generating this wiki page:
The flext-target-oracle-oic project is a Singer-compliant target designed for loading data into Oracle Integration Cloud (OIC). It leverages the FLEXT framework to provide a typed, enterprise-grade integration for managing OIC resources such as connections, integrations, packages, and lookups. The project is built on Python 3.13+ and utilizes Pydantic for robust configuration and data validation.
Sources: README.md:5-9, pyproject.toml:23-45
Installation and Requirements
The target is packaged as a Python module and requires a modern Python environment. It depends on several core FLEXT libraries to handle API interactions, observability, and Meltano integration.
| Requirement | Value |
|---|---|
| Python Version | 3.13+ |
| Primary Dependencies | flext-core, flext-api, flext-meltano, flext-oracle-oic, singer-sdk |
| Build Backend | hatchling |
Sources: pyproject.toml:23-53
To install the package for development or production use, you can utilize pip or a compatible package manager. The project defines two main entry point scripts: flext-target-oracle-oic and target-oracle-oic.
Sources: pyproject.toml:117-119
Core Architecture
The system follows the Singer SDK pattern, where a FlextTargetOracleOic class acts as the orchestrator, delegating record processing to specific "Sink" classes based on the stream name.
Target and Sink Mapping
The target maps incoming Singer streams to specific OIC resource sinks. If a stream does not match a known type, it falls back to a default base sink.
The diagram shows how the FlextTargetOracleOic class resolves the appropriate sink class based on the incoming stream metadata.
Sources: src/flext_target_oracle_oic/target.py:53-76
Component Hierarchy
The implementation utilizes inheritance from both the singer-sdk and internal flext abstractions to provide standard ETL behaviors.
Configuration
To successfully connect to Oracle Integration Cloud, specific configuration parameters must be provided. These are managed via the FlextTargetOracleOicSettings class, which supports environment variable overrides.
Required Settings
The following settings are mandatory for the target to function:
| Parameter | Description |
|---|---|
base_url | The OIC instance URL (e.g., https://...integration.ocp.oraclecloud.com) |
oauth_client_id | OAuth2 Client ID for authentication |
oauth_client_secret | OAuth2 Client Secret for authentication |
oauth_token_url | The IDCS or IAM token endpoint URL |
Sources: src/flext_target_oracle_oic/utilities.py:27-32, tests/unit/test_e2e.py:46-56
Authentication Flow
The target uses OAuth2 Client Credentials grant to obtain a Bearer token for API requests. The TargetOracleOic.Authenticator handles token lifecycle management, including caching and refreshing tokens when necessary.
Execution Flow
When running the target, the following sequence occurs:
- Initialization: The
FlextTargetOracleOicis instantiated and itssetup()method is called. - Stream Routing: As Singer messages arrive via
STDIN, the target identifies the stream name and selects the appropriate sink (e.g.,FlextTargetOracleOicConnectionsSink). - Record Processing: The sink's
process_recordmethod is invoked. This method is responsible for validating the record against OIC models and preparing it for the API. - Completion: Once all records are processed, the
teardown()method is executed to clean up resources.
Sources: src/flext_target_oracle_oic/target.py:78-84, tests/unit/test_e2e_sinks.py:43-55
Summary
The flext-target-oracle-oic provides a structured, typed approach to loading data into Oracle Integration Cloud. By utilizing the FLEXT framework and Singer SDK, it ensures that integrations are maintainable, testable (through E2E suites that validate authentication and sink logic), and compatible with modern ETL toolchains like Meltano.
Sources: README.md:16-30, tests/unit/test_e2e.py:1-12