Add gnt-backup remove functionality
[ganeti-local] / lib / opcodes.py
index 87bcf05..c6cad58 100644 (file)
@@ -83,7 +83,7 @@ class OpRunClusterCommand(OpCode):
 class OpVerifyCluster(OpCode):
   """Verify the cluster state."""
   OP_ID = "OP_CLUSTER_VERIFY"
-  __slots__ = []
+  __slots__ = ["skip_checks"]
 
 
 class OpVerifyDisks(OpCode):
@@ -166,6 +166,7 @@ class OpCreateInstance(OpCode):
     "vcpus", "ip", "bridge", "src_node", "src_path", "start",
     "wait_for_sync", "ip_check", "mac",
     "kernel_path", "initrd_path", "hvm_boot_order",
+    "iallocator",
     ]
 
 
@@ -286,6 +287,10 @@ class OpExportInstance(OpCode):
   OP_ID = "OP_BACKUP_EXPORT"
   __slots__ = ["instance_name", "target_node", "shutdown"]
 
+class OpRemoveExport(OpCode):
+  """Remove an instance's export."""
+  OP_ID = "OP_BACKUP_REMOVE"
+  __slots__ = ["instance_name"]
 
 # Tags opcodes
 class OpGetTags(OpCode):
@@ -336,3 +341,22 @@ class OpTestDelay(OpCode):
   """
   OP_ID = "OP_TEST_DELAY"
   __slots__ = ["duration", "on_master", "on_nodes"]
+
+
+class OpTestAllocator(OpCode):
+  """Allocator framework testing.
+
+  This opcode has two modes:
+    - gather and return allocator input for a given mode (allocate new
+      or replace secondary) and a given instance definition (direction
+      'in')
+    - run a selected allocator for a given operation (as above) and
+      return the allocator output (direction 'out')
+
+  """
+  OP_ID = "OP_TEST_ALLOCATOR"
+  __slots__ = [
+    "direction", "mode", "allocator", "name",
+    "mem_size", "disks", "disk_template",
+    "os", "tags", "nics", "vcpus",
+    ]