xlab-steampunk / redfish-client-python

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

Support for adding customer headers to each request #41

Closed kwilcox closed 1 year ago

kwilcox commented 1 year ago

Some Redfish implementations (namely OpenBMC) require an If-Match header on some actions. For example, IndicatorLED state requires the etag that was returned from the parent state request. This adds support for passing through additional headers as needed.

Example usage:

etag = node.raw.get('@odata.etag', '*')
node.patch(
    dict(IndicatorLED='Lit'),
    headers={
        "If-Match": etag
    }
)