Revision d654aae1 lib/rapi/client.py

b/lib/rapi/client.py
971 971
                             ("/%s/instances/%s/migrate" %
972 972
                              (GANETI_RAPI_VERSION, instance)), None, body)
973 973

  
974
  def RenameInstance(self, instance, new_name, ip_check=None, name_check=None):
975
    """Changes the name of an instance.
976

  
977
    @type instance: string
978
    @param instance: Instance name
979
    @type new_name: string
980
    @param new_name: New instance name
981
    @type ip_check: bool
982
    @param ip_check: Whether to ensure instance's IP address is inactive
983
    @type name_check: bool
984
    @param name_check: Whether to ensure instance's name is resolvable
985

  
986
    """
987
    body = {
988
      "new_name": new_name,
989
      }
990

  
991
    if ip_check is not None:
992
      body["ip_check"] = ip_check
993

  
994
    if name_check is not None:
995
      body["name_check"] = name_check
996

  
997
    return self._SendRequest(HTTP_PUT,
998
                             ("/%s/instances/%s/rename" %
999
                              (GANETI_RAPI_VERSION, instance)), None, body)
1000

  
974 1001
  def GetJobs(self):
975 1002
    """Gets all jobs for the cluster.
976 1003

  

Also available in: Unified diff