def update_vim(self, context, vim_id, status):
    t_admin_context = t_context.get_admin_context()
    update_time = timeutils.utcnow()
    with t_admin_context.session.begin(subtransactions=True):
        try:
            query = t_admin_context.session.query(meo_db.Vim)
            query.filter((meo_db.Vim.id == vim_id)).update({'status': status, 'updated_at': update_time})
        except orm_exc.NoResultFound:
            raise meo.VimNotFoundException(vim_id=vim_id)
        event_db = common_services_db.Event(resource_id=vim_id, resource_type=constants.RES_TYPE_VIM, resource_state=status, event_details='', event_type=constants.RES_EVT_MONITOR, timestamp=update_time)
        t_admin_context.session.add(event_db)
    return status
def update_vim(self, context, vim_id, status):
    t_admin_context = t_context.get_admin_context()
    update_time = timeutils.utcnow()
    with t_admin_context.session.begin(subtransactions=True):
        try:
            query = t_admin_context.session.query(meo_db.Vim)
            query.filter((meo_db.Vim.id == vim_id)).update({'status': status, 'updated_at': update_time})
        except orm_exc.NoResultFound:
            raise meo.VimNotFoundException(vim_id=vim_id)
        event_db = common_services_db.Event(resource_id=vim_id, resource_type=constants.RES_TYPE_VIM, resource_state=status, event_details=, event_type=constants.RES_EVT_MONITOR, timestamp=update_time)
        t_admin_context.session.add(event_db)
    return status