Commit 6856693f authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Add a WConfd RPC Client

The client is generated automatically by Ganeti.THH.HsRPC.

It also includes helper functions for creating a client object.
Signed-off-by: default avatarPetr Pudlak <>
Reviewed-by: default avatarKlaus Aehlig <>
parent d808bf6e
......@@ -825,6 +825,7 @@ HS_LIB_SRCS = \
src/Ganeti/VCluster.hs \
src/Ganeti/WConfd/ConfigState.hs \
src/Ganeti/WConfd/ConfigWriter.hs \
src/Ganeti/WConfd/Client.hs \
src/Ganeti/WConfd/Core.hs \
src/Ganeti/WConfd/DeathDetection.hs \
src/Ganeti/WConfd/Language.hs \
......@@ -4016,6 +4016,12 @@ luxidMaximalRunningJobsDefault = 20
wconfdDeathdetectionIntervall :: Int
wconfdDeathdetectionIntervall = 311
wconfdDefCtmo :: Int
wconfdDefCtmo = 10
wconfdDefRwto :: Int
wconfdDefRwto = 60
-- * Confd
confdProtocolVersion :: Int
{-# LANGUAGE TemplateHaskell #-}
{-| The Ganeti WConfd client functions.
The client functions are automatically generated from Ganeti.WConfd.Core
Copyright (C) 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
module Ganeti.WConfd.Client where
import Ganeti.THH.HsRPC
import Ganeti.Constants
import Ganeti.Runtime (GanetiDaemon(..))
import Ganeti.UDSServer (ConnectConfig(..), Client, connectClient)
import Ganeti.WConfd.Core (exportedFunctions)
-- * Generated client functions
$(mkRpcCalls exportedFunctions)
-- * Helper functions for creating the client
-- | The default WConfd client configuration
wconfdConnectConfig :: ConnectConfig
wconfdConnectConfig = ConnectConfig { connDaemon = GanetiWConfd
, recvTmo = wconfdDefRwto
, sendTmo = wconfdDefRwto
-- | Given a socket path, creates a WConfd client with the default
-- configuration and timeout.
getWConfdClient :: FilePath -> IO Client
getWConfdClient = connectClient wconfdConnectConfig wconfdDefCtmo
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment