-
Notifications
You must be signed in to change notification settings - Fork 880
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
Remove "endpoints" field from /network/<id> #415
Comments
When doing a GET on a network resource, I feel the expected behavior is to get all the info about that resource. If there isn't any elegant way to do this (get only one property of the network resource), we can go ahead and remove the endpoint resources from the network resource, given we already have the URL for endpoints under a network: '"/networks/" + nwID + "/endpoints"' |
Oh, I didn't realize |
Typical way to do this is to allow pagination/sorting/filtering as a query string. E,g Thinking about this a little further, couldn't you use |
@dave-tucker Issue here is not a missing API, but the efficiency of getting the nw name from the nw id in a scaled setup with the current API: |
Finally looking into this, I think this would be taken care if we move to a more REST way, where a GET on a collection returns the list of members' identifiers, not the member themselves. Same can be done for the network resource representation: the member endpoints should be represented sa a collection of endpoint ids. The full expansion of the endpoint will be achieved via the We should modify all existing URL endpoints to behave this way. |
@aboch Would |
@rlane I was thinking the endpoints field would not be removed, rather it would contain a list of endpoints id. |
@aboch how about we return the both the ID and name - which I think is required to keep the functionality of the current query strings we have. Then to answer @rlane's question, we can add an
e.g "get the networks resource and filter it to only show elements where the id is equal to aabbccdd12345789" This would return: [
{
"id": "aabbccdd12345789",
"name" : "foo"
}
] A GET to [
{
"id": "aabbccdd12345789",
"name" : "foo"
},
{
"id": "aabbccdd12345799",
"name" : "bar"
}
]
|
@dave-tucker I think you are suggesting the GET from collection to return a list of resources in partial representation form. I see other references to this approach on line and simply driven by practicality. Thanks for suggesting this, LGTM. |
@rlane It has been detected that this issue has not received any activity in over 6 months. Can you please let us know if it is still relevant:
Thank you! |
Currently querying
/network/<id>
returns a list of all endpoints in the network. If all you want is the name of the network, then getting thousands of endpoints is an unnecessary cost. If a remote plugin queries the network name on each CreateEndpoint call then this makes the process of creating endpoints quadratic time.Instead, there could be a
/network/<id>/endpoints
resource that returns the list.edit: @aboch pointed out
/network/<id>/endpoints
already exists - thanks!The text was updated successfully, but these errors were encountered: