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

Floating IPs: Initial API #15524

Merged
merged 2 commits into from
Jul 24, 2017
Merged

Floating IPs: Initial API #15524

merged 2 commits into from
Jul 24, 2017

Conversation

gildub
Copy link
Contributor

@gildub gildub commented Jul 7, 2017

Initial API service definition for FloatingIP with show list

@gildub gildub changed the title Floating IPs api initial Floating IPs: Initial API Jul 7, 2017
@gildub
Copy link
Contributor Author

gildub commented Jul 7, 2017

@chessbyte, could you please assign it?

@chessbyte chessbyte assigned blomquisg and abellotti and unassigned blomquisg Jul 7, 2017
@imtayadeway
Copy link
Contributor

@gildub looks promising - can you add some tests exercising the behavior you've added?

@gildub
Copy link
Contributor Author

gildub commented Jul 12, 2017

@imtayadeway, I added the test file, thanks.

config/api.yml Outdated
:identifier: floating_ip
:options:
- :collection
- :subcollection
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this needed as part of this PR? I suspect that you want to add future support for other collections to have floating ips - if that's the case I would add this line only when you do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, removed

config/api.yml Outdated
:get:
- :name: read
:identifier: floating_ip_show
:subcollection_actions:
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, with everything on this line and below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done.

Copy link
Contributor

@imtayadeway imtayadeway left a comment

Choose a reason for hiding this comment

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

Looks good - just needs a couple things:

  • it looks like you're adding subcollection configuration that's not being used - can you either add tests for this or save that for a future PR?

  • Tests look good, but I thing we need a few more to cover the main paths. Something like:

  • GET /api/floating_ips (200 path)

  • GET /api/floating_ips (403 path)

  • GET /api/floating_ips/:id (200 path)

  • GET /api/floating_ips/:id (403 path)

  • POST /api/floating_ips (with action=query) (200 path)

  • POST /api/floating_ips (with action=query) (403 path)

Thanks!

@gildub
Copy link
Contributor Author

gildub commented Jul 14, 2017

@imtayadeway,

  • I've removed the subcollection
  • I've added tests for the bulk query in spec/requests/api/collections_spec.rb for the query itself (200) and in spec/requests/api/floating_ips_spec.rb for the (403)
  • I've also added the default query in spec/requests/api/collections_spec.rb which I believe makes parts of spec/requests/api/floating_ips_spec.rb redundant

@@ -119,6 +119,11 @@ def test_collection_bulk_query(collection, collection_url, klass, id = nil)
test_collection_query(:flavors, flavors_url, Flavor)
end

it "query FloatingIps" do
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is duplicating some of the tests in the other spec file. If this wasn't obvious then I'd suggest keeping the other ones, but it's up to you 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@imtayadeway, sure although I believe all those test could go in the collection but that would be the purpose of another PR ;)

gildub added 2 commits July 19, 2017 10:39
Initial API service definition for FloatingIP with show list
@miq-bot
Copy link
Member

miq-bot commented Jul 19, 2017

Checked commits https://github.com/gildub/manageiq/compare/93f99db3725c702ab34d2db3211c46fa49823b7c~...9aa40772a22df014bebe3a1c7bbf4376d475b8b3 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks fine. 👍

Copy link
Contributor

@imtayadeway imtayadeway left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks!

@abellotti
Copy link
Member

Thanks @gildub for the API enhancement. This LGTM!! 👍

@abellotti abellotti merged commit f3bf8c7 into ManageIQ:master Jul 24, 2017
@abellotti abellotti added this to the Sprint 65 Ending Jul 24, 2017 milestone Jul 24, 2017
@gildub gildub deleted the floating_IPs_API-initial branch July 31, 2018 04:11
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.

5 participants