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

SOLVED
damienleick
Getting noticed

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
1 ACCEPTED SOLUTION
damienleick
Getting noticed

Finaaly success to do it not with meraki api

View solution in original post

3 REPLIES 3
damienleick
Getting noticed

Finaaly success to do it not with meraki api

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.

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.