theforeman / foreman_rh_cloud

a plugin to Foreman that generates and uploads reports to the Red Hat cloud
GNU General Public License v3.0
6 stars 32 forks source link

Add backend changes for missing hosts #821

Closed chris1984 closed 1 year ago

chris1984 commented 1 year ago

Getting data back on get method :)

19:21:52 rails.1   | 2023-05-19T19:21:52 [I|app|9d49580f] Started GET "/api/v2/organizations/3/rh_cloud/missing_hosts" for 192.168.196.1 at 2023-05-19 19:21:52 -0400
19:21:52 rails.1   | 2023-05-19T19:21:52 [I|app|9d49580f] Processing by Api::V2::RhCloud::InventoryController#get_hosts as JSON
19:21:52 rails.1   | 2023-05-19T19:21:52 [I|app|9d49580f]   Parameters: {"apiv"=>"v2", "organization_id"=>"3"}
19:21:52 rails.1   | 2023-05-19T19:21:52 [D|app|9d49580f] Body: {"id":1,"name":"foo.example.com","organization_id":3,"insights_id":"111-222","rhsm_id":"111-222","ip_address":"192.168.196.1"}
chris1984 commented 1 year ago

@ShimShtein updated, want me to start working on tests for the get/index controller methods or do you have something else in mind for the next steps?

chris1984 commented 1 year ago

@ShimShtein Added the POST methods and got the permissions fixed up, let me know how this looks. I am sure it looks like 💩 🙃

chris1984 commented 1 year ago

Looks quite good actually. A couple of smaller comments and we're there.

@shim Thanks 😃 also removed the rescue from the POST in the inventory controller as well. Marked it ready for review and removed it out of DRAFT status.

ShimShtein commented 1 year ago

@chris1984 , could you please rebase this one?

chris1984 commented 1 year ago

@ShimShtein updated :)

chris1984 commented 1 year ago

@ShimShtein can this get a merge?