cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4091
Views
2
Helpful
3
Replies

Update Device Switch Port (python) problem (HTTP response not OK)

damienleick1
Level 2
Level 2

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
1 Accepted Solution

Accepted Solutions

damienleick1
Level 2
Level 2

Finaaly success to do it not with meraki api

View solution in original post

3 Replies 3

damienleick1
Level 2
Level 2

Finaaly success to do it not with meraki api

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/