server_description – An object representation of a server the driver is connected to. (original) (raw)
Toggle table of contents sidebar
Represent one server the driver is connected to.
See also
This module is compatible with both the synchronous and asynchronous PyMongo APIs.
class pymongo.server_description.ServerDescription¶
Immutable representation of one server.
Parameters:
- address (_Address) – A (host, port) pair
- hello (Optional [ Hello ]) – Optional Hello instance
- round_trip_time (Optional _[_float]) – Optional float
- error (Optional _[_Exception]) – Optional, the last error attempting to connect to the server
- round_trip_time – Optional float, the min latency from the most recent samples
- min_round_trip_time (float)
property address_: Tuple[str, int | None]_¶
The address (host, port) of this server.
property all_hosts_: set[tuple[str, int]]_¶
List of hosts, passives, and arbiters known to this server.
property error_: Exception | None_¶
The last error attempting to connect to the server, or None.
property min_round_trip_time_: float_¶
The min latency from the most recent samples.
property primary_: tuple[str, int] | None_¶
This server’s opinion about who the primary is, or None.
property replica_set_name_: str | None_¶
Replica set name or None.
property retryable_reads_supported_: bool_¶
Checks if this server supports retryable writes.
property retryable_writes_supported_: bool_¶
Checks if this server supports retryable writes.
property round_trip_time_: float | None_¶
The current average latency or None.
The type of this server.
property server_type_name_: str_¶
The server type as a human readable string.
Added in version 3.4.