Export APIs
The export APIs are used to export access to a datastore or a data-flow interface based on export configuration. The details for that configuration, and each available export type, are covered in the export section. This section shows a few simple examples of how to work with the export APIs.
Exporting a Datastore Interface#
Exporting access to a datastore gives clients the ability to connect through Tranquil Data to some "backing" store. As a result, someone who may not have security credentials to connect directly to the backing service, or users that should only be allowed to work with data through a specific policy, have a protected and audited path.
For instance, suppose you have a Posrgres-compatible service (PostgresQL, Cockroach, Aurora, etc.). Continuing with the examples from the previous API sections, you may want to allow access to pull live data (custom client, DBT process, BI tool, etc.) for advertising. You would issue the following:
curl -X PUT -H "Content-Type: application/json" \
"http://localhost:8890/export" \
-d '{
"type" : "postgres",
"endpoint" : "localhost:5432",
"resolverGroup" : "postgres_prod",
"metadata" : {
"type" : "platformUse",
"purposeId" : "use.targetedads"
}
}'
This results in a new network endpoint that provides access to the Postgres database running at localhost:5432 through the policies and models defined in Tranquil Data. The endpoint is only valid to assert the platformUse of use.targetedads. Any data that is not consistent with this purpose will be filtered or redacted, and all decisions audited. Suppose a client connects to this exported endpoint, and issues:
The result is a row that only contains the name and email columns, and an audit trail explaining why that decision was made.
Export Status#
After the export in the previous example, the configuration becomes part of Tranquil Data's durable state. The PUT /export opertation returned a unique identifier that can be used to manage this export going forward, and that can be re-discovered via the GET /export operation.
Getting all exports will show the above export as active. You can use the PUT /export/stop and PUT /export/start to (repsectively) stop an active export or re-start an inactive export. To remove an export completely from Tranquil's state, use the DELETE /export operation.
When the Tranquil Data software is re-started it will attempt to start any exports that were active when it last shut down.