def delete(self,req,id=None): #1.获取服务所在的虚拟机 #2.调用删除命令,删除虚拟机上的服务 #3.删除sv_arg_type_tb数据库与该服务相关的信息, #4.删除sv_tb上与该服务相关的数据 #删除远程虚拟机上的服务 print 'for the test!!!' environ = req.environ ''' user_id = environ['HTTP_X_USER_ID'] user_name = environ['HTTP_X_USER_NAME'] user_role = environ['HTTP_X_ROLES'] ''' self.db_session=environ['db_session'] self.rmsvMan.deleteSvOnVM(id); #删除本地sv_arg_type_tb上的数据 db.deleteSvInfoOnTB(self.db_session,id) #删除本地sv_tb上的数据 db.deleteSvArg4IDOnTB(self.db_session,id) return 'delete successfully!'
def delete(self, req, id=None): #1.获取服务所在的虚拟机 #2.调用删除命令,删除虚拟机上的服务 #3.删除sv_arg_type_tb数据库与该服务相关的信息, #4.删除sv_tb上与该服务相关的数据 #删除远程虚拟机上的服务 print 'for the test!!!' environ = req.environ ''' user_id = environ['HTTP_X_USER_ID'] user_name = environ['HTTP_X_USER_NAME'] user_role = environ['HTTP_X_ROLES'] ''' self.db_session = environ['db_session'] self.rmsvMan.deleteSvOnVM(id) #删除本地sv_arg_type_tb上的数据 db.deleteSvInfoOnTB(self.db_session, id) #删除本地sv_tb上的数据 db.deleteSvArg4IDOnTB(self.db_session, id) return 'delete successfully!'
try: target=SvTarget.svtarget_factory(self.db_session,id).to_dict() except Exception,e: return e.msg policy.init() try: policy.enforce(context, action, target) except Exception,e: return e.msg print self.rmsvMan.deleteSvOnVM(self.db_session,id); #删除本地sv_arg_type_tb上的数据 db.deleteSvInfoOnTB(self.db_session,id) #删除本地sv_tb上的数据 db.deleteSvArg4IDOnTB(self.db_session,id) return 'delete successfully!' def update(self,req,body,id=None): environ = req.environ ''' user_id = environ['HTTP_X_USER_ID'] user_name = environ['HTTP_X_USER_NAME'] user_role = environ['HTTP_X_ROLES'] ''' self.db_session=environ['db_session'] context=environ['hydrogen.context'] action="deploy_service" try: target=SvTarget.svtarget_factory(self.db_session,id).to_dict() except Exception,e: