Git Product home page Git Product logo

digital-ocean's Introduction

Digital-ocean

Clojure interface for Digital Ocean

[digitalocean "1.2"]

V2 API

Authentication

You can pass in an OAuth token directly to every function.

You can get a token from your Digital Ocean account user settings.

Getting started

(ns myproject
  (:require [digitalocean.v2.core :as do]))

(defonce token "YOURAUTHTOKEN")

Droplets

Get all droplets

(do/droplets token)

Get a droplet by ID

(do/get-droplet token 123)

Boot up a new droplet. All droplets require an image id to boot from.

Note that certain fields are required. See the Digital Ocean API V2 docs for all params

(do/create-droplet token nil
  {:name "ubuntu-s-1vcpu-2gb-lon1-01"
   :region "lon1"
   :size "s-1vcpu-2gb"
   :image "ubuntu-16-04-x64"
   :tags ["web"]
  })

Delete a droplet by ID

(do/delete-droplet token 123)

Domains

Get all

(do/domains token)

Get one domain by name

(do/get-domain token "fshionable.com")

Domain records

Get records for a domain

(do/records token "fshionable.com")

Images

Get all images

(do/images token)

Keys

;; Get all keys
(do/keys token)

;; Create a new one
(do/create-key token nil {
  :name "Blah"
  :public_key "Blah"})

Regions

Get all regions

(do/regions token)

Sizes

Get all sizes

(do/sizes token)

License

Copyright © 2014 Owain Lewis

Distributed under the Eclipse Public License, the same as Clojure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.