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

REST methods should handle redirects #145

Closed
jsmartt opened this issue Jan 27, 2017 · 4 comments
Closed

REST methods should handle redirects #145

jsmartt opened this issue Jan 27, 2017 · 4 comments

Comments

@jsmartt
Copy link
Collaborator

jsmartt commented Jan 27, 2017

Scenario/Intent

The REST methods should handle redirects. One issue I've already run into is that for Synergy Enclsoures, trying to get the script (enc.script) gives a 301 error message saying it has moved to a LogicalEnclosure uri.

I think we could implements something pretty similar to this, where we only follow redirects up to 3 or 5 times.

Because we need the data to re-submit the request, we'll need to handle this in the rest_api method, not response_handler.

Environment Details

  • OneView SDK Version: 3.1.0
  • OneView Appliance Version: All
  • OneView Client API Version: All

Steps to Reproduce

With a client using api_version 300 as @client, talking to a v300 DCS...

@client.api_version = 300
OneviewSDK.api_version = 300
OneviewSDK::API300.variant = 'Synergy'

e = @client.get_all(:Enclosures).first
e.script

Expected Result

It to be able to get the script (following any redirects needed to get there)

Actual Result

I get this error:

OneviewSDK::RequestError: 301
from /usr/local/rvm/gems/ruby-2.2.4/gems/oneview-sdk-3.1.0/lib/oneview-sdk/rest.rb:162:in `response_handler'
@jsmartt
Copy link
Collaborator Author

jsmartt commented Feb 1, 2017

@tmiotto , @ricardogpsf , @aalexmonteiro , @fgbulsoni or @piantola , do any of you have any concerns with this, or shall I implement it?

@tmiotto
Copy link
Contributor

tmiotto commented Feb 1, 2017

@jsmartt I have one concern that is to avoid being eternally redirected, maybe we should have a limit for it, or timeout.

By the way, I'm okay with you implementing it.

@jsmartt
Copy link
Collaborator Author

jsmartt commented Feb 1, 2017

@tmiotto , correct. We'd definitely have to set a limit

@ricardogpsf
Copy link
Member

@jsmartt I'm okay too with the idea of implementation.

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

No branches or pull requests

3 participants