influxdb-0.2.0: Haskell client library for InfluxDB

Safe HaskellNone

Database.InfluxDB.Http

Contents

Synopsis

Documentation

data Config Source

Configurations for HTTP API client.

data Credentials Source

User credentials.

Constructors

Credentials 

Fields

credsUser :: !Text
 
credsPassword :: !Text
 

Instances

rootCreds :: CredentialsSource

Default credentials.

data Server Source

Server location.

Constructors

Server 

Fields

serverHost :: !Text

Hostname or IP address

serverPort :: !Int
 
serverSsl :: !Bool

SSL is enabled or not in the server side

Instances

localServer :: ServerSource

Default server location.

Writing Data

Updating Points

post :: Config -> Text -> SeriesT IO a -> IO aSource

Post a bunch of writes for (possibly multiple) series into a database.

postWithPrecisionSource

Arguments

:: Config 
-> Text

Database name

-> TimePrecision 
-> SeriesT IO a 
-> IO a 

Post a bunch of writes for (possibly multiple) series into a database like post but with time precision.

data SeriesT m a Source

Monad transformer to batch up multiple writes of series to speed up insertions.

data PointT p m a Source

Monad transformer to batch up multiple writes of points to speed up insertions.

Instances

writeSeriesSource

Arguments

:: (Monad m, ToSeriesData a) 
=> Text

Series name

-> a

Series data

-> SeriesT m () 

Write a single series data.

withSeriesSource

Arguments

:: forall m a . (Monad m, ToSeriesData a) 
=> Text

Series name

-> PointT a m () 
-> SeriesT m () 

Write a bunch of data for a single series. Columns for the points don't need to be specified because they can be inferred from the type of a.

writePoints :: (Monad m, ToSeriesData a) => a -> PointT a m ()Source

Write a data into a series.

Deleting Points

One Time Deletes (not implemented)

Regularly Scheduled Deletes (not implemented)

Querying Data

querySource

Arguments

:: FromSeries a 
=> Config 
-> Text

Database name

-> Text

Query text

-> IO [a] 

Query a specified database.

The query format is specified in the InfluxDB Query Language.

data Stream m a Source

Effectful stream

Constructors

Yield a (m (Stream m a))

Yield a value. The stream will be continued.

Done

The end of the stream.

queryChunkedSource

Arguments

:: FromSeries a 
=> Config 
-> Text

Database name

-> Text

Query text

-> (Stream IO a -> IO b)

Action to handle the resulting stream of series

-> IO b 

Query a specified database like query but in a streaming fashion.

Administration & Security

Creating and Dropping Databases

listDatabases :: Config -> IO [Database]Source

List existing databases.

createDatabase :: Config -> Text -> IO ()Source

Create a new database. Requires cluster admin privileges.

dropDatabaseSource

Arguments

:: Config 
-> Text

Database name

-> IO () 

Drop a database. Requires cluster admin privileges.

Security

Cluster admin

listClusterAdmins :: Config -> IO [Admin]Source

List cluster administrators.

addClusterAdminSource

Arguments

:: Config 
-> Text

Admin name

-> Text

Password

-> IO Admin 

Add a new cluster administrator. Requires cluster admin privilege.

updateClusterAdminPasswordSource

Arguments

:: Config 
-> Admin 
-> Text

New password

-> IO () 

Update a cluster administrator's password. Requires cluster admin privilege.

deleteClusterAdmin :: Config -> Admin -> IO ()Source

Delete a cluster administrator. Requires cluster admin privilege.

Database user

listDatabaseUsers :: Config -> Text -> IO [User]Source

List database users.

addDatabaseUserSource

Arguments

:: Config 
-> Text

Database name

-> Text

User name

-> Text

Password

-> IO () 

Add an user to the database users.

updateDatabaseUserPasswordSource

Arguments

:: Config 
-> Text

Database name

-> Text

User name

-> Text

New password

-> IO () 

Update password for the database user.

deleteDatabaseUserSource

Arguments

:: Config 
-> Text

Database name

-> Text

User name

-> IO () 

Delete an user from the database users.

grantAdminPrivilegeToSource

Arguments

:: Config 
-> Text

Database name

-> Text

User name

-> IO () 

Give admin privilege to the user.

revokeAdminPrivilegeFromSource

Arguments

:: Config 
-> Text

Database name

-> Text

User name

-> IO () 

Remove admin privilege from the user.