Description: Schedules immediate content replication between two Artifactory instances.
Replication can optionally include properties and delete items if they do not exist in the source repository.
This API completes the existing cron-based replication exposed via the Artifactory UI and allows for pre-scheduled execution.
Pull Replication - pulls content from a remote Artifactory repository to a local cache of the remote repository.
Push Replication - pushes content from a local repository into a local repository of another Artifactory instance.
Multi-push Replication - pushes content from a local repository into a local repository of several Artifactory instances. This feature is only available with Artifactory Enterprise license.
The type of replication initiated depends on the type of repository specified in the repoPath
parameter.
If repoPath
is a local repository, a push replication will be triggered. You may specify multiple target repositories in the payload for multi-push replication, but all must be local to their respective instances.
If repoPath
is a remote repository cache, a pull replication will be triggered. Note that in this case you may only specify a single repository in the payload.
Important note - If no repositories are provided in the payload, Artifactory will trigger all existing replication configurations.
Note: Enabling the checkBinaryExistenceInFilestore flag requires an Enterprise+ license. For more information, see Repository Replication.
Security: Requires a privileged user (can be anonymous) For non-admin users, the maximum number of files that will be replicated is as defined by the artifactory.search.userQueryLimit
system property.
Usage: POST /api/replication/execute/{repoPath}
Consumes: application/json
[ { + "url" : "<URL of the repository at the remote Artifactory instance, Used only by push replication>", + "username" : "<username at the remote Artifactory instance, Used only by push replication>", + "password" : "<password at the remote Artifactory instance, Used only by push replication>", - "proxy" : "<name of the proxy (if used) at the remote Artifactory instance, Used only by push replication>" - "properties" : "<true | false>", // When true, properties of replicated artifacts will be synchronized also - "delete" : "<true | false>", // When true, items that were deleted remotely will also be deleted locally (including properties metadata) - "checkBinaryExistenceInFilestore" : "<true | false>" // When true, enables distributed checksum storage. For more information, see Optimizing Repository Replication with Checksum-Based storage } ]
+=mandatory; -=optional
Since: 4.7.5
Sample Usage:
// Single push replication POST /api/replication/execute/libs-release-local [ { "url":"http://localhost:8082/artifactory/libs-release-local", "username":"admin", "password":"password", "proxy":"localProxy" } ] // Pull replication POST /api/replication/execute/libs-remote [ { "properties" : "true", "delete" : "true" } ] // Multi-push replication POST /api/replication/execute/libs-release-local [ { "url":"http://localhost:8082/artifactory/libs-release-local", "username":"admin", "password":"password", "proxy":"localProxy", "properties" : "true", "delete" : "true" }, { "url":"http://localhost:8082/artifactory/ext-release-local", "username":"admin", "password":"password" "properties" : "true", "delete" : "true" }, { "url":"http://localhost:8082/artifactory/plugins-release-local", "username":"admin", "password":"password" "properties" : "true", "delete" : "true" } ] // Trigger configured push replication POST /api/replication/execute/libs-release-local // Trigger configured pull replication POST /api/replication/execute/libs-remote