xlab-steampunk / redfish-client-python

Minimalistic Redfish API client
Apache License 2.0
4 stars 8 forks source link

Add PUT request method for Redfish resource #27

Closed alexmaslenn closed 2 years ago

alexmaslenn commented 2 years ago

Some scenarios for HPE Storage Controller management would require PUT HTTP method. Currently only POST, PATCH and DELETE are available.

tadeboro commented 2 years ago

Adding support for PUT requests is easy: we just need to add two lines next to https://github.com/xlab-steampunk/redfish-client-python/blob/dab78c7a5be3dbcc03f7c5de08a87dfab5f7a2d8/redfish_client/connector.py#L164-L165

Making this usable from the resource level might be a bit trickier since right now, the code does not support sending requests to arbitrary paths (for example, https://github.com/xlab-steampunk/redfish-client-python/blob/dab78c7a5be3dbcc03f7c5de08a87dfab5f7a2d8/redfish_client/resource.py#L202-L212 is hardcoded to the @odata.id). In the Ruby version of the client, we did add the ability to interact with an arbitrary path on the remote (https://github.com/xlab-steampunk/redfish-client-ruby/blob/269d555dd607c033b38874d8513b12ed2e59c3b2/lib/redfish_client/resource.rb#L202-L214), but the Python version never needed that and thus does not have it implemented.