noc.core.gridvcs.manager

Module Contents

noc.core.gridvcs.manager.logger
class noc.core.gridvcs.manager.GridVCSField(repo)

Bases: object

Django’s model manager.

class MyModel(NOCModel):
… data = GridVCSModelManager(“my_repo”) …

o = MyModel() # Place data o.data.write(“text”) # Get last revision print o.data.read() # Get list of revisions revisions = o.data.get_revisions() # Get revision print o.data.get_revision(r) # Get diff between revision print o.data.diff(rev1, rev2)

contribute_to_class(self, model, name)

Initialize Django’s model

__get__(self, instance, owner)

Mongoengine shortcut

class noc.core.gridvcs.manager.GridVCSObjectDescriptor(field)

Bases: object

__get__(self, instance, instance_type=None)
class noc.core.gridvcs.manager.GridVCSObjectProxy(repo, id)

Bases: object

_cache
get_gridvcs(self)
read(self)
write(self, data)
delete(self)
get_revision(self, r)
has_revision(self, r)

Check config has revision

Parameters:r – String containing revision id
Returns:True if object has revision
get_revisions(self, reverse=False)
diff(self, r1, r2)
mdiff(self, r1, obj2, r2)