hdo-0.1: A Digital Ocean client in Haskell

Safe HaskellNone
LanguageHaskell2010

DigitalOcean

Contents

Description

Contains Haskell representation of most data types used for interacting with DigitalOcean's API v2

See https://developers.digitalocean.com/documentation/v2/

Synopsis

Documentation

data Region Source

A type for describing Region A region can be assigned an empty object when it is undefined, or be referenced simply by its slug https://developers.digitalocean.com/documentation/v2/#regions

sizeSlugs :: [String] Source

String representation of size slugs This maps to corresponding expected JSON string value.

data Mega Source

Instances

data Giga Source

Instances

newtype Bytes a Source

A type for various sizes Type parameter is used to define number's magnitude

Constructors

Bytes 

Fields

bytesSize :: Int
 

newtype Date Source

Constructors

Date 

Fields

theDate :: UTCTime
 

data Network a Source

Type of a single Network definition

This type is parameterized with a phantom type which lifts the network address type at the type level (could use DataKinds extension...). This allows distinguishing types of of networks while using same parsing.

Constructors

NetworkV4 

Fields

ip_address :: IP
 
netmask :: IP
 
gateway :: IP
 
netType :: NetType
 
NetworkV6 

data V4 Source

Instances

data V6 Source

Instances

jsonNetwork :: (FromJSON a3, FromJSON a2, FromJSON a1, FromJSON a) => (a3 -> a2 -> a1 -> a -> b) -> Object -> Parser b Source

data Networks Source

Type of Networks configured for a Droplet

A network is either a list of IPv4 and IPv6 NICs definitions, or no network. We need this because a droplet can contain an 'empty' networks JSON Object entry, instead of null.

Constructors

Networks 

Fields

v4 :: [Network V4]
 
v6 :: [Network V6]
 
NoNetworks 

Droplets Actions

data ActionResult Source

Type of action status This is returned when action is initiated or when status of some action is requested

data DNSType Source

Enumeration of possible DNS records types

Constructors

A 
CNAME 
TXT 
PTR 
SRV 
NS 
AAAA 
MX 

failParse :: (Show a1, Monad m) => a1 -> m a Source