This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Golang and Python.
Apache License 2.0
12
stars
16
forks
source link
Resource retrieve! should not get index for resource #300
Improve the performance of the resource #retrieve! method.
Environment Details
OneView SDK Version: All, but current is 5.2.0
OneView Appliance Version: All
OneView Client API Version: All
Ruby Version: All
Platform: All
Steps to Reproduce
call #retrieve! on any resource and follow the REST calls being made
Expected Result
Do an intelligent lookup of the resource. Instead of getting the entire list of resources and filtering with Ruby code, it should send the query in the OneView API request, so only that resource is returned. If the URI is set, it can even just do a refresh.
Another option is to create an additional method, but I believe the idea of #retrieve! is to be a performant, safe retrieval using unique attributes.
Actual Result
This method is really not much more than a wrapper for ::find_by(*args).first. When there are large numbers of resources, the current implementation is slow and potentially dangerously memory-intensive.
Scenario/Intent
Improve the performance of the resource
#retrieve!
method.Environment Details
Steps to Reproduce
call
#retrieve!
on any resource and follow the REST calls being madeExpected Result
Do an intelligent lookup of the resource. Instead of getting the entire list of resources and filtering with Ruby code, it should send the query in the OneView API request, so only that resource is returned. If the URI is set, it can even just do a refresh.
Another option is to create an additional method, but I believe the idea of
#retrieve!
is to be a performant, safe retrieval using unique attributes.Actual Result
This method is really not much more than a wrapper for
::find_by(*args).first
. When there are large numbers of resources, the current implementation is slow and potentially dangerously memory-intensive.