-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A client library for the DigitalOcean API
--
-- A client library for the DigitalOcean API
@package DigitalOcean
@version 0.1.0.0
module Net.DigitalOcean.Config
data Config
Config :: !Text -> Config
_confAuth :: Config -> !Text
confAuth :: Iso' Config Text
-- | Generate a Wreq Options instance from the given Config.
-- Can be further modified to set additional parameters, headers, etc
options :: Config -> Options
instance Show Config
instance Eq Config
module Net.DigitalOcean.Request
-- | Send a GET request to the given endpoint, and parse the result via
-- handleResp
get :: (FromJSON a, Error e, MonadError e m, MonadIO m) => String -> String -> Config -> m a
-- | Send a POST request to the given endpoint, and parse the result via
-- handleResp
post :: (ToJSON a, FromJSON b, Error e, MonadError e m, MonadIO m) => String -> String -> a -> Config -> m b
-- | Send a PUT request to the given endpoint, and parse the result via
-- handleResp
put :: (ToJSON a, FromJSON b, Error e, MonadError e m, MonadIO m) => String -> String -> a -> Config -> m b
-- | Send a DELETE request to the given endpoint, and parse the result via
-- handleResp
delete :: (Error e, MonadError e m, MonadIO m) => String -> Config -> m ()
-- | Given a raw response, extract the json element "key", and then parse.
-- Also error should the status code != 2xx
handleResp :: (FromJSON a, Error e, MonadError e m, MonadIO m) => String -> Response ByteString -> m a
-- | Get the url for an endpoint
url :: String -> String
instance Show ResponseError
instance Eq ResponseError
instance Generic ResponseError
instance Datatype D1ResponseError
instance Constructor C1_0ResponseError
instance Selector S1_0_0ResponseError
instance Selector S1_0_1ResponseError
instance FromJSON ResponseError
module Net.DigitalOcean.Actions
-- | An action that has be taken on a DigitalOcean resource
data Action
Action :: !Int -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> Action
_actId :: Action -> !Int
_actStatus :: Action -> !Text
_actType :: Action -> !Text
_actStartedAt :: Action -> !Text
_actCompletedAt :: Action -> !Text
_actResourceId :: Action -> !Text
_actResourceType :: Action -> !Text
_actRegion :: Action -> !Text
-- | List all actions performed on the account
--
-- DO documentation
getActions :: (Error e, MonadError e m, MonadIO m) => Config -> m [Action]
-- | Get a single action performed on the account
--
-- DO documentation
getAction :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m Action
actId :: Lens' Action Int
actStatus :: Lens' Action Text
actType :: Lens' Action Text
actStartedAt :: Lens' Action Text
actCompletedAt :: Lens' Action Text
actResourceId :: Lens' Action Text
actResourceType :: Lens' Action Text
actRegion :: Lens' Action Text
instance FromJSON Action
instance Show Action
instance Eq Action
module Net.DigitalOcean.Regions
-- | A Digital Ocean region
data Region
Region :: !Text -> !Text -> ![Text] -> ![Text] -> !Bool -> Region
_rgnName :: Region -> !Text
_rgnSlug :: Region -> !Text
_rgnSizes :: Region -> ![Text]
_rgnFeatures :: Region -> ![Text]
_rgnAvailable :: Region -> !Bool
-- | Returns a list of all the visible Digital Ocean regions
--
-- DO documentation
getRegions :: (Error e, MonadError e m, MonadIO m) => Config -> m [Region]
rgnName :: Lens' Region Text
rgnSlug :: Lens' Region Text
rgnSizes :: Lens' Region [Text]
rgnFeatures :: Lens' Region [Text]
rgnAvailable :: Lens' Region Bool
instance FromJSON Region
instance Show Region
instance Eq Region
module Net.DigitalOcean.Sizes
-- | A potential size of a Digital Ocean droplet
data Size
Size :: !Text -> !Int -> !Double -> !Double -> !Int -> !Int -> !Int -> ![Text] -> Size
_szSlug :: Size -> !Text
_szTransfer :: Size -> !Int
_szPriceMonthly :: Size -> !Double
_szPriceHourly :: Size -> !Double
_szMemory :: Size -> !Int
_szVCPUs :: Size -> !Int
_szDisk :: Size -> !Int
_szRegions :: Size -> ![Text]
-- | List all potential sizes
--
-- DO documentation
getSizes :: (Error e, MonadError e m, MonadIO m) => Config -> m [Size]
szSlug :: Lens' Size Text
szTransfer :: Lens' Size Int
szPriceMonthly :: Lens' Size Double
szPriceHourly :: Lens' Size Double
szMemory :: Lens' Size Int
szVCPUs :: Lens' Size Int
szDisk :: Lens' Size Int
szRegions :: Lens' Size [Text]
instance FromJSON Size
instance Show Size
instance Eq Size
module Net.DigitalOcean.Images
-- | A Digital Ocean image
data Image
Image :: !Int -> !Text -> !Text -> Maybe Text -> !Bool -> ![Text] -> !Text -> !Int -> Image
_imgId :: Image -> !Int
_imgName :: Image -> !Text
_imgDist :: Image -> !Text
_imgSlug :: Image -> Maybe Text
_imgPublic :: Image -> !Bool
_imgRegions :: Image -> ![Text]
_imgCreatedAt :: Image -> !Text
_imgMinDiskSize :: Image -> !Int
-- | List all images availible to the account
--
-- DO documentation
getImages :: (Error e, MonadError e m, MonadIO m) => Config -> m [Image]
-- | List all distribution images availible to the account
--
-- DO documentation
getDistributionImages :: (Error e, MonadError e m, MonadIO m) => Config -> m [Image]
-- | List all application images availible to the account
--
-- DO documentation
getApplicationImages :: (Error e, MonadError e m, MonadIO m) => Config -> m [Image]
-- | Get the image with the given ID/slug
--
-- DO documentation
getImage :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m Image
-- | Rename an image
--
-- DO documentation
renameImage :: (Error e, MonadError e m, MonadIO m) => Text -> Text -> Config -> m Image
-- | Delete an image
--
-- DO documentation
deleteImage :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m ()
-- | Transfer an image to another region
--
-- DO documentation
transferImage :: (Error e, MonadError e m, MonadIO m) => Text -> Text -> Config -> m Action
imgId :: Lens' Image Int
imgName :: Lens' Image Text
imgDist :: Lens' Image Text
imgSlug :: Lens' Image (Maybe Text)
imgPublic :: Lens' Image Bool
imgRegions :: Lens' Image [Text]
imgCreatedAt :: Lens' Image Text
imgMinDiskSize :: Lens' Image Int
instance FromJSON Image
instance Show Image
instance Eq Image
module Net.DigitalOcean.SSHKeys
-- | An SSH public key stored by Digital Ocean
data SSHKey
SSHKey :: !Int -> !Text -> !Text -> !Text -> SSHKey
_keyId :: SSHKey -> !Int
_keyFingerprint :: SSHKey -> !Text
_keyPublicKey :: SSHKey -> !Text
_keyName :: SSHKey -> !Text
-- | Returns all SSH keys associated with the account
--
-- DO documentation
getSSHKeys :: (Error e, MonadError e m, MonadIO m) => Config -> m [SSHKey]
-- | Returns the ssh key with the given id or fingerprint
--
-- DO documentation
getSSHKey :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m SSHKey
-- | Creates a new SSH key with the given name and contents
--
-- DO documentation
createSSHKey :: (Error e, MonadError e m, MonadIO m) => Text -> Text -> Config -> m SSHKey
-- | Renames an existing SSH key
--
-- DO documentation
renameSSHKey :: (Error e, MonadError e m, MonadIO m) => Text -> Text -> Config -> m SSHKey
-- | Deletes an SSH key
--
-- DO documentation
deleteSSHKey :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m ()
keyId :: Lens' SSHKey Int
keyFingerprint :: Lens' SSHKey Text
keyPublicKey :: Lens' SSHKey Text
keyName :: Lens' SSHKey Text
instance FromJSON SSHKey
instance Show SSHKey
instance Eq SSHKey
instance Generic SSHKey
instance Datatype D1SSHKey
instance Constructor C1_0SSHKey
instance Selector S1_0_0SSHKey
instance Selector S1_0_1SSHKey
instance Selector S1_0_2SSHKey
instance Selector S1_0_3SSHKey
module Net.DigitalOcean.Droplets
data Network
data Kernel
data Droplet
data Snapshot
data Backup
-- | The various actions that can be performed on a droplet
--
-- DO documentation
data DropletAction
DisableBackups :: DropletAction
Reboot :: DropletAction
PowerCycle :: DropletAction
Shutdown :: DropletAction
PowerOff :: DropletAction
PowerOn :: DropletAction
Restore :: DropletAction
PasswordReset :: DropletAction
Resize :: !Text -> DropletAction
Rebuild :: !Text -> DropletAction
Rename :: !Text -> DropletAction
ChangeKernel :: !Int -> DropletAction
EnableIpv6 :: DropletAction
EnablePrivateNetworking :: DropletAction
SnapshotDrp :: !Text -> DropletAction
Upgrade :: DropletAction
data DropletCreationOpts
createDroplet :: (Error e, MonadError e m, MonadIO m) => DropletCreationOpts -> Config -> m Droplet
getDroplet :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m Droplet
getDroplets :: (Error e, MonadError e m, MonadIO m) => Config -> m [Droplet]
getDropletKernels :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m [Kernel]
getDropletSnapshots :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m [Snapshot]
getDropletBackups :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m [Backup]
getDropletActions :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m [Action]
deleteDroplet :: (Error e, MonadError e m, MonadIO m) => Text -> Config -> m ()
-- | Perform an action on the droplet with the given ID
performDropletAction :: (Error e, MonadError e m, MonadIO m) => Text -> DropletAction -> Config -> m Action
-- | Creates a basic Droplet creation options object with ipv6 and private
-- networking enabled, and without backups, user data or ssh keys.
--
-- Can and should be further modified before passing to
-- createDroplet
defaultDCO :: Text -> Text -> Text -> Text -> DropletCreationOpts
netProto :: Lens' Network Text
netIpAddr :: Lens' Network Text
netNetmask :: Lens' Network Text
netGateway :: Lens' Network Text
netType :: Lens' Network Text
krnId :: Lens' Kernel Text
krnName :: Lens' Kernel Text
krnVersion :: Lens' Kernel Text
drpId :: Lens' Droplet Int
drpName :: Lens' Droplet Text
drpMemory :: Lens' Droplet Int
drpVCPUs :: Lens' Droplet Int
drpDisk :: Lens' Droplet Int
drpLocked :: Lens' Droplet Bool
drpCreatedAt :: Lens' Droplet Text
drpStatus :: Lens' Droplet Text
drpBackupIds :: Lens' Droplet [Text]
drpSnapshotIds :: Lens' Droplet [Text]
drpFeatures :: Lens' Droplet [Text]
drpRegion :: Lens' Droplet Region
drpImage :: Lens' Droplet Image
drpNetworks :: Lens' Droplet [Network]
drpKernel :: Lens' Droplet Kernel
snpId :: Lens' Snapshot Int
snpName :: Lens' Snapshot Text
snpDist :: Lens' Snapshot Text
snpSlug :: Lens' Snapshot (Maybe Text)
snpPublic :: Lens' Snapshot Bool
snpRegions :: Lens' Snapshot [Text]
bckId :: Lens' Backup Int
bckName :: Lens' Backup Text
bckDist :: Lens' Backup Text
bckSlug :: Lens' Backup (Maybe Text)
bckPublic :: Lens' Backup Bool
bckRegions :: Lens' Backup [Text]
dcoName :: Lens' DropletCreationOpts Text
dcoRegion :: Lens' DropletCreationOpts Text
dcoSize :: Lens' DropletCreationOpts Text
dcoImage :: Lens' DropletCreationOpts Text
dcoSSHKeys :: Lens' DropletCreationOpts (Maybe [Text])
dcoBackups :: Lens' DropletCreationOpts Bool
dcoIpv6 :: Lens' DropletCreationOpts Bool
dcoPrivateNetworking :: Lens' DropletCreationOpts Bool
dcoUserData :: Lens' DropletCreationOpts (Maybe Text)
instance ToJSON DropletAction
instance ToJSON DropletCreationOpts
instance Show DropletCreationOpts
instance Eq DropletCreationOpts
instance FromJSON Backup
instance Show Backup
instance Eq Backup
instance FromJSON Snapshot
instance Show Snapshot
instance Eq Snapshot
instance FromJSON Droplet
instance Show Droplet
instance Eq Droplet
instance FromJSON Kernel
instance Show Kernel
instance Eq Kernel
instance FromJSON [Network]
instance Show Network
instance Eq Network
module Net.DigitalOcean