Railtown Ingestion Client
$ dotnet add package Railengine.IngestionThe RailengineIngestionClient allows you to ingest JSON documents into your engine.
using Railengine.Ingestion;
using System.Net.Http;
// Create ingestion client with encoded Engine Token
var httpClient = new HttpClient();
var engineToken = Environment.GetEnvironmentVariable("RAILENGINE_ENGINE_TOKEN");
var ingestionClient = new RailengineIngestionClient(httpClient, engineToken);
// Ingest a document
var myDocument = new MyDocument
{
Title = "Example Document",
Content = "This is the document content...",
Tags = new[] { "example", "demo" }
};
await ingestionClient.IngestDocument(myDocument);
Ingest a JSON document into the engine.
Task IngestDocument(
object payload, // Object to serialize as JSON
string charset = "utf-8" // Character encoding
);
The Railengine Engine Token is available from your Conductr Engine dashboard.
Use it to initialize the RailengineIngestionClient as so:
var ingestionClient = new RailengineIngestionClient(httpClient, "engine-token");