lxd-client-0.1.0.6: LXD client written in Haskell.

Safe HaskellNone
LanguageHaskell2010

Network.LXD.Client.Types

Contents

Description

This module implements all types used to communicate with the LXD daemon REST end-point.

These types are e.g. used in the Network.LXD.Client.Commands module.

Synopsis

Generic responses

data GenericResponse op a #

Generic LXD API response object.

Instances

type Response a = GenericResponse String a #

LXD API synchronous repsonse object, without resulting operation.

type AsyncResponse a = GenericResponse OperationId (BackgroundOperation a) #

LXD API asynchronous response object, with resulting operation

Background operations

API

data ApiConfig #

LXD API configuration object.

Returend when querying GET /1.0. Some objects may not be present if an untrusted requeset was made.

newtype ApiVersion #

LXD API version string, e.g. 1.0.

Constructors

ApiVersion String 

Certificates

Containers

Querying information

Configuration

newtype ContainerRename #

Used to rename a container to the given name.

Used when querying POST /1.0/containers/<name>.

Constructors

ContainerRename String 

State

Creating containers

data ContainerSource #

Source for creating a container, as used by ContainerCreateRequest.

Constructors

ContainerSourceLocalByAlias LocalImageByAlias

Container based on a local image with a certain alias.

ContainerSourceLocalByFingerprint LocalImageByFingerprint

Container based on a local image with a certain alias.

ContainerSourceNone

Container without a pre-populated rootfs.

ContainerSourceRemote RemoteImage

Continer based on a public remote image.

Deleting containers

Executing commands

data ExecParams #

Configuration parameter to ExecRequest and ExecResponse.

Constructors

ExecImmediate

Don't wait for a websocket connection before executing.

ExecWebsocketInteractive

Wait for websocket, allocate PTY.

ExecWebsocketNonInteractive

Wait for websocket, don't allocate PTY.

type ExecResponseMetadataImmediate = Value #

Metadata of an immediate exec response.

Returned when querying POST /1.0/containers/<name>/exec with ExecImmediate as configuration.

Working with file descriptors

newtype Secret #

A secret used to connect to a websocket.

Constructors

Secret String 

data FdSet #

A set of selected file descriptors.

Constructors

FdAll 
FdPty 

Instances

data Fds set where #

A set of file descriptors.

Constructors

FdsAll :: {..} -> Fds FdAll 
FdsPty :: {..} -> Fds FdPty 

Instances

type family ExecFds (params :: ExecParams) :: FdSet where ... #

Type family converting an ExecParams to an FdSet.

Working with files

newtype Gid #

Group ID of a container file.

Constructors

Gid Int 

Instances

Bounded Gid # 

Methods

minBound :: Gid #

maxBound :: Gid #

Enum Gid # 

Methods

succ :: Gid -> Gid #

pred :: Gid -> Gid #

toEnum :: Int -> Gid #

fromEnum :: Gid -> Int #

enumFrom :: Gid -> [Gid] #

enumFromThen :: Gid -> Gid -> [Gid] #

enumFromTo :: Gid -> Gid -> [Gid] #

enumFromThenTo :: Gid -> Gid -> Gid -> [Gid] #

Eq Gid # 

Methods

(==) :: Gid -> Gid -> Bool #

(/=) :: Gid -> Gid -> Bool #

Integral Gid # 

Methods

quot :: Gid -> Gid -> Gid #

rem :: Gid -> Gid -> Gid #

div :: Gid -> Gid -> Gid #

mod :: Gid -> Gid -> Gid #

quotRem :: Gid -> Gid -> (Gid, Gid) #

divMod :: Gid -> Gid -> (Gid, Gid) #

toInteger :: Gid -> Integer #

Num Gid # 

Methods

(+) :: Gid -> Gid -> Gid #

(-) :: Gid -> Gid -> Gid #

(*) :: Gid -> Gid -> Gid #

negate :: Gid -> Gid #

abs :: Gid -> Gid #

signum :: Gid -> Gid #

fromInteger :: Integer -> Gid #

Ord Gid # 

Methods

compare :: Gid -> Gid -> Ordering #

(<) :: Gid -> Gid -> Bool #

(<=) :: Gid -> Gid -> Bool #

(>) :: Gid -> Gid -> Bool #

(>=) :: Gid -> Gid -> Bool #

max :: Gid -> Gid -> Gid #

min :: Gid -> Gid -> Gid #

Read Gid # 
Real Gid # 

Methods

toRational :: Gid -> Rational #

Show Gid # 

Methods

showsPrec :: Int -> Gid -> ShowS #

show :: Gid -> String #

showList :: [Gid] -> ShowS #

ToHttpApiData Gid # 
FromHttpApiData Gid # 

newtype Uid #

User ID of a container file.

Constructors

Uid Int 

Instances

Bounded Uid # 

Methods

minBound :: Uid #

maxBound :: Uid #

Enum Uid # 

Methods

succ :: Uid -> Uid #

pred :: Uid -> Uid #

toEnum :: Int -> Uid #

fromEnum :: Uid -> Int #

enumFrom :: Uid -> [Uid] #

enumFromThen :: Uid -> Uid -> [Uid] #

enumFromTo :: Uid -> Uid -> [Uid] #

enumFromThenTo :: Uid -> Uid -> Uid -> [Uid] #

Eq Uid # 

Methods

(==) :: Uid -> Uid -> Bool #

(/=) :: Uid -> Uid -> Bool #

Integral Uid # 

Methods

quot :: Uid -> Uid -> Uid #

rem :: Uid -> Uid -> Uid #

div :: Uid -> Uid -> Uid #

mod :: Uid -> Uid -> Uid #

quotRem :: Uid -> Uid -> (Uid, Uid) #

divMod :: Uid -> Uid -> (Uid, Uid) #

toInteger :: Uid -> Integer #

Num Uid # 

Methods

(+) :: Uid -> Uid -> Uid #

(-) :: Uid -> Uid -> Uid #

(*) :: Uid -> Uid -> Uid #

negate :: Uid -> Uid #

abs :: Uid -> Uid #

signum :: Uid -> Uid #

fromInteger :: Integer -> Uid #

Ord Uid # 

Methods

compare :: Uid -> Uid -> Ordering #

(<) :: Uid -> Uid -> Bool #

(<=) :: Uid -> Uid -> Bool #

(>) :: Uid -> Uid -> Bool #

(>=) :: Uid -> Uid -> Bool #

max :: Uid -> Uid -> Uid #

min :: Uid -> Uid -> Uid #

Read Uid # 
Real Uid # 

Methods

toRational :: Uid -> Rational #

Show Uid # 

Methods

showsPrec :: Int -> Uid -> ShowS #

show :: Uid -> String #

showList :: [Uid] -> ShowS #

ToHttpApiData Uid # 
FromHttpApiData Uid # 

data RawFileResponse #

Raw file response, not yet decoded, used because of a bug in Servant.

Use headers to get actual content type.

fileResponse :: FileType -> ByteString -> Either String FileResponse #

Construct a file response from a type and a ByteString.

data FileResponse #

LXD file response object, representing either a file or a directory.

Used by the GET /1.0/containers/<name>/files/<filename> endpoints.

data PathResponse #

LXD path response object, which is a file and metadata.

Used by the /1.0/containers/<name>/files/... endpoints.

Referencing containers

newtype LocalContainer #

Reference to a local container, as used by ImageSource.

Images

Querying information

data ImageAlias #

Alias of an image.

Returned when querying GET /1.0/images/aliases/<name>, and as a part of GET /1.0/images/<fingerprint>.

defaultImageAlias :: String -> ImageAlias #

Create a default ImageAlias, with empty description and target.

Creating and publishing new images

Deleting images

data ImageDeleteRequest #

LXD image delete request object.

Used when querying DELETE /1.0/images/<fingerprint>.

Constructors

ImageDeleteRequest 

Referencing images

newtype LocalImageByFingerprint #

Source for a local image, specified by its fingerprint

remoteImage :: String -> ImageAliasName -> RemoteImage #

Create a remote image reference form a public remote.

remoteImageId :: String -> ImageId -> RemoteImage #

Create a remote image reference form a public remote, using an image ID.

Networks

data Network #

LXD network.

Returned when querying GET /1.0/networks/<name>.

Profiles

data Profile #

LXD profile.

Returned by GET /1.0/profiles/<name>.

Storage

data Pool #

LXD pool.

Returned by GET /1.0/storage-pools/<name>.

Instances

Volumes

type VolumeType = String #

Type of a volume.

data VolumeName #

LXD volume name, and its type.

Returned by GET /1.0/storage-pools/<name>/volumes.

data Volume #

LXD volume.

Returend by GET /1.0/storage-pools/<name>/volumes/<type>/<volume>.

Operations

type OperationStatus = String #

LXD operation status.

newtype OperationProgress #

Progress of an LXD operation.

You can try to decode operationMetadata if the operationStatusCode is SRunning to see of the operation contains progress information.

The embedded String value is in the format 87% (12.04 MB/s).

Events

data Event #

An event received from /1.0/events.

Servant Helpers