<html><body>
<p><font size="2" face="sans-serif">Hi </font><br>
<font size="2" face="sans-serif"> When I fix some bugs, I found that some code in nova/compute/api.py</font><br>
<br>
<font size="2" face="sans-serif"> sometimes we use db ,sometimes we use objects.... do we have any criteria for it? I knew we can't access db in compute layer code, how about others ? prefer object or db direct access? thanks</font><br>
<br>
<font size="2" face="sans-serif">def service_delete(self, context, service_id):</font><br>
<font size="2" face="sans-serif"> """Deletes the specified service."""</font><br>
<font size="2" face="sans-serif"> objects.Service.get_by_id(context, service_id).destroy()</font><br>
<br>
<font size="2" face="sans-serif"> def instance_get_all_by_host(self, context, host_name):</font><br>
<font size="2" face="sans-serif"> """Return all instances on the given host."""</font><br>
<font size="2" face="sans-serif"> return self.db.instance_get_all_by_host(context, host_name)</font><br>
<br>
<font size="2" face="sans-serif"> def compute_node_get_all(self, context):</font><br>
<font size="2" face="sans-serif"> return self.db.compute_node_get_all(context)</font><br>
<br>
<font size="2" face="sans-serif">Best Regards! <br>
<br>
Kevin (Chen) Ji ¼Í ³¿<br>
<br>
Engineer, zVM Development, CSTL<br>
Notes: Chen CH Ji/China/IBM@IBMCN Internet: jichenjc@cn.ibm.com<br>
Phone: +86-10-82454158<br>
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District, Beijing 100193, PRC </font></body></html>