diff --git a/utils/fileHelper.js b/utils/fileHelper.js index 6950f68..48dcea7 100644 --- a/utils/fileHelper.js +++ b/utils/fileHelper.js @@ -1,5 +1,5 @@ const axios = require('axios'); - +const db = require('../handlers/db') /** * Fetches files for a given instance. * @param {Object} instance - The instance object. @@ -125,8 +125,22 @@ async function deleteFile(instance, filename, path = '') { return response.data; } +async function FetchTotalContainerDisk(instance) { + const url = `http://${instance.Node.address}:${instance.Node.port}/instances/${instance.VolumeId}/disk/usage`; + + const response = await axios.get(url, { + auth: { + username: 'Skyport', + password: instance.Node.apiKey + } + }); + + return response.data; +} + module.exports = { fetchFiles, + FetchTotalContainerDisk, fetchFileContent, createFile, editFile,