Skip to content

Definition files and sets for many clients

An ingestion is also a definition file: YAML with the ingestion’s fields plus application and client. A folder of files is applied as a set, which makes the platform’s ingestions match the files. This is the way to run the same feed for many clients and to move ingestions between environments. For one ingestion end to end first see Define, test and go live.

application: ingest
client: acme
code: orders-sftp
name: Orders over SFTP
source:
kind: sftp
host: sftp.example.com
directory: /in/orders
username: feed
credential: {name: sftp-password}
knownHosts: sftp.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...
every: PT5M
split: {kind: csv, header: true}
target:
code: ingest:orders:order:received
targetUrl: https://hooks.example.com/orders
pool: orders
connection: orders-conn
mode: NEXT_ON_ERROR
batchSize: 100

A file may hold several definitions separated by ---, but keep one per file so a diff reads well. Unknown fields are errors. An extension’s source is written flat (kind: camel-route then its settings). The full field list is in the definition reference.

A definition that is not particular to one client lists them under clients in place of client:

application: ingest
clients:
- acme
- globex
- clt_0ABCDEFGHJKMN
code: fuel-prices
source:
kind: http
# ...

It is read as one definition per client, in the order listed. Each is an ordinary ingestion (ingest/acme/fuel-prices, ingest/globex/fuel-prices) with its own settings and secrets at its client, its own place in the source, its own leases, failures and pause, and jobs belonging to its client. The plan lists each one.

  • Every client: write clients: "*". It is resolved when the set is applied, to every client then in existence, whatever its status (a suspended client’s ingestion takes no jobs and runs nowhere, but is kept). A client made later gets its ingestion at the next apply, not by itself. Only an anchor-tier caller may apply one. "*" stands alone; it is not an entry in a list.
  • Adding a client to the list creates its ingestion at the next apply. Taking one off deletes that client’s ingestion, as for any definition a set no longer lists.
  • A client may not be listed twice, client and clients may not both be given, and the same (application, client, code) may not come from two definitions. A client that needs a different definition gets its own code.

A file is the same in every environment, so what differs per environment or per client (a vendor’s login, an organisation id, the delivery address) is not in the file. The source names a settings entry:

source:
kind: mix # a built-in kind (api-poll, sftp, ...) or an extension's
config: mix-positions # the entry's key; or `config: true`, the ingestion's own code

A source holds its settings inline or names an entry, never both: any other setting beside config is a validation problem at source.config.

Where the entry lives. It is platform configuration of the ingestion’s application, section ingest, property = the key, scope CLIENT = the ingestion’s client, type PLAIN. Its value is a JSON object: the kind’s settings (without kind; an extension kind’s settings themselves) and optionally targetUrl. The delivery address is in the file’s target.targetUrl or the entry’s targetUrl, exactly one. Several ingestions of one application and client may name one key, if the value suits each.

How to write it. Only through its ingestion:

Terminal window
fcdev ingest config set ingest/acme/mix-positions mix-positions.json --secrets
fcdev ingest config get ingest/acme/mix-positions
fcdev ingest config delete ingest/acme/mix-positions

or PUT /api/ingestions/{id}/config with {"value": {...}} (also GET, DELETE). These need the update permission on the ingestion, even when a set owns it: the entry is the environment’s part, not the set’s. The value is checked against every ingestion of that application and client that names the key. A problem names the ingestion, and nothing is written unless all pass. A write is audited on the ingestion (the value is not in the audit row).

The generic configuration page and API refuse section ingest (400 CONFIG_SECTION_RESERVED), and show *** to anyone who cannot update ingestions.

config.status Meaning
INLINE The source holds its own settings
SET The entry exists and is valid
MISSING The entry does not exist; the ingestion is not listed to any runtime and takes no jobs
INVALID The entry exists but fails validation; same effect, with the problems shown

An ingestion with a MISSING or INVALID entry starts by itself once the entry is valid. Saving a definition that names a missing entry succeeds with a CONFIG_MISSING warning, so applying a set never depends on someone having entered an environment’s values first.

Secrets in an entry. In the settings form every secret setting has a Stored as selector: Value (stored encrypted), AWS Parameter Store or AWS Secrets Manager. For a value it is a password input with a Set / Not set tag; leave it blank to keep the value there is. For the other two you type the parameter name, or the secret’s name or ARN (with #key for one key of a JSON secret), and the console stores the reference. The platform names the secret: the name the entry already holds for that setting, else <entry key>-<setting in kebab case> (key mix-positions, setting clientSecret: mix-positions-client-secret). Over the API, PUT .../config takes secretFields ({"<setting path>": "<value>"}) or secrets ({"<secret name>": "<value>"}) beside value, and the entry and secrets are written in one transaction. A secret’s value may be a reference, aws-sm://<name-or-arn>[#<key>] or aws-ps://<parameter>, which the platform resolves each time the runtime fetches it, so an AWS rotation needs no change here. From a terminal use fcdev ingest config set <ref> <file.json> --secrets-file <refs.json> (references only; a plain value is refused before anything is sent).

The kind’s schema. For a built-in kind the definition itself is the schema (an unknown setting is a problem). For an extension kind it is the field list a live runtime reports. With no runtime reporting the kind, the value is stored with a SCHEMA_UNCHECKED warning and the runtime checks it before building the route.

A file that still holds ${env:NAME} outside a comment is refused with its line: environment variables are not read into definitions.

A folder of files is applied as one set, and the apply makes the ingestions what the files say. Per definition:

Plan When
create No ingestion has that (application, client, code)
unchanged The set owns it and it says the same
change The set owns it and it differs: saved as the next live version. active is set from the file only when the file says it; otherwise a pause or resume made since stays
adopt It was made by hand: taken into the set (a new version only if it differs)
remove The set owns it but the file no longer lists it: deleted, with its versions, leases and state
Terminal window
$ fcdev ingest apply client-code/acme/ingest --set acme --dry-run
set acme, dry run: nothing was changed, 3 definition(s)
change ingest/acme/orders-sftp (target, split)
create ingest/acme/stock-feed
unchanged ingest/acme/invoices
  • An apply is one transaction. An unresolvable definition fails the whole apply and nothing is written.
  • An ingestion owned by another set is 409 INGESTION_SET_OWNED.
  • A dry run does every check and writes nothing; always run one before a real apply.
  • apply refuses a folder with no definitions, since applying none would delete everything the set owns. Use sets release instead.
  • Applying needs platform:ingestion:set:apply. Listing sets needs view and a caller that reaches every client and application, since a set spans them.

Read-only while owned. An ingestion a set owns cannot be updated, versioned, made live or deleted by hand. Pause and resume still work. To change it, change the file and apply. Releasing the set ends ownership and changes nothing else.

History and going back. Each apply that changed something is kept with the files it was given, the newest 10 per set.

Terminal window
fcdev ingest sets list
fcdev ingest sets applies acme
fcdev ingest sets reapply acme <apply-id> --dry-run
fcdev ingest sets release acme

Re-applying an old apply goes back to it as a new apply. The console has the same under Ingestion sets (/ui/ingestion-sets): each set lists its applies and files, with Go back to this on every apply but the newest (confirmation first).

Terminal window
fcdev ingest export --all --out ./ingestions --client acme

writes <dir>/<application>/<client>/<code>.yaml. Exporting then applying the same files changes nothing, because what differs between environments is not in the files. To copy other platform definitions (event types, subscriptions and so on) between environments, see Copy definitions between environments.

Every change saves a version. The live version is the one runtimes receive; a saved version does not run until it is made live. A version saved after the live one (or while nothing is live) is a draft, waiting for someone with platform:ingestion:ingestion:promote.

  • A save is deduplicated by the definition’s sha256 digest: the same definition as live changes nothing, and the same as a draft answers that draft.
  • A create or update without promote saves a draft and never refuses.
  • fcdev ingest versions <ref> lists versions with the live one marked; fcdev ingest live <ref> <version> promotes one.
  • pause and resume need update, and keep versions and state.

Use a profile and --yes (see Work against a remote platform); on a prod profile every write asks for confirmation. Give the pipeline’s service account the platform:ingestion-route-author role if it must push Camel routes (as drafts that an administrator makes live), or platform:ingestion-admin to apply and promote. See Custom Camel routes.