Hi folks,
Im trying to set values of a list with maapi_set_elem2. But to able to set a value i have to know its uuid. But unfortunately in my case im not aware of uuid of subnet.
In the below case i know that the subnet2 uuid is available. so i am able to easily set new ‘cidr’ value with the new one.
So ‘cidr’ is unique item here. I would like to find uuid over the cidr item.Because in further details i have set another items under this subnet.
For instance;
Here to set ip-address of the host i need to find its subnet with cidr first.
maapi_set_elem2(msock,th,"192.168.28.41","/dhcp/mysubnets/subnets/**uuid**/hosts/{host1uuid}/ip-address")
> (maapi_set_elem2(msock,th,"**192.168.144.0/24**","/dhcp/mysubnets/subnets/{%s}/cidr", "**subnet2**")
>
> grouping subnet4-list {
> list subnets {
> key uuid;
> unique "net";
> leaf uuid {
> type string;
> }
> leaf cidr{
> type inet:ipv4-prefix;
> mandatory true;
> }
> container hosts {
> list hosts {
> description "Host grouping.";
> key uuid;
> unique "host-label-name";
> unique "ip-address";
> unique "host-identifier";
> leaf uuid {
> type string;
> }
> leaf host-label-name {
> etc.....
> }
}
Is there any idea for this problem?
Thanks in advance,
Kind regards.