Inter-Sync Gateway Replication Configuration
Using Sync Gateway’s Admin REST API to configure and manage inter-Sync Gateway replications
Related topics: Overview | Bootstrap | Database | Database Security | Access Control | Import | Inter-Sync Gateway Replication
|
Pre-3.0 Legacy Configuration Equivalents
This content describes configuration for Sync Gateway 3.0 and higher — for legacy configuration, see: Legacy Pre-3.0 Configuration |
Introduction
Sync Gateway 3.0 and later uses the Admin REST API to provision persistent configuration changes. This page introduces the PUT/{url}/{db}/_replication/{replicationId} endpoint for convenience — see Replication for a full description of the endpoints available.
Upsert a Replication
For complete endpoint details, see PUT/{url}/{db}/_replication/{replicationId}.
Example
-
Curl
-
HTTP
curl --location --request PUT 'http://localhost:4985/db1-local/_replication/db1-rep-id1 '\
--header 'Content-Type: application/json' \
--data-raw '{
"direction": "push",
"purge_on_removal": false,
"remote": "http://user1:password1@example.com:4984/db1-remote",
"filter":"sync_gateway/bychannel",
"query_params": {
"channels":["channel.user1"]
},
"continuous": false
}'
PUT /db1-local/_replication/db1-rep-id1 HTTP/1.1
Host: localhost:4985
Content-Type: application/json
Content-Length: 235
{"direction": "push",
"purge_on_removal":false,
"remote": "http://user1:password1@example.com:4984/db1-remote",
"filter":"sync_gateway/bychannel",
"query_params": {
"channels":["channel.user1"]
},
"continuous": false
}
Schema
This section shows the replication configuration settings in schema format. Use these schemas to construct JSON models for the Admin REST API.
The configuration settings described here are provisioned through the Replication endpoints.
ERROR (template-block): Data file attachment$bundled-admin.yaml not resolved