Feb 25 2020
6:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 25 2020
6:35 AM
Update Device Switch Port (python) problem (HTTP response not OK)
Hi i've got a problem.
I would like to update a config on a port of one of my switch with API (python) and i've always got a : HTTP response not OK.
from meraki import meraki
from meraki_sdk.meraki_sdk_client import MerakiSdkClient
from meraki_sdk.models.update_device_switch_port_model import UpdateDeviceSwitchPortModel
from meraki_sdk.models.udld_enum import UdldEnum
from meraki_sdk.exceptions.api_exception import APIException
x_cisco_meraki_api_key = 'MY_API_KEU'
client = MerakiSdkClient(x_cisco_meraki_api_key)
switch_ports_controller = client.switch_ports
collect = {}
serial = 'Q2DX-XXXX-XXXX'
collect['serial'] = serial
number = '23'
collect['number'] = number
update_device_switch_port = UpdateDeviceSwitchPortModel()
update_device_switch_port.enabled = True
update_device_switch_port.mtype = 'access'
update_device_switch_port.vlan = 667
update_device_switch_port.poe_enabled = False
update_device_switch_port.isolation_enabled = False
update_device_switch_port.rstp_enabled = True
update_device_switch_port.stp_guard = 'BPDU guard'
update_device_switch_port.link_negotiation = 'Auto negotiate'
update_device_switch_port.udld = UdldEnum.ENUM_ALERT_ONLY
update_device_switch_port.storm_control_enabled = True
collect['update_device_switch_port'] = update_device_switch_port
try:
result = switch_ports_controller.update_device_switch_port(collect)
except APIException as e:
print(e)
Any ideas ? thanks
Solved! Go to solution.
Labels:
- Labels:
-
Dashboard API
1 Accepted Solution
Feb 25 2020
10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 Replies 3
Feb 25 2020
10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 25 2020
10:04 AM
Finaaly success to do it not with meraki api
Feb 25 2020
12:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 25 2020
12:30 PM
The specific Meraki SDK you‘re using will be deprecated, take a look at https://community.meraki.com/t5/Developers-APIs/Python-update-network-device/m-p/76600/highlight/tru...
As mentioned, use https://github.com/meraki/dashboard-api-python instead.
Feb 25 2020
12:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 25 2020
12:39 PM
I have update to last version and using the official documentation of API.
Anyway i've done what I want with this one https://developer.cisco.com/codeexchange/github/repo/meraki/automation-scripts/

Get notified when there are additional replies to this discussion.