All Projects → Hoverbear → digitalocean

Hoverbear / digitalocean

Licence: MIT License
A prototype API for Digital Ocean.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to digitalocean

rust-ipfs-api
Rust language IPFS API implementation
Stars: ✭ 20 (-42.86%)
Mutual labels:  api-wrapper, rust-library
stedding
Ansible playbooks for Laravel LEMP Stack
Stars: ✭ 31 (-11.43%)
Mutual labels:  provisioning
rLandsat
R Package to make Landsat8 data accessible
Stars: ✭ 95 (+171.43%)
Mutual labels:  api-wrapper
murmur3
A rust implementation of murmur3
Stars: ✭ 48 (+37.14%)
Mutual labels:  rust-library
digitalocean-helper-bot
用 telegram bot 管理 Digital Ocean 账号
Stars: ✭ 24 (-31.43%)
Mutual labels:  digitalocean
primeuploads-py
An unoffcial python API client for primeuploads.com
Stars: ✭ 40 (+14.29%)
Mutual labels:  api-wrapper
Hacktoberfest-Guide-2019
කොල්ලන්ට කෙල්ලන්ට Hacktoberfest ටී ෂර්ට්👉 Hacktoberfest 2019 opensource guide. Happy Open Source❤️😍😍❤️ Do Your Activity Here 👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇
Stars: ✭ 11 (-68.57%)
Mutual labels:  digitalocean
HacktoberFest-HelloWorld
All your PRs will be merged !! 😊
Stars: ✭ 24 (-31.43%)
Mutual labels:  digitalocean
ansible-debian
Buildfiles: Ansible automated leight-weight and sensible Debian provisioning
Stars: ✭ 83 (+137.14%)
Mutual labels:  provisioning
bmemcached-rs
Rust binary memcached implementation
Stars: ✭ 24 (-31.43%)
Mutual labels:  rust-library
warc
⚙️ A Rust library for reading and writing WARC files
Stars: ✭ 26 (-25.71%)
Mutual labels:  rust-library
popyt
A very easy to use Youtube Data v3 API wrapper.
Stars: ✭ 42 (+20%)
Mutual labels:  api-wrapper
eksphemeral
A simple Amazon EKS manager for ephemeral clusters
Stars: ✭ 68 (+94.29%)
Mutual labels:  provisioning
GraphiPy
GraphiPy: Universal Social Data Extractor
Stars: ✭ 61 (+74.29%)
Mutual labels:  api-wrapper
fixie-trie
Compact tries for fixed-width keys
Stars: ✭ 23 (-34.29%)
Mutual labels:  rust-library
Gauntlet
🔖 Guides, Articles, Podcasts, Videos and Notes to Build Reliable Large-Scale Distributed Systems.
Stars: ✭ 336 (+860%)
Mutual labels:  digitalocean
anx-api
Javascript wrapper for the AppNexus Console API
Stars: ✭ 37 (+5.71%)
Mutual labels:  api-wrapper
sparql-micro-service
SPARQL micro-services: A lightweight approach to query Web APIs with SPARQL
Stars: ✭ 22 (-37.14%)
Mutual labels:  api-wrapper
nextcloud
Nextcloud OCS and WebDAV API wrapper for Ruby.
Stars: ✭ 16 (-54.29%)
Mutual labels:  api-wrapper
ramapi
Python implementation for the Rick and Morty API
Stars: ✭ 17 (-51.43%)
Mutual labels:  api-wrapper

DigitalOcean

Build Status Crates.io

A crate for interacting with the Digital Ocean API.

While browsing this documentation, please feel encouraged to reference the DigitalOcean docs.

A Basic Example

extern crate digitalocean;
use digitalocean::prelude::*;
use std::env;

fn main() {
    let api_key = env::var("API_KEY")
        .expect("API_KEY not set.");
    let client = DigitalOcean::new(api_key)
        .unwrap();

    Droplet::list()
        .execute(&client);
}

Usage Fundamentals

All values (Domain, SshKey, etc) can be found in the api module.

Calling an action will return a Request<_,_> type. For example Droplet::create() will create a Request<Create, Droplet>. These types may then have specific futher functions to futher build up the request or transform it into some other request.

extern crate digitalocean;
use digitalocean::DigitalOcean;
use digitalocean::api::Domain;

fn main() {
    // Gets details of a specific domain.
    let req = Domain::get("foo.com");

    // Get the records for that domain instead (futher build the request)
    let req = req.records();
    // Get the records of a domain without having a prior request.
    let req = Domain::get("foo.com").records();

    // Create a new record for a domain
    let req = Domain::get("foo.com").records().create("CNAME", "test", "127.0.0.1");
}

In order to realize any action, .execute() must be called with a DigitalOcean client. It is also possible to call do_client.execute(some_request).

In order to use the entire API, it is recommended to reference the various Request types.

Design

The crate is founded on a few design considerations:

  • Keep things simple and generic.
  • Map closely to the DigitalOcean API.
  • Requests are agnostic over Clients.
  • It should be difficult to make an invalid API request.
  • Use static dispatch as much as possible.
  • Only the bare minimum amount of information should be carried around.
  • Allow for easy construction of separate clients (hyper, etc.)
  • No caching (yet). (DigitalOcean does not have ETags)

Debugging

This crate uses the log crate. You can see digitalocean logs by passing an environment variable such as:

RUST_LOG=digitalocean=debug cargo run

Development Status

This crate is in a prototype state.

Not all endpoints have been fully end-to-end tested on the production DigitalOcean API. It's very likely that some endpoints will have parsing errors due to unexpected values returned from the API.

If something does not work please file a bug!

Feedback, patches, and new features are encouraged. Please just open an issue or PR!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].