moveMapMarker Not Working For UpdateNetworkDevice

CCIE-Adam
Getting noticed

moveMapMarker Not Working For UpdateNetworkDevice

When I update a network device and set moveMapMarker to true, the map marker is not moved.  Funny thing is, if I go into the dashboard and click the pencil next to the address and click save (not changing the address that's in there currently), it's moved. So I know the address is good.  Code looks like this:

 

kwargs = {

                            'name': '12345 - Switch',
                            'address': '123 Any St, Sometown TN' , * Yes, I have a real address in here.
                            'moveMapMarker ': True
                        }
dashboard.devices.updateNetworkDevice('123456789', 'XXXX-XXXX-XXXX', **kwargs)

It will update the name and address fine so I know the call is not erroring out.  Anyone else have this issue?

8 Replies 8
PhilipDAth
Kind of a big deal
Kind of a big deal

I have used that API before but with GPS co-ordinates and that did update ok.

 

I'm picking it doesn't like something about the address format.  I note your address does not include the country.  Perhaps make your address more globally unique.

CCIE-Adam
Getting noticed

It worked when I used the 0.34 legacy API.  Best I can tell, it quit working when I moved to the 0.9x API.  I don't think it's the address format as I can login to the dashboard and click save with no change to the address and it will move it. 

PhilipDAth
Kind of a big deal
Kind of a big deal

I don't think that is a valid test.

 

It all depends on how the system is determining which country you are in if you leave that out of your address.  Perhaps when you use the dashboard and click save it is geolocating your location from the IP address you are browsing using.  The API couldn't risk using this approach.

 

I think you are running a risk if not using a fully formed address which includes the country the address is in.

 

 

Put another way, could you expect to write the address you have used on an envelope, and then post it from any country in the world, and expect to get it delivered?

CCIE-Adam
Getting noticed

I will give that a try when I get to the office tomorrow.   I'm just trying to figure out why it quit working.

CCIE-Adam
Getting noticed

I put USA at the end of the address and it still did not move the marker.  

CCIE-Adam
Getting noticed

Even if I specify the lat and lng, it does not move the marker.  

 

EDIT:  Specifying the lat and lng does work.  I was just doing it wrong.  What I ended up doing was setting up an account with Google and using their API to get the coordinates.

CCIE-Adam
Getting noticed

I actually got this to work by moving the moveMapMarker = True out of the kwargs variable and putting it inline with the function call.  Seems odd it will take some parameters in the kwargs but not all.  Ended up looking something like this:

 

kwargs = {

                            'name': '12345 - Switch',
                            'address': '123 Any St, Sometown TN' , * Yes, I have a real address in here.
                        }
dashboard.devices.updateNetworkDevice('123456789', 'XXXX-XXXX-XXXX', **kwargs, moveMapMarker = True)

CCIE-Adam
Getting noticed

I also found my original issue with having the moveMapMarker in the kwargs dictionary.   I had a space after the moveMapMarker key.  I would expect this to error out but the code simply ignored it.  

Get notified when there are additional replies to this discussion.