The documentation in 6.3 (which hopefully is the same as 6.2) calls for that last argument to be a DBKey, which I think should be of a similar format to argument #8. It looks like you're providing an integer rather than a DBKey.
Hmm... yes, it does not seem to be the right format. However, that is the value I get back from "Template getTemplateIDByName" and there doesn't seem to be a way to lookup it's DB key...
I think the only published way to get the template key is to create the template from the BLCLI. You'll notice that all of the Template create... and Template add... return DBKey.
Message was edited by: Tim Fessenden
I was able to hack it out by constructing the key based on the ID, but it means you have to know the latest version number of the template.
This is fine until you change your template and then the version numbers won't match!
If any of the PS guys have developed an add-on BLCLI call to get the DBKey for a template by name/group, that would be helpful.
Aaron - I'm very disappointed. What a sloppy hack! :)
Here ya go. I haven't tested it, but it should work. Copy this to your .../br/xml/cli directory.
Template getDBKeyByGroupAndName "/fq/group/name" "template name"
I wasn't going to use my sloppy hack long term, just for the short term to get the whole process working.
I was hoping someone had already implemented this so I wouldn't have to figure it out myself. So I appreciate you whipping something up...
Use the attached instead, and invoke like so:
Template getTemplateDBKeyByGroupAndName "/fq/group/name" "template name"
Brad, the one you posted didn't work for me.
I kept getting:
Command execution failed. Failed to parse xml command file : C:\Program Files\BladeLogic\OM\br\xml\cli\Template-PSAdditional.xml
In the blcli log, it indicated there was a validation error:
org.xml.sax.SAXParseException: The content of element type "command_invocation" is incomplete, it must match "(namespace_ref,name,input,store_result?)".
I cleaned up the XML a bit, removed a weird comment and some """ strings to the point where it looked pretty much like the unreleased command that I found in Template-Additional.xml, but still no dice, same error.
So then I copied the getDBKeyByGroupAndName from Template-Additional.xml and marked it as released, but then that produced the following error:
Command execution failed. R: Cannot find command : Template, getDBKeyByGroupAndName
I think that maybe if there are two CLI calls with the name "method signature", then you get this error because renaming it to getTemplateDBKeyByGroupAndName did the trick.
Yeah, that's good. I told you I didn't test it. We can talk about this offline to solve the mystery.