06-13-2018 02:39 AM - edited 03-01-2019 04:11 AM
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
06-13-2018 08:04 AM
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
06-13-2018 10:34 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide