Enable lockless node queries
[ganeti-local] / lib / opcodes.py
index e5edbf1..44931c9 100644 (file)
@@ -171,6 +171,8 @@ class OpCode(BaseOpCode):
     return txt
 
 
+# cluster opcodes
+
 class OpDestroyCluster(OpCode):
   """Destroy the cluster.
 
@@ -255,8 +257,22 @@ class OpSetClusterParams(OpCode):
 
   """
   OP_ID = "OP_CLUSTER_SET_PARAMS"
-  __slots__ = ["vg_name", "enabled_hypervisors", "hvparams", "beparams"]
+  __slots__ = [
+    "vg_name",
+    "enabled_hypervisors",
+    "hvparams",
+    "beparams",
+    "candidate_pool_size",
+    ]
+
+
+class OpRedistributeConfig(OpCode):
+  """Force a full push of the cluster configuration.
 
+  """
+  OP_ID = "OP_CLUSTER_REDIST_CONF"
+  __slots__ = [
+    ]
 
 # node opcodes
 
@@ -303,7 +319,7 @@ class OpAddNode(OpCode):
 class OpQueryNodes(OpCode):
   """Compute the list of nodes."""
   OP_ID = "OP_NODE_QUERY"
-  __slots__ = ["output_fields", "names"]
+  __slots__ = ["output_fields", "names", "use_locking"]
 
 
 class OpQueryNodeVolumes(OpCode):
@@ -312,6 +328,17 @@ class OpQueryNodeVolumes(OpCode):
   __slots__ = ["nodes", "output_fields"]
 
 
+class OpSetNodeParams(OpCode):
+  """Change the parameters of a node."""
+  OP_ID = "OP_NODE_SET_PARAMS"
+  OP_DSC_FIELD = "node_name"
+  __slots__ = [
+    "node_name",
+    "force",
+    "master_candidate",
+    "offline",
+    ]
+
 # instance opcodes
 
 class OpCreateInstance(OpCode):
@@ -386,6 +413,19 @@ class OpFailoverInstance(OpCode):
   __slots__ = ["instance_name", "ignore_consistency"]
 
 
+class OpMigrateInstance(OpCode):
+  """Migrate an instance.
+
+  This migrates (without shutting down an instance) to its secondary
+  node.
+
+  @ivar instance_name: the name of the instance
+
+  """
+  OP_ID = "OP_INSTANCE_MIGRATE"
+  __slots__ = ["instance_name", "live", "cleanup"]
+
+
 class OpConnectConsole(OpCode):
   """Connect to an instance's console."""
   OP_ID = "OP_INSTANCE_CONSOLE"
@@ -410,7 +450,7 @@ class OpDeactivateInstanceDisks(OpCode):
 class OpQueryInstances(OpCode):
   """Compute the list of instances."""
   OP_ID = "OP_INSTANCE_QUERY"
-  __slots__ = ["output_fields", "names"]
+  __slots__ = ["output_fields", "names", "use_locking"]
 
 
 class OpQueryInstanceData(OpCode):
@@ -424,8 +464,9 @@ class OpSetInstanceParams(OpCode):
   OP_ID = "OP_INSTANCE_SET_PARAMS"
   OP_DSC_FIELD = "instance_name"
   __slots__ = [
-    "instance_name", "ip", "bridge", "mac",
+    "instance_name",
     "hvparams", "beparams", "force",
+    "nics", "disks",
     ]
 
 
@@ -447,7 +488,7 @@ class OpDiagnoseOS(OpCode):
 class OpQueryExports(OpCode):
   """Compute the list of exported images."""
   OP_ID = "OP_BACKUP_QUERY"
-  __slots__ = ["nodes"]
+  __slots__ = ["nodes", "use_locking"]
 
 
 class OpExportInstance(OpCode):