Environment
Proposed Functionality
The README makes mention of extending a "base" DiffSyncModel for handling CRUD actions in a backend, but doesn't do a great job of visualizing this concept.
you need to extend your DiffSyncModel class(es) to define your own create, update and/or delete methods for each model.
I think extending the example out a little more would go a long way to showing how to build your models and adapters.
classDevice(DiffSyncModel):
"""Example model of a network Device."""
_modelname="device"_identifiers= ("name",)
_attributes= ()
_children= {"interface": "interfaces"}
name: strsite_name: Optional[str] # note that this attribute is NOT included in _attributesrole: Optional[str] # note that this attribute is NOT included in _attributesinterfaces: List=list()
classSystemADevice(Device):
system_A_unique_field: Optional[str] =None@classmethoddefcreate(cls, diffsync, ids, attrs):
"""Talk to SystemA to create device"""pass
classSystemBDevice(Device):
system_B_unique_field: Optional[str] =None@classmethoddefcreate(cls, diffsync, ids, attrs):
"""Talk to SystemB to create device"""passUse Case
This should help newbies (like myself) to get a better idea of how to architect a diffsync-based integration.
Environment
Proposed Functionality
The README makes mention of extending a "base" DiffSyncModel for handling CRUD actions in a backend, but doesn't do a great job of visualizing this concept.
I think extending the example out a little more would go a long way to showing how to build your models and adapters.
Use Case
This should help newbies (like myself) to get a better idea of how to architect a diffsync-based integration.