### Start Pipeline Source: https://docs.feldera.com/python/_sources/examples Starts an existing pipeline to begin processing data. ```APIDOC ## Start Pipeline ### Description Starts a created pipeline to begin processing data and executing defined SQL operations. ### Method POST ### Endpoint /pipelines/{pipeline_name}/start ### Parameters #### Path Parameters - **pipeline_name** (string) - Required - Name of the pipeline to start #### Query Parameters None #### Request Body None ### Request Example ```python pipeline.start() ``` ### Response #### Success Response Returns success status #### Response Example ``` {"status": "started"} ``` ``` -------------------------------- ### View Feldera Installation Resources with kubectl Source: https://docs.feldera.com/get-started/enterprise/helm-guide Displays Kubernetes services, pods, StatefulSets, deployments, and persistent volume claims in the 'feldera' namespace post-installation. Helps verify deployment status and resource allocation; outputs include IPs, readiness, and storage details. ```bash $ kubectl get svc -n feldera ``` ```bash $ kubectl get pods -n feldera ``` ```bash $ kubectl get sts -n feldera ``` ```bash $ kubectl get deployments -n feldera ``` ```bash $ kubectl get pvc -n feldera ``` -------------------------------- ### Install Feldera Enterprise using Helm Source: https://docs.feldera.com/get-started/enterprise/quickstart Installs or upgrades the Feldera Enterprise deployment in a Kubernetes cluster using Helm. It requires account ID, license key, and the desired Feldera version. This command configures the Feldera chart with specified settings, including the database secret reference. ```bash ACCOUNT_ID="00000000-0000-0000-0000-000000000000" # Set to your own LICENSE_KEY="00000000-0000-0000-0000-000000000000" # Set to your own VERSION=0.88.0 # Replace with previously chosen version helm upgrade --install feldera \ oci://public.ecr.aws/feldera/feldera-chart --version "${VERSION}" \ --namespace feldera --create-namespace \ --set felderaVersion="${VERSION}" \ --set felderaAccountId="${ACCOUNT_ID}" \ --set felderaLicenseKey="${LICENSE_KEY}" \ --set felderaDatabaseSecretRef="feldera-db-insecure-secret" ``` -------------------------------- ### Install Feldera Python SDK from GitHub Source: https://docs.feldera.com/python/introduction Installs the Feldera Python SDK directly from a GitHub repository. Useful for installing the latest development version or specific branches. ```bash pip install git+https://github.com/feldera/feldera#subdirectory=python ``` ```bash pip install git+https://github.com/feldera/feldera@{BRANCH_NAME}#subdirectory=python ``` -------------------------------- ### Check Feldera Setup by Retrieving Programs Source: https://docs.feldera.com/tutorials/rest_api This curl command verifies the Feldera setup by fetching the list of programs. It sends a GET request to the /v0/programs endpoint and formats the JSON output with jq. This is a good initial test for API connectivity. ```bash curl -s -X GET http://127.0.0.1:8080/v0/programs | jq ``` -------------------------------- ### Feldera Pipeline Support Bundle Generation (Python) Source: https://docs.feldera.com/python/_sources/examples Shows how to generate and retrieve a support bundle for a Feldera pipeline using the Python SDK. This includes creating a pipeline, starting it, generating the bundle as bytes, verifying its integrity as a ZIP file, saving it to disk, and performing cleanup. Assumes Feldera is running on localhost:8080. ```python # Create a client (assuming Feldera is running on localhost:8080) client = FelderaClient.localhost(port=8080) # Define a simple SQL program sql_program = """ CREATE TABLE users(id INT, name STRING); CREATE MATERIALIZED VIEW user_count AS SELECT COUNT(*) as count FROM users; """ # Create a pipeline pipeline_name = "support-bundle-example" pipeline = PipelineBuilder( client, pipeline_name, sql_program ).create_or_replace() print(f"Created pipeline: {pipeline.name}") # Start the pipeline pipeline.start() print("Pipeline started") # Generate support bundle as bytes print("Generating support bundle...") support_bundle_bytes = pipeline.support_bundle() print(f"Support bundle size: {len(support_bundle_bytes)} bytes") # Verify it's a valid ZIP file try: with zipfile.ZipFile(io.BytesIO(support_bundle_bytes), 'r') as zip_file: file_list = zip_file.namelist() print(f"Support bundle contains {len(file_list)} files:") for file_name in file_list[:5]: # Show first 5 files print(f" - {file_name}") if len(file_list) > 5: print(f" ... and {len(file_list) - 5} more files") except zipfile.BadZipFile: print("Warning: Support bundle is not a valid ZIP file") # Save support bundle to a file output_path = f"{pipeline_name}-support-bundle.zip" pipeline.support_bundle(output_path=output_path) print(f"Support bundle saved to: {output_path}") # Verify the saved file if os.path.exists(output_path): file_size = os.path.getsize(output_path) print(f"Saved file size: {file_size} bytes") # Clean up os.unlink(output_path) print("Cleaned up saved file") # Stop the pipeline pipeline.stop(force=True) pipeline.clear_storage() pipeline.delete() print("Pipeline stopped and deleted") ``` -------------------------------- ### Build and Manage Feldera Pipeline Lifecycle Source: https://docs.feldera.com/python/introduction Demonstrates the full lifecycle of a Feldera pipeline: defining SQL, creating a client, building and creating a pipeline, starting it, providing input data via pandas DataFrame, and waiting for completion. This example is for batch processing. ```python from feldera import FelderaClient, PipelineBuilder import pandas as pd tbl_name = "user_data" view_name = "select_view" sql = f""" -- Declare input tables CREATE TABLE {tbl_name} (name STRING); -- Create Views based on your queries CREATE VIEW {view_name} AS SELECT * FROM {tbl_name}; """ client = FelderaClient("https://try.feldera.com", api_key="YOUR_API_KEY") pipeline = PipelineBuilder(client, name="example", sql=sql).create() # start the pipeline pipeline.start() # read input data df = pd.read_csv("data.csv") pipeline.input_pandas(tbl_name, df) # wait for the pipeline to complete pipeline.wait_for_completion(force_stop=True) ``` -------------------------------- ### Setup Feldera and NATS with Docker Compose Source: https://docs.feldera.com/connectors/sources/nats This snippet shows how to download the docker-compose.yml file and start Feldera, NATS server, and NATS CLI using Docker Compose. It then demonstrates how to connect to the NATS CLI container. ```bash curl -L https://raw.githubusercontent.com/feldera/feldera/main/deploy/docker-compose.yml -o docker-compose.yml docker compose --profile nats up ``` ```bash docker compose exec nats-cli sh ``` -------------------------------- ### Feldera Pipeline to Kafka Sink Example Source: https://docs.feldera.com/python/_sources/examples Demonstrates creating a Feldera pipeline that ingests data from an internal generator and writes to a Kafka topic. It covers pipeline creation, starting in a paused state, listening for output, resuming, and finally cleaning up resources. Assumes Kafka is running on localhost:9092. ```python from feldera import FelderaClient, PipelineBuilder client = FelderaClient('http://localhost:8080') sql = """ CREATE TABLE Stocks ( symbol VARCHAR NOT NULL, price_time BIGINT NOT NULL, -- UNIX timestamp price DECIMAL(38, 2) NOT NULL ) with ( 'connectors' = '[{ "transport": { "name": "datagen", "config": { "plan": [{ "limit": 5, "rate": 1, "fields": { "symbol": { "values": ["AAPL", "GOOGL", "SPY", "NVDA"] }, "price": { "strategy": "uniform", "range": [100, 10000] } } }] } } }]' ); CREATE VIEW googl_stocks WITH ( 'connectors' = [ { "name": "kafka-3", "transport": { "name": "kafka_output", "config": { "bootstrap.servers": "localhost:9092", "topic": "googl_stocks", "auto.offset.reset": "earliest" } }, "format": { "name": "json", "config": { "update_format": "insert_delete", "array": false } } } ] ) AS SELECT * FROM Stocks WHERE symbol = 'GOOGL'; """ pipeline = PipelineBuilder(client, name="kafka_example", sql=sql).create_or_replace() # Start the pipeline in paused state, attach listener, then unpause the pipeline. # This ensures that the listener gets all the output from the view. pipeline.start_paused() out = pipeline.listen("googl_stocks") pipeline.resume() # important: `wait_for_completion` will block forever here pipeline.wait_for_idle() pipeline.stop(force=True) df = out.to_pandas() assert df.shape[0] != 0 # clear the storage and delete the pipeline pipeline.delete(True) ``` -------------------------------- ### Feldera Example: Transaction Lifecycle Source: https://docs.feldera.com/pipelines/transactions Demonstrates the lifecycle of a Feldera transaction, from creating a pipeline and starting a transaction to inserting data, observing view staleness, committing the transaction, and verifying propagated updates. ```bash # Create a simple pipeline that copies all records in table `t` to view `v`. $ echo 'create table t(x int); create materialized view v as select * from t;' | fda create transaction_test --stdin Pipeline created successfully. $ fda start transaction_test Pipeline started successfully. # Update the table. $ fda query transaction_test "insert into t values(1)" +-------+ | count | +-------+ | 1 | +-------+ # The change is instantly reflected in the output view. $ fda query transaction_test "select * from v" +---+ | x | +---+ | 1 | +---+ # Start a transaction. $ fda start-transaction transaction_test Transaction started successfully with ID: 1 # Insert more records. $ fda query transaction_test "insert into t values(2)" +-------+ | count | +-------+ | 1 | +-------+ $ fda query transaction_test "insert into t values(3)" +-------+ | count | +-------+ | 1 | +-------+ # The view remains unmodified since the transaction has not been committed. $ fda query transaction_test "select * from v" +---+ | x | +---+ | 1 | +---+ # Commit the transaction. $ fda commit-transaction transaction_test Transaction committed successfully. # Updates performed during the transaction are now propagated to all views. $ fda query transaction_test "select * from v" +---+ | x | +---+ | 2 | | 3 | | 1 | +---+ ``` -------------------------------- ### Verify K3D and kubectl Prerequisites Source: https://docs.feldera.com/get-started/enterprise/kubernetes-guides/k3d Commands to verify that required tools are installed and accessible. K3D version check confirms the lightweight Kubernetes distribution is available, while kubectl version check ensures the Kubernetes command-line tool is ready for cluster interaction. ```bash # Check k3d installation k3d version # Check kubectl installation kubectl version ``` -------------------------------- ### Start Deployment Source: https://docs.feldera.com/api/partially-update-a-pipeline Initiates the start of a deployment. This can be an early start before a timeout or a regular start. ```APIDOC ## POST /websites/feldera/deployments/start ### Description Starts the deployment process. This endpoint is used to initiate the deployment, potentially transitioning from a 'Stopped' state to 'Provisioning'. ### Method POST ### Endpoint /websites/feldera/deployments/start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **deployment_resources_desired_status** (string) - Required - The desired status for the deployment resources. Set to `Provisioned` to start. - **deployment_resources_desired_status_since** (date-time) - Required - The timestamp indicating when this desired status was set. ### Request Example ```json { "deployment_resources_desired_status": "Provisioned", "deployment_resources_desired_status_since": "2023-10-27T10:30:00Z" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the start request was processed. - **deployment_id** (uuid) - Optional - The ID of the deployment being started. #### Response Example ```json { "message": "Deployment start initiated.", "deployment_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` -------------------------------- ### Start FDA Pipeline Source: https://docs.feldera.com/interface/cli Starts the execution of pipeline 'p1' using fda start. No inputs beyond pipeline name; outputs status. Begins data processing; pipeline must be created and configured. ```bash fda start p1 ``` -------------------------------- ### Full Feldera schema setup with tables, views, and connectors (SQL) Source: https://docs.feldera.com/tutorials/basics/part3 Provides a comprehensive example that creates the VENDOR, PART, and PRICE tables each with URL input connectors, adds a Kafka input connector for PRICE, defines the LOW_PRICE view for aggregation, and sets up the PREFERRED_VENDOR view with a Kafka output connector. This illustrates a complete end‑to‑end data pipeline within Feldera. ```SQL create table VENDOR ( id bigint not null primary key, name varchar, address varchar ) WITH ('connectors' = '[{ "transport": { "name": "url_input", "config": {"path": "https://feldera-basics-tutorial.s3.amazonaws.com/vendor.json"} }, "format": { "name": "json" } }]'); create table PART ( id bigint not null primary key, name varchar ) WITH ('connectors' = '[{ "transport": { "name": "url_input", "config": {"path": "https://feldera-basics-tutorial.s3.amazonaws.com/part.json" } }, "format": { "name": "json" } }]'); create table PRICE ( part bigint not null, vendor bigint not null, price integer ) WITH ('connectors' = '[{ "transport": { "name": "url_input", "config": {"path": "https://feldera-basics-tutorial.s3.amazonaws.com/price.json" } }, "format": { "name": "json" } }, { "format": {"name": "json"}, "transport": { "name": "kafka_input", "config": { "topic": "price", "start_from": "earliest", "bootstrap.servers": "redpanda:9092" } } }]'); -- Lowest available price for each part across all vendors. create view LOW_PRICE ( part, price ) as select part, MIN(price) as price from PRICE group by part; -- Lowest available price for each part along with part and vendor details. create view PREFERRED_VENDOR ( part_id, part_name, vendor_id, vendor_name, price ) WITH ( 'connectors' = '[{ "format": {"name": "json"}, "transport": { "name": "kafka_output", "config": { "topic": "preferred_vendor", "bootstrap.servers": "redpanda:9092" } } }]' ) as select PART.id as part_id, PART.name as part_name, VENDOR.id as vendor_id, VENDOR.name as vendor_name, PRICE.price from PRICE, PART, VENDOR, LOW_PRICE where PRICE.price = LOW_PRICE.price AND PRICE.part = LOW_PRICE.part AND PART.id = PRICE.part AND VENDOR.id = PRICE.vendor; ``` -------------------------------- ### Start Website Deployment Source: https://docs.feldera.com/api/create-a-new-pipeline Initiates the early start of a website deployment. This action transitions the deployment from a 'Stopped' state to 'Provisioning'. ```APIDOC ## POST /websites/feldera/start ### Description Initiates the early start of a website deployment. This transitions the deployment to a provisioning state. ### Method POST ### Endpoint /websites/feldera/start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the deployment has started. #### Response Example ```json { "message": "Deployment initiated successfully." } ``` ``` -------------------------------- ### Helm Install Feldera with External PostgreSQL Source: https://docs.feldera.com/get-started/enterprise/helm-guide Sets Helm values during new Feldera installation to enable external PostgreSQL database. References the created secret and optional TLS ConfigMap. Requires Helm chart for Feldera; must be a fresh install, not upgrade. ```bash --set postgresExternal=true --set felderaDatabaseSecretRef="feldera-db-secret" --set postgresTlsConfigMapRef="postgres-pem" ``` -------------------------------- ### Create TLS Certificate ConfigMap for PostgreSQL Source: https://docs.feldera.com/get-started/enterprise/helm-guide Downloads and creates a ConfigMap for TLS certificates to secure PostgreSQL connections, using Amazon RDS example. Optional step; Feldera falls back to system certificates if omitted. Allows overriding names via Helm values for certificate file and ConfigMap reference. ```bash wget https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem kubectl create configmap postgres-pem -n feldera --from-file=postgresql-ca.pem=global-bundle.pem ``` -------------------------------- ### POST /start Source: https://docs.feldera.com/pipelines/lifecycle Starts the pipeline by setting the desired status to 'Provisioned'. This initiates asynchronous provisioning of compute and storage resources. ```APIDOC ## POST /start ### Description Initiates the provisioning of compute and storage resources for the pipeline. The call returns immediately, but provisioning happens asynchronously. ### Method POST ### Endpoint /start ### Parameters #### Query Parameters - **initial** (string) - Optional - Controls the initial state of the pipeline. Possible values: `standby`, `paused`, `running` (default: `running`). ### Request Example { "initial": "running" } ### Response #### Success Response (200) - **deployment_id** (string) - Identifier for the deployment. - **deployment_resources_status** (string) - Current status of resources. #### Response Example { "deployment_id": "12345", "deployment_resources_status": "Provisioning" } ``` -------------------------------- ### Start Feldera Locally with Docker Compose Source: https://docs.feldera.com/tutorials/rest_api This command downloads the docker-compose.yml file for Feldera and starts the services using docker compose. Ensure Docker is installed and running. ```bash curl -L https://raw.githubusercontent.com/feldera/feldera/main/deploy/docker-compose.yml | \ docker compose -f - up ``` -------------------------------- ### POST /start Source: https://docs.feldera.com/api/recompile-a-pipeline-with-the-feldera-runtime-version-included-in-the Sets the desired status of a pipeline to 'Provisioned', initiating its startup process. ```APIDOC ## POST /start ### Description Initiates the pipeline startup process by setting its desired status to `Provisioned`. After invoking this, you should monitor the pipeline's status using `GET /v0/pipelines/{name}`. ### Method POST ### Endpoint /start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the pipeline to start. - **program_code** (string) - Required - The source code of the pipeline program. - **program_config** (object) - OPTIONAL - Program configuration. - **cache** (boolean) - OPTIONAL. If `true` (default), uses a prior compilation with the same checksum. Set to `false` to always trigger a new compilation. - **profile** (string) - OPTIONAL. Compilation profile. Possible values: [`dev`, `unoptimized`, `optimized`, `optimized_symbols`]. - **runtime_version** (string) - OPTIONAL. Override runtime version of the pipeline being executed. - **description** (string) - OPTIONAL - A description for the pipeline. ### Request Example ```json { "name": "my-pipeline", "program_code": "SELECT * FROM input", "program_config": { "profile": "optimized", "runtime_version": "v0.96.0" }, "description": "Real-time data processing pipeline" } ``` ### Response #### Success Response (200) - **id** (uuid) - The unique identifier of the pipeline. - **name** (string) - The name of the pipeline. - **status** (string) - The status of the operation. Expected to be related to starting the pipeline. #### Response Example ```json { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "my-pipeline", "status": "Provisioning requested" } ``` ``` -------------------------------- ### Get Pipeline Metrics (Go) Source: https://docs.feldera.com/api/retrieve-circuit-metrics-of-a-running-or-paused-pipeline Example of retrieving pipeline circuit metrics using Go. It shows how to construct the URL and make an HTTP GET request. ```go package main import ( "fmt" "io/ioutil" "net/http" ) func getPipelineMetrics(pipelineName string, format string) (string, error) { url := fmt.Sprintf("https://docs.feldera.com/v0/pipelines/%s/metrics?format=%s", pipelineName, format) resp, err := http.Get(url) if err != nil { return "", fmt.Errorf("failed to make request: %w", err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("unexpected status code: %d", resp.StatusCode) } body, err := ioutil.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("failed to read response body: %w", err) } return string(body), nil } // Example usage: // func main() { // metrics, err := getPipelineMetrics("my-pipeline", "prometheus") // if err != nil { // fmt.Println("Error:", err) // return // } // fmt.Println(metrics) // } ``` -------------------------------- ### Get Pipeline Metrics (Node.js) Source: https://docs.feldera.com/api/retrieve-circuit-metrics-of-a-running-or-paused-pipeline Example of retrieving pipeline circuit metrics using Node.js. It demonstrates how to make an HTTP GET request to the metrics endpoint. ```javascript const fetch = require('node-fetch'); async function getPipelineMetrics(pipelineName, format = 'prometheus') { const url = `https://docs.feldera.com/v0/pipelines/${pipelineName}/metrics?format=${format}`; const response = await fetch(url, { method: 'GET', headers: { 'Accept': 'application/octet-stream' } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.text(); // Or response.json() if format is 'json' } // Example usage: // getPipelineMetrics('my-pipeline').then(data => console.log(data)).catch(error => console.error(error)); ``` -------------------------------- ### Start Redpanda with Docker Compose Source: https://docs.feldera.com/tutorials/basics/part3 Downloads and starts a local Redpanda instance using the official Feldera Docker Compose configuration. This command streams the compose file from GitHub and brings up only the redpanda service. Requires Docker and internet access to fetch the configuration file. ```shell curl -L https://raw.githubusercontent.com/feldera/feldera/main/deploy/docker-compose.yml | docker compose -f - up redpanda ``` -------------------------------- ### Configure Kafka Input Connector to Start from Specific Offset Source: https://docs.feldera.com/connectors/sources/kafka This example shows how to configure the Feldera Kafka input connector to start consuming messages from a specific offset within a partition. It utilizes the `start_from` configuration with an `offsets` array to define the exact starting point. ```sql CREATE TABLE INPUT ( ... -- columns omitted ) WITH ( 'connectors' = '[ { "transport": { "name": "kafka_input", "config": { "topic": "book-fair-sales", "start_from": {"offsets": [42]}, "bootstrap.servers": "example.com:9092" } }, "format": { "name": "json", "config": { "update_format": "insert_delete", "array": false } } }]' ) ``` -------------------------------- ### CLI: Start an Input Connector Source: https://docs.feldera.com/connectors/orchestration This command-line interface (CLI) command is used to start a specific input connector. It targets the 'c1' connector within the 'numbers' pipeline on the 'example' system, changing its state to 'Running' and enabling data ingestion from it. ```bash fda connector example numbers c1 start ``` -------------------------------- ### Connect to Feldera Sandbox Source: https://docs.feldera.com/python/examples Establishes a connection to the Feldera Sandbox environment using an API key. Requires an API key obtained from the Feldera Sandbox interface. ```python from feldera import FelderaClient, PipelineBuilder client = FelderaClient('https://try.feldera.com', api_key=api_key) pipeline = PipelineBuilder(client, name, sql).create() ``` -------------------------------- ### Install Feldera SDK from Local Directory Source: https://docs.feldera.com/python/_sources/introduction Installs the Feldera Python SDK from a local clone of the repository. Useful for development or testing custom modifications. ```bash # the Feldera Python SDK is present inside the python/ directory pip install python/ ``` -------------------------------- ### Start Pipeline (cURL) Source: https://docs.feldera.com/api/start-the-pipeline-asynchronously-by-updating-the-desired-status Initiates a Feldera pipeline startup process using cURL. This asynchronous operation returns immediately after setting the desired status. Progress monitoring requires polling other GET endpoints. The `initial` parameter can set the pipeline to 'running', 'paused', or 'standby'. ```curl curl -L -X POST 'https://docs.feldera.com/v0/pipelines/:pipeline_name/start' \ -H 'Accept: application/json' ``` -------------------------------- ### Configure Database Secret for External PostgreSQL Source: https://docs.feldera.com/get-started/enterprise/helm-guide Creates a Kubernetes Secret to store the PostgreSQL connection URL for Feldera. Requires kubectl access and a YAML file with credentials. Outputs a secret named 'feldera-db-secret' in the 'feldera' namespace; used during Helm installation. ```yaml # Filename: feldera-db-secret.yaml apiVersion: v1 kind: Secret type: Opaque metadata: name: feldera-db-secret stringData: .connection_url: "postgresql://username:password@db-name.cluster-name.region.rds.amazonaws.com/db_name?sslmode=require" ``` ```bash #kubectl create namespace feldera # If the namespace does not exist yet kubectl apply -n feldera -f feldera-db-secret.yaml ``` -------------------------------- ### Initialize Feldera Client Source: https://docs.feldera.com/python/_sources/examples Create a FelderaClient instance to connect to Feldera services. Supports connections to sandbox, localhost, and custom endpoints with optional TLS verification and timeouts. ```APIDOC ## Initialize Feldera Client ### Description Creates a new FelderaClient instance for connecting to Feldera services with various configuration options. ### Method CONSTRUCTOR ### Endpoint N/A (Client initialization) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **host** (string) - Required - URL of the Feldera service - **api_key** (string) - Optional - API key for authentication - **verify** (string|boolean) - Optional - Path to certificate or boolean for SSL verification - **timeout** (integer) - Optional - Timeout in seconds for HTTP requests ### Request Example ```python from feldera import FelderaClient client = FelderaClient('https://try.feldera.com', api_key='your_api_key') ``` ### Response #### Success Response Returns a FelderaClient instance #### Response Example ``` ``` ``` -------------------------------- ### Retrieve Support Bundle for Pipeline in Python Source: https://docs.feldera.com/python/examples This example shows how to generate and download a support bundle for a Feldera pipeline using the Python SDK. It requires the Feldera client and libraries like zipfile and io; inputs are the pipeline name and SQL program, outputs are the bundle as bytes or saved file. Limitations include potential blocking during pipeline operations and the need for manual cleanup of saved files. ```python # Create a client (assuming Feldera is running on localhost:8080) client = FelderaClient.localhost(port=8080) # Define a simple SQL program sql_program = """ CREATE TABLE users(id INT, name STRING); CREATE MATERIALIZED VIEW user_count AS SELECT COUNT(*) as count FROM users; """ # Create a pipeline pipeline_name = "support-bundle-example" pipeline = PipelineBuilder( client, pipeline_name, sql_program ).create_or_replace() print(f"Created pipeline: {pipeline.name}") # Start the pipeline pipeline.start() print("Pipeline started") # Generate support bundle as bytes print("Generating support bundle...") support_bundle_bytes = pipeline.support_bundle() print(f"Support bundle size: {len(support_bundle_bytes)} bytes") # Verify it's a valid ZIP file try: with zipfile.ZipFile(io.BytesIO(support_bundle_bytes), 'r') as zip_file: file_list = zip_file.namelist() print(f"Support bundle contains {len(file_list)} files:") for file_name in file_list[:5]: # Show first 5 files print(f" - {file_name}") if len(file_list) > 5: print(f" ... and {len(file_list) - 5} more files") except zipfile.BadZipFile: print("Warning: Support bundle is not a valid ZIP file") # Save support bundle to a file output_path = f"{pipeline_name}-support-bundle.zip" pipeline.support_bundle(output_path=output_path) print(f"Support bundle saved to: {output_path}") # Verify the saved file if os.path.exists(output_path): file_size = os.path.getsize(output_path) print(f"Saved file size: {file_size} bytes") # Clean up os.unlink(output_path) print("Cleaned up saved file") # Stop the pipeline pipeline.stop(force=True) pipeline.clear_storage() pipeline.delete() print("Pipeline stopped and deleted") ``` -------------------------------- ### Start Jaeger for Pipeline Tracing Source: https://docs.feldera.com/tutorials/monitoring Starts the Jaeger tracing service using the all-in-one executable for tracing Feldera pipelines. ```bash ./jaeger-all-in-one ``` -------------------------------- ### Create Redpanda Topics for Pipeline I/O Source: https://docs.feldera.com/tutorials/basics/part3 Creates two Kafka topics (price and preferred_vendor) for streaming data into and out of the Feldera pipeline. The price topic receives updates for the PRICE table while preferred_vendor outputs query results. Requires a running Redpanda cluster and rpk CLI installation. ```shell rpk -X brokers=127.0.0.1:19092 topic create price preferred_vendor ``` -------------------------------- ### Install Feldera Python SDK from Local Directory Source: https://docs.feldera.com/python/introduction Installs the Feldera Python SDK from a local directory after cloning the repository. This method is used when working with a local copy of the Feldera source code. ```bash pip install python/ ``` -------------------------------- ### GET /v0/pipelines//status Source: https://docs.feldera.com/changelog Retrieves the current status of a pipeline. In sidecar mode, this endpoint now returns HTTP 200 with an "Initializing" message while the pipeline is starting up. ```APIDOC ## GET /v0/pipelines/{name}/status\n\n### Description\nReturns the operational status of the specified pipeline.\n\n### Method\nGET\n\n### Endpoint\n/v0/pipelines/{name}/status\n\n### Parameters\n#### Path Parameters\n- **name** (string) - Required - The unique identifier of the pipeline.\n\n#### Query Parameters\nNone\n\n#### Request Body\nNone\n\n### Request Example\n```\nGET /v0/pipelines/example-pipeline/status HTTP/1.1\nHost: api.feldera.com\nAuthorization: Bearer \n```\n\n### Response\n#### Success Response (200)\n- **pipeline_id** (string) - Identifier of the pipeline.\n- **status** (string) - Current status, e.g., `running`, `paused`, `initializing`.\n\n#### Response Example\n```\n{\n "pipeline_id": "example-pipeline",\n "status": "initializing"\n}\n``` ``` -------------------------------- ### Install Feldera Enterprise Using Helm Chart Source: https://docs.feldera.com/get-started/enterprise/helm-guide This script sets environment variables for account ID, license key, and version, then installs or upgrades Feldera in the 'feldera' namespace using the Helm chart from AWS ECR public registry. It requires a valid license and chosen version; inputs are variables, output is deployed pods. Limitations: License verification requires internet access to cloud.feldera.com. ```bash ACCOUNT_ID="00000000-0000-0000-0000-000000000000" # Set to own LICENSE_KEY="00000000-0000-0000-0000-000000000000" # Set to own VERSION=0.88.0 # Replace with previously chosen version helm upgrade --install feldera \ oci://public.ecr.aws/feldera/feldera-chart --version "${VERSION}" \ --namespace feldera --create-namespace \ --set felderaVersion="${VERSION}" \ --set felderaAccountId="${ACCOUNT_ID}" \ --set felderaLicenseKey="${LICENSE_KEY}" \ --set felderaDatabaseSecretRef="feldera-db-insecure-secret" ``` -------------------------------- ### POST /v0/pipelines/:pipeline_name/start Source: https://docs.feldera.com/api/start-the-pipeline-asynchronously-by-updating-the-desired-status Starts a pipeline asynchronously by setting its desired status to running, paused, or standby. The endpoint accepts the action immediately and performs provisioning in the background. Use query parameters to specify initial state and bootstrap policy; monitor status via polling GET endpoints. ```APIDOC ## POST /v0/pipelines/:pipeline_name/start ### Description Starts the pipeline asynchronously by updating the desired status. Returns immediately after acceptance; provisioning occurs in the background. Poll GET endpoints to monitor progress. A stopped pipeline can be started with initial=running, paused, or standby. Success is returned even if already starting. Cannot call if stopping is in progress. ### Method POST ### Endpoint /v0/pipelines/:pipeline_name/start ### Parameters #### Path Parameters - **pipeline_name** (string) - REQUIRED - Unique pipeline name #### Query Parameters - **initial** (string) - OPTIONAL - Determines post-provisioning state: standby, paused, or running (valid values only) - **bootstrap_policy** (string) - OPTIONAL - Possible values: allow, reject, await_approval #### Request Body None ### Request Example ```bash curl -L -X POST 'https://docs.feldera.com/v0/pipelines/:pipeline_name/start' \ -H 'Accept: application/json' ``` ### Response #### Success Response (202) Action accepted and being performed. No response body specified. #### Response Example {} #### Error Response (400) - **details** (object) - OPTIONAL - Detailed error metadata based on error_code - **error_code** (string) - Error type specifier - **message** (string) - Human-readable error message Action could not be performed. #### Error Response (404) - **details** (object) - OPTIONAL - Detailed error metadata based on error_code - **error_code** (string) - Error type specifier - **message** (string) - Human-readable error message Pipeline with that name does not exist. #### Error Response (500) - **details** (object) - OPTIONAL - Detailed error metadata based on error_code - **error_code** (string) - Error type specifier - **message** (string) - Human-readable error message Internal server error. ``` -------------------------------- ### Populate Feldera Pipeline with Pandas DataFrames (Python) Source: https://docs.feldera.com/python/_sources/examples This example demonstrates how to use Pandas DataFrames as input to a Feldera pipeline. It reads CSV files into Pandas DataFrames, starts the pipeline, subscribes to an output view, feeds the DataFrames as input, waits for completion, retrieves the output as a DataFrame, and then deletes the pipeline. ```python # populate pandas dataframes df_students = pd.read_csv('students.csv') df_grades = pd.read_csv('grades.csv') pipeline.start() # subscribe to listen to outputs from a view out = pipeline.listen("average_scores") # feed pandas dataframes as input pipeline.input_pandas("students", df_students) pipeline.input_pandas("grades", df_grades) # wait for the pipeline to complete and stop pipeline.wait_for_completion(True) # get the output of the view as a pandas dataframe df = out.to_pandas() # clear the storage and delete the pipeline pipeline.delete(True) ``` -------------------------------- ### Initialize FelderaClient in Python Source: https://docs.feldera.com/python/introduction Creates an instance of FelderaClient to interact with your Feldera instance. This is typically the first step in using the SDK. Requires Feldera instance URL and an API key. ```python from feldera import FelderaClient client = FelderaClient("https://try.feldera.com", api_key="YOUR_API_KEY") ``` -------------------------------- ### Connect to Feldera on Localhost Source: https://docs.feldera.com/python/examples Establishes a connection to a local Feldera instance. This is useful for local development and testing. Requires the Feldera backend to be running locally. ```python from feldera import FelderaClient, PipelineBuilder client = FelderaClient('http://127.0.0.1:8080', api_key=api_key) pipeline = PipelineBuilder(client, name, sql).create() ``` -------------------------------- ### Start Pipeline API Source: https://docs.feldera.com/api/retrieve-a-pipeline Sets the desired status of a pipeline to 'Provisioned', initiating its startup process. Users typically poll `GET /v0/pipelines/{name}` after invoking this to monitor the actual status. ```APIDOC ## POST /start ### Description Sets the desired status of a pipeline to 'Provisioned', initiating its startup process. Users typically poll `GET /v0/pipelines/{name}` after invoking this to monitor the actual status. ### Method POST ### Endpoint `/start` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Indicates that the desired status has been successfully updated to 'Provisioned'. #### Response Example None (typically returns an empty response or a success status code) ``` -------------------------------- ### POST /start Source: https://docs.feldera.com/api/fully-update-a-pipeline-if-it-already-exists-otherwise-create-a-new-pipeline Initiates the provisioning of a pipeline by setting its desired status to 'Provisioned'. ```APIDOC ## POST /start ### Description Starts a pipeline by setting its desired status to `Provisioned`. After invoking this endpoint, you should poll the `GET /v0/pipelines/{name}` endpoint to monitor the actual status. ### Method POST ### Endpoint /start ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the pipeline to start. - **program_code** (string) - Required - The Rust or SQL code for the pipeline. - **program_config** (object) - Optional - Configuration for the program compilation and runtime. - **cache** (boolean) - Optional. If `true` (default), uses cached compilation output if available. Set to `false` to force a new compilation. - **profile** (string) - Optional. Compilation profile. Possible values: [`dev`, `unoptimized`, `optimized`, `optimized_symbols`]. - **runtime_version** (string) - Optional. Overrides the runtime version of the pipeline. ### Request Example ```json { "name": "my-pipeline", "program_code": "SELECT 1", "program_config": { "profile": "optimized" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the pipeline start request was accepted. #### Response Example ```json { "message": "Pipeline start requested successfully." } ``` #### Error Response (400) - **message** (string) - Error message if the request body is invalid or missing required fields. ``` -------------------------------- ### Check Pipeline Deployment Status via API Source: https://docs.feldera.com/tutorials/rest_api This shell command uses curl to GET the pipeline and jq to extract deployment_status. Requires a started pipeline on localhost:8080. No inputs; outputs status like 'Running'. Used to verify pipeline is active after start; assumes successful startup for full functionality. ```bash curl -s GET http://127.0.0.1:8080/v0/pipelines/supply-chain | jq '.deployment_status' ``` -------------------------------- ### Insert Vendor Data via SQL in Feldera Source: https://docs.feldera.com/tutorials/basics/part1 Populates the VENDOR table with sample vendor records using an INSERT statement. Demonstrates ad-hoc data insertion in the Feldera Web Console. ```SQL INSERT INTO VENDOR (id, name, address) VALUES (1, 'Gravitech Dynamics', '222 Graviton Lane'), (2, 'HyperDrive Innovations', '456 Warp Way'), (3, 'DarkMatter Devices', '333 Singularity Street'); ``` -------------------------------- ### Run Feldera with Grafana Using Docker Source: https://docs.feldera.com/tutorials/monitoring This command starts Feldera along with Grafana and Prometheus via Docker Compose for a complete monitoring setup. ```bash docker compose -f deploy/docker-compose.yml up grafana --force-recreate ``` -------------------------------- ### Start Feldera Pipeline via API Source: https://docs.feldera.com/tutorials/rest_api This shell command uses curl to POST a start request to the pipeline endpoint. Requires a compiled pipeline named 'supply-chain' on localhost:8080. No inputs; outputs HTTP 202 indicating acceptance. May fail if connectors can't connect; intended for triggering data processing after setup. ```bash curl -i -X POST http://127.0.0.1:8080/v0/pipelines/supply-chain/start ```