Skip to content

Latest commit

 

History

History
93 lines (71 loc) · 1.97 KB

Config - Restore Configuration.adoc

File metadata and controls

93 lines (71 loc) · 1.97 KB

Config - Restore Configuration

To restore the configuration send a HTTP POST to /api/edge/config/restore.json?header=text%2Fhtml&noraw=1&X-CSRF-TOKEN=X-CSRF-Token as a multipart/form-data request with the qqfile key containing a valid .tar.gz configuration file.

This method is CSRF protected so also requires a X-CSRF-TOKEN (see Sensitive Requests (CSRF Protection)).

It does not support a HTTP GET.

Request

Request Querystring

Name Type Values Description

header

String

text/html

Unknown hard-coded value.

noraw

Number

1

Unknown hard-coded value.

X-CSRF-TOKEN

String

A 256-bit hexadecimal CSRF token

The Cross-Site Request Forgery (CSRF) token from a cookie set during login.

Request Content

Name Type Values Description

qqfile

String

Configuration file

The configuration to restore.

Response

Root

Name Type Values Description

errors (Optional)

Array (String)

Array of errors

An array of the errors that occurred.

success

Boolean

true or false

Whether the API request was successful.

Examples

Bad File Example

POST /api/edge/config/restore.json?header=text%2Fhtml&noraw=1&X-CSRF-TOKEN=e3117c58b702c42f8b928b350b1660abff886f7d7d44735a6ae4a8bb6fefc66b Request
-----------------------------339514711711515864301518031004
Content-Disposition: form-data; name="qqfile"; filename="BadConfigurationFile.bin"
Content-Type: application/octet-stream

I am a BadConfigurationFile.
-----------------------------339514711711515864301518031004--
POST /api/edge/config/restore.json?header=text%2Fhtml&noraw=1&X-CSRF-TOKEN=e3117c58b702c42f8b928b350b1660abff886f7d7d44735a6ae4a8bb6fefc66b Response
{"errors": ["CONFIG request failed"], "success": false}