(backups)
- createBackup - Create backup
- downloadBackup - Download backup
- getBackups - List backups
- sendDownloadBackupEmail - Send download backup email
Create backup
import { SDK } from "@lukehagar/discoursejs";
async function run() {
const sdk = new SDK();
const res = await sdk.backups.createBackup({
withUploads: false,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateBackupRequestBody | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.CreateBackupResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Download backup
import { SDK } from "@lukehagar/discoursejs";
import { DownloadBackupRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const filename: string = "<value>";
const token: string = "<value>";
const res = await sdk.backups.downloadBackup(filename, token);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
filename |
string | ✔️ | N/A |
token |
string | ✔️ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.DownloadBackupResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
List backups
import { SDK } from "@lukehagar/discoursejs";
async function run() {
const sdk = new SDK();
const res = await sdk.backups.getBackups();
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetBackupsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Send download backup email
import { SDK } from "@lukehagar/discoursejs";
import { SendDownloadBackupEmailRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const filename: string = "<value>";
const res = await sdk.backups.sendDownloadBackupEmail(filename);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
filename |
string | ✔️ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.SendDownloadBackupEmailResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |