Archives the contents of an application replica set, optionally also its underlying database, and if the result compares equal, removes the entire replica set. Optionally, the replica set's database can be moved to a different (e.g., less expensive "cold-storage") MongoDB environment. See also here for the steps taken during replica set removal.
| Webservice Type: | POST |
| Output format: | json |
| Mandatory query parameters: |
regionId, region where to set up the replica set, e.g., eu-west-1
replicaSetName, name of the replica set; used as the hostname to which the domain name is appended, as well as
for the database and RabbitMQ exchange name
keyName, the name of the SSH key to use; must identify an existing SSH key by that name in the region specified
and will be used to log on to existing and new instances using a root ssh connection.
privateKeyEncryptionPassphrase, the pass phrase to decrypt the private key for the key specified by the keyName parameter
|
| Optional form parameters: |
bearerTokenForReplicaSetToArchive, the bearer token to use to authenticate with the replica set that is to be archived.
If not provided, the bearer token of the subject used to authenticate this request
is used by default.
bearerTokenForArchive, the bearer token to use to authenticate with the archive server to which to import the content.
If not provided, the bearer token of the subject used to authenticate this request
is used by default.
timeoutInMilliseconds, timeout in milliseconds to wait for responses from nodes when analyzing the replica sets
existing in the region; if not specified, waiting will not time out.
durationToWaitBeforeCompareServersInMilliseconds, tells how long to wait before starting to compare the content in the archive
with the original content after importing. The reason such a wait time
can be appropriate is, among other things, that after starting to load all tracked
races in the archive some time will pass until all data hase been loaded and
all calculations based on the data have completed, such as maneuver calculations
and wind estimation. A comparison may fail if wind estimations haven't completed
yet for a race in the archive. If not provided, this defaults to five minutes.
maxNumberOfCompareserverAttempts, if the comparison started after durationToWaitBeforeCompareServersInMilliseconds fails, this many
attempts will be made, each after waiting another durationToWaitBeforeCompareServersInMilliseconds.
Only if these many comparisons all fail will the process be called a failure, and further processing
such as removing the replica set or archiving its database will not be executed.
removeApplicationReplicaSet, boolean value defaulting to true; if true, the original replica set will be
removed if importing and comparing the content worked
successfully.
mongoUriToArchiveDbTo, if provided, this must identify a full-fledged database-specific MongoDB URI, such as
mongodb://172.16.0.123/mynewevent?replicaSet=archive&retryWrites=true&readPreference=nearest.
If provided, it specified the database end point to which to move the replica set's original DB content.
After moving, the DB content will be compared by hashing original and copy, and only if this comparison
was successful will the original be dropped. Note: although you must specify a DB name ("mynewevent" in
the example above), the DB name in the URI will be ignored, and the original DB name will be used under
all circumstances for the copy.
force, boolean value defaulting to false. Before archiving, the replica set is checked for
live content, that is, races that are currently being tracked live. Because archiving stops
the replica set's processes and may remove the replica set, doing so while a race is tracked live would
interrupt that live tracking and could lose data still being ingested. If live content is detected and
force is false (the default), the operation is aborted and the service responds with
HTTP status 409 Conflict and a JSON body describing the offending replica set(s), events and races
(the body has the same structure as the response of the
live-content service). Set force to
true to bypass this safety check and archive the replica set regardless of any live content,
knowingly accepting the disruption of any live tracking.
|
| Request method: | POST |
| Example: | curl -X POST -d 'regionId=eu-west-2' -d 'replicaSetName=axelstest' -d 'keyName=Horst' --data-urlencode 'privateKeyEncryptionPassphrase=HorstsSuperSecretPassword' -H 'Authorization: Bearer RwGK+DV38LKjeuDu+Bx87/3blLJHD7Ff+NCLeud9nRQ=' --data-urlencode 'bearerTokenForReplicaSetToArchive=DE7x+W/dwFKRAxFbJkC/IMafEnJ8kTQF+MUHNVhEwsD4=' --data-urlencode 'bearerTokenForArchive=CHxGpF0nr78Z4m/f28/MgiYhdRB3xoDCYd+rLc37rTt=' --data-urlencode 'mongoUriToArchiveDbTo=mongodb://172.31.36.221/mynewevent?replicaSet=archive&retryWrites=true&readPreference=nearest' "https://sapsailing.com/sailinglandscape/api/landscape/movetoarchiveserver" produces output:
{
"uuidForMdiProgress": "1f07d1cf-0652-4fc3-83bc-a79612a5aa68"
}
|