Using the API, you can achieve the following:
Sample Input:
$ curl -u api_username:api_key \
https://openredis.com/api/v2/instances
Sample Output:
[
{
"url": "redis://:(redacted)@54.204.33.44:14000",
"id": "3999",
},
{
"url": "redis://:(redacted)@54.204.33.44:14049",
"id": "4049",
}
]
Sample Input:
$ curl -u api_username:api_key -X POST \
https://openredis.com/api/v2/instances/3999/stop
$ curl -u api_username:api_key -X POST \
https://openredis.com/api/v2/instances/3999/start
Both of these API calls return a 204 No Content
status code.
Note: This operation only works if your instance has been stopped.
Sample Input:
$ curl -u api_username:api_key -X POST \
https://openredis.com/api/v2/instances/3999/upgrade
Given:
Sample Input:
$ curl -u api_username:api_key \
https://openredis.com/api/v2/backups/3999
Sample Output:
[
{
"ts": 1373846654,
"key": "0.dump.rdb",
"url": "http://s3.amazonaws.com/some/long/url/with/an/access/key/0"
},
{
"ts": 1373846654,
"key": "1.dump.rdb",
"url": "http://s3.amazonaws.com/some/long/url/with/an/access/key/1"
}
]
Note: This operation only works if your instance has been stopped.
Given:
Sample Input:
$ curl -u api_username:api_key -X POST \
https://openredis.com/api/v2/backups/3999/1.dump.rdb
Similarly response is 204 No Content
.
Log requests are rate limited to 1 request for every 5 seconds in order to avoid potential network congestion problems.
If you don't have an API key yet, please check how to get your access credentials.
Given the previous input, your instance ID would be one of
3999
or 4049
. Let's say you need to view 3999
:
You can then access the logs by doing the following:
Sample Input:
$ curl -u api_username:api_key \
https://openredis.com/api/v2/logs/3999?limit=500
Sample Output:
{
"body": "
[27996] 02 Dec 22:00:15 * Background saving terminated with success
[27996] 02 Dec 23:00:12 * Background saving started by pid 10858
[10858] 02 Dec 23:00:12 * DB saved on disk
[27996] 02 Dec 23:00:12 * Background saving terminated with success
[27996] 03 Dec 00:00:13 * Background saving started by pid 14673
[14673] 03 Dec 00:00:13 * DB saved on disk
[27996] 03 Dec 00:00:13 * Background saving terminated with success
[27996] 03 Dec 01:00:13 * Background saving started by pid 17965
[17965] 03 Dec 01:00:13 * DB saved on disk
[27996] 03 Dec 01:00:13 * Background saving terminated with success
"
}
Note: The output formatting of the output above has been simplified and should contain 500 log lines.