# watcherclient.common.httpclient module

class watcherclient.common.httpclient.HTTPClient(endpoint, **kwargs)

  Bases: `VersionNegotiationMixin`

  json_request(method, url, **kwargs)
  log_curl_request(method, url, kwargs)
  static log_http_response(resp, body=None)
  raw_request(method, url, **kwargs)

class watcherclient.common.httpclient.SessionClient(os_infra_optim_api_version, api_version_select_state, max_retries, retry_interval, endpoint, **kwargs)

  Bases: `VersionNegotiationMixin`, `LegacyJsonAdapter`

  HTTP client based on Keystone client session.

  json_request(method, url, **kwargs)
  raw_request(method, url, **kwargs)

class watcherclient.common.httpclient.VerifiedHTTPSConnection(host, port, key_file=None, cert_file=None, ca_file=None, timeout=None, insecure=False)

  Bases: `HTTPSConnection`

  httplib-compatible connection using client-side SSL authentication

  :see http://code.activestate.com/recipes/

    577548-https-httplib-client-connection-with-certificate-v/

  connect()

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

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

  static get_system_ca_file()

    Return path to system default CA file.

class watcherclient.common.httpclient.VersionNegotiationMixin

  Bases: `object`

  negotiate_version(conn, resp)

    Negotiate the server version

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

    param conn: A connection object param resp: The response object from http request

watcherclient.common.httpclient.get_server(endpoint)

  Extract and return the server & port that we’re connecting to.

watcherclient.common.httpclient.with_retries(func)

  Wrapper for _http_request adding support for retries.

this page last updated: 2026-03-26 21:48:01

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

found an error? report a bug