Skip to content

Instantly share code, notes, and snippets.

@jathanism
Created October 21, 2015 22:43
Show Gist options
  • Save jathanism/bced45430baf6bfd7e62 to your computer and use it in GitHub Desktop.
Save jathanism/bced45430baf6bfd7e62 to your computer and use it in GitHub Desktop.
import copy
from pynsot.client import get_api_client()
api = get_api_client()
site = api.sites(api.default_site)
objects = site.networks.get(network_address='192.168.0.0')['data']['networks']
to_update = copy.deepcopy(objects)
[t['attributes'] = {} for t in to_update] # Strip the attributes
result = site.networks.put(to_update)
# result will be a list of the updated objects and be a 200 OK response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment