Meraki API : updating switch access policy updates the template access policy

SOLVED
Thibaut-Matzke
Here to help

Meraki API : updating switch access policy updates the template access policy

Hello,

 

While trying to write a simple python script to configure a switch access policy to a network template, I couldn't find any methods to change it from the template.

 

I tried the method  with a configuration template ID in it :

dashboard.switch.updateNetworkSwitchAccessPolicy(networkId=MyTemplateNetworkId)

 And got the following API Error :

 

"meraki.exceptions.APIError: switch, updateNetworkSwitchAccessPolicy - 400 Bad Request, {'errors': ['Unsupported for configuration templates']}"

 

I then tried to update a switch access policy bind to this template by using the same method, and it worked :

dashboard.switch.updateNetworkSwitchAccessPolicy(networkId=frwhlppd_network_id, accessPolicyNumber="1",name=' TEST ')

 

2021-08-24 09:49:09 meraki: INFO > PUT https://api.meraki.com/api/v1/networks/L_XXXXXXXXXXXXX/switch/accessPolicies/1
2021-08-24 09:49:10 meraki: INFO > switch, updateNetworkSwitchAccessPolicy - 200 OK
{'accessPolicyNumber': '1', 'name': ' TEST ', [...] }

 

 

Is this normal ? I guess this is for now the only way to modify a template access policy, but will we have another way to do it (by using the template-related method for instance) ? 

 

Thank you in advance for your answers on this topic !

1 ACCEPTED SOLUTION

@Thibaut-Matzke : who has write access to a template-bind switch can modify the access policy of this template?

Yes

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com

View solution in original post

4 REPLIES 4
Inderdeep
Kind of a big deal
Kind of a big deal

@Thibaut-Matzke : Check the below link for the access Policy API call

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

 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com

Hello Inderdeep,

 

Thank you for your reply. Yes I do know that is the access Policy API call, but my question is : is it normal that using a switch-related API call modifies the template bind to it ?

 

When you have a switch that isn't bind to any template, the access policy is only for the switch, which is logic.

 

But when you have a switch bind to a template, the functionality is only available on the template side, not on the switch side.

 

To modify a template switch access policy, you would except to use a API call in the config Templates API group, but it actually works by using a method in the switch API call Group.

 

This means that anyone who has write access to a template-bind switch can modify the access policy of this template, right ? 

@Thibaut-Matzke : who has write access to a template-bind switch can modify the access policy of this template?

Yes

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com

Hello Inderdeep,

 

Okay, thank you very much !

Get notified when there are additional replies to this discussion.