Revision be747966

b/htools/Ganeti/HTools/QC.hs
1847 1847

  
1848 1848
-- * Luxi tests
1849 1849

  
1850
instance Arbitrary Luxi.TagObject where
1851
  arbitrary = elements [minBound..maxBound]
1852

  
1850 1853
instance Arbitrary Luxi.LuxiReq where
1851 1854
  arbitrary = elements [minBound..maxBound]
1852 1855

  
......
1866 1869
                              (listOf getFQDN) <*> arbitrary
1867 1870
      Luxi.ReqQueryConfigValues -> Luxi.QueryConfigValues <$> getFields
1868 1871
      Luxi.ReqQueryClusterInfo -> pure Luxi.QueryClusterInfo
1869
      Luxi.ReqQueryTags -> Luxi.QueryTags <$> getName <*> getFQDN
1872
      Luxi.ReqQueryTags -> Luxi.QueryTags <$> arbitrary <*> getFQDN
1870 1873
      Luxi.ReqSubmitJob -> Luxi.SubmitJob <$> (resize maxOpCodes arbitrary)
1871 1874
      Luxi.ReqSubmitManyJobs -> Luxi.SubmitManyJobs <$>
1872 1875
                                (resize maxOpCodes arbitrary)
b/htools/Ganeti/Luxi.hs
32 32
  , Client
33 33
  , JobId
34 34
  , RecvResult(..)
35
  , TagObject(..)
35 36
  , strOfOp
36 37
  , checkRS
37 38
  , getClient
......
99 100
-- | The Ganeti job type.
100 101
type JobId = Int
101 102

  
103
-- | Data type representing what items do the tag operations apply to.
104
$(declareSADT "TagObject"
105
  [ ("TagInstance", 'tagInstance)
106
  , ("TagNode",     'tagNode)
107
  , ("TagGroup",    'tagNodegroup)
108
  , ("TagCluster",  'tagCluster)
109
  ])
110
$(makeJSONInstance ''TagObject)
111

  
102 112
-- | Currently supported Luxi operations and JSON serialization.
103 113
$(genLuxiOp "LuxiOp"
104 114
  [(luxiReqQuery,
......
134 144
    )
135 145
  , (luxiReqQueryClusterInfo, [])
136 146
  , (luxiReqQueryTags,
137
     [ ("kind", [t| String |])
147
     [ ("kind", [t| TagObject |])
138 148
     , ("name", [t| String |])
139 149
     ])
140 150
  , (luxiReqSubmitJob,

Also available in: Unified diff