commit 5c98b73e3fc59e9c62ff98f6156e00a10dcf8b4d
Author: Helga Velroyen <helgav@google.com>
Date:   Fri Nov 22 15:21:49 2013 +0100

    Instance queries: remove opcodes and LU
    
    Removes the remains of the instance queries.
    
    Signed-off-by: Helga Velroyen <helgav@google.com>
    Reviewed-by: Hrvoje Ribicic <riba@google.com>

diff --git a/lib/cmdlib/__init__.py b/lib/cmdlib/__init__.py
index 79b4b1a..e33c871 100644
--- a/lib/cmdlib/__init__.py
+++ b/lib/cmdlib/__init__.py
@@ -89,7 +89,6 @@ from ganeti.cmdlib.instance_operation import \
   LUInstanceReboot, \
   LUInstanceConsole
 from ganeti.cmdlib.instance_query import \
-  LUInstanceQuery, \
   LUInstanceQueryData
 from ganeti.cmdlib.backup import \
   LUBackupPrepare, \
diff --git a/lib/cmdlib/instance_query.py b/lib/cmdlib/instance_query.py
index 64f7d51..42c2666 100644
--- a/lib/cmdlib/instance_query.py
+++ b/lib/cmdlib/instance_query.py
@@ -26,45 +26,13 @@ import itertools
 from ganeti import compat
 from ganeti import constants
 from ganeti import locking
-from ganeti import query
-from ganeti.cmdlib.base import QueryBase, NoHooksLU
+from ganeti.cmdlib.base import NoHooksLU
 from ganeti.cmdlib.common import ShareAll, GetWantedInstances, \
   CheckInstancesNodeGroups, AnnotateDiskParams
 from ganeti.cmdlib.instance_utils import NICListToTuple
 from ganeti.hypervisor import hv_base
 
 
-
-class InstanceQuery(QueryBase):
-  FIELDS = query.INSTANCE_FIELDS
-
-  def ExpandNames(self, lu):
-    raise NotImplementedError
-
-  def DeclareLocks(self, lu, level):
-    raise NotImplementedError
-
-
-class LUInstanceQuery(NoHooksLU):
-  """Logical unit for querying instances.
-
-  """
-  # pylint: disable=W0142
-  REQ_BGL = False
-
-  def CheckArguments(self):
-    raise NotImplementedError
-
-  def ExpandNames(self):
-    raise NotImplementedError
-
-  def DeclareLocks(self, level):
-    raise NotImplementedError
-
-  def Exec(self, feedback_fn):
-    raise NotImplementedError
-
-
 class LUInstanceQueryData(NoHooksLU):
   """Query runtime instance data.
 
diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py
index 3fffe8e..b833d26 100644
--- a/lib/rapi/rlib2.py
+++ b/lib/rapi/rlib2.py
@@ -886,7 +886,6 @@ class R_2_instances(baserlib.OpcodeResource):
   """/2/instances resource.
 
   """
-  GET_OPCODE = opcodes.OpInstanceQuery
   POST_OPCODE = opcodes.OpInstanceCreate
   POST_RENAME = {
     "os": "os_type",
@@ -970,7 +969,6 @@ class R_2_instances_name(baserlib.OpcodeResource):
   """/2/instances/[instance_name] resource.
 
   """
-  GET_OPCODE = opcodes.OpInstanceQuery
   DELETE_OPCODE = opcodes.OpInstanceRemove
 
   def GET(self):
diff --git a/lib/server/masterd.py b/lib/server/masterd.py
index 49975a6..a152b26 100644
--- a/lib/server/masterd.py
+++ b/lib/server/masterd.py
@@ -390,16 +390,6 @@ class ClientOps:
       logging.info("Received job query request for %s", msg)
       return queue.OldStyleQueryJobs(job_ids, fields)
 
-    elif method == luxi.REQ_QUERY_INSTANCES:
-      (names, fields, use_locking) = args
-      logging.info("Received instance query request for %s", names)
-      if use_locking:
-        raise errors.OpPrereqError("Sync queries are not allowed",
-                                   errors.ECODE_INVAL)
-      op = opcodes.OpInstanceQuery(names=names, output_fields=fields,
-                                   use_locking=use_locking)
-      return self._Query(op)
-
     elif method == luxi.REQ_QUERY_CONFIG_VALUES:
       (fields, ) = args
       logging.info("Received config values query request for %s", fields)
diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs
index b38cf69..bf049ef 100644
--- a/src/Ganeti/OpCodes.hs
+++ b/src/Ganeti/OpCodes.hs
@@ -609,16 +609,6 @@ $(genOpCode "OpCode"
      , pIallocator
      ],
      "instance_name")
-  , ("OpInstanceQuery",
-     [t| [[JSValue]] |],
-     OpDoc.opInstanceQuery,
-     [ pOutputFields
-     , pUseLocking
-     , withDoc
-       "Empty list to query all instances, instance names otherwise"
-       pNames
-     ],
-     [])
   , ("OpInstanceQueryData",
      [t| JSObject (JSObject JSValue) |],
      OpDoc.opInstanceQueryData,
