def delete_user(self, instance, username): return self.api.users.delete(base.getid(instance), username)
def get_instance(self, instanceid): return self._get("/instances/%s" % \ base.getid(instanceid), "instance")
def list_users(self, instance): return self.api.users.list(base.getid(instance))
def create_user(self, instance, username, password, databases): return self.api.users.create(base.getid(instance), username, password, databases)
def create_databases(self, instance, databases): body = {"databases": databases} return self._post("/instances/%s/databases" % base.getid(instance), body)
def get_instance(self, instanceid): return self._get("/instances/%s" % base.getid(instanceid), "instance")
def resize_instance(self, instanceid, size): body = {"resize": {"volume": {"size": size}}} self._resize("/instances/%s/action" % base.getid(instanceid), body)
def get_databases(self, instance): return self.api.databases.get_databases(base.getid(instance))
def restart_instance(self, instanceid): body = {"restart": {}} self._restart("/instances/%s/action" % base.getid(instanceid), body)
def delete_instance(self, instanceid): self.api.client.authenticate() self._delete("/instances/%s" % base.getid(instanceid))
def delete(self, instanceid, username): self._delete("/instances/%s/users/%s" % (base.getid(instanceid), username))
def get_flavor(self, flavorid): return self._get("/flavors/%s" % base.getid(flavorid), "flavor")