Closed jaeho9929 closed 2 years ago
The validate callback has a transaction_data (td) parameter, you extract the vector of deleted objects using transaction_dvec() (see API in clixon_backend_transaction.h). Since this object is in the candidate db (eg before the delete), you can examine it in its context. The code below iterates over all deleted objects (x) and references its parent (xp):
int
main_validate(clicon_handle h,
transaction_data td)
{
int i;
cxobj *x, *xp;
for (i=0; i<transaction_dlen(td); i++){
x = transaction_dvec(td)[i];
xp = xml_parent(x);
}
This gave me an idea. Thank you!, olofhagsand.
Hello!
I trying to use clixon for interface setting for my base system. When I deleted an IP address for some specific interface (e.g. eth0), I could get transaction data like below.
I couldn't set my base system only using this transaction data. Because I couldn't get information about which interface address has changed. Is there any method to get about a transaction's parent information? or, Is there any use-case or best practice for this case ??
Thank you.