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

Some resources doesn't return an URI/path #65

Closed piantola closed 8 years ago

piantola commented 8 years ago

The bulk Ethernet network creates a range or multiples VLANs at once, but doesn't return a path. This behavior is expected.

Error output:

vagrant@chef-synergy-dev:/project/oneview-sdk-ruby/examples$ ruby bulk_ethernet_network.rb
Connected to OneView appliance at https://<hostname>
/project/oneview-sdk-ruby/lib/oneview-sdk-ruby/rest.rb:21:in `rest_api': Must specify path (RuntimeError)
        from /project/oneview-sdk-ruby/lib/oneview-sdk-ruby/rest.rb:75:in `rest_get'
        from /project/oneview-sdk-ruby/lib/oneview-sdk-ruby/rest.rb:125:in `response_handler'
        from /project/oneview-sdk-ruby/lib/oneview-sdk-ruby/resource.rb:121:in `create'
        from bulk_ethernet_network.rb:20:in `<main>'
piantola commented 8 years ago

One way to correct this problem is verify at rest.rb whenever the path is nil and set it to BASE_URI of the actual resource or simple ignore it.