Ed-Fi API Publisher
9.6K
The Ed-Fi API Publisher is a utility that can be used to move data and changes from one Ed-Fi ODS API instance to another instance of the same version of Ed-Fi. It operates as a standard API client against both API endpoints (source and target) and thus it does not require any special network configuration, direct ODS database access or a particular database engine. From a data security/privacy perspective, it is also subject to all authorization performed by the Ed-Fi ODS API endpoints with which it communicates.
Operationally, it can be used in a "Pull" model where it is deployed alongside a target (central) API and gathers data from multiple source APIs.

Alternatively, it could also be used in a "Push" model where the utility is deployed alongside the source APIs and pushes data to the central target.

However, it can also be used in a "Publishing" model where it is installed alongside a source API and pushes data to multiple targets (e.g. to both a State Education Agency and a collaborative).

If a source API supports the "Change Queries" feature, the Ed-Fi API Publisher will perform a full publishing of the source data on the first run, and then will only publish changed data to the target on subsequent runs. The change versions that have been published to a particular target are maintained in a configuration store automatically for each source/target combination.
For a walkthrough that sets up a local Ed-Fi ODS/API 7.3 sandbox and publishes its sample data with the API Publisher, see the Quick Start in the Ed-Fi documentation.
The API Publisher has three options to use the product:
EdFi.ApiPublisher.1.4.0.nupkg, to include .zip extension: EdFi.ApiPublisher.1.4.0.zip.EdFi.ApiPublisher.Win64 has EdFiApiPublisher.exe for Windows and includes the .NET runtime, so no separate installation is needed; EdFi.ApiPublisher runs on any operating system with dotnet EdFiApiPublisher.dll and requires the .NET 10 runtime.The Docker image for the Ed-Fi API Publisher is available here: Ed-Fi API Publisher tag v1.4.0 on Docker Hub. Use this to include in your Docker environment and alongside other components of the Ed-Fi stack. The image includes the .NET runtime.
Building from source requires the .NET 10 SDK. Build the solution by running the following command from the repository's src directory:
dotnet build
The API Publisher executable (EdFiApiPublisher.exe) will be located in the .\EdFi.Tools.ApiPublisher.Cli\bin\Debug\net10.0 subfolder.
For more documentation on API Publisher's parameters, please see the API Publisher Configuration markdown file for other runtime options.
For more information in relation to key changes and deletes, please see Considerations in relation to key changes and deletes
When the source exposes GET /{resource}/partitions (ODS/API 7.3 and later), the publisher reads each main resource with partitioned cursor paging: one GET /{resource}/partitions request returns starting page tokens, and each partition is walked with pageToken/pageSize requests following the Next-Page-Token response header. Older sources, and the /deletes and /keyChanges child resources on every source, keep using offset/limit exactly as before. Detection is automatic and needs no configuration: the first resource probes GET /{resource}/partitions once, and a definitive answer (a 200 with page tokens, or the 404 a pre-7.3 source returns) is reused for the rest of the run. An Ed-Fi API v8.0 source answers the probe with 400, which counts as inconclusive, so it is read with offset/limit. An inconclusive probe (for example a gateway answering 502) falls back to offset/limit for that resource and is retried on the next one.
--disableCursorPaging=true forces the legacy offset/limit path for every resource (useful for A/B comparisons or if a source misbehaves).--cursorPagingPartitionCount=N sets how many partitions are requested per resource (1..200). By default it equals --maxDegreeOfParallelismForStreamResourcePages (capped at 200, the API maximum), so each page-fetch worker walks one partition."/ed-fi/students": using Cursor paging or using Offset paging. A source that simply lacks the endpoint is noted once at INFO; a WARN line explains a fallback caused by a failed probe or a failed /partitions request./partitions call), so on a source made up of small resources it can be slightly slower than offset/limit (about 20% in the parity runs behind this feature); use --disableCursorPaging=true if that matters more than the throughput gain on large resources. Partitions are split by key range, not by row count, so a skewed resource can leave one worker walking a long partition after the others finish; raising --cursorPagingPartitionCount above the worker count evens that out at the cost of shorter partitions.See API Publisher Configuration for details and the memory-ceiling implications.
A run reading a cursor-paged source records how far each partition got, so a run that fails or is stopped can be continued with --resumeLastRun=true instead of started again from the beginning.
/deletes and /keyChanges, have no partition or page token to record and are read in full.--runStatePath=PATH says where the run state is kept; a directory takes the default file name inside it, which is what a containerised run wants when the path is a mounted volume. Without it the file sits in the working directory. It has to be storage that outlives the run: a containerised run that leaves the file on the container filesystem loses its resume when the container goes. The file holds page tokens, which say what a run has read and how to read more of it, so it is created readable only by the user running the publisher where the platform supports file modes. The default file name carries the source and target connection names and the change version namespace, so publications sharing a directory keep their own progress rather than overwriting each other's.--sourceName and --targetName) for a run to be resumable. Connection names are what tell one publication's state from another's, and a run configured with only a URL, key and secret has none; two such runs would be indistinguishable, so a resume between them is refused rather than guessed at.WARN line and a normal run from the beginning, when the state was written for a different source connection, a different target connection, a different --lastChangeVersionProcessedNamespace or a different publisher version, when either run's connections are unnamed, or when the file has been edited into something a run cannot act on. The state is removed by a run that finishes without losing a document.Usage notes and known issues for version 1.4 are described in Known Issues Details in the Ed-Fi documentation.
When you're ready to look further, review these other topics:
For support with the API Publisher, please use Ed-Fi Support to open a support case and/or feature request.
Copyright (c) 2024 Ed-Fi Alliance, LLC and contributors.
Licensed under the Apache License, Version 2.0 (the "License").
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
See NOTICES for additional copyright and license notifications.
Content type
Image
Digest
sha256:cacbeff91…
Size
89.7 MB
Last updated
3 days ago
docker pull edfialliance/ods-api-publisherPulls:
174
Oct 5 to Oct 11