Statistics
| Branch: | Tag: | Revision:

root / src / Ganeti / DataCollectors / InstStatusTypes.hs @ 72375ff8

History | View | Annotate | Download (1.7 kB)

1
{-# LANGUAGE TemplateHaskell #-}
2
{-| Type declarations specific for the instance status data collector.
3

    
4
-}
5

    
6
{-
7

    
8
Copyright (C) 2013 Google Inc.
9

    
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2 of the License, or
13
(at your option) any later version.
14

    
15
This program is distributed in the hope that it will be useful, but
16
WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
General Public License for more details.
19

    
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23
02110-1301, USA.
24

    
25
-}
26

    
27
module Ganeti.DataCollectors.InstStatusTypes
28
  ( InstStatus(..)
29
  , ReportData(..)
30
  ) where
31

    
32

    
33
import Ganeti.DataCollectors.Types
34
import Ganeti.Hypervisor.Xen.Types
35
import Ganeti.THH
36
import Ganeti.THH.Field
37
import Ganeti.Types
38

    
39
-- | Data type representing the status of an instance to be returned.
40
$(buildObject "InstStatus" "iStat"
41
  [ simpleField "name"         [t| String |]
42
  , simpleField "uuid"         [t| String |]
43
  , simpleField "adminState"   [t| AdminState |]
44
  , simpleField "actualState"  [t| ActualState |]
45
  , optionalNullSerField $
46
    simpleField "uptime"       [t| String |]
47
  , timeAsDoubleField "mtime"
48
  , simpleField "state_reason" [t| ReasonTrail |]
49
  , simpleField "status"       [t| DCStatus |]
50
  ])
51

    
52
$(buildObject "ReportData" "rData"
53
  [ simpleField "instances" [t| [InstStatus] |]
54
  , simpleField "status"    [t| DCStatus |]
55
  ])