HewlettPackard / oneview-sdk-ruby

This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Golang and Python.
Apache License 2.0
12 stars 16 forks source link

Error listing the OS Deployment Plans from OneView #222

Closed marikrg closed 7 years ago

marikrg commented 7 years ago

Scenario/Intent

Error listing the OS Deployment Plans.

For some versions of OneView, the request must be GET '/rest/os-deployment-plans/' (with the slash in the end) instead of GET '/rest/os-deployment-plans'

Environment Details

Steps to Reproduce

Run the example to list all OS Deployment Plans, against the appliance we are using for testing

Expected Result

List all available OS Deployment Plans

Actual Result

D, [2017-03-29T15:06:54.280982 #25450] DEBUG -- : Making :get rest call to https://ipaddr/rest/os-deployment-plans
D, [2017-03-29T15:06:54.281113 #25450] DEBUG -- :   Options: {"X-API-Version"=>"300", "auth"=>"token", "Content-Type"=>"application/json"}
D, [2017-03-29T15:06:55.993928 #25450] DEBUG -- :   Response: Code=405. Headers={"date"=>["Wed, 29 Mar 2017 17:33:22 GMT"], "server"=>["Apache"], "allow"=>["DELETE, POST, PUT"], "content-language"=>["en-US"], "content-type"=>["application/json;charset=UTF-8"], "pragma"=>["no-cache"], "cache-control"=>["no-cache"], "expires"=>["Thu, 01 Jan 1970 00:00:00 GMT"], "connection"=>["close"], "transfer-encoding"=>["chunked"]}
  Body={"nestedErrors":[],"details":"The request method GET is not supported or not applicable for the requested resource.","errorSource":null,"recommendedActions":["Allowed methods include DELETE. Refer to the API specification to determine the supported HTTP request methods for the resource type."],"errorCode":"HTTP_METHOD_NOT_ALLOWED","data":{},"message":"The request method is not supported or not applicable for this type of resource."}
/home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/exceptions.rb:28:in `raise!': 405 {"nestedErrors":[],"details":"The request method GET is not supported or not applicable for the requested resource.","errorSource":null,"recommendedActions":["Allowed methods include DELETE. Refer to the API specification to determine the supported HTTP request methods for the resource type."],"errorCode":"HTTP_METHOD_NOT_ALLOWED","data":{},"message":"The request method is not supported or not applicable for this type of resource."} (OneviewSDK::RequestError)
    from /home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/rest.rb:231:in `response_handler'
    from /home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/resource.rb:282:in `block in find_with_pagination'
    from /home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/resource.rb:280:in `loop'
    from /home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/resource.rb:280:in `find_with_pagination'
    from /home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/resource.rb:265:in `find_by'
    from /home/marikrg/dev/oneview-sdk-ruby/lib/oneview-sdk/resource.rb:295:in `get_all'
    from api300/synergy/os_deployment_plan.rb:17:in `<main>'
aalexmonteiro commented 7 years ago

@marikrg , what appliance are you using(3.00 or 3.10)? This error means that this method is not available by OV and this could be a possible bug on Oneview.

fgbulsoni commented 7 years ago

It was a 300 appliance. I've tried against two different 300 appliances and that error comes up on both. That comes when you use '/rest/os-deployment-plans' while '/rest/os-deployment-plans/' returns the list of resources as expected. P.S. the documentation actually shows /rest/os-deployment-plans/ as the correct URL btw.

aalexmonteiro commented 7 years ago

Ok @fgbulsoni , I understood. Thanks.