node-vultr
Node.JS Promise-based library to communicate with the Vultr API
Test coverage is currently 100%, although some tests involving actually creating the VPS's itself are currently not tested.
This library creates a new instance of "Vultr" for you, exposing a few libraries and methods you can use to communicate.
To start a new Vultr instance:
var Vultr = ; var vultrInstance = apiKey;
apiKey
is your Vultr API key.
Enable the Vultr API
You can generate a Vultr API key from the Settings
page.
Running the integration tests
It's safe for you to run the integration tests, simply copy config/data.example.js
to config/data.js
and fill out your real API key. Run npm test
to run the tests.
Account
vultrInstance.account.info
vultrInstanceaccount
DNS
vultrInstance.dns.list
vultrInstancedns
vultrInstance.dns.createDomain
vultrInstancedns
vultrInstance.dns.createRecord
vultrInstancedns
vultrInstance.dns.records
vultrInstancedns
vultrInstance.dns.deleteRecord
vultrInstancedns
vultrInstance.dns.deleteDomain
vultrInstancedns;
OS
vultrInstance.os.list
vultrInstanceos
ISO
vultrInstance.iso.list
vultrInstanceiso
vultrInstance.iso.createFromUrl
vultrInstanceiso
Backup
vultrInstance.backup.list
vultrInstancebackup
Plans
vultrInstance.plans.list
vultrInstanceplans
Regions
vultrInstance.regions.list
vultrInstanceregions
vultrInstance.regions.availability
Retrieve a list of the VPSPLANIDs currently available in this location. (DCID can be retrieved from vultrInstance.regions.list()
)
vultrInstanceregions
Server
vultrInstance.server.list
vultrInstanceserver
vultrInstance.server.bandwidth
SUBID
is the VPS ID
vultrInstanceserver
vultrInstance.server.reboot
SUBID
is the VPS ID
vultrInstanceserver
vultrInstance.server.halt
SUBID
is the VPS ID
vultrInstanceserver
vultrInstance.server.start
SUBID
is the VPS ID. This function also RESTARTS an already running VPS.
vultrInstanceserverstartSUBID
vultrInstance.server.destroy
SUBID
is the VPS ID
vultrInstanceserver
vultrInstance.server.reinstall
SUBID
is the VPS ID
vultrInstanceserver
vultrInstance.server.restoreSnapshot
SUBID
is the VPS ID. SNAPSHOTID
can be retrieved from vultrInstance.snapshot.list()
.
vultrInstanceserver
vultrInstance.server.restoreBackup
SUBID
is the VPS ID. BACKUPID
cannot be retrieved yet (asked Vultr support about this).
vultrInstanceserver
vultrInstance.server.create
create
returns SUBID
, this is used in many other calls. PLAN, OS and REGION can be retrieved from the services offering the same name.
vultrInstanceserver
vultrInstance.server.listIpv4
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.reverseSetIpv4
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.reverseDefaultIpv4
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.listIpv6
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.reverseSetIpv6
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.reverseListIpv6
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.reverseDeleteIpv6
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.setLabel
SUBID
is the VPS ID. LABEL
is a string
of your choosing.
vultrInstanceserver
vultrInstance.server.createIpv4
SUBID
is the VPS ID. The second argument is "yes" or "no" to trigger a reboot.
vultrInstanceserver
vultrInstance.server.destroyIpv4
SUBID
is the VPS ID. The second argument is "yes" or "no" to trigger a reboot.
vultrInstanceserver
vultrInstance.server.osChangeList
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.osChange
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.upgradePlanlist
SUBID
is the VPS ID.
vultrInstanceserver
vultrInstance.server.upgradePlan
SUBID
is the VPS ID.
vultrInstanceserver
Snapshot
vultrInstance.snapshot.list
vultrInstancesnapshot
vultrInstance.snapshot.create
SUBID
is the VPS ID. DESCRIPTION
is an optional description for this snapshot.
vultrInstancesnapshot
vultrInstance.snapshot.destroy
SNAPSHOTID
can be retrieved from vultrInstance.snapshopt.list()
.
vultrInstancesnapshot
SSHKey
vultrInstance.sshkey.list
vultrInstancesshkey
vultrInstance.sshkey.create
vultrInstancesshkey
vultrInstance.sshkey.update
SSHKEYID
can be retrieved from vultrInstance.sshkey.list()
or after calling vultrInstance.sshkey.create()
.
vultrInstancesshkey
vultrInstance.sshkey.destroy
SSHKEYID
can be retrieved from vultrInstance.sshkey.list()
or after calling vultrInstance.sshkey.create()
.
vultrInstancesshkey
StartupScript
vultrInstance.startupscript.list
vultrInstancestartupscript
vultrInstance.startupscript.create
vultrInstancestartupscript
vultrInstance.startupscript.update
SSHKEYID
can be retrieved from vultrInstance.startupscript.list()
or after calling vultrInstance.startupscript.create()
.
vultrInstancestartupscript
vultrInstance.startupscript.destroy
SSHKEYID
can be retrieved from vultrInstance.startupscript.list()
or after calling vultrInstance.startupscript.create()
.
vultrInstancestartupscript