1
0
Fork 0

Port latest API docs for hotbackup to devel. (#10161)

This commit is contained in:
Max Neunhöffer 2019-10-04 10:49:35 +02:00 committed by GitHub
parent ae05fafa4e
commit c3f863f289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 17 deletions

View File

@ -12,8 +12,6 @@ guarantee consistency. Note that the backup at first resides on the
same machine and hard drive as the original data. Make sure to upload same machine and hard drive as the original data. Make sure to upload
it to a remote site for an actual backup. it to a remote site for an actual backup.
The body of the request may contain an object with the following attributes:
@RESTBODYPARAM{label,string,optional,string} @RESTBODYPARAM{label,string,optional,string}
The label for this backup. The label is used together with a The label for this backup. The label is used together with a
timestamp string create a unique backup identifier, `<timestamp>_<label>`. timestamp string create a unique backup identifier, `<timestamp>_<label>`.
@ -65,4 +63,6 @@ within the timeout, then an *HTTP 408* is returned.
}; };
@END_EXAMPLE_ARANGOSH_RUN @END_EXAMPLE_ARANGOSH_RUN
The result `body` contains besides the above discussed error codes the `result` object, if `code` is equal to `201`, which holds the unique identifier of this hot backup as the string attibute `id`, the full size in bytes as `sizeInBytes`, the number of idividual files as `nrFiles` and the number of database servers as `nrDBServers`. Single server deployments list potentially misleadingly `nrDBServers: 1`. Furthermore, the body contains a `datetime` time stamp and the flag `potentiallyInconsistent`, which indicates that the backup could inconsistent. This only happens if `allowInconsistent` has happened.
@endDocuBlock @endDocuBlock

View File

@ -16,7 +16,7 @@ attribute.
@RESTBODYPARAM{remoteRepository,string,required,string} @RESTBODYPARAM{remoteRepository,string,required,string}
URL of remote reporsitory. This is required when a download URL of remote reporsitory. This is required when a download
operation is scheduled. In this case leave out the `downloadId` operation is scheduled. In this case leave out the `downloadId`
attribute. attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configurtion section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as `..` and `.` are applied accordingly. Local repositories must be absolute paths and must begin with a `/`. Trailing `/` are removed.
@RESTBODYPARAM{config,object,required,object} @RESTBODYPARAM{config,object,required,object}
Configuration of remote repository. This is required when a download Configuration of remote repository. This is required when a download
@ -98,6 +98,8 @@ there is no known download operation with the given `downloadId`.
}; };
@END_EXAMPLE_ARANGOSH_RUN @END_EXAMPLE_ARANGOSH_RUN
The `result` object of the body holds the `downloadId` string attribute which can be used to follow the download process.
@EXAMPLE_ARANGOSH_RUN{RestBackupDownloadBackupStarted_rocksdb} @EXAMPLE_ARANGOSH_RUN{RestBackupDownloadBackupStarted_rocksdb}
var hotbackup = require("@arangodb/hotbackup"); var hotbackup = require("@arangodb/hotbackup");
try { try {
@ -150,4 +152,5 @@ there is no known download operation with the given `downloadId`.
}; };
@END_EXAMPLE_ARANGOSH_RUN @END_EXAMPLE_ARANGOSH_RUN
@endDocuBlock @endDocuBlock

View File

@ -60,4 +60,6 @@ method other than `POST`, then an *HTTP 405 METHOD NOT ALLOWED* is returned.
}; };
@END_EXAMPLE_ARANGOSH_RUN @END_EXAMPLE_ARANGOSH_RUN
The result consists of a `list` object of hot backups by their `id`, where `id` uniquely identifies a specific hot backup, `version` depicts the version of ArangoDB, which was used to create any individual hot backup and `datetime` displays the time of creation of the hot backup. Further parameters are the size of the backup in bytes as `sizeInBytes`, the number of individual data files as `nrFiles`, the number of db servers at time of creation as `nrDBServers`, the number of backup parts, which are found on the currently reachable db servers as `nrPiecesPresent`. If the backup was created allowing inconsistences, it is so denoted as `potentiallyInconsistent`. The `available` boolean parameter is tightly connected to the backup to be present and ready to be restored on all db servers. It is `true` except, when the number of db servers currently reachable does not match to the number of db servers listed in the backup.
@endDocuBlock @endDocuBlock

View File

@ -8,8 +8,6 @@ Restores a consistent backup from a
snapshot in time, with a given id. The backup snapshot must reside on snapshot in time, with a given id. The backup snapshot must reside on
the ArangoDB service locally. the ArangoDB service locally.
The request may contain an object with the following attributes:
@RESTBODYPARAM{id,string,required,string} @RESTBODYPARAM{id,string,required,string}
The id of the backup to restore from. The id of the backup to restore from.
@ -54,9 +52,7 @@ are detailed in the returned error document.
// will work again: // will work again:
var startTime = require("internal").time(); var startTime = require("internal").time();
var failureSeen = false; var failureSeen = false;
while (require("internal").time() - startTime < 30) { while (require("internal").time() - startTime < 10) {
try {
// get can throw exceptions
var r = internal.arango.GET("/_api/version"); var r = internal.arango.GET("/_api/version");
if (r.error === true) { if (r.error === true) {
failureSeen = true; failureSeen = true;
@ -65,10 +61,10 @@ are detailed in the returned error document.
break; break;
} }
} }
} catch (err) {
}
require("internal").wait(0.1); require("internal").wait(0.1);
} }
@END_EXAMPLE_ARANGOSH_RUN @END_EXAMPLE_ARANGOSH_RUN
The `result` object returns the `id` of the fail safe hot backup to return to, if necessary. And the all telling `isCluster` boolean attribute.
@endDocuBlock @endDocuBlock

View File

@ -16,7 +16,7 @@ attribute.
@RESTBODYPARAM{remoteRepository,string,optional,string} @RESTBODYPARAM{remoteRepository,string,optional,string}
URL of remote reporsitory. This is required when an upload URL of remote reporsitory. This is required when an upload
operation is scheduled. In this case leave out the `uploadId` operation is scheduled. In this case leave out the `uploadId`
attribute. attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configurtion section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as `..` and `.` are applied accordingly. Local repositories must be absolute paths and must begin with a `/`. Trailing `/` are removed.
@RESTBODYPARAM{config,object,optional,object} @RESTBODYPARAM{config,object,optional,object}
Configuration of remote repository. This is required when an upload Configuration of remote repository. This is required when an upload
@ -83,6 +83,8 @@ there is no known upload operation with the given `uploadId`.
}; };
@END_EXAMPLE_ARANGOSH_RUN @END_EXAMPLE_ARANGOSH_RUN
The `result` object of the body holds the `uploadId` string attribute which can be used to follow the upload process.
@EXAMPLE_ARANGOSH_RUN{RestBackupUploadBackupStarted_rocksdb} @EXAMPLE_ARANGOSH_RUN{RestBackupUploadBackupStarted_rocksdb}
try { try {
require("fs").makeDirectory("/tmp/backups"); require("fs").makeDirectory("/tmp/backups");