hdo-0.4: A Digital Ocean client in Haskell

Safe HaskellNone
LanguageHaskell2010

Network.DO

Contents

Synopsis

Types

type Command w a = FreeT (DO :+: (DropletCommands :+: (IPCommands :+: DomainCommands))) (RESTT w) a Source #

newtype Error Source #

Constructors

Error 

Fields

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.

type KeyId = Int Source #

newtype Bytes a Source #

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

Constructors

Bytes 

Fields

newtype Date Source #

Constructors

Date 

Fields

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

NetworkV6 

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

NoNetworks 

Instances

Droplets Actions

data ActionResult result Source #

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

Instances

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 #

Generic Commands

Droplets Commands

Floating IPs Commands

Domains Commands

Utilities

runDOEnv :: Command IO a -> IO a Source #

Run DO actions, extracting authentication token from environment variable AUTH_TOKEN.

runDO :: Command IO a -> Maybe AuthToken -> IO a Source #

Run DO actions, passing a built authentication token.

runDODebug :: Command IO a -> Maybe AuthToken -> IO a Source #

Run DO actions, debugging requests, passing a built authentication token.

outputResult :: (Pretty a, MonadIO m) => a -> m () Source #

publicIP :: Droplet -> Maybe IP Source #

Lookup (first) public IP for given Droplet, if any.

findByIdOrName :: String -> [Droplet] -> [Droplet] Source #

Find the first droplet that matches given Id or name