UNPKG

pterodactyl-api-wrapper

Version:

[![NPM version](https://img.shields.io/npm/v/pterodactyl-api-wrapper.svg)](https://npmjs.com/package/pterodactyl-api-wrapper) [![License](https://img.shields.io/npm/l/pterodactyl-api-wrapper.svg)](LICENSE)

28 lines (26 loc) 926 B
import ClientAPICall from "../../../../../functions/createAppCall"; /** * Deletes a backup from a server. * * @param {Object} options - API call options. * @param {string} options.apiKey - The API key for authentication. * @param {string} options.panel - The base URL of the Pterodactyl panel. * @param {string} options.server_id - The ID of the server. * @param {string} options.backup_id - The ID of the backup. * @returns {Promise<any>} - API response confirming backup deletion. * * @throws {Error} - Throws an error if the API request fails. */ export default async function deleteBackup(options: { apiKey: string; panel: string; server_id: string; backup_id: string; }): Promise<any> { return ClientAPICall({ apiKey: options.apiKey, panel: options.panel, method: "DELETE", endpoint: `servers/${options.server_id}/backups/${options.backup_id}` }); }