Skip to content
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

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

jntullo
Copy link

@jntullo jntullo commented Feb 19, 2018

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

@@ -230,6 +232,12 @@ def memory_reserve
get_reserve(:memory_reserve)
end

def lans
Copy link
Contributor

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?

@bzwei
Copy link
Contributor

bzwei commented Feb 19, 2018

@agrare please review

def lans
hosts = all_hosts
MiqPreloader.preload(hosts, :lans)
hosts.collect(&:lans).flatten.compact.uniq
Copy link
Member

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
@miq-bot
Copy link
Member

miq-bot commented Feb 19, 2018

Checked commit jntullo@61ce705 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@agrare agrare assigned agrare and unassigned gtanzillo Feb 20, 2018
@agrare agrare merged commit 4e212e4 into ManageIQ:master Feb 20, 2018
@agrare agrare added this to the Sprint 80 Ending Feb 26, 2018 milestone Feb 20, 2018
@himdel
Copy link
Contributor

himdel commented May 20, 2018

@miq-bot add_label gaprindashvili/yes

Needed by ManageIQ/manageiq-api#325 for gaprindashvili v2v support

simaishi pushed a commit that referenced this pull request May 29, 2018
Add lans as a virtual relationship to ems_cluster
(cherry picked from commit 4e212e4)
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 96fdbc36275d13b05fd7e7ebeecd20db10cd81be
Author: Adam Grare <agrare@redhat.com>
Date:   Mon Feb 19 20:04:56 2018 -0500

    Merge pull request #17019 from jntullo/ems_cluster_lans
    
    Add lans as a virtual relationship to ems_cluster
    (cherry picked from commit 4e212e4b276591eae36c2c8a2a5e80803a4c0828)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants