You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying a filter in a custom relationship the UI limits the choices on that side of the relationship to match the filter. However, it is possible to use the API to create a relationship-association which violates this filter.
Steps to Reproduce
Create a 2 sites (object types really don't matter) site1 and site2
Create a VM Cluster cluster1
Create a relationship 1-1 relating a virtualization | cluster to a dcim | site using a filter such as:
{
"name": "site1"
}
Navigate to the cluster in the UI and attempt to relate the cluster to site2, in the UI you should see the choices are limited to site1.
Use the API to POST to /extras/relationship-associations/ something like (replacing the ids with the source_id of cluster1 and the destination id of site2):
The UI and the API should be consistent. The API should fail to create the relationship-association as this does not match the given filters.
Observed Behavior
The API creates the relationship with site2 which is invalid in the UI.
The text was updated successfully, but these errors were encountered:
glennmatthews
changed the title
Custom Relationship API does not honor filters
Custom Relationship REST API does not honor filter restrictions
Apr 4, 2022
Environment
When specifying a filter in a custom relationship the UI limits the choices on that side of the relationship to match the filter. However, it is possible to use the API to create a relationship-association which violates this filter.
Steps to Reproduce
/extras/relationship-associations/
something like (replacing the ids with the source_id of cluster1 and the destination id of site2):Expected Behavior
The UI and the API should be consistent. The API should fail to create the relationship-association as this does not match the given filters.
Observed Behavior
The API creates the relationship with site2 which is invalid in the UI.
The text was updated successfully, but these errors were encountered: