Git Product home page Git Product logo

Comments (9)

shiyuechengineer avatar shiyuechengineer commented on August 20, 2024

I just tested and it was successful for me. It would be helpful to troubleshoot your situation if you included information like the version of the library you're using, your source code, and also the logging data as evidence of whether you are getting 2XX responses. Here's what works for me on the latest beta version 1.0.0b8:

import meraki
m = meraki.DashboardAPI()
m.devices.updateDevice(serial, address='500 Terry A Francois Blvd, San Francisco, CA 94158', moveMapMarker=True)

from dashboard-api-python.

shiyuechengineer avatar shiyuechengineer commented on August 20, 2024

Here's the code with the same result (200 OK, address updated and map marker moved successfully) on version 0.110.3.

import meraki
m = meraki.DashboardAPI()
m.devices.updateNetworkDevice(network_id, serial, address='500 Terry A Francois Blvd, San Francisco, CA 94158', moveMapMarker=True)

from dashboard-api-python.

neveragain2003 avatar neveragain2003 commented on August 20, 2024

Tried the following on version 0.90.2:
import meraki
apiKey = 'APIKEY'
dashboard = meraki.DashboardAPI(api_key=apiKey)
kwargs = {
'address': '6100 Tower Circle, Franklin, TN 37067',
'moveMapMarker ': True
}
dashboard.devices.updateNetworkDevice(networkID, serial, **kwargs)

I get a 200 response and the address is changed but the marker is not moved in the dashboard.

When I do it your way and remove the **kwargs and put the parms inline with the function call, it works. Any advice as to why it will take the address in the kwargs but not the moveMapMarker?

from dashboard-api-python.

shiyuechengineer avatar shiyuechengineer commented on August 20, 2024

Thanks for providing that information since it's exactly what is needed to troubleshoot. The reason why it doesn't work is because of the extra trailing space in the 'moveMapMarker ' key. Remove that, and you will be able to make the change successfully.

from dashboard-api-python.

neveragain2003 avatar neveragain2003 commented on August 20, 2024

Thank you for the information. I did not notice the extra space.

from dashboard-api-python.

shiyuechengineer avatar shiyuechengineer commented on August 20, 2024

No problem and due to this issue you've reported, we'll make a change to future versions so that errant spaces like this will be fixed automatically, basically changing payload = {k: v for (k, v) in kwargs.items() if k in body_params} to payload = {k.strip(): v for (k, v) in kwargs.items() if k.strip() in body_params}.

from dashboard-api-python.

neveragain2003 avatar neveragain2003 commented on August 20, 2024

I am curious why you allow values that are not valid and not have it error out? I just ran into a similar issue where I misspelled timeZone. It didn't throw an error and it took me a minute to find the mistake.

from dashboard-api-python.

shiyuechengineer avatar shiyuechengineer commented on August 20, 2024

You can only do so much user error checking... if you try to make the API call separately of the Python library, you'll see you can include random attributes/objects to the request body, and it wouldn't return an error either.

from dashboard-api-python.

shiyuechengineer avatar shiyuechengineer commented on August 20, 2024

Hey @neveragain2003, thinking about this more, if we were to check for invalid input parameters like moveMapMarker (with a space) or timezone (without capitalizing Z), what would you like to see happen? For example, a warning message that gets displayed to notify you about the typo (but still proceeding to make the call), or an exception where that call is not made entirely at all?

from dashboard-api-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.