示例#1
0
 def delete(self, wait=False):
     """Deletes this instance and all the databases and users within it."""
     
     self.client.delete(self.path)
     helpers.maybe_wait_until_deleted(self, wait, self.path)
     
     return True
示例#2
0
 def delete_instance(self, instance_id, wait=False):
     """
     """
     # check to see if this is actually a name and not an ID
     if not (len(instance_id) == 36 and len(instance_id.replace('-', '')) == 32):
         instance = Instance.find(name=instance_id)
         if type(instance) == Instance:
             instance_id = instance.id
         else:
             # TODO : proper exception
             raise Exception("Error resolving %s to a single instance" % instance_id)
     
     self.client.delete(Instance.path_to(instance_id))
     helpers.maybe_wait_until_deleted(self, wait, Instance.path_to(instance_id))
     
     return True