cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
489
Views
0
Helpful
1
Replies

Question about NavuContainer Loop ?

previousqna
Level 5
Level 5

I want to pick up ID from another service model java code.

In this case , I want to some data calculate from "tenant-id" under 'AIO001' data.

But my code does not work for test2 for loop. i can not pick up "tenant-id" under each Aio-id.

I can see testlist1 printout only in my debug log.

Please any comments or advises.

ID service model inputs are below;

/services/aioid:aioid[Aio-id='AIO001']/site-id[site-id='S001']/tunnel-id 1

/services/aioid:aioid[Aio-id='AIO001']/site-id[site-id='S002']/tunnel-id 2

/services/aioid:aioid[Aio-id='AIO002']/vCPE-id 2

/services/aioid:aioid[Aio-id='AIO002']/site-id[site-id='S003']/tunnel-id 3

Java Code;

           NavuList AioId = ncsRoot.container("services").list("aioid","aioid");

           NavuList testlist1 = AioId.elem(tenantID.valueAsString()).list("site-id");

System.out.println(testlist1);   <— work

           for (NavuContainer test2: testlist1.elements()){          

              System.out.println(test2.leaf("tunnel-id").valueAsString());   <— does not work

           }

My debug output is below;

NavuList[NavuNodeInfo[site-id,7,2],/ncs:services/aioid:aioid{AIO001}/site-id]

1 Accepted Solution

Accepted Solutions

previousqna
Level 5
Level 5

You should use NavuList.children(), i.e. "for (NavuContainer test2: testlist1.children()){"

View solution in original post

1 Reply 1

previousqna
Level 5
Level 5

You should use NavuList.children(), i.e. "for (NavuContainer test2: testlist1.children()){"

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: