unable to find in SDK: MS STP settings/root bridge option

Solved
YoeriOppelaar1
Here to help

unable to find in SDK: MS STP settings/root bridge option

Hi All,

i hope i overlooked it together with a colleage, but we are unable to find the function in the Python Meraki SDK to view or set the MS STP setting / Root bridge priority values. 

 

We are looking for the function that uses this API endpoint ( https://developer.cisco.com/meraki/api-v1/get-network-switch-stp/ ) (GET and PUT) version. 

 

Of course i could use the api endpoint directly but as 99% of our automation for Meraki rely on the SDK i prefer to stick with it.

 

hope someone can point to the right function, or that Meraki devs could make it available in the SDK

 

1 Accepted Solution
Greenberet
Head in the Cloud

try to update your local meraki library. Maybe it is outdated.

 

 


Get:

import meraki

# Defining your API key as a variable in source code is not recommended
API_KEY = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0'
# Instead, use an environment variable as shown under the Usage section
# @ https://github.com/meraki/dashboard-api-python/

dashboard = meraki.DashboardAPI(API_KEY)

network_id = 'L_646829496481105433'

response = dashboard.switch.getNetworkSwitchStp(
    network_id
)

print(response)

 

Put:

import meraki

# Defining your API key as a variable in source code is not recommended
API_KEY = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0'
# Instead, use an environment variable as shown under the Usage section
# @ https://github.com/meraki/dashboard-api-python/

dashboard = meraki.DashboardAPI(API_KEY)

network_id = 'L_646829496481105433'

response = dashboard.switch.updateNetworkSwitchStp(
    network_id, 
    rstpEnabled=True, 
    stpBridgePriority=[{'switches': ['Q234-ABCD-0001', 'Q234-ABCD-0002', 'Q234-ABCD-0003'], 'stpPriority': 4096}, {'stacks': ['789102', '123456', '129102'], 'stpPriority': 28672}]
)

print(response)

 

The examples are from the meraki page you've linked. Just press the "template" button

View solution in original post

2 Replies 2
Greenberet
Head in the Cloud

try to update your local meraki library. Maybe it is outdated.

 

 


Get:

import meraki

# Defining your API key as a variable in source code is not recommended
API_KEY = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0'
# Instead, use an environment variable as shown under the Usage section
# @ https://github.com/meraki/dashboard-api-python/

dashboard = meraki.DashboardAPI(API_KEY)

network_id = 'L_646829496481105433'

response = dashboard.switch.getNetworkSwitchStp(
    network_id
)

print(response)

 

Put:

import meraki

# Defining your API key as a variable in source code is not recommended
API_KEY = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0'
# Instead, use an environment variable as shown under the Usage section
# @ https://github.com/meraki/dashboard-api-python/

dashboard = meraki.DashboardAPI(API_KEY)

network_id = 'L_646829496481105433'

response = dashboard.switch.updateNetworkSwitchStp(
    network_id, 
    rstpEnabled=True, 
    stpBridgePriority=[{'switches': ['Q234-ABCD-0001', 'Q234-ABCD-0002', 'Q234-ABCD-0003'], 'stpPriority': 4096}, {'stacks': ['789102', '123456', '129102'], 'stpPriority': 28672}]
)

print(response)

 

The examples are from the meraki page you've linked. Just press the "template" button

Hi @Greenberet 
I use SDK 1.37 just checked it, i tried to refer, even hardcoded, my editor ( VSCode) tells me that function is not in module.

i just digged in the function of the SDK, and indeed it is allready in there, so probaly my editor is messing up.

i look to editor first from now on!

Thanks so much.

 

Get notified when there are additional replies to this discussion.