# File lib/cloudservers/server.rb, line 146 def rebuild!(imageId = self.imageId) data = JSON.generate(:rebuild => {:imageId => imageId}) response = @connection.csreq("POST",@svrmgmthost,"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data) CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/) self.populate true end