iallocator: rename mem_size to memory
[ganeti-local] / lib / opcodes.py
index dfae4aa..ce28539 100644 (file)
@@ -118,6 +118,10 @@ _PIpCheckDoc = "Whether to ensure instance's IP address is inactive"
 _PNoRemember = ("no_remember", False, ht.TBool,
                 "Do not remember the state change")
 
+#: Target node for instance migration/failover
+_PMigrationTargetNode = ("target_node", None, ht.TMaybeString,
+                         "Target node for shared-storage instances")
+
 #: OP_ID conversion regular expression
 _OPID_RE = re.compile("([a-z])([A-Z])")
 
@@ -513,8 +517,19 @@ class OpClusterQuery(OpCode):
   """Query cluster information."""
 
 
-class OpClusterVerify(OpCode):
-  """Verify the cluster state.
+class OpClusterVerifyConfig(OpCode):
+  """Verify the cluster config.
+
+  """
+  OP_PARAMS = [
+    ("verbose", False, ht.TBool, None),
+    ("error_codes", False, ht.TBool, None),
+    ("debug_simulate_errors", False, ht.TBool, None),
+    ]
+
+
+class OpClusterVerifyGroup(OpCode):
+  """Run verify on a node group from the cluster.
 
   @type skip_checks: C{list}
   @ivar skip_checks: steps to be skipped from the verify process; this
@@ -523,7 +538,9 @@ class OpClusterVerify(OpCode):
                      only L{constants.VERIFY_NPLUSONE_MEM} can be passed
 
   """
+  OP_DSC_FIELD = "group_name"
   OP_PARAMS = [
+    ("group_name", ht.NoDefault, ht.TNonEmptyString, None),
     ("skip_checks", ht.EmptyList,
      ht.TListOf(ht.TElemOf(constants.VERIFY_OPTIONAL_CHECKS)), None),
     ("verbose", False, ht.TBool, None),
@@ -861,6 +878,7 @@ class OpNodeMigrate(OpCode):
     _PNodeName,
     _PMigrationMode,
     _PMigrationLive,
+    _PMigrationTargetNode,
     ("iallocator", None, ht.TMaybeString,
      "Iallocator for deciding the target node for shared-storage instances"),
     ]
@@ -1045,10 +1063,9 @@ class OpInstanceFailover(OpCode):
     _PInstanceName,
     _PShutdownTimeout,
     _PIgnoreConsistency,
+    _PMigrationTargetNode,
     ("iallocator", None, ht.TMaybeString,
      "Iallocator for deciding the target node for shared-storage instances"),
-    ("target_node", None, ht.TMaybeString,
-     "Target node for shared-storage instances"),
     ]
 
 
@@ -1067,12 +1084,11 @@ class OpInstanceMigrate(OpCode):
     _PInstanceName,
     _PMigrationMode,
     _PMigrationLive,
+    _PMigrationTargetNode,
     ("cleanup", False, ht.TBool,
      "Whether a previously failed migration should be cleaned up"),
     ("iallocator", None, ht.TMaybeString,
      "Iallocator for deciding the target node for shared-storage instances"),
-    ("target_node", None, ht.TMaybeString,
-     "Target node for shared-storage instances"),
     ("allow_failover", False, ht.TBool,
      "Whether we can fallback to failover if migration is not possible"),
     ]
@@ -1431,7 +1447,7 @@ class OpTestAllocator(OpCode):
     ("hypervisor", None, ht.TMaybeString, None),
     ("allocator", None, ht.TMaybeString, None),
     ("tags", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), None),
-    ("mem_size", None, ht.TOr(ht.TNone, ht.TPositiveInt), None),
+    ("memory", None, ht.TOr(ht.TNone, ht.TPositiveInt), None),
     ("vcpus", None, ht.TOr(ht.TNone, ht.TPositiveInt), None),
     ("os", None, ht.TMaybeString, None),
     ("disk_template", None, ht.TMaybeString, None),