virtualizorjs 1.0.5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +212 -126
- package/dist/index.d.mts +383 -0
- package/dist/index.d.ts +383 -0
- package/dist/index.js +276 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +267 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +53 -48
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/workflows/npm-publish-github-packages.yml +0 -36
- package/.github/workflows/release-package.yml +0 -33
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -92
- package/SECURITY.md +0 -26
- package/examples/createvps.js +0 -33
- package/examples/eventhandling.js +0 -36
- package/examples/listvps.js +0 -117
- package/src/Actions.js +0 -79
- package/src/VirtualizorClient.js +0 -491
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
-
and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
-
diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
-
and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
-
overall community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
-
advances of any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
-
* Public or private harassment
|
|
34
|
-
* Publishing others' private information, such as a physical or email
|
|
35
|
-
address, without their explicit permission
|
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
-
professional setting
|
|
38
|
-
|
|
39
|
-
## Enforcement Responsibilities
|
|
40
|
-
|
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
-
or harmful.
|
|
45
|
-
|
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
-
decisions when appropriate.
|
|
50
|
-
|
|
51
|
-
## Scope
|
|
52
|
-
|
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public spaces.
|
|
55
|
-
Examples of representing our community include using an official e-mail address,
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
57
|
-
representative at an online or offline event.
|
|
58
|
-
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at
|
|
63
|
-
.
|
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
-
|
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
-
reporter of any incident.
|
|
68
|
-
|
|
69
|
-
## Enforcement Guidelines
|
|
70
|
-
|
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
-
|
|
74
|
-
### 1. Correction
|
|
75
|
-
|
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
-
unprofessional or unwelcome in the community.
|
|
78
|
-
|
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
|
82
|
-
|
|
83
|
-
### 2. Warning
|
|
84
|
-
|
|
85
|
-
**Community Impact**: A violation through a single incident or series
|
|
86
|
-
of actions.
|
|
87
|
-
|
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
-
like social media. Violating these terms may lead to a temporary or
|
|
93
|
-
permanent ban.
|
|
94
|
-
|
|
95
|
-
### 3. Temporary Ban
|
|
96
|
-
|
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
|
98
|
-
sustained inappropriate behavior.
|
|
99
|
-
|
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
-
communication with the community for a specified period of time. No public or
|
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
-
Violating these terms may lead to a permanent ban.
|
|
105
|
-
|
|
106
|
-
### 4. Permanent Ban
|
|
107
|
-
|
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
-
|
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
-
the community.
|
|
114
|
-
|
|
115
|
-
## Attribution
|
|
116
|
-
|
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
-
version 2.0, available at
|
|
119
|
-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
-
|
|
121
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
-
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
-
|
|
124
|
-
[homepage]: https://www.contributor-covenant.org
|
|
125
|
-
|
|
126
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
-
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
-
https://www.contributor-covenant.org/translations.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Contributing to VirtualizorJS
|
|
3
|
-
|
|
4
|
-
Welcome to VirtualizorJS! We appreciate your interest in contributing to our project. By contributing, you help make VirtualizorJS better for everyone. Please take a moment to review this document before getting started.
|
|
5
|
-
|
|
6
|
-
## Table of Contents
|
|
7
|
-
|
|
8
|
-
1. [Code of Conduct](#code-of-conduct)
|
|
9
|
-
2. [How Can I Contribute?](#how-can-i-contribute)
|
|
10
|
-
3. [Getting Started](#getting-started)
|
|
11
|
-
- [Fork the Repository](#fork-the-repository)
|
|
12
|
-
- [Clone the Repository](#clone-the-repository)
|
|
13
|
-
- [Install Dependencies](#install-dependencies)
|
|
14
|
-
- [Make Changes](#make-changes)
|
|
15
|
-
- [Test Your Changes](#test-your-changes)
|
|
16
|
-
4. [Submitting a Pull Request](#submitting-a-pull-request)
|
|
17
|
-
5. [Code of Conduct](#code-of-conduct)
|
|
18
|
-
6. [License](#license)
|
|
19
|
-
|
|
20
|
-
## Code of Conduct
|
|
21
|
-
|
|
22
|
-
Please review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the standards and expectations for all contributors.
|
|
23
|
-
|
|
24
|
-
## How Can I Contribute?
|
|
25
|
-
|
|
26
|
-
### Reporting Bugs
|
|
27
|
-
|
|
28
|
-
If you encounter a bug, please [open an issue](../../issues) and provide as much detail as possible.
|
|
29
|
-
|
|
30
|
-
### Suggesting Enhancements
|
|
31
|
-
|
|
32
|
-
Have an idea to enhance VirtualizorJS? Feel free to [open an issue](../../issues) with your suggestion, or even better, submit a pull request.
|
|
33
|
-
|
|
34
|
-
### Pull Requests
|
|
35
|
-
|
|
36
|
-
We welcome contributions! Before submitting a pull request, please ensure:
|
|
37
|
-
|
|
38
|
-
- Your code adheres to the existing coding style.
|
|
39
|
-
- You have documented any new features or changes.
|
|
40
|
-
|
|
41
|
-
## Getting Started
|
|
42
|
-
|
|
43
|
-
### Fork the Repository
|
|
44
|
-
|
|
45
|
-
Click on the "Fork" button at the top right of the repository page to create your copy.
|
|
46
|
-
|
|
47
|
-
### Clone the Repository
|
|
48
|
-
|
|
49
|
-
Clone your forked repository to your local machine:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
git clone https://github.com/kkMihai/virtualizorjs.git
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Install Dependencies
|
|
56
|
-
|
|
57
|
-
Navigate to the project directory and install dependencies:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
cd virtualizorjs
|
|
61
|
-
npm install
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Make Changes
|
|
65
|
-
|
|
66
|
-
Make your changes and add new features or fix bugs.
|
|
67
|
-
|
|
68
|
-
### Test Your Changes
|
|
69
|
-
|
|
70
|
-
Ensure that your changes don't introduce new issues. Run tests and fix any failures:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
npm test
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Submitting a Pull Request
|
|
77
|
-
|
|
78
|
-
When you're ready to submit your changes:
|
|
79
|
-
|
|
80
|
-
1. Commit your changes: `git commit -m "Your commit message"`
|
|
81
|
-
2. Push to your fork: `git push origin your-branch`
|
|
82
|
-
3. Open a pull request from your fork to the `main` branch of the original repository.
|
|
83
|
-
|
|
84
|
-
Our team will review your pull request and provide feedback. Thank you for contributing to VirtualizorJS!
|
|
85
|
-
|
|
86
|
-
## Code of Conduct
|
|
87
|
-
|
|
88
|
-
Please follow our [Code of Conduct](CODE_OF_CONDUCT.md) in all interactions.
|
|
89
|
-
|
|
90
|
-
## License
|
|
91
|
-
|
|
92
|
-
By contributing to VirtualizorJS, you agree that your contributions will be licensed under the [MIT License](LICENSE).
|
package/SECURITY.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
| Version | Supported |
|
|
6
|
-
| ------- | ------------------ |
|
|
7
|
-
| 1.0.1 | ✅ |
|
|
8
|
-
| 1.0.0-beta | ❌ |
|
|
9
|
-
|
|
10
|
-
## Reporting a Vulnerability
|
|
11
|
-
|
|
12
|
-
If you discover any security issues within the project, please report them by following these guidelines:
|
|
13
|
-
|
|
14
|
-
1. **Go to the Issues section:** Visit [GitHub Issues](https://github.com/kkMihai/virtualizorjs/issues) to check if the vulnerability has already been reported or discussed.
|
|
15
|
-
|
|
16
|
-
2. **Open a New Issue:** If the vulnerability is not reported, please open a new issue.
|
|
17
|
-
|
|
18
|
-
3. **Provide Details:** Clearly describe the nature of the vulnerability, including steps to reproduce if possible. The more information you provide, the easier it is for us to understand and address the issue.
|
|
19
|
-
|
|
20
|
-
4. **Expectations:** We will acknowledge your report within a reasonable timeframe and strive to keep you informed of the progress.
|
|
21
|
-
|
|
22
|
-
5. **Resolution:** Once the vulnerability is validated, we will work on resolving it. The timeline for resolution may vary based on the severity of the issue.
|
|
23
|
-
|
|
24
|
-
Please note that this security policy applies to supported versions. Ensure you are using a supported version before reporting any vulnerabilities.
|
|
25
|
-
|
|
26
|
-
Thank you for helping us keep VirtualizorJS secure!
|
package/examples/createvps.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const VirtualizorClient = require("virtualizorjs");
|
|
2
|
-
|
|
3
|
-
const { CreateVPS } = new VirtualizorClient({
|
|
4
|
-
host: "< IP or Hostname of Virtualizor Server >",
|
|
5
|
-
port: 4085, // Default port for Virtualizor API
|
|
6
|
-
adminapikey: "< Your API KEY >",
|
|
7
|
-
adminapipass: "< Your API PASS >",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
async function exampleUsage() {
|
|
11
|
-
try {
|
|
12
|
-
const vps = await CreateVPS({
|
|
13
|
-
virtualizationType: "kvm",
|
|
14
|
-
nodeSelection: "node1",
|
|
15
|
-
userEmail: "user@example.com",
|
|
16
|
-
userPassword: "password",
|
|
17
|
-
serverHostname: "serverhostname",
|
|
18
|
-
rootPassword: "password",
|
|
19
|
-
osId: "222",
|
|
20
|
-
ipAddress: "188.0.0.0",
|
|
21
|
-
storageSpace: "10", // GB
|
|
22
|
-
serverRam: "1024", // MB
|
|
23
|
-
bandwidthLimit: "1000", // GB | 0 for unlimited
|
|
24
|
-
cpuCores: "1",
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
console.log(vps); // Output: { time_taken: 0.022, ... }
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.error("Error:", error);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
exampleUsage();
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const VirtualizorClient = require('virtualizorjs');
|
|
2
|
-
|
|
3
|
-
const Client = new VirtualizorClient({
|
|
4
|
-
host: '< IP or Hostname of Virtualizor Server >',
|
|
5
|
-
port: 4085,
|
|
6
|
-
adminapikey: "< Your API KEY >",
|
|
7
|
-
adminapipass: "< Your API PASS >",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const { StartVPS } = Client;
|
|
11
|
-
|
|
12
|
-
StartVPS(1);
|
|
13
|
-
|
|
14
|
-
// Event listener for when a virtual server is created
|
|
15
|
-
Client.on('vpsCreated', (response) => {
|
|
16
|
-
console.log(`Virtual Server Created! Details:`, response);
|
|
17
|
-
// Output: Virtual Server Created! Details: { ...virtualizorResponse }
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// Event listener for when a virtual server is started
|
|
21
|
-
Client.on('vpsStarted', (response) => {
|
|
22
|
-
console.log(`Virtual Server Started! Details:`, response);
|
|
23
|
-
// Output: Virtual Server Started! Details: { ...virtualizorResponse }
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Event listener for when a virtual server is stopped
|
|
27
|
-
Client.on('vpsStopped', (response) => {
|
|
28
|
-
console.log(`Virtual Server Stopped! Details:`, response);
|
|
29
|
-
// Output: Virtual Server Stopped! Details: { ...virtualizorResponse }
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// Event listener for when a virtual server is restarted
|
|
33
|
-
Client.on('vpsRestarted', (response) => {
|
|
34
|
-
console.log(`Virtual Server Restarted! Details:`, response);
|
|
35
|
-
// Output: Virtual Server Restarted! Details: { ...virtualizorResponse }
|
|
36
|
-
});
|
package/examples/listvps.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
const VirtualizorClient = require("virtualizorjs");
|
|
2
|
-
|
|
3
|
-
const { ListVPS } = new VirtualizorClient({
|
|
4
|
-
host: "< IP or Hostname of Virtualizor Server >",
|
|
5
|
-
port: 4085, // Default port for Virtualizor API
|
|
6
|
-
adminapikey: "< Your API KEY >",
|
|
7
|
-
adminapipass: "< Your API PASS >",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
async function exampleUsage() {
|
|
11
|
-
try {
|
|
12
|
-
const vpsList = await ListVPS();
|
|
13
|
-
console.log(vpsList);
|
|
14
|
-
//Output:
|
|
15
|
-
// {
|
|
16
|
-
// "37": {
|
|
17
|
-
// "vpsid": "37",
|
|
18
|
-
// "vps_name": "v1001",
|
|
19
|
-
// "uuid": "mark7ygoeqtfdf72",
|
|
20
|
-
// "serid": 0,
|
|
21
|
-
// "time": "1534260671",
|
|
22
|
-
// "edittime": "1534499180",
|
|
23
|
-
// "virt": "kvm",
|
|
24
|
-
// "uid": "55",
|
|
25
|
-
// "plid": "1",
|
|
26
|
-
// "hostname": "www.mydomainff.com",
|
|
27
|
-
// "osid": "270",
|
|
28
|
-
// "os_name": "centos-6.5-x86",
|
|
29
|
-
// "iso": "",
|
|
30
|
-
// "sec_iso": "",
|
|
31
|
-
// "boot": "cda",
|
|
32
|
-
// "space": "2",
|
|
33
|
-
// "inodes": "0",
|
|
34
|
-
// "ram": "128",
|
|
35
|
-
// "burst": "0",
|
|
36
|
-
// "swap": "128",
|
|
37
|
-
// "cpu": "1000",
|
|
38
|
-
// "cores": "1",
|
|
39
|
-
// "cpupin": "-1",
|
|
40
|
-
// "cpu_percent": "0.00",
|
|
41
|
-
// "bandwidth": "1",
|
|
42
|
-
// "network_speed": "0",
|
|
43
|
-
// "upload_speed": "-1",
|
|
44
|
-
// "io": "0",
|
|
45
|
-
// "ubc": "a:0:{}",
|
|
46
|
-
// "acpi": "1",
|
|
47
|
-
// "apic": "1",
|
|
48
|
-
// "pae": "1",
|
|
49
|
-
// "shadow": "0",
|
|
50
|
-
// "vnc": "1",
|
|
51
|
-
// "vncport": "5901",
|
|
52
|
-
// "vnc_passwd": "",
|
|
53
|
-
// "hvm": "0",
|
|
54
|
-
// "suspended": "0",
|
|
55
|
-
// "suspend_reason": null,
|
|
56
|
-
// "nw_suspended": null,
|
|
57
|
-
// "rescue": "0",
|
|
58
|
-
// "band_suspend": "0",
|
|
59
|
-
// "tuntap": "0",
|
|
60
|
-
// "ppp": "0",
|
|
61
|
-
// "ploop": "0",
|
|
62
|
-
// "dns_nameserver": "a:0:{}",
|
|
63
|
-
// "osreinstall_limit": "0",
|
|
64
|
-
// "preferences": null,
|
|
65
|
-
// "nic_type": "virtio",
|
|
66
|
-
// "vif_type": "",
|
|
67
|
-
// "virtio": "0",
|
|
68
|
-
// "pv_on_hvm": "0",
|
|
69
|
-
// "disks": null,
|
|
70
|
-
// "kvm_cache": "0",
|
|
71
|
-
// "io_mode": "0",
|
|
72
|
-
// "cpu_mode": "default",
|
|
73
|
-
// "total_iops_sec": "0",
|
|
74
|
-
// "read_bytes_sec": "0",
|
|
75
|
-
// "write_bytes_sec": "0",
|
|
76
|
-
// "kvm_vga": "0",
|
|
77
|
-
// "acceleration": "0",
|
|
78
|
-
// "vnc_keymap": "en-us",
|
|
79
|
-
// "routing": "0",
|
|
80
|
-
// "mg": "",
|
|
81
|
-
// "used_bandwidth": "0.01",
|
|
82
|
-
// "cached_disk": "a:2:{s:4:\"disk\";a:3:{s:4:\"Used\";i:776044;s:9:\"Available\";i:1190036;s:4:\"Use%\";d:39.469999999999998863131622783839702606201171875;}s:5:\"inode\";a:4:{s:6:\"Inodes\";i:122880;s:5:\"IUsed\";i:21323;s:5:\"IFree\";i:101557;s:4:\"Use%\";d:17.35000000000000142108547152020037174224853515625;}}",
|
|
83
|
-
// "webuzo": "0",
|
|
84
|
-
// "disable_ebtables": "0",
|
|
85
|
-
// "install_xentools": "0",
|
|
86
|
-
// "admin_managed": "0",
|
|
87
|
-
// "rdp": "0",
|
|
88
|
-
// "topology_sockets": "0",
|
|
89
|
-
// "topology_cores": "0",
|
|
90
|
-
// "topology_threads": "0",
|
|
91
|
-
// "mac": "00:16:3e:5f:cd:48",
|
|
92
|
-
// "notes": null,
|
|
93
|
-
// "disable_nw_config": "0",
|
|
94
|
-
// "locked": "",
|
|
95
|
-
// "openvz_features": "",
|
|
96
|
-
// "speed_cap": "",
|
|
97
|
-
// "numa": "0",
|
|
98
|
-
// "bpid": "0",
|
|
99
|
-
// "bserid": "0",
|
|
100
|
-
// "timezone": null,
|
|
101
|
-
// "usbdevice": "",
|
|
102
|
-
// "server_name": "localhost",
|
|
103
|
-
// "email": "tt@rrr.com",
|
|
104
|
-
// "pid": "0",
|
|
105
|
-
// "type": "0",
|
|
106
|
-
// "os_distro": "centos",
|
|
107
|
-
// "ips": {
|
|
108
|
-
// "2": "8.8.8.1"
|
|
109
|
-
// }
|
|
110
|
-
// }
|
|
111
|
-
// }
|
|
112
|
-
} catch (error) {
|
|
113
|
-
console.error("Error:", error);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
exampleUsage();
|
package/src/Actions.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Actions that can be performed on the server. Made available as an enum incase the API changes.
|
|
3
|
-
* @enum {string}
|
|
4
|
-
* @readonly
|
|
5
|
-
*/
|
|
6
|
-
module.exports = {
|
|
7
|
-
/**
|
|
8
|
-
* Action to add a new virtual private server (VPS).
|
|
9
|
-
* @type {string}
|
|
10
|
-
*/
|
|
11
|
-
AddVPS: "addvs",
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Action to manage a VPS.
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
VPSManage: "vpsmanage",
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Action to get a VPS Info
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
GetVPS: "vs",
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Action to list all VPS.
|
|
27
|
-
* @type {string}
|
|
28
|
-
*/
|
|
29
|
-
ListVPS: "listvs",
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Action to start a VPS.
|
|
33
|
-
* @type {string}
|
|
34
|
-
*/
|
|
35
|
-
StartVPS: "start",
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Action to stop a VPS.
|
|
39
|
-
* @type {string}
|
|
40
|
-
*/
|
|
41
|
-
StopVPS: "stop",
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Action to restart a VPS.
|
|
45
|
-
* @type {string}
|
|
46
|
-
*/
|
|
47
|
-
RestartVPS: "restart",
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Action to get VPS RAM information.
|
|
51
|
-
* @type {string}
|
|
52
|
-
*/
|
|
53
|
-
GetVPSRam: "ram",
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Action to get VPS CPU information.
|
|
57
|
-
* @type {string}
|
|
58
|
-
*/
|
|
59
|
-
GetVPSCPU: "cpu",
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Action to get VPS disk information.
|
|
63
|
-
* @type {string}
|
|
64
|
-
*/
|
|
65
|
-
GetVPSDisk: "disk",
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Action to get Server Bandwidth information.
|
|
69
|
-
* @type {string}
|
|
70
|
-
*/
|
|
71
|
-
GetServerBandwidth: "bandwidth",
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Action to get VPS Bandwidth information.
|
|
75
|
-
* @type {string}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
GetPlans: "plans",
|
|
79
|
-
};
|