caviar.network

Network module.

caviar.network.http_resource(protocol, host, port, auth, headers)

Create an HTTP resource from root path.

Parameters:
  • protocol (str) – HTTP protocol, such as ‘http’ and ‘https’.
  • host (str) – Host.
  • port (str) – Port.
  • auth – Authentication specification.
  • headers (dict) – Common headers. Each entry contains a list of values.
Return type:

caviar.network.http.HTTPResource

Returns:

The created resource.

caviar.network.ssh_session_factory(ssh_client, private_key_path)

Create an SSH session factory.

Parameters:
  • ssh_client (SSHClient) – SSH client implementation.
  • private_key_path (str) – Path of local private key file.
Return type:

ssh.SSHSessionFactory

Returns:

The created SSH session factory.