Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
digitalocean
Advanced tools
var Api = require('digitalocean').Api;
var api = new Api('CLIENT_ID', 'API_KEY');
/*
This method returns all active droplets that are currently running in your account.
REST equivalent: GET /droplets
*/
api.droplets.all(function(list) {
// get all droplets
console.log(list);
});
/*
This method returns full information for a specific droplet ID
REST equivalent: GET /droplets/12345
*/
api.droplets.get(12345, function(droplet) {
// get droplet #12345
console.log(droplet);
/* REST equivalent: GET /droplets/12345/destroy */
droplet.destroy(function() {
// destroyed
});
});
/*
This method allows you to add a new public SSH key to your account.
REST equivalent: GET /ssh_keys/new
*/
api.ssh_keys.new(
{
name: "New SSH key"
ssh_pub_key: "ssh-rsa ..................... user@host"
},
function(newSshKey) {
console.log(newSshKey);
}
);
api.droplets.all([onSuccess])
api.droplets.get(id, [onSuccess])
api.droplets.new({new droplet fields}, [onSuccess])
Properties
{
id: 100823,
backups_active: null,
image_id: 420,
name: "test222",
region_id: 1,
size_id: 33,
status: "active",
}
Methods
reboot([onSuccess]);
power_cycle([onSuccess]);
shutdown([onSuccess]);
power_off([onSuccess]);
power_on([onSuccess]);
password_reset([onSuccess]);
resize({size_id: 1}, [onSuccess]);
snapshot({name: "Name"}, [onSuccess]);
restore({image_id: 1}, [onSuccess]);
rebuild({image_id: 1}, [onSuccess]);
enable_backups([onSuccess]);
disable_backups([onSuccess]);
rename({name: "New name"}, [onSuccess]);
destroy([onSuccess]);
Complete API documentation can be found at https://www.digitalocean.com/api_access
By default all error will asynchronously throw an error. To catch them
you need to handle 'error'
event:
api.images.get(12345, function() {
/* ... */
}).on('error', function(error) {
console.error(error);
});
FAQs
nodejs wrapper for digitalocean v2 api
The npm package digitalocean receives a total of 25,851 weekly downloads. As such, digitalocean popularity was classified as popular.
We found that digitalocean 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.