Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 98063ca

Browse files
authored
Add files via upload
1 parent 197c4e4 commit 98063ca

File tree

5 files changed

+23
-24
lines changed

5 files changed

+23
-24
lines changed

application/ApplicationRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function getUrl(request, host, data) { // _data = nullable
313313
else if(request == 'GetAllUsersPagination') {
314314
return host + '/api/application/users?page=' + data;
315315
} else if (request == "GetAllAllocations") {
316-
return host + '/api/application/nodes/' + data + "/allocations";
316+
return host + "/api/application/nodes/" + data + "/allocations"
317317
}
318318
}
319319

application/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const getallusers = require('./methods/getAllUsers.js');
1515
const getuserinfo = require('./methods/getUserInfo.js');
1616
const getnode = require('./methods/getNodeInfo.js');
1717
const getallnodes = require('./methods/getAllNodes.js');
18-
const getallallocations = require("./methods/getAllAllocations.js")
18+
const getallallocations = require('./methods/getAllAllocations.js');
1919

2020
// PATCH
2121
const updateuser = require('./methods/updateUser.js');

application/methods/createServer.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ const req = require('../ApplicationRequest.js');
1717
*
1818
* @yields Object (refer to docs for schema);
1919
*/
20-
function createServer(allocation, Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
20+
function createServer(allocationID, Version, NameOfServer, OwnerID, EggID, DockerImage,
2121
StartupCmd, RAM, Swap, Disk, IO, CPU,
22-
AmountOfDatabases, AmountOfAllocations, backups) {
23-
const data = makeData(allocation, Version, NameOfServer, OwnerID, NestID, EggID, DockerImage, StartupCmd, RAM, Swap, Disk, IO, CPU, AmountOfDatabases, AmountOfAllocations, backups);
22+
AmountOfDatabases, AmountOfAllocations, backups, node) {
23+
const data = makeData(allocationID, Version, NameOfServer, OwnerID, EggID, DockerImage, StartupCmd, RAM, Swap, Disk, IO, CPU, AmountOfDatabases, AmountOfAllocations, backups, node);
2424
const Req = new req(process.env.APPLICATION_NODEACTYL_HOST, process.env.APPLICATION_NODEACTYL_KEY);
2525
return Req.postRequest('CreateServer', data, null);
2626
}
2727

28-
function makeData(allocation, Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
28+
function makeData(allocationID, Version, NameOfServer, OwnerID, EggID, DockerImage,
2929
StartupCmd, RAM, Swap, Disk, IO, CPU,
30-
AmountOfDatabases, AmountOfAllocations, backups) {
30+
AmountOfDatabases, AmountOfAllocations, backups, node) {
3131
return {
3232
'name': NameOfServer,
3333
'user': OwnerID,
34-
'description': 'A Nodeactyl-v1-support server',
34+
'description': '',
35+
"node": node,
3536
'egg': EggID,
36-
'pack': NestID,
3737
'docker_image': DockerImage,
3838
'startup': StartupCmd,
3939
'limits': {
@@ -58,12 +58,11 @@ function makeData(allocation, Version, NameOfServer, OwnerID, NestID, EggID, Doc
5858
'BUILD_NUMBER': Version,
5959
'INSTALL_REPO': Version,
6060
"BOT_JS_FILE": "index.js",
61-
"AUTO_UPDATE": true,
61+
"AUTO_UPDATE": false,
6262
"USER_UPLOAD": true
6363
},
6464
"allocation": {
65-
"default": allocation,
66-
'additional': []
65+
"default": allocationID
6766
},
6867
'start_on_completion': true,
6968
'skip_scripts': false,
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const req = require('../ApplicationRequest.js');
2-
3-
function GetAllAllocations(node) {
4-
const Req = new req(process.env.APPLICATION_NODEACTYL_HOST, process.env.APPLICATION_NODEACTYL_KEY);
5-
return Req.getRequest('GetAllAllocations', node);
6-
}
7-
8-
module.exports = GetAllAllocations;
1+
const req = require('../ApplicationRequest.js');
2+
3+
function getAllAllocations(location) {
4+
const Req = new req(process.env.APPLICATION_NODEACTYL_HOST, process.env.APPLICATION_NODEACTYL_KEY);
5+
return Req.getRequest('GetAllAllocations', location);
6+
}
7+
8+
module.exports = getAllAllocations;

application/methods/updateBuild.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ const req = require('../ApplicationRequest.js');
1717
*
1818
* @yields Object (refer to docs for schema);
1919
*/
20-
function updateBuild(id, RAM, Disk, IO, CPU,
20+
function updateBuild(id, allocation, RAM, Disk, IO, CPU,
2121
AmountOfDatabases, AmountOfAllocations, Backups) {
22-
const data = makeData(id, RAM, Disk, IO, CPU,
22+
const data = makeData(id, allocation, RAM, Disk, IO, CPU,
2323
AmountOfDatabases, AmountOfAllocations, Backups);
2424
const Req = new req(process.env.APPLICATION_NODEACTYL_HOST, process.env.APPLICATION_NODEACTYL_KEY);
2525
return Req.patchRequest('UpdateBuild', data, null);
2626
}
2727

28-
function makeData(id, RAM, Disk, IO, CPU,
28+
function makeData(id, allocation, RAM, Disk, IO, CPU,
2929
AmountOfDatabases, AmountOfAllocations, Backups) {
3030
return {
3131
"id": id,
32-
"allocation": "1",
32+
"allocation": allocation,
3333
'memory': RAM,
3434
'swap': "0",
3535
'disk': Disk,

0 commit comments

Comments
 (0)