Revision c0a146a1 lib/rapi/client.py

b/lib/rapi/client.py
1073 1073
                             ("/%s/instances/%s/migrate" %
1074 1074
                              (GANETI_RAPI_VERSION, instance)), None, body)
1075 1075

  
1076
  def FailoverInstance(self, instance, iallocator=None,
1077
                       ignore_consistency=None, target_node=None):
1078
    """Does a failover of an instance.
1079

  
1080
    @type instance: string
1081
    @param instance: Instance name
1082
    @type iallocator: string
1083
    @param iallocator: Iallocator for deciding the target node for
1084
      shared-storage instances
1085
    @type ignore_consistency: bool
1086
    @param ignore_consistency: Whether to ignore disk consistency
1087
    @type target_node: string
1088
    @param target_node: Target node for shared-storage instances
1089
    @rtype: string
1090
    @return: job id
1091

  
1092
    """
1093
    body = {}
1094

  
1095
    if iallocator is not None:
1096
      body["iallocator"] = iallocator
1097

  
1098
    if ignore_consistency is not None:
1099
      body["ignore_consistency"] = ignore_consistency
1100

  
1101
    if target_node is not None:
1102
      body["target_node"] = target_node
1103

  
1104
    return self._SendRequest(HTTP_PUT,
1105
                             ("/%s/instances/%s/failover" %
1106
                              (GANETI_RAPI_VERSION, instance)), None, body)
1107

  
1076 1108
  def RenameInstance(self, instance, new_name, ip_check=None, name_check=None):
1077 1109
    """Changes the name of an instance.
1078 1110

  

Also available in: Unified diff