def list_node(db_name, node_id, typeMatch, typeValue, lock_id, cmdId): params[MdbJKey.db_name] = db_name params[MdbJKey.lock_id] = lock_id params[MdbJKey.node_id] = node_id params[MdbJKey.type_match] = typeMatch params[MdbJKey.type_value] = get_type_str(typeValue) send_request(params, cmdId)
def libdb_attr_get(db_name, node_id, name, lock_id): params = dict() params[MdbJKey.db_name] = db_name params[MdbJKey.lock_id] = lock_id params[MdbJKey.node_id] = node_id params[MdbJKey.name] = name send_request(params, CmdId.CMD_ATTRBUTE_GET) return
def libdb_dump_nodes(db_name, lock_id): ''' params = dict() params[MdbJKey.db_name] = db_name params[MdbJKey.lock_id] = lock_id params[MdbJKey.node_id] = 0 ''' req = get_req_info(db_name, McType.MC_TYPE_RMC, McType.MC_TYPE_RMC, 0, 0, lock_id) send_request(req, CmdId.CMD_DUMP_NODES)
def libdb_attr_set(db_name, node_id, name, cookie, value, snapshot_flag, lock_id): params = dict() params[MdbJKey.db_name] = db_name params[MdbJKey.lock_id] = lock_id params[MdbJKey.node_id] = node_id params[MdbJKey.cookie] = cookie if isinstance(value, str) == False: value = str(value) params[MdbJKey.name] = name params[MdbJKey.data] = value params[MdbJKey.snapshot] = snapshot_flag send_request(params, CmdId.CMD_ATTRBUTE_SET)
def libdb_destroy_node(db_name, node_id, lock_id): req = get_req_info(db_name, McType.MC_TYPE_RMC, McType.MC_TYPE_RMC, node_id, 0, lock_id) send_request(req, CmdId.CMD_NODE_DESTROY)
def libdb_get_node_by_node_id(db_name, node_id, lock_id): req = get_req_info(db_name, McType.MC_TYPE_RMC, McType.MC_TYPE_RMC, node_id, 0, lock_id) send_request(req, CmdId.CMD_NODE_GET_BY_NODE_ID)
def libdb_create_node(db_name, parent, mctype, snapshot_flag, lock_id): req = get_req_info(db_name, parent, mctype, node_id, snapshot_flag, lock_id) send_request(req, CmdId.CMD_NODE_CREATE_WITH_NODE_ID)