arnessi / pynetdot Goto Github PK
View Code? Open in Web Editor NEWPython client for netdot REST API
License: GNU Lesser General Public License v3.0
Python client for netdot REST API
License: GNU Lesser General Public License v3.0
When I try and run code and use python3:
Traceback (most recent call last):
File "netdot_test_api.py", line 1, in <module>
import pynetdot
File "/usr/local/lib/python3.4/dist-packages/pynetdot/__init__.py", line 4, in <module>
from .models import *
File "/usr/local/lib/python3.4/dist-packages/pynetdot/models/__init__.py", line 3, in <module>
import base
ImportError: No module named 'base'
It seems there are still some bugs when running under python 3.
Here is one:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/temp/devel/netdot_extra/netdot_device.py in save_attribute(self, attribute_name, value, overwrite)
165 da.device = self.device
166 da.value = value
--> 167 da.save()
168 return da
169
~/.virtualenvs/pynetdot/lib/python3.6/site-packages/pynetdot/netdot.py in save(self)
192 id is not set.
193 """
--> 194 if not self.is_dirty():
195 # There were no changes
196 return True
~/.virtualenvs/pynetdot/lib/python3.6/site-packages/pynetdot/netdot.py in is_dirty(self)
156 if not self.id:
157 return True
--> 158 return bool(self.get_dirty_fields())
159
160 def display(self, view='all'):
~/.virtualenvs/pynetdot/lib/python3.6/site-packages/pynetdot/netdot.py in get_dirty_fields(self)
147 changed_fields = dict([
148 (key, value)
--> 149 for key, value in self._original_state.iteritems()
150 if value != new_state[key]
151 ])
AttributeError: 'dict' object has no attribute 'iteritems'
Write a method that will find a free ipblock of a given size in a give ipblock container and create it as a subnet.
such as host, updatedev and others.
See https://github.com/cvicente/Netdot/tree/master/htdocs/rest for all supported resources.
Write documentation
Examples, how to generate code for Base* classes...
>>> pynetdot.Person.all()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/matej/devel/pynetdot/pynetdot/netdot.py", line 60, in all
return cls._search()
File "/home/matej/devel/pynetdot/pynetdot/netdot.py", line 80, in _search
cls._from_netdot(obj, c.attrib)
File "/home/matej/devel/pynetdot/pynetdot/netdot.py", line 127, in _from_netdot
field.parse(obj)
File "/home/matej/devel/pynetdot/pynetdot/fields.py", line 137, in parse
class_ = getattr(pynetdot.models, self.link_to)
AttributeError: 'module' object has no attribute 'UserType'
Person references UserType, but this REST resurce is does not have a class - it's commented out in meta2model.py.
class BasePerson(n.Netdot):
_fields = [
f.LinkField('user_type', display_name='User Type', link_to='UserType'),
at the same time.
We could have class definitions for each netdot version in subfolders named after the netdot version.
We can get the version of netdot used by calling /netdot/rest/ or /netdot/rest/schemainfo/. We could then load our models from appropriate subfolder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.