-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A Digital Ocean client in Haskell
--
-- HDO is a client to Digital Ocean API. It can either be used as
-- a library embedded in other tools or as a command-line client
-- (docean).
@package hdo
@version 0.3
module Network.DO
type Command w a = FreeT (DO :+: (DropletCommands :+: (IPCommands :+: DomainCommands))) (RESTT w) a
type AuthToken = String
type Slug = String
type URI = String
newtype Error
Error :: String -> Error
[msg] :: Error -> String
type Result a = Either Error a
error :: String -> Result a
data ToolConfiguration
Tool :: Maybe URI -> Maybe AuthToken -> Bool -> ToolConfiguration
[slackUri] :: ToolConfiguration -> Maybe URI
[authToken] :: ToolConfiguration -> Maybe AuthToken
[quiet] :: ToolConfiguration -> Bool
-- | 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
data Region
Region :: String -> Slug -> [SizeSlug] -> Bool -> Region
[regionName] :: Region -> String
[regionSlug] :: Region -> Slug
[regionSizes] :: Region -> [SizeSlug]
[regionAvailable] :: Region -> Bool
RegionSlug :: Slug -> Region
NoRegion :: Region
-- | String representation of size slugs This maps to corresponding
-- expected JSON string value.
sizeSlugs :: [String]
-- | Enumeration of all possible size slugs
data SizeSlug
M512 :: SizeSlug
G1 :: SizeSlug
G2 :: SizeSlug
G4 :: SizeSlug
G8 :: SizeSlug
G16 :: SizeSlug
G32 :: SizeSlug
G48 :: SizeSlug
G64 :: SizeSlug
G96 :: SizeSlug
type ImageSlug = String
type KeyId = Int
defaultImage :: ImageSlug
data BoxConfiguration
BoxConfiguration :: String -> Region -> SizeSlug -> ImageSlug -> [KeyId] -> Bool -> BoxConfiguration
[configName] :: BoxConfiguration -> String
[boxRegion] :: BoxConfiguration -> Region
[size] :: BoxConfiguration -> SizeSlug
[configImageSlug] :: BoxConfiguration -> ImageSlug
[keys] :: BoxConfiguration -> [KeyId]
[backgroundCreate] :: BoxConfiguration -> Bool
type Id = Integer
data Mega
data Giga
-- | A type for various sizes Type parameter is used to define number's
-- magnitude
newtype Bytes a
Bytes :: Int -> Bytes a
[bytesSize] :: Bytes a -> Int
jsonBytes :: Int -> Parser (Bytes a)
newtype Date
Date :: UTCTime -> Date
[theDate] :: Date -> UTCTime
data Status
New :: Status
Active :: Status
Off :: Status
Archive :: Status
data NetType
Public :: NetType
Private :: NetType
-- | 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.
data Network a
NetworkV4 :: IP -> IP -> IP -> NetType -> Network a
[ip_address] :: Network a -> IP
[netmask] :: Network a -> IP
[gateway] :: Network a -> IP
[netType] :: Network a -> NetType
NetworkV6 :: IP -> Int -> IP -> NetType -> Network a
[ip_address] :: Network a -> IP
[netmask_v6] :: Network a -> Int
[gateway] :: Network a -> IP
[netType] :: Network a -> NetType
data V4
data V6
jsonNetwork :: (FromJSON a3, FromJSON a2, FromJSON a1, FromJSON a) => (a3 -> a2 -> a1 -> a -> b) -> Object -> Parser b
-- | 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.
data Networks
Networks :: [Network V4] -> [Network V6] -> Networks
[v4] :: Networks -> [Network V4]
[v6] :: Networks -> [Network V6]
NoNetworks :: Networks
-- | (Partial) Type of Droplets
--
-- https://developers.digitalocean.com/documentation/v2/#droplets
data Droplet
Droplet :: Id -> String -> Bytes Mega -> Int -> Bytes Giga -> Bool -> Date -> Status -> [Id] -> [Id] -> Region -> SizeSlug -> Networks -> Droplet
[dropletId] :: Droplet -> Id
[name] :: Droplet -> String
[memory] :: Droplet -> Bytes Mega
[vcpus] :: Droplet -> Int
[disk] :: Droplet -> Bytes Giga
[locked] :: Droplet -> Bool
[created_at] :: Droplet -> Date
[status] :: Droplet -> Status
[backup_ids] :: Droplet -> [Id]
[snapshot_ids] :: Droplet -> [Id]
[region] :: Droplet -> Region
[size_slug] :: Droplet -> SizeSlug
[networks] :: Droplet -> Networks
data ImageType
Snapshot :: ImageType
Temporary :: ImageType
Backup :: ImageType
-- | Type of droplet images
--
-- https://developers.digitalocean.com/documentation/v2/#images
data Image
Image :: Id -> String -> String -> Maybe Slug -> Bool -> [Region] -> Bytes Giga -> Date -> ImageType -> Image
[imageId] :: Image -> Id
[imageName] :: Image -> String
[distribution] :: Image -> String
[imageSlug] :: Image -> Maybe Slug
[publicImage] :: Image -> Bool
[imageRegions] :: Image -> [Region]
[min_disk_size] :: Image -> Bytes Giga
[image_created_at] :: Image -> Date
[imageType] :: Image -> ImageType
-- | Type of SSH Keys
--
-- https://developers.digitalocean.com/documentation/v2/#ssh-keys
data Key
Key :: Id -> String -> String -> String -> Key
[keyId] :: Key -> Id
[keyFingerprint] :: Key -> String
[publicKey] :: Key -> String
[keyName] :: Key -> String
type TransferRate = Double
type Price = Double
-- | Type of Size objects
--
-- https://developers.digitalocean.com/documentation/v2/#sizes
data Size
Size :: SizeSlug -> Bytes Mega -> Int -> Bytes Giga -> TransferRate -> Price -> Price -> [Region] -> Bool -> Size
[szSlug] :: Size -> SizeSlug
[szMemory] :: Size -> Bytes Mega
[szVcpus] :: Size -> Int
[szDisk] :: Size -> Bytes Giga
[szTransfer] :: Size -> TransferRate
[szPrice_Monthly] :: Size -> Price
[szPrice_Hourly] :: Size -> Price
[szRegions] :: Size -> [Region]
[szAvailable] :: Size -> Bool
-- | Type of action status This is returned when action is initiated or
-- when status of some action is requested
data ActionResult result
ActionResult :: Id -> ActionStatus -> result -> Maybe Date -> Maybe Date -> Id -> String -> Region -> ActionResult result
[actionId] :: ActionResult result -> Id
[actionStatus] :: ActionResult result -> ActionStatus
[actionType] :: ActionResult result -> result
[actionStartedAt] :: ActionResult result -> Maybe Date
[actionCompletedAt] :: ActionResult result -> Maybe Date
[actionResourceId] :: ActionResult result -> Id
[actionResourceType] :: ActionResult result -> String
[actionRegionSlug] :: ActionResult result -> Region
data ActionStatus
InProgress :: ActionStatus
Completed :: ActionStatus
Errored :: ActionStatus
data DropletActionType
PowerOff :: DropletActionType
PowerOn :: DropletActionType
MakeSnapshot :: DropletActionType
data Action
DoPowerOff :: Action
DoPowerOn :: Action
CreateSnapshot :: String -> Action
-- | Type of Domain zones
--
-- https://developers.digitalocean.com/documentation/v2/#domains
newtype DomainName
DomainName :: String -> DomainName
[domain] :: DomainName -> String
data Domain
Domain :: DomainName -> Maybe Int -> Maybe String -> Domain
[domainName] :: Domain -> DomainName
[domainTTL] :: Domain -> Maybe Int
[zone_file] :: Domain -> Maybe String
data DomainConfig
DomainConfig :: DomainName -> IP -> DomainConfig
-- | Enumeration of possible DNS records types
data DNSType
A :: DNSType
CNAME :: DNSType
TXT :: DNSType
PTR :: DNSType
SRV :: DNSType
NS :: DNSType
AAAA :: DNSType
MX :: DNSType
-- | Type of Domain zone file entries
--
--
-- https://developers.digitalocean.com/documentation/v2/#domain-records
data DomainRecord
DomainRecord :: Id -> DNSType -> String -> String -> Maybe Int -> Maybe Int -> Maybe Int -> DomainRecord
[recordId] :: DomainRecord -> Id
[recordType] :: DomainRecord -> DNSType
[recordName] :: DomainRecord -> String
[recordData] :: DomainRecord -> String
[recordPriority] :: DomainRecord -> Maybe Int
[recordPort] :: DomainRecord -> Maybe Int
[recordWeight] :: DomainRecord -> Maybe Int
parseRecord :: String -> Result DomainRecord
-- | Floating IPs
-- https://developers.digitalocean.com/documentation/v2/#floating-ips
data FloatingIP
FloatingIP :: IP -> Maybe Droplet -> Region -> FloatingIP
[floatingIp] :: FloatingIP -> IP
[floatingDroplet] :: FloatingIP -> Maybe Droplet
[floatingRegion] :: FloatingIP -> Region
data FloatingIPTarget
TargetRegion :: Slug -> FloatingIPTarget
TargetDroplet :: Id -> FloatingIPTarget
data IPAction
AssignIP :: Id -> IPAction
UnassignIP :: IPAction
data IPActionType
Assign :: IPActionType
Unassign :: IPActionType
failParse :: (Show a1, Monad m) => a1 -> m a
listKeys :: (Monad w) => Command w [Key]
listSizes :: (Monad w) => Command w [Size]
listRegions :: (Monad w) => Command w [Region]
listImages :: (Monad w) => Command w [Image]
listDroplets :: (Monad w) => Command w [Droplet]
createDroplet :: (Monad w) => BoxConfiguration -> Command w (Either Error Droplet)
showDroplet :: (Monad w) => Integer -> Command w (Either Error Droplet)
destroyDroplet :: (Monad w) => Integer -> Command w (Maybe String)
dropletAction :: (Monad w) => Id -> Action -> Command w (Result (ActionResult DropletActionType))
dropletConsole :: (Monad w) => Droplet -> Command w (Result ())
getAction :: (Monad w) => Id -> Id -> Command w (Result (ActionResult DropletActionType))
listDropletSnapshots :: (Monad w) => Id -> Command w [Image]
listFloatingIPs :: (Monad w) => Command w [FloatingIP]
createFloatingIP :: (Monad w) => FloatingIPTarget -> Command w (Result FloatingIP)
deleteFloatingIP :: (Monad w) => IP -> Command w (Maybe String)
assignFloatingIP :: (Monad w) => IP -> Id -> Command w (Result (ActionResult IPActionType))
unassignFloatingIP :: (Monad w) => IP -> Command w (Result (ActionResult IPActionType))
listDomains :: (Monad w) => Command w [Domain]
createDomain :: (Monad w) => DomainName -> IP -> Command w (Result Domain)
deleteDomain :: (Monad w) => DomainName -> Command w (Maybe String)
listRecords :: (Monad w) => DomainName -> Command w [DomainRecord]
createRecord :: (Monad w) => DomainName -> DomainRecord -> Command w (Result DomainRecord)
deleteRecord :: (Monad w) => DomainName -> Id -> Command w (Maybe String)
-- | Run DO actions, extracting authentication token from environment
-- variable AUTH_TOKEN.
runDOEnv :: Command IO a -> IO a
-- | Run DO actions, passing a built authentication token.
runDO :: Command IO a -> Maybe AuthToken -> IO a
getAuthFromEnv :: IO (Maybe AuthToken)
outputResult :: (Pretty a, MonadIO m) => a -> m ()
generateName :: IO String
-- | Lookup (first) public IP for given Droplet, if any.
publicIP :: Droplet -> Maybe IP
-- | Find the first droplet that matches given Id or name
findByIdOrName :: String -> [Droplet] -> [Droplet]