Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
oceanusancora
Advanced tools
DigitalOcean API client wrapper
Weekly downloads
Readme
A DigitalOcean API client for use with NodeJS.
var oa = require('oceanusancora'),
fs = require('fs');
var client = oa.createClient({
client_id: 'id',
api_key: 'key'
});
client.droplets.list(function (err, statusCode, body, response, res) {
if (err) {
console.log(err);
return;
}
console.log(JSON.stringify(res, null, 2, true));
});
Take a look in the examples
folder for more examples.
Install using npm:
npm install oceanusancora
Below is a list of options you may use when calling any scripts you may have written
-c --client_id X
-a --api_key X
--debug
--no-cookies
--timeout X(ms)
--proxy X
--encoding X
They are fairly self-explanatory no-cookies, timeout, proxy, encoding are all options to request. if using debug its reccomended you use --encoding utf8
or something similar as all you will see is a buffer otherwise in the response.
Because of these command line options you can try a few already from the examples section:
node examples/list_droplets.js -c <client_id> -a <api_key>
// Listing Domains
list(cb)
// Create New Domain
new(name, ip_address, cb)
// Show A Domain
show(domain_id, cb)
// Destroy a Domain
destroy(domain_id, cb)
// Listing Records for a given Domain
records(domain_id, cb)
// Create a new Record for a given Domain
newRecord(domain_id, record_type, data, options, cb)
// Show a Record for a given Domain
showRecord(domain_id, record_id, cb)
// Destroy a Record for a given Domain
destroyRecord(domain_id, record_id, cb)
// Edit a Record for a given Domain
editRecord(domain_id, record_id, record_type, data, options, cb)
// Listing Droplets
list(cb)
// Add a new Droplet
new(name, size, image, region, options, cb)// options = {ssh_key_ids : 'string(CSV)', private_networking : boolean, backups_enabled: boolean}
// Show a Droplet
show(droplet_id, cb)
// Reboot a Droplet
reboot(droplet_id, cb)
// Power Cycle a Droplet
powerCycle(droplet_id, cb)
// Shut Down a Droplet
shutDown(droplet_id, cb)
// Power Off a Droplet
powerOff(droplet_id, cb)
// Power On a Droplet
powerOn(droplet_id, cb)
// Reset root password on a Droplet
passwordReset(droplet_id, cb)
// Resize a Droplet
resize(droplet_id, size, cb)
// Make a Snapshot of a Droplet
snapshot(droplet_id, name, cb)
// Restore a Droplet
restore(droplet_id, image_id, cb)
// Rebuild a Droplet
rebuild(droplet_id, image_id, cb)
// Rename a Droplet
rename(droplet_id, name, cb)
// Destroy a Droplet
destroy(droplet_id, scrub_data, cb)
// Listing Events
show(event_id, cb)
// Listing Images
list(filter, cb)
// Show an Image
show(image, cb)
// Destroy an Image
destroy(image, cb)
// Transfer an Image
transfer(image, region_id, cb)
// Listing Regions
list(cb)
// Listing Sizes
list(cb)
// Listing SSH_Keys
list(cb)
// Add a new SSH Key
new(name, ssh_pub_key, cb)
// Show a SSH Key
show(ssh_key_id, cb)
// Edit a SSH Key
edit(ssh_key_id, options, cb) // options = {name: 'string', ssh_pub_key: 'string'}
// Destroy a SSH Key
destroy(ssh_key_id, cb)
npm test
todo: further client testing; nock reply data does not represent what DigitalOcean responds with in all cases, but is currently unused.
MIT.
FAQs
DigitalOcean API client wrapper
The npm package oceanusancora receives a total of 0 weekly downloads. As such, oceanusancora popularity was classified as not popular.
We found that oceanusancora demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.