podman-0.1.0.0: A podman remote client library
Copyright(c) 2021 Red Hat
LicenseApache-2.0
MaintainerTristan de Cacqueray <tdecacqu@redhat.com>
Safe HaskellNone
LanguageHaskell2010

Podman

Description

See Podman.Tutorial to learn how to use this library.

Here is the recommended way to import this library:

{-# LANGUAGE OverloadedStrings #-}

import Podman

This module re-exports the rest of the library.

Podman.Types provides data types generated from the swagger definitions.

Podman.Internal provides utility function to further decode API response. Internal is exposed for testing purpose and it shouldn't be used.

Synopsis

Client

data PodmanClient #

Use withClient to create the PodmanClient

withClient #

Arguments

:: MonadIO m 
=> Text

The api url, can be "http+unix://var/run/podman.sock" or "https://localhost:9000"

-> (PodmanClient -> m a)

The callback

-> m a

withClient performs the IO

type Result a = Either Error a #

Action result

Server

getVersion :: MonadIO m => PodmanClient -> m (Result Version) #

Returns the Component Version information

Container

newtype ContainerName #

Constructors

ContainerName Text 

Instances

Instances details
Eq ContainerName # 
Instance details

Defined in Podman.Api

Show ContainerName # 
Instance details

Defined in Podman.Api

containerExists #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Result Bool) 

Quick way to determine if a container exists by name or ID

containerInspect #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> Bool

Get filesystem usage

-> m (Result InspectContainerResponse) 

Return low-level information about a container.

containerList #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerListQuery

The list query, uses defaultContainerListQuery

-> m (Result [ListContainer]) 

Returns a list of containers

data WaitCondition #

Instances

Instances details
Eq WaitCondition # 
Instance details

Defined in Podman.Api

Show WaitCondition # 
Instance details

Defined in Podman.Api

containerWait :: MonadIO m => PodmanClient -> ContainerName -> WaitCondition -> m (Either Error Int) #

Wait on a container to met a given condition

mkSpecGenerator #

Arguments

:: Text

image

-> SpecGenerator 

Creates a SpecGenerator by setting all the optional attributes to Nothing

containerStart #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> Maybe Text

Override the key sequence for detaching a container.

-> m (Maybe Error) 

Start a container

containerDelete #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> Maybe Bool

Force delete

-> Maybe Bool

Delete volumes

-> m (Maybe Error) 

Delete container

containerKill #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> Maybe Text

Signal to be sent to container, (default TERM)

-> m (Maybe Error) 

Send a signal to a container, defaults to killing the container

containerMount #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Either Error FilePath) 

Mount a container to the filesystem

containerPause #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Maybe Error) 

Use the cgroups freezer to suspend all processes in a container.

containerUnpause #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Maybe Error) 

Unpause Container

containerRename #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> ContainerName

New name for the container

-> m (Maybe Error) 

Change the name of an existing container.

containerRestart #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> Maybe Word

Timeout before sending kill signal to container

-> m (Maybe Error) 

Restart a container

containerSendFiles #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> [Entry]

List of tar entries

-> Text

Path to a directory in the container to extract

-> Maybe Bool

Pause the container while copying (defaults to true)

-> m (Maybe Error) 

Copy a tar archive of files into a container

containerGetFiles #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> Text

Path to a directory in the container to extract

-> m (Result (Entries FormatError)) 

Get a tar archive of files from a container

containerAttach #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> AttachQuery

The attach query, use defaultAttachQuery

-> (ContainerConnection -> IO a)

The callback

-> m (Result a) 

Hijacks the connection to forward the container's standard streams to the client.

containerChanges #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Result [ContainerChange]) 

Report on changes to container's filesystem; adds, deletes or modifications.

containerInitialize #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Maybe Error) 

Performs all tasks necessary for initializing the container but does not start the container.

containerExport #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> m (Result (Entries FormatError)) 

Export the contents of a container as a tarball.

containerLogs #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> LogStream

The log to stream

-> LogsQuery

The logs query, use defaultLogsQuery

-> (ContainerOutput -> IO ())

The callback

-> m (Maybe Error) 

data LogStream #

Get stdout and stderr logs from a container.

Constructors

LogStdout 
LogStderr 
LogBoth 

Instances

Instances details
Eq LogStream # 
Instance details

Defined in Podman.Api

Show LogStream # 
Instance details

Defined in Podman.Api

data ContainerConnection #

A connection attached to a container. Note that full-duplex communication may require async threads because the http-client doesn't seems to expose aio (e.g. Connection doesn't have a fd, only a recv call)

data ContainerOutput #

A container output

Instances

Instances details
Eq ContainerOutput # 
Instance details

Defined in Podman.Api

Show ContainerOutput # 
Instance details

Defined in Podman.Api

Exec

newtype ExecId #

Constructors

ExecId Text 

Instances

Instances details
Eq ExecId # 
Instance details

Defined in Podman.Api

Methods

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

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

Show ExecId # 
Instance details

Defined in Podman.Api

execCreate #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

The container name

-> ExecConfig

The exec config

-> m (Result ExecId) 

Create an exec instance

execInspect #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ExecId

Exec instance ID

-> m (Result ExecInspectResponse) 

Inspect an exec instance

execStart #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ExecId

Exec instance ID

-> m (Result [ContainerOutput]) 

Start an exec instance

Pod

generateKubeYAML #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> [ContainerName]

List of name or ID of the container or pod.

-> Bool

Generate YAML for a Kubernetes service object.

-> m (Result Text) 

Generate a Kubernetes YAML file.

generateSystemd #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ContainerName

Name or ID of the container or pod.

-> GenerateSystemdQuery

Systemd configuration.

-> m (Result (Map Text Text)) 

Generate Systemd Units based on a pod or container.

Image

newtype ImageName #

Constructors

ImageName Text 

Instances

Instances details
Eq ImageName # 
Instance details

Defined in Podman.Api

Show ImageName # 
Instance details

Defined in Podman.Api

imageExists #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ImageName

The image name

-> m (Result Bool) 

Check if image exists in local store.

imageList #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ImageListQuery

The list query, use defaultImageListQuery

-> m (Result [ImageSummary]) 

Returns a list of images on the server.

imageTree #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ImageName

The image name

-> Maybe Bool

Show all child images and layers of the specified image

-> m (Result ImageTreeResponse) 

Retrieve the image tree for the provided image name or ID

imagePull #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ImagePullQuery

The pull query, use mkImagePullQuery

-> m (Result [ImageName]) 

Pull one or more images from a container registry.

imagePullRaw #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> ImagePullQuery

The pull query, use mkImagePullQuery

-> m (Result ImagesPullResponse) 

Pull one or more images from a container registry with the full results.

Network

newtype NetworkName #

Constructors

NetworkName Text 

Instances

Instances details
Eq NetworkName # 
Instance details

Defined in Podman.Api

Show NetworkName # 
Instance details

Defined in Podman.Api

networkExists #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> NetworkName

The network name

-> m (Maybe Error)

Returns Nothing when the network exists

Check if network exists in local store.

networkList #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> Maybe Text

JSON encoded value of the filters (a map[string][]string) to process on the network list.

-> m (Result [NetworkListReport]) 

Returns a list of networks on the server.

Volume

newtype VolumeName #

Constructors

VolumeName Text 

Instances

Instances details
Eq VolumeName # 
Instance details

Defined in Podman.Api

Show VolumeName # 
Instance details

Defined in Podman.Api

volumeExists #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> VolumeName

The volume name

-> m (Maybe Error)

Returns Nothing when the volume exists

Check if volume exists in local store.

volumeList #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> Maybe Text

JSON encoded value of the filters (a map[string][]string) to process on the volume list.

-> m (Result [Volume]) 

Returns a list of volumes on the server.

Secret

newtype SecretName #

Constructors

SecretName Text 

Instances

Instances details
Eq SecretName # 
Instance details

Defined in Podman.Api

Show SecretName # 
Instance details

Defined in Podman.Api

secretList #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> m (Result [SecretInfoReport]) 

Returns a list of secrets

secretCreate #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> SecretName

The secret name

-> ByteString

The secret data

-> m (Result SecretCreateResponse) 

secretInspect #

Arguments

:: MonadIO m 
=> PodmanClient

The client instance

-> SecretName

The secret name

-> m (Result SecretInfoReport) 

Inspect a secret.

re-exports

data Text #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Text -> Int #

hash :: Text -> Int #

ToJSON Text 
Instance details

Defined in Data.Aeson.Types.ToJSON

KeyValue Object

Constructs a singleton HashMap. For calling functions that demand an Object for constructing objects. To be used in conjunction with mconcat. Prefer to use object where possible.

Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

(.=) :: ToJSON v => Text -> v -> Object #

KeyValue Pair 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

(.=) :: ToJSON v => Text -> v -> Pair #

ToJSONKey Text 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON Text 
Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey Text 
Instance details

Defined in Data.Aeson.Types.FromJSON

Chunk Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

Associated Types

type ChunkElem Text #

FoldCase Text 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

foldCase :: Text -> Text #

foldCaseList :: [Text] -> [Text]

FromPairs Value (DList Pair) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

fromPairs :: DList Pair -> Value

v ~ Value => KeyValuePair v (DList Pair) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

pair :: String -> v -> DList Pair

type State Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

type State Text = Buffer
type ChunkElem Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char