Showing results for 
Search instead for 
Did you mean: 

Does POST cliTemplateConfiguration/upload work with Global Variables?


Hi All,

I've been using POST cliTemplateConfiguration/upload to upload CLI Templates into Prime but I'm having issues with templates which use global variables (they're not being populated when I deploy the template).  If I post the following template with local variables I can deploy without a problem and the hostname gets set to 'carlsrouter'

<?xml version="1.0" ?>


      <content>hostname $hostname


      <description>Applies Hostname</description>




      <path>My Templates/Zen Service Templates</path>




          <description>Device Host Name</description>








If I upload the following template into Prime via the API and deploy I get a router named '$gv.lab-hostname' :

<?xml version="1.0" ?>


      <content>hostname $gv.lab-hostname


      <description>Applies Hostname2</description>



      <path>My Templates/Provisioning Templates</path>


If I create either template using the Web UI they work without a problem.

Is there something special I need to do when uploading templates which use global variables via the API?



4 Replies 4

Spencer Zier
Cisco Employee
Cisco Employee

What version of Prime Infrastructure are you using?  We tried reproducing this issue on 3.1.0 but couldn't get it to reproduce.  As long as we defined the global variable in the UI, simply specifying it in the cliTemplate/content request parameter, like you do in your ZEN-HOSTNAME-POSTED2 example, works.

Hi Spencer,

Thanks for the feedback.  I'm using Build

Once I've POSTed the template to Prime (e.g. curl -H "Content-Type: text/xml" --data-binary @ZEN-HOSTNAME-POSTED3.xml -X POST -u username '')

You can see that when going to deploy the template through the Web GUI it doesn't recognise that I've provided a template with Global Variables (When the 'Form' button is selected):

Screen Shot 2016-11-04 at 11.57.45.png

But if I select the 'CLI' button you can see that the global variable is there:

Screen Shot 2016-11-04 at 11.58.08.png

Just to show the variable exists as a global variable:

Screen Shot 2016-11-04 at 11.58.32.png

If I search for and add the $gv.lab-hostname variable to the template through the Web GUI and save the template, it kicks it working using the global variables again.

i.e Web GUI update to make the template content look like this (then click save):


hostname $gv.lab-hostname



Then I see the expected form values when trying to deploy:

Screen Shot 2016-11-04 at 12.50.49.png

Were you using the exact same build when you tried to replicate?



Carl, my apologies.  There was a UI save happening afterwards that would cause the template to function properly during deployment when we attempted to reproduce this issue.  We'll work on getting this issue fixed.  I've created CSCvc11240 to track this issue (it's not publicly visible yet but should be within 24 hours).

Workarounds we'd suggest right now is either:

  1. Use template-specific (non-global) variables and populating the values as needed during deployment
  2. After uploading the template, open it in the UI and click the save button.

Thank you for bringing this issue up and thank you for your patience.  I very much appreciate it.

Edit: bug is now visible, added link

Hi Spencer,

Thanks for the update, hopefully the fix is simple and can be rolled out quickly.



Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers