-
Notifications
You must be signed in to change notification settings - Fork 34
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
Adds new relationship_association module #146
Adds new relationship_association module #146
Conversation
@jvanderaa I have fixed all failing tests. |
token: thisIsMyToken | ||
relationship: 01234567-abcd-0123-abcd-012345678901 | ||
source_type: dcim.device | ||
source_id: abcdefgh-0123-abcd-0123-abcdefghijkl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we could potentially do to make it easier for the user is to find the ID for them by taking the source.type and kwargs under source
and find it for them, but it is extra logic I don't know if we have currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source/destination ID is not the ID of the type, but rather the actual Device/IP Address/etc. object to relate to the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Here is an example:
- name: Create relationship association
networktocode.nautobot.relationship_association:
url: http://nautobot.local
token: thisIsMyToken
relationship: 01234567-abcd-0123-abcd-012345678901
source_type: dcim.device
source:
name: den-edge-01
site: DEN
destination_type: ipam.vrf
destination_id: 01234567-abcd-0123-abcd-123456789012
We can split on the source_type that will provide us the correct app and endpoint to query against.
We would then search for that for them rather than them having to lookup the ID by using the lookup plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. There are many places convenience logic like that could be added for sure.
Closes: #143