ironicclient.common.http module

ironicclient.common.http module

class ironicclient.common.http.HTTPClient(endpoint, **kwargs)[source]

Bases: ironicclient.common.http.VersionNegotiationMixin

json_request(method, url, **kwargs)[source]
log_curl_request(method, url, kwargs)[source]
static log_http_response(resp, body=None)[source]
raw_request(method, url, **kwargs)[source]
class ironicclient.common.http.SessionClient(os_ironic_api_version, api_version_select_state, max_retries, retry_interval, endpoint=None, **kwargs)[source]

Bases: ironicclient.common.http.VersionNegotiationMixin, keystoneauth1.adapter.LegacyJsonAdapter

HTTP client based on Keystone client session.

json_request(method, url, **kwargs)[source]
raw_request(method, url, **kwargs)[source]
class ironicclient.common.http.VerifiedHTTPSConnection(host, port, key_file=None, cert_file=None, ca_file=None, timeout=None, insecure=False)[source]

Bases: httplib.HTTPSConnection

httplib-compatible connection using client-side SSL authentication

:see http://code.activestate.com/recipes/
577548-https-httplib-client-connection-with-certificate-v/
connect()[source]

Connect to a host on a given (SSL) port.

If ca_file is pointing somewhere, use it to check Server Certificate.

Redefined/copied and extended from httplib.py:1105 (Python 2.6.x). This is needed to pass cert_reqs=ssl.CERT_REQUIRED as parameter to ssl.wrap_socket(), which forces SSL to check server certificate against our client certificate.

static get_system_ca_file()[source]

Return path to system default CA file.

class ironicclient.common.http.VersionNegotiationMixin[source]

Bases: object

negotiate_version(conn, resp)[source]

Negotiate the server version

Assumption: Called after receiving a 406 error when doing a request.

Parameters:
  • conn – A connection object
  • resp – The response object from http request
ironicclient.common.http.get_server(url)[source]

Extract and return the server & port.

ironicclient.common.http.with_retries(func)[source]

Wrapper for _http_request adding support for retries.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.