Skip to content

Commit

Permalink
Update fileHelper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ma4z-sys authored Jan 10, 2025
1 parent edf87be commit 215ee94
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion utils/fileHelper.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 215ee94

Please sign in to comment.