ironic.common.redfish.connector module¶
Async HTTP connector for Redfish using httpx.
- class ironic.common.redfish.connector.AsyncConnector(url, verify=True, default_request_timeout=60, response_callback=None, server_side_retries=3, server_side_retries_delay=2, connect_timeout=None)[source]¶
Bases:
objectAsync HTTP connector using httpx.AsyncClient.
Provides asynchronous HTTP operations for Redfish BMC communication.
- check_retry_on_exception(response)[source]¶
Check if the exception in response should be retried.
This method checks for vendor-specific error conditions that should trigger a retry (e.g., iDRAC not ready, iLO not ready).
- Parameters:
response – httpx.Response object.
- Returns:
True if the request should be retried, False otherwise.
- async delete(path='', headers=None, timeout=None)[source]¶
Async HTTP DELETE method.
- Parameters:
path – Optional sub-URI path to the resource.
headers – Optional dictionary of headers.
timeout – Optional timeout in seconds.
- Returns:
httpx.Response object.
- Raises:
ConnectionError on request failures.
- Raises:
Various HTTP exceptions on HTTP errors.
- async get(path='', headers=None, timeout=None)[source]¶
Async HTTP GET method.
Returns the response object rather than the parsed body so that callers can read headers (notably ETag, needed for conditional updates) and the status code. This matches the other verbs.
- Parameters:
path – Optional sub-URI path to the resource.
headers – Optional dictionary of headers.
timeout – Optional timeout in seconds.
- Returns:
httpx.Response object.
- Raises:
ConnectionError on request failures.
- Raises:
Various HTTP exceptions on HTTP errors.
- async patch(path='', data=None, headers=None, etag=None, timeout=None)[source]¶
Async HTTP PATCH method.
- Parameters:
path – Optional sub-URI path to the resource.
data – Optional JSON data for request body.
headers – Optional dictionary of headers.
etag – Optional eTag string.
timeout – Optional timeout in seconds.
- Returns:
httpx.Response object.
- Raises:
ConnectionError on request failures.
- Raises:
Various HTTP exceptions on HTTP errors.
- async post(path='', data=None, headers=None, timeout=None)[source]¶
Async HTTP POST method.
- Parameters:
path – Optional sub-URI path to the resource.
data – Optional JSON data for request body.
headers – Optional dictionary of headers.
timeout – Optional timeout in seconds.
- Returns:
httpx.Response object.
- Raises:
ConnectionError on request failures.
- Raises:
Various HTTP exceptions on HTTP errors.
- async put(path='', data=None, headers=None, timeout=None)[source]¶
Async HTTP PUT method.
- Parameters:
path – Optional sub-URI path to the resource.
data – Optional JSON data for request body.
headers – Optional dictionary of headers.
timeout – Optional timeout in seconds.
- Returns:
httpx.Response object.
- Raises:
ConnectionError on request failures.
- Raises:
Various HTTP exceptions on HTTP errors.
- set_auth(auth)[source]¶
Set the authentication mechanism.
- Parameters:
auth – Authentication object (AsyncAuthBase instance).
- set_http_basic_auth(username, password)[source]¶
Set HTTP Basic authentication.
- Parameters:
username – Username for basic auth.
password – Password for basic auth.
- set_http_session_auth(session_auth_token)[source]¶
Set session-based authentication.
- Parameters:
session_auth_token – Session authentication token.
- set_sessions_uri(sessions_uri)[source]¶
Record where the Sessions collection lives.
Set by session authentication once it has resolved the URI, so that
_is_sessions_path()can recognise the login request itself rather than guessing from the path.- Parameters:
sessions_uri – URI of the Sessions collection.