cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
493
Views
0
Helpful
2
Replies

Query package version through upgrade component

yfherzog
Cisco Employee
Cisco Employee

Implementing an upgrade component for an NSO package, can we somehow query the current package version field and the target package version field (package-version field in package-meta-data.xml) from within the Java code of the upgrade component?

Thank you!

Yftach

2 Replies 2

rogaglia
Cisco Employee
Cisco Employee

hi Yftach,

I am sure I am not understanding your question because the current package version can be seen using the traditional API calls:

admin@ncs> show packages package l3vpn package-version

package-version 1.0

[ok][2018-06-13 17:02:27]

admin@ncs>

Roque

Thanks Roque!

The idea is to be able to query both the current version and the target one inside the upgrade component code, and then be able to reach decisions based on that.

To be honest, I realize that that querying /packages/package{l3vpn}/package-version should give me the current version.

Having said, I was unable to retrieve it. I was trying different ways to open (operational) CDB sessions, but when I try to query the path mentioned, I get errors such as "Not a cdb path: /packages".

I'm probably doing something wrong, so would like to have some sort of reference for how to fetch it.

And also, would like to hear if someone can provide any clues on how to query the package-version field of the new package.

Yftach