Modify two mirror-device related rpc calls
[ganeti-local] / lib / opcodes.py
index e9a125b..e06a37e 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#
 #
 
 # Copyright (C) 2006, 2007 Google Inc.
@@ -98,6 +98,14 @@ class OpDumpClusterConfig(OpCode):
   __slots__ = []
 
 
+class OpRenameCluster(OpCode):
+  """Rename the cluster."""
+  OP_ID = "OP_CLUSTER_RENAME"
+  __slots__ = ["name"]
+
+
+# node opcodes
+
 class OpRemoveNode(OpCode):
   """Remove a node."""
   OP_ID = "OP_NODE_REMOVE"
@@ -113,13 +121,7 @@ class OpAddNode(OpCode):
 class OpQueryNodes(OpCode):
   """Compute the list of nodes."""
   OP_ID = "OP_NODE_QUERY"
-  __slots__ = ["output_fields", "nodes"]
-
-
-class OpQueryNodeData(OpCode):
-  """Compute the node info."""
-  OP_ID = "OP_NODE_INFO"
-  __slots__ = ["nodes"]
+  __slots__ = ["output_fields", "names"]
 
 
 class OpQueryNodeVolumes(OpCode):
@@ -136,7 +138,7 @@ class OpCreateInstance(OpCode):
   __slots__ = ["instance_name", "mem_size", "disk_size", "os_type", "pnode",
                "disk_template", "snode", "swap_size", "mode",
                "vcpus", "ip", "bridge", "src_node", "src_path", "start",
-               "wait_for_sync"]
+               "wait_for_sync", "ip_check"]
 
 
 class OpReinstallInstance(OpCode):
@@ -148,7 +150,13 @@ class OpReinstallInstance(OpCode):
 class OpRemoveInstance(OpCode):
   """Remove an instance."""
   OP_ID = "OP_INSTANCE_REMOVE"
-  __slots__ = ["instance_name"]
+  __slots__ = ["instance_name", "ignore_failures"]
+
+
+class OpRenameInstance(OpCode):
+  """Rename an instance."""
+  OP_ID = "OP_INSTANCE_RENAME"
+  __slots__ = ["instance_name", "ignore_ip", "new_name"]
 
 
 class OpStartupInstance(OpCode):
@@ -163,6 +171,13 @@ class OpShutdownInstance(OpCode):
   __slots__ = ["instance_name"]
 
 
+class OpRebootInstance(OpCode):
+  """Reboot an instance."""
+  OP_ID = "OP_INSTANCE_STARTUP"
+  __slots__ = ["instance_name", "reboot_type", "extra_args",
+               "ignore_secondaries" ]
+
+
 class OpAddMDDRBDComponent(OpCode):
   """Add a MD-DRBD component."""
   OP_ID = "OP_INSTANCE_ADD_MDDRBD"
@@ -208,7 +223,7 @@ class OpDeactivateInstanceDisks(OpCode):
 class OpQueryInstances(OpCode):
   """Compute the list of instances."""
   OP_ID = "OP_INSTANCE_QUERY"
-  __slots__ = ["output_fields"]
+  __slots__ = ["output_fields", "names"]
 
 
 class OpQueryInstanceData(OpCode):
@@ -248,13 +263,13 @@ class OpGetTags(OpCode):
   __slots__ = ["kind", "name"]
 
 
-class OpSetTag(OpCode):
-  """Sets the value of a tag on a given object."""
+class OpAddTags(OpCode):
+  """Add a list of tags on a given object."""
   OP_ID = "OP_TAGS_SET"
-  __slots__ = ["kind", "name", "tag"]
+  __slots__ = ["kind", "name", "tags"]
 
 
-class OpDelTag(OpCode):
-  """Remove a tag from a given object."""
+class OpDelTags(OpCode):
+  """Remove a list of tags from a given object."""
   OP_ID = "OP_TAGS_DEL"
-  __slots__ = ["kind", "name", "tag"]
+  __slots__ = ["kind", "name", "tags"]