Bandwagon host api Support all bandwagonhost api. Check API document here or PDF
npm install bandwagon.js
const Bandwagon = require('bandwagon.js')
// method is optional, allow "POST" or "GET", defaults: "GET"
let bwg = new Bandwagon({veid:'YOUR VEID', api_key:'YOUR API KEY', method: 'POST'})
bwg.getServiceInfo().then(res=>console.log(res.data));
bwg.resetRootPassword().then(res => {
let json = res.data;
if (json && json.password) {
console.log(`YOUR NEW PASSWORD is: ${json.password}`)
} else {
console.error(`Reset password failure`);
}
})
bwg.createSnapshot({description:'SOME_SNAPSHOT_DESC'}).then(res=>console.log(res.data))
Or
const Bandwagon = require('bandwagon.js')
let bwg = new Bandwagon()
// Pass veid/api_key when call API
bwg.getLiveServiceInfo({veid:'YOUR VEID', api_key:'YOUR API KEY'}).then(res => console.log(res.data))
Starts the VPS
Stops the VPS
Reboots the VPS
Allows to forcibly stop a VPS that is stuck and cannot be stopped by normal means. Please use this feature with great care as any unsaved data will be lost.
Get VPS base service info.
This function returns all data provided by getServiceInfo. In addition, it provides detailed status of the VPS. Please note that this call may take up to 15 seconds to complete.
List operation system can be install your VPS
Reinstall the Operating System. OS must be specified via "os" variable. Use getAvailableOS call to get list of available systems.
Generates and sets a new root password.
Obsolete, use getRawUsageStats instead
Returns a twodimensional array with the detailed usage statistics shown under Detailed Statistics in KiwiVM.
Sets new hostname.
Sets new PTR (rDNS) record for IP.
Simulate change of directory inside of the VPS. Can be used to build a shell like Basic shell.
Execute a shell command on the VPS (synchronously).
Execute a shell script on the VPS (asynchronously).
Create snapshot
Get list of snapshots.
Delete snapshot by fileName (can be retrieved with snapshot/list call).
Restores snapshot by fileName (can be retrieved with snapshot/list call). This will overwrite all data on the VPS.
Set or remove sticky attribute ("sticky" snapshots are never purged). Name of snapshot can be retrieved with snapshot/list call – look for fileName variable.Set sticky = 1 to set sticky attributeSet sticky = 0 to remove sticky attribute
Generates a token with which the snapshot can be transferred to another instance.
Imports a snapshot from another instance identified by VEID and Token. Both VEID and Token must be obtained from another instance beforehand with a snapshot/export call. Get list of automatic backups.
Get list of automatic backups.
Copies a backup identified by backup_token (returned by backup/list) into a restorable Snapshot.
Assigns a new IPv6 address. For initial IPv6 assignment an empty IP is required (call without parameters), and a new IP from the available pool is assigned automatically. All subsequent requested IPv6 addresses must be within the /64 subnet of the first IPv6 address.
Releases specified IPv6 address.
Return all possible migration locations.
Start VPS migration to new location. Takes new location ID as input. Note that this will result in all IPv4 addresses to be replaced with new ones, and all IPv6 addresses will be released.
cloneFromExternalServer(params={externalServerIP, externalServerSSHport, externalServerRootPassword})
(OVZ only) Clone a remote server or VPS. See Migrate from another server for example on how this works.
Retrieve information related to service suspensions.
Clear abuse issue identified by record_id and unsuspend the VPS. Refer to getSuspensionDetails call for details.
When you perform too many API calls in a short amount of time, KiwiVM API may start dropping your requests for a few minutes. This call allows monitoring this matter.