I see a post from 2010 that indicates that nested macros won't be supported. However, the use case seems like it would be so common, there must be a workaround.
I have an HTTP Agent that retrieves a json array containing details about 5 ethernet switches. I've gotten Discovery to create the host entries. So far, so good. Now I'm trying to create a template that will do this across multiple devices. The first issue I run into is API keys. I'd expect to be able to define the API keys as macros within each respective top-level host. Then, in the template macro, I could just reference them like this...
{$API_SWITCHES_URL} => https://somedomain.com/api/switches/index.json?api_key={$API_KEY}
{$API_KEY} is defined in the host.
When I attempt to test this in a host though, it shows up as two separate macros and no substitution is done. Is there a way around this?
I have an HTTP Agent that retrieves a json array containing details about 5 ethernet switches. I've gotten Discovery to create the host entries. So far, so good. Now I'm trying to create a template that will do this across multiple devices. The first issue I run into is API keys. I'd expect to be able to define the API keys as macros within each respective top-level host. Then, in the template macro, I could just reference them like this...
{$API_SWITCHES_URL} => https://somedomain.com/api/switches/index.json?api_key={$API_KEY}
{$API_KEY} is defined in the host.
When I attempt to test this in a host though, it shows up as two separate macros and no substitution is done. Is there a way around this?
Comment