Skip to content

Prototype/example of an adapter that doesn't leverage the internal datastore #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/example3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Example 3

This is a simple example to show how DiffSync can be used to compare and synchronize data with a remote system like via a REST API like Nautobot.

For this example, we have a shared model for Region and Country defined in `models.py`.
A Country must be associated with a Region and can be part of a Subregion too.

The comparison and synchronization of dataset is done between a local JSON file and the [public instance of Nautobot](https://demo.nautobot.com).


## Install the requirements

to use this example you must have some dependencies installed, please make sure to run
```
pip install -r requirements.txt
```

## Try the example

The first time a lot of changes should be reported between Nautobot and the local data because by default the demo instance doesn't have the subregion define.
After the first sync, the diff should show no difference.
At this point, Diffsync will be able to identify and fix all changes in Nautobot. You can try to add/update or delete any country in Nautobot and DiffSync will automatically catch it and it will fix it with running in sync mode.

```
### DIFF Compare the data between Nautobot and the local JSON file.
main.py --diff

### SYNC Update the list of country in Nautobot.
main.py --sync
```

Loading