API Backup and Restore Observability
Prerequisites
Section titled “Prerequisites”- Authorization code and instance ID
- Observability API URLs
General
Section titled “General”It is possible to backup the configuration and dashboards.
This document describes how to call the Observability API using the cURL tool. Of course, you can also use another suitable tool (e.g. POSTMAN) or programming language to communicate with the Observability API.
Get backup-retentions
Section titled “Get backup-retentions”The API endpoint to get your backup retentions, is available through this URL where you still have to insert your project ID and observability instance ID: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/backup-retentions
cURL command:
For this cURL command to work you will have to set the environment variables PROJECT_ID, INSTANCE_ID and API_TOKEN.
curl "https://argus.api.eu01.stackit.cloud/v1/projects/$PROJECT_ID/instances/$INSTANCE_ID/backup-retentions" \-u "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json"Response
{ "grafanaBackupRetention": "14d", "alertConfigBackupRetention": "14d", "alertRulesBackupRetention": "14d", "scrapeConfigBackupRetention": "14d", "message": "Successfully got backup retention"}Get backup schedules
Section titled “Get backup schedules”The API endpoint to get your backup schedules is available through this URL where you still have to insert your project ID and observability instance ID: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/backup-schedules?backupTarget=[backupTarget]
The input parameter backupTarget accepts either of the following values: alertConfig, alertRules, scrapeConfig or grafana.
cURL command:
For this cURL command to work you will have to set the environment variables PROJECT_ID, INSTANCE_ID and API_TOKEN.
BACKUP_TARGET="alertConfig"
curl -X GET "https://argus.api.eu01.stackit.cloud/v1/projects/$PROJECT_ID/instances/$INSTANCE_ID/backup-schedules?backupTarget=$BACKUP_TARGET" \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json"Response
{ "grafanaBackupSchedules": [ { "schedule": "0 * * * *", "scheduleId": "f6c728f0-c4e4-4ccc-a283-f7bfffb99fe2" } ], "scrapeConfigBackupSchedules": [ { "schedule": "0 * * * *", "scheduleId": "c1eaaaaa-1de5-4f89-9033-d152027207a8" } ], "alertConfigBackupSchedules": [ { "schedule": "0 * * * *", "scheduleId": "dc2ca261-de00-4de8-a25d-68607a56c28b" }, { "schedule": "0 */2 * * *", "scheduleId": "682fb584-8d54-42c5-97f7-6178cfb9ee21" }, { "schedule": "0 * * * MON", "scheduleId": "0f2b2efe-e60e-4f16-acd2-fb068fc33d86" }, { "schedule": "0 * * * 3", "scheduleId": "d7b1a4ac-a2c2-4021-8a2a-1e199d105468" }, { "schedule": "0 * * * tue", "scheduleId": "5837bf0d-dd4d-45f8-8c2e-a62535f1c7c4" } ], "alertRulesBackupSchedules": [ { "schedule": "0 * * * *", "scheduleId": "08714660-09e7-4c5e-858c-24dc5f316187" } ], "message": "Successfully got backup schedules"}Create backup schedule
Section titled “Create backup schedule”The API endpoint to create a new backup schedule is available through this URL where you still have to insert your project ID and observability instance ID: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/backup-schedules?backupTarget=[backupTarget]
The input parameter backupTarget accepts either of the following values**:** alertConfig, alertRules, scrapeConfig or grafana.
cURL command:
For this cURL command to work you will have to set the environment variables PROJECT_ID, INSTANCE_ID and API_TOKEN.
BACKUP_TARGET="alertConfig"
curl -X POST "https://argus.api.eu01.stackit.cloud/v1/projects/$PROJECT_ID/instances/$INSTANCE_ID/backup-schedules?backupTarget=$BACKUP_TARGET" \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json" \-d "{ "schedule": "0 * * * *"}"Response
{ "message": "Backup schedule will be created"}Get a list of backups
Section titled “Get a list of backups”The API endpoint to get a list of created backups is available through this URL where you still have to insert your project ID and observability instance ID: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/backups?backupTarget=[backupTarget]
The input parameter backupTarget accepts either of the following values: alertConfig, alertRules, scrapeConfig or grafana.
cURL command:
For this cURL command to work you will have to set the environment variables PROJECT_ID, INSTANCE_ID and API_TOKEN.
BACKUP_TARGET="alertConfig"
curl -X GET "https://argus.api.eu01.stackit.cloud/v1/projects/$PROJECT_ID/instances/$INSTANCE_ID/backups?backupTarget=$BACKUP_TARGET" \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json"Response
{ "alertConfigBackups": [ "01-12-2021T00:00:18", "01-12-2021T00:00:19", "01-12-2021T00:00:25", "01-12-2021T00:00:30", "01-12-2021T00:05:12", "01-12-2021T00:10:32", "01-12-2021T00:15:14", "01-12-2021T00:20:11", "01-12-2021T00:25:09", "01-12-2021T00:30:10", ---------------------, "30-11-2021T23:55:13" ], "message": "Successfully got backups"}Create a manual backup
Section titled “Create a manual backup”The API endpoint to create a backup manually is available through this URL where you still have to insert your project ID and observability instance ID: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/backups?backupTarget=[backupTarget]
The input parameter backupTarget accepts either of the following values**:** alertConfig, alertRules, scrapeConfig or grafana.
cURL command:
For this cURL command to work you will have to set the environment variables PROJECT_ID, INSTANCE_ID and API_TOKEN.
BACKUP_TARGET="alertConfig"
curl -X POST "https://argus.api.eu01.stackit.cloud/v1/projects/$PROJECT_ID/instances/$INSTANCE_ID/backups?backupTarget=$BACKUP_TARGET" \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json"Response
{ "message": "Backup will be created"}Restore a backup
Section titled “Restore a backup”You need to provide your instance ID and backup date to restore in URL: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/backup-restores/[backupDate]?restoreTarget=[restoreTarget]
The input parameter restoreTarget accepts either of the following values**:** alertConfig, alertRules, scrapeConfig or grafana.
cURL command:
For this cURL command to work you will have to set the environment variables PROJECT_ID, INSTANCE_ID and API_TOKEN.
BACKUP_DATE="30-11-2021T19:35:16"RESTORE_TARGET="alertConfig"
curl -X POST "https://argus.api.eu01.stackit.cloud/v1/projects/$PROJECT_ID/instances/$INSTANCE_ID/backup-restores/$BACKUP_DATE?restoreTarget=$RESTORE_TARGET" \-H "Authorization: Bearer $API_TOKEN" \-H "Content-Type: application/json"Response
{ "message": "Restore will be proceeded"}