Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owainlewis/digital-ocean
Idiomatic Clojure client for Digital Ocean that makes it easy to boot virtual servers from your REPL
https://github.com/owainlewis/digital-ocean
api-client clojure digital-ocean
Last synced: 4 months ago
JSON representation
Idiomatic Clojure client for Digital Ocean that makes it easy to boot virtual servers from your REPL
- Host: GitHub
- URL: https://github.com/owainlewis/digital-ocean
- Owner: owainlewis
- Created: 2014-01-06T16:34:54.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T12:46:22.000Z (over 5 years ago)
- Last Synced: 2024-09-16T18:22:44.370Z (5 months ago)
- Topics: api-client, clojure, digital-ocean
- Language: Clojure
- Homepage:
- Size: 50.8 KB
- Stars: 37
- Watchers: 6
- Forks: 13
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```clojure
(ns myproject
(:require [digitalocean.v2.core :as do]))(defonce token "YOURAUTHTOKEN")
```
### Droplets
Get all droplets
```clojure
(do/droplets token)
```Get a droplet by ID
```clojure
(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
```clojure
(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
```clojure
(do/delete-droplet token 123)
```### Domains
Get all
```clojure
(do/domains token)
```Get one domain by name
```clojure
(do/get-domain token "fshionable.com")
```### Domain records
Get records for a domain
```clojure
(do/records token "fshionable.com")
```## Images
Get all images
```clojure
(do/images token)
```### Keys
```clojure
;; Get all keys
(do/keys token);; Create a new one
(do/create-key token nil {
:name "Blah"
:public_key "Blah"})```
### Regions
Get all regions
```clojure
(do/regions token)
```### Sizes
Get all sizes
```clojure
(do/sizes token)
```## License
Copyright © 2014 Owain Lewis
Distributed under the Eclipse Public License, the same as Clojure.