cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
18
Views
0
Helpful
5
Replies
Highlighted
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.

Everyone's tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

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

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

View solution in original post

5 REPLIES 5
Cisco Employee

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

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.

Cisco Employee

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

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.

 

Cisco Employee

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

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?

Cisco Employee

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

We are unable to set it and 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)));

Cisco Employee

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

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

View solution in original post

Content for Community-Ad
August's Community Spotlight Awards