cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NameError: name 'UplinkEnum' is not defined

SOLVED
Highlighted
Getting noticed

NameError: name 'UplinkEnum' is not defined

Hi I've got a problem with this python request. error log : 

 

File "uplinks-stats.py", line 15, in <module>
uplink = UplinkEnum.WAN1
NameError: name 'UplinkEnum' is not defined

 

Script : 

 

import json
from meraki_sdk.meraki_sdk_client import MerakiSdkClient
from meraki_sdk.exceptions.api_exception import APIException

x_cisco_meraki_api_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
meraki = MerakiSdkClient(x_cisco_meraki_api_key)


collect = {}

organization_id = 'XXXXXX'
collect['organization_id'] = organization_id

uplink = UplinkEnum.WAN1
collect['uplink'] = uplink

ip = '8.8.8.8'
collect['ip'] = ip

organization_uplinks_stats = meraki.organizations.get_organization_uplinks_loss_and_latency(collect)

with open('data-uplink.json', 'w') as f:
json.dump(organization_uplinks_stats, f)

 

 

 

 Any ideas ?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Kind of a big deal

Re: NameError: name 'UplinkEnum' is not defined

Add the following import:

from meraki_sdk.models.uplink_enum import UplinkEnum

View solution in original post

3 REPLIES 3
Kind of a big deal

Re: NameError: name 'UplinkEnum' is not defined

Add the following import:

from meraki_sdk.models.uplink_enum import UplinkEnum

View solution in original post

Highlighted
Getting noticed

Re: NameError: name 'UplinkEnum' is not defined

Thanks it work ! Think Cisco need to add this information to the documentation because I never saw it

Highlighted
Meraki Employee

Re: NameError: name 'UplinkEnum' is not defined

This confusion is one of the reasons why we are deprecating that Python SDK, which is auto-generated by a third-party tool, with our library/package published in-house.

Solutions Architect @ Cisco Meraki | API & Developer Ecosystem
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.