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

Commit b707d11

Browse files
authored
Add files via upload
1 parent ab4f70c commit b707d11

File tree

6 files changed

+45
-16
lines changed

6 files changed

+45
-16
lines changed

application/ApplicationRequest.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ class Request {
7575
const err = createError(request, error, data);
7676
if (err) throw err;
7777
});
78+
} else if (request == "GetAllAllocations") {
79+
return axios.default.get(splitted, {
80+
maxRedirects: 5,
81+
headers: {
82+
'Authorization': 'Bearer ' + this.key,
83+
'Content-Type': 'application/json',
84+
'Accept': 'Application/vnd.pterodactyl.v1+json',
85+
},
86+
}).then(response => {
87+
if (request == 'GetAllAllocations') {
88+
return response.data.data;
89+
}
90+
}).catch(error => {
91+
const err = createError(request, error, data);
92+
if (err) throw err;
93+
});
7894
}
7995
}
8096

@@ -296,6 +312,8 @@ function getUrl(request, host, data) { // _data = nullable
296312
}
297313
else if(request == 'GetAllUsersPagination') {
298314
return host + '/api/application/users?page=' + data;
315+
} else if (request == "GetAllAllocations") {
316+
return host + '/api/application/nodes/' + data + "/allocations";
299317
}
300318
}
301319

application/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +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")
1819

1920
// PATCH
2021
const updateuser = require('./methods/updateUser.js');
@@ -94,6 +95,7 @@ module.exports = {
9495
getUserInfo: getuserinfo,
9596
getNodeInfo: getnode,
9697
getAllNodes: getallnodes,
98+
getAllAllocations: getallallocations,
9799

98100
// PATCH
99101
updateUser: updateuser,

application/methods/createServer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ const req = require('../ApplicationRequest.js');
1717
*
1818
* @yields Object (refer to docs for schema);
1919
*/
20-
function createServer(Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
20+
function createServer(allocation, Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
2121
StartupCmd, RAM, Swap, Disk, IO, CPU,
2222
AmountOfDatabases, AmountOfAllocations, backups) {
23-
const data = makeData(Version, NameOfServer, OwnerID, NestID, EggID, DockerImage, StartupCmd, RAM, Swap, Disk, IO, CPU, AmountOfDatabases, AmountOfAllocations, backups);
23+
const data = makeData(allocation, Version, NameOfServer, OwnerID, NestID, EggID, DockerImage, StartupCmd, RAM, Swap, Disk, IO, CPU, AmountOfDatabases, AmountOfAllocations, backups);
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(Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
28+
function makeData(allocation, Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
2929
StartupCmd, RAM, Swap, Disk, IO, CPU,
3030
AmountOfDatabases, AmountOfAllocations, backups) {
3131
return {
@@ -62,7 +62,8 @@ function makeData(Version, NameOfServer, OwnerID, NestID, EggID, DockerImage,
6262
"USER_UPLOAD": true
6363
},
6464
"allocation": {
65-
"default": 1
65+
"default": allocation,
66+
'additional': []
6667
},
6768
'start_on_completion': true,
6869
'skip_scripts': false,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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;

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"_from": "nodeactyl-v1-support@^1.4.8",
3-
"_id": "nodeactyl-v1-support@1.4.8",
2+
"_from": "nodeactyl-v1-support@^1.5.9",
3+
"_id": "nodeactyl-v1-support@1.5.9",
44
"_inBundle": false,
5-
"_integrity": "sha512-W3LTjcsJo4/VqrYgu2yr2VCtOaF3wpL3Y+xJKAZmFSzUrDACqGDnNnRasCde0eo1nJ8nYPi5HvBOW2z1WuNHIg==",
5+
"_integrity": "sha512-DJiQ95ZcRalW5PyH/VGatyE+IGY5xso4T4x4k78lc6u/Lh89lKkVOPFyKgrYPqmtXWu/vNp5RA1TLoAtPaAtaQ==",
66
"_location": "/nodeactyl-v1-support",
77
"_phantomChildren": {},
88
"_requested": {
99
"type": "range",
1010
"registry": true,
11-
"raw": "nodeactyl-v1-support@^1.4.8",
11+
"raw": "nodeactyl-v1-support@^1.5.9",
1212
"name": "nodeactyl-v1-support",
1313
"escapedName": "nodeactyl-v1-support",
14-
"rawSpec": "^1.4.8",
14+
"rawSpec": "^1.5.9",
1515
"saveSpec": null,
16-
"fetchSpec": "^1.4.8"
16+
"fetchSpec": "^1.5.9"
1717
},
1818
"_requiredBy": [
1919
"#USER",
2020
"/"
2121
],
22-
"_resolved": "https://registry.npmjs.org/nodeactyl-v1-support/-/nodeactyl-v1-support-1.4.7.tgz",
23-
"_shasum": "7ed937e8e7fc350fc1adc9e5cff2cbc3ac6d0916",
24-
"_spec": "nodeactyl-v1-support@^1.4.8",
25-
"_where": "/root/client",
22+
"_resolved": "https://registry.npmjs.org/nodeactyl-v1-support/-/nodeactyl-v1-support-1.4.8.tgz",
23+
"_shasum": "e83e5a31c61867850673c4a0428d3009d4b73587",
24+
"_spec": "nodeactyl-v1-support@^1.5.9",
25+
"_where": "C:\\Users\\engin\\Desktop\\Development\\RedHost Client",
2626
"author": {
2727
"name": "EiskalterFreund"
2828
},
@@ -45,5 +45,5 @@
4545
"scripts": {
4646
"test": "echo \"Error: no test specified\" && exit 1"
4747
},
48-
"version": "1.4.8"
48+
"version": "1.5.9"
4949
}

0 commit comments

Comments
 (0)