Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. NXShell change geoLocation

NXShell change geoLocation

Scheduled Pinned Locked Moved Support
2 Posts 2 Posters 21.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    thierryc
    wrote on last edited by
    #1

    Hello,

    I am trying to set the geoLocation on some containers using nxshell.
    I am not able to find how to set the geolocation neither how to update the geolocation of my node

    cd = session.findObjectById(123)
    geo = cd.geolocation
    print geo

    This works but now ...

    geo.setLatitude(11.1) or anything  in this way does not work.

    And then I can not find a  cd.setGeoLocation()
    And neither  cd.geolocation = geo  works as it is a read-only attribute.

    Regards.

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi,

      Geolocation is an immutable object, so you have to create new object when you need different location. NetObj and derived classes are also immutable, so you have to use NXCObjectModificationData class and session.modifyObject method. Working example for getting and setting geo location for node:

      from org.netxms.base import GeoLocation
      
      node = session.findObjectByName("netxms")
      print node.getGeolocation()
      md = NXCObjectModificationData(node.getObjectId())
      md.setGeolocation(GeoLocation(11.0, 22.0))
      session.modifyObject(md)
      

      Best regards,
      Victor

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups