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

Added new firmware collection api #14476

Merged
merged 6 commits into from
Apr 24, 2017

Conversation

rodneyhbrown7
Copy link

@rodneyhbrown7 rodneyhbrown7 commented Mar 23, 2017

Adds a REST API for firmware elements
updates the product features yaml file
Adds a firmwares_controller

@@ -14,6 +14,7 @@ module EmsRefresh
extend EmsRefresh::SaveInventoryConfiguration
extend EmsRefresh::SaveInventoryAutomation
extend EmsRefresh::SaveInventoryOrchestrationStacks
extend EmsRefresh::SaveInventoryPhysicalInfra
Copy link
Member

Choose a reason for hiding this comment

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

@@ -20,6 +20,7 @@ def save_ems_inventory(ems, hashes, target = nil)
when ManageIQ::Providers::StorageManager then save_ems_storage_inventory(ems, hashes, target)
when ManageIQ::Providers::MiddlewareManager then save_ems_middleware_inventory(ems, hashes, target)
when ManageIQ::Providers::DatawarehouseManager then save_ems_datawarehouse_inventory(ems, hashes, target)
when ManageIQ::Providers::PhysicalInfraManager then save_ems_physical_infra_inventory(ems, hashes, target)
Copy link
Member

@juliancheal juliancheal Mar 24, 2017

Choose a reason for hiding this comment

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

This line is already in master https://github.com/ManageIQ/manageiq/blob/master/app/models/ems_refresh/save_inventory.rb#L14

We have alias for EmsCloud, EmsInfra, and EmsPhysicalInfra which is why it's not written out fully and you may not have noticed it.

@miq-bot
Copy link
Member

miq-bot commented Mar 24, 2017

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Mar 24, 2017

This pull request is not mergeable. Please rebase and repush.

@skovic
Copy link

skovic commented Apr 13, 2017

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] Update firmware api Update firmware api Apr 13, 2017
@miq-bot miq-bot removed the wip label Apr 13, 2017
config/api.yml Outdated
:description: Firmwares
:options:
- :collection
- :subcollection
Copy link
Member

Choose a reason for hiding this comment

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

which primary collection is declaring this as a subcollection ?

Copy link
Author

Choose a reason for hiding this comment

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

This should be the PhysicalServer collection. The PhysicalServer collection is defined in PR #14028.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rodneyhbrown7 it looks like in the linked PR it's not declaring this as a subcollection. It may be best to leave this out in this PR, or until you are ready to add it to the phyical server config

Copy link

Choose a reason for hiding this comment

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

@abellotti @imtayadeway @rodneyhbrown7 I removed the firmwares subcollection option for now. If this PR gets merged before the linked PR (#14028), the linked PR will be updated to add this as a subcollection.


it 'query Firmwares' do
FactoryGirl.create(:firmware)
test_collection_query(:firmwares, "/api/firmwares", Firmware)
Copy link
Member

Choose a reason for hiding this comment

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

leverage firmwares_url() for all tests.

expect_single_resource_query("resource_id" => 1)
end
end
end
Copy link
Member

Choose a reason for hiding this comment

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

add test for invalid role and such.

expect_single_resource_query("id" => 1)
expect_single_resource_query("name" => "UEFI")
expect_single_resource_query("version" => "D7E152CUS-2.11")
expect_single_resource_query("resource_id" => 1)
Copy link
Member

Choose a reason for hiding this comment

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

these can be a single call, expect_single_resource_query("id" => 1, "name" => ...)

@abellotti abellotti requested a review from imtayadeway April 18, 2017 11:54
@abellotti
Copy link
Member

/cc @imtayadeway

@abellotti
Copy link
Member

Ping @imtayadeway can I borrow your 👀 for a quick review here ? Thanks !! 🎵

@skovic skovic force-pushed the update_firmware_api branch from b65d306 to e7b1458 Compare April 20, 2017 19:08
describe "display firmware details" do
context "with a valid role" do
it "shows its properties" do
fw = FactoryGirl.create(:firmware, :id => 1, :name => "UEFI",
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably don't want to set the id here - that's the database's job and could result in some erratic behavior


context "with an invalid role" do
it "fails to show its properties" do
fw = FactoryGirl.create(:firmware, :id => 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

As above

@imtayadeway
Copy link
Contributor

@abellotti @rodneyhbrown7 this LGTM with just a couple of nits above 👍

@miq-bot
Copy link
Member

miq-bot commented Apr 21, 2017

Checked commits rodneyhbrown7/manageiq@36bf074~...6266155 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks good. 🍪

@abellotti
Copy link
Member

Thanks @rodneyhbrown7 for enhancing the API.

@abellotti abellotti added this to the Sprint 59 Ending Apr 24, 2017 milestone Apr 24, 2017
@abellotti abellotti merged commit 5e00d4d into ManageIQ:master Apr 24, 2017
@abellotti abellotti changed the title Update firmware api Added new firmwares collection api Apr 24, 2017
@abellotti abellotti changed the title Added new firmwares collection api Added new firmware collection api Apr 24, 2017
@rodneyhbrown7 rodneyhbrown7 deleted the update_firmware_api branch January 12, 2018 13:21
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