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

Adding summary for number of resources, racks and health states to Provider #17841

Merged

Conversation

EsdrasVP
Copy link
Member

This PR is able to:

  • Add a counter for the number of resources on a Physical Infrastructure Provider
  • Add a counter for the number of health states on a Physical Infrastructure Provider

This should be displayed at the API by accessing

  • /api/providers/:id?attributes=resources_info
  • /api/providers/:id?attributes=health_state_info

If both are accessed, the response is presented as follows:

{
    "resources_info": {
        "total_racks": 100,
        "total_resources": 200
    },
    "health_state_info": {
        "total_valid": 150,
        "total_warning": 30,
        "total_critical": 20
    }
}

@EsdrasVP EsdrasVP force-pushed the provider_resources_status_summary branch 4 times, most recently from 8de93d2 to 5a67ca2 Compare August 10, 2018 18:44
@EsdrasVP
Copy link
Member Author

@miq-bot assign @agrare

virtual_column :total_valid, :type => :integer
virtual_column :total_warning, :type => :integer
virtual_column :total_critical, :type => :integer
virtual_column :health_state_info, :type => :string
Copy link
Member

Choose a reason for hiding this comment

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

Where are you planning on using this virtual column? It's defined as :string but the method returns a hash.

Copy link
Member Author

@EsdrasVP EsdrasVP Aug 13, 2018

Choose a reason for hiding this comment

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

@gtanzillo The intention is to add it to the physical infra provider JSON response at the ManageIQ API. I put it as a :string because there is no type :hash for virtual columns. What I could do is do create these columns as :json, I didn't do it before because I didn't know it was possible. What do you think of that? It's more accurate, and fit to the purpose, then :string.

Copy link
Member

Choose a reason for hiding this comment

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

@EsdrasVP Yes, I think that the :json type makes more sense here and I would go with that.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gtanzillo Great, I made the change, so :json will be used instead of :string.

@EsdrasVP EsdrasVP force-pushed the provider_resources_status_summary branch from 5a67ca2 to 5ed1437 Compare August 16, 2018 12:50
@miq-bot
Copy link
Member

miq-bot commented Aug 16, 2018

Checked commit EsdrasVP@5ed1437 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 3 offenses detected

app/models/manageiq/providers/physical_infra_manager.rb

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gtanzillo gtanzillo merged commit 172deef into ManageIQ:master Aug 20, 2018
@gtanzillo gtanzillo added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants