API: How do you set a ConfigurationTemplate's Notes field using the API?

david_n_m_bond
Building a reputation

API: How do you set a ConfigurationTemplate's Notes field using the API?

It can be done in the UI.  I see no way to do it in the API.

 

Any thoughts?

Author, https://www.nuget.org/packages/Meraki.Api/
10 Replies 10
RaphaelL
Kind of a big deal
Kind of a big deal

Just to make sure , you are talking about this in the UI : 

 

Select the template , Network-Wide -> General  , Network Notes ?

RaphaelL_0-1644450081359.png

 

david_n_m_bond
Building a reputation

Hi @RaphaelL ,

 

That's the one.  It seems that this cannot be set via the API?

Author, https://www.nuget.org/packages/Meraki.Api/

Even worse , you can't even read the value from the API.

 

At the moment none of these 2 calls can't help you :

PUT /organizations/{organizationId}/configTemplates/{configTemplateId}

GET /organizations/{organizationId}/configTemplates

 

Sorry.

AutomationDude
Building a reputation

Hey David,

 

I believe you can simple use the normal API call for networks, as templates also have a network_id associated to them.

https://developer.cisco.com/meraki/api-v1/#!update-network

 

Since Templates are not returned when using the call Get Orgs Network , I doubt that you could update them as a network.

AutomationDude
Building a reputation

Hmm you might be right, I came across a similar use case a long time ago and there was something about being able to access templates via network calls. Might be confusing two things though, will test on my side when I have time and report back

NetworkLarry
Getting noticed

The Network notes field of a Template is inherited by the networks bound to the template.  You may have noticed the templated networks do not have a visible Network notes field in the Dashboard UI.  However, that field shows up in the API data of the network and it contained the Template Notes contents.

 

@RafaelL - The ConfigTemplateId key/value is returned by that API call if the network is bound to a template.

The following line of Python code will assign templateID the value of configTemplateId if the key is present, otherwise, it assigns the value "unbound".  
templateID = network.get('configTemplateId', "unbound")

If you want to obtain the organization's templates, you have to use this API call.  And, as you can see you receive very little template information from that call.  https://developer.cisco.com/meraki/api-v1/#!get-organization-config-templates
 
Larry

You CAN retrieve it via API because the Network will inherit the notes  ( via getOrganizationNetworks or getNetwork ) but you CAN'T update the Template notes via API. 

A small caveat to this is that you can of course only retrieve it if you HAVE a network bound to it. 

NetworkLarry
Getting noticed

That was my point - I was correcting your earlier statement "Since Templates are not returned when using the call Get Orgs Network".

 

Agreed, you cannot update the Template notes, currently.  I didn't say you could.

 

There are a lot of settings that are set by templates that you cannot update via the API in networks bound to a template.  This is an area where the API documentation is lacking - those exceptions should be clearly documented, but currently they are not.  You only discover it when you try to use an API call and you get an error message stating something to the effect "templated networks are not supported by this endpoint".  

Get notified when there are additional replies to this discussion.