-
Notifications
You must be signed in to change notification settings - Fork 898
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
Add lans as a virtual relationship to ems_cluster #17019
Conversation
app/models/ems_cluster.rb
Outdated
@@ -230,6 +232,12 @@ def memory_reserve | |||
get_reserve(:memory_reserve) | |||
end | |||
|
|||
def lans |
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.
should we move this to AggregationMixin
together with the existing all_storages
?
Possibly add a spec for it?
@agrare please review |
a4cc28e
to
33e034c
Compare
def lans | ||
hosts = all_hosts | ||
MiqPreloader.preload(hosts, :lans) | ||
hosts.collect(&:lans).flatten.compact.uniq |
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.
How about hosts.flat_map(&:lans).compact.uniq
instead of collect + flatten?
Lans need to be exposed via the API for the creation of transformation mappings. By adding this virtual relationship, they are able to be queried via `/api/clusters/:id?attributes=lans` There will be a lans collection added to the API in a follow-up PR
33e034c
to
61ce705
Compare
Checked commit jntullo@61ce705 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
👍
@miq-bot add_label gaprindashvili/yes Needed by ManageIQ/manageiq-api#325 for gaprindashvili v2v support |
Add lans as a virtual relationship to ems_cluster (cherry picked from commit 4e212e4)
Gaprindashvili backport details:
|
Lans need to be exposed via the API for the creation of transformation mappings. By adding this virtual relationship, they are able to be queried via
/api/clusters/:id?attributes=lans
cc: @bzwei, @priley86
@miq-bot assign @gtanzillo
@miq-bot add_label transformation