cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
67
Views
0
Helpful
5
Replies
khgrant
Cisco Employee

URGENT: id-allocator maapi function to request a particular id

 

Hi NSO team,

 

We recently discovered that id-allocator idRequest in Java code is asking with a "id" as the key.

 

Therefore, whatever we input in the idRequest maapi call, the id-allocator is assigning the next available "value" for the "id" we have given. Our intention was to input the value we want and expect id-allocator to assign that value for us. But, obviously, what we input was the "id" not the "value".

We had thought that "id" and "value" were the same or having the same values. But, this is not the case as explained.

 

Any ideas/solutions for how ask for a particualr "value" from the id-allocator in Java code?

 

This is an extremely urgent request, if anybody can be of help.

 

 

Regards,

-Fatih

 

1 ACCEPTED SOLUTION

Accepted Solutions
khgrant
Cisco Employee

 

Fatih,

 

 

You got your path wrong. When in doubt about paths, I recommend going into the NCS CLI and setting the objects manually, then show ... | display xpath | display prefixes

 

JLINDBLA-M-J8L9(config-allocation-1)# sh f | display xpath | display prefixes

/ralloc:resource-pools/idalloc:id-pool[idalloc:name='x']/idalloc:allocation[idalloc:id='1']/idalloc:username fatih

/ralloc:resource-pools/idalloc:id-pool[idalloc:name='x']/idalloc:allocation[idalloc:id='1']/idalloc:request/idalloc:sync true

/ralloc:resource-pools/idalloc:id-pool[idalloc:name='x']/idalloc:allocation[idalloc:id='1']/idalloc:request/idalloc:id 15

 

Best Regards,

/jan

 

View solution in original post

5 REPLIES 5
khgrant
Cisco Employee

 

Fatih,

 

The id-allocator does not support static allocatation. I believe that is what you want.

   

If you send the exact context, we could help you with an answer because clearly you already have the "value" you need.

 

 

Roque...

 

khgrant
Cisco Employee

 

Hi!

 

Actually the allocator supports that, but it's not exposed in the java api.  I don't have my computer here so you'll have to look yourselves.

 

The leaf to use is documented in the YANG (in the allocation request list), you set that leaf to the value you want.  To use it, copy the idRequest code and modify it to set that additional leaf as part of the request and it should work.

 

 

Fredrik

 

khgrant
Cisco Employee

 

Fatih,

 

Yesterday I pointed you to the exact leaf that needs to be set. At the bottom of id-allocator.yang.  Don't you get that to work, or are you unable to set it?

 

Best Regards,

  /jan

khgrant
Cisco Employee

 

cc'ing the team...

 

 

Hello Jan,

 

We are unable to set it.

 

Kiran and Anusha are trying the below right now:

 

String resourcePath = "/services/siteswitch_multipoint_bridging:siteswitch_multipoint_bridging[device='" + devicelist.get(i) + "']"
+ "[interface-type='" + intfTypelist.get(i) + "'][interface-index='" + intfNamelist.get(i) + "'][vlan-id='" + vlanlist.get(i) + "']";
log.info("resourcePath: "+resourcePath);
ConfPath IdPath2 = new ConfPath("/ralloc:resource-pools/id-pool{%x}/allocation{%x}/allocating-service{%x}/request/id",
poolTypelist.get(i), servicePathlist.get(i), resourcePath);
ConfInt32 value = new ConfInt32(Integer.parseInt(evcIdlist.get(i)));

 

 

Regards,

-Fatih

 

khgrant
Cisco Employee

 

Fatih,

 

 

You got your path wrong. When in doubt about paths, I recommend going into the NCS CLI and setting the objects manually, then show ... | display xpath | display prefixes

 

JLINDBLA-M-J8L9(config-allocation-1)# sh f | display xpath | display prefixes

/ralloc:resource-pools/idalloc:id-pool[idalloc:name='x']/idalloc:allocation[idalloc:id='1']/idalloc:username fatih

/ralloc:resource-pools/idalloc:id-pool[idalloc:name='x']/idalloc:allocation[idalloc:id='1']/idalloc:request/idalloc:sync true

/ralloc:resource-pools/idalloc:id-pool[idalloc:name='x']/idalloc:allocation[idalloc:id='1']/idalloc:request/idalloc:id 15

 

Best Regards,

/jan

 

View solution in original post

Create
Recognize Your Peers
Content for Community-Ad