root / src / Ganeti / Query / Cluster.hs @ e5fba493
History | View | Annotate | Download (1.2 kB)
1 | 1c3231aa | Thomas Thrainer | {-| Implementation of the Ganeti Query2 cluster queries. |
---|---|---|---|
2 | 1c3231aa | Thomas Thrainer | |
3 | 1c3231aa | Thomas Thrainer | -} |
4 | 1c3231aa | Thomas Thrainer | |
5 | 1c3231aa | Thomas Thrainer | {- |
6 | 1c3231aa | Thomas Thrainer | |
7 | 1c3231aa | Thomas Thrainer | Copyright (C) 2012, 2013 Google Inc. |
8 | 1c3231aa | Thomas Thrainer | |
9 | 1c3231aa | Thomas Thrainer | This program is free software; you can redistribute it and/or modify |
10 | 1c3231aa | Thomas Thrainer | it under the terms of the GNU General Public License as published by |
11 | 1c3231aa | Thomas Thrainer | the Free Software Foundation; either version 2 of the License, or |
12 | 1c3231aa | Thomas Thrainer | (at your option) any later version. |
13 | 1c3231aa | Thomas Thrainer | |
14 | 1c3231aa | Thomas Thrainer | This program is distributed in the hope that it will be useful, but |
15 | 1c3231aa | Thomas Thrainer | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | 1c3231aa | Thomas Thrainer | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | 1c3231aa | Thomas Thrainer | General Public License for more details. |
18 | 1c3231aa | Thomas Thrainer | |
19 | 1c3231aa | Thomas Thrainer | You should have received a copy of the GNU General Public License |
20 | 1c3231aa | Thomas Thrainer | along with this program; if not, write to the Free Software |
21 | 1c3231aa | Thomas Thrainer | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
22 | 1c3231aa | Thomas Thrainer | 02110-1301, USA. |
23 | 1c3231aa | Thomas Thrainer | |
24 | 1c3231aa | Thomas Thrainer | -} |
25 | 1c3231aa | Thomas Thrainer | |
26 | 1c3231aa | Thomas Thrainer | module Ganeti.Query.Cluster |
27 | 1c3231aa | Thomas Thrainer | ( clusterMasterNodeName |
28 | 1c3231aa | Thomas Thrainer | ) where |
29 | 1c3231aa | Thomas Thrainer | |
30 | 1c3231aa | Thomas Thrainer | import Control.Monad (liftM) |
31 | 1c3231aa | Thomas Thrainer | |
32 | 1c3231aa | Thomas Thrainer | import Ganeti.Objects |
33 | 1c3231aa | Thomas Thrainer | import Ganeti.Config |
34 | 1c3231aa | Thomas Thrainer | import Ganeti.Errors |
35 | 1c3231aa | Thomas Thrainer | |
36 | 1c3231aa | Thomas Thrainer | -- | Get master node name. |
37 | 1c3231aa | Thomas Thrainer | clusterMasterNodeName :: ConfigData -> ErrorResult String |
38 | 1c3231aa | Thomas Thrainer | clusterMasterNodeName cfg = |
39 | 1c3231aa | Thomas Thrainer | let cluster = configCluster cfg |
40 | 1c3231aa | Thomas Thrainer | masterNodeUuid = clusterMasterNode cluster |
41 | 1c3231aa | Thomas Thrainer | in liftM nodeName $ getNode cfg masterNodeUuid |