Skip to main content

PUT /api/sam/admin/config/backup

Import a full SAM Manager system configuration from a JSON object, replacing the current configuration

Description

This method replaces the current SAM Manager system configuration with the configuration specified by the JSON packet provided.

To use this endpoint, you must log in as a user with access to the %SAM.Admin resource.

Request Example

PUT http://localhost:8080/api/sam/admin/config/backup

The packet provided must have the same schema as the one returned by GET /api/sam/admin/config/backup or by exporting a system configuration using the SAM web portal. For example:

{
    "clusters": [
        {
            "name": "local",
            "description": "my local cluster",
            "targets": [
                {
                    "instance": "172.16.6.6:80",
                    "name": "IRIS3",
                    "description": "IRIS3",
                    "urlPrefix": "",
                    "dashboardId": "2"
                }
            ],
            "alertrules": [
                {
                    "alert": "test",
                    "annotations": {
                        "description": "iris_system_alerts is {{ $value }}"
                    },
                    "expr": "iris_system_alerts{cluster=\"local\"} > 50",
                    "labels": {
                        "severity": "critical"
                    }
                }
            ]
        }
    ],
    "KeepDays": 2,
    "grafanadb": "base64 encoded sqlite3 .dump content"

You must specify a urlPrefix for each target instance. If the target does not include a urlPrefix, you must specify an empty string (""), as above. KeepDays must have a value between 1 and 30 inclusive.

Response Example

If the request packet is incorrectly formatted, the request will fail with a status code of 422 Unprocessable Entity.

FeedbackOpens in a new tab