Skip to content

ECNConfig

Part of Configuration & authentication in the Python API reference.

Related guidance: getting-started/configuration, getting-started/authentication, security/credentials.

Runnable examples: preflight.py.

from picogrid_ecn_client import ECNConfig

Configure one immutable SDK MQTT v5 connection.

ECNConfig(
*,
host: str,
integration_name: str,
terminal_id: UUID | None = None,
mqtt_port: int,
ntp_host: str | None = None,
ntp_port: int = 123,
auth: BearerTokenAuth | MTLSAuth | NoAuth,
tls: TLSConfig = TLSConfig(),
wire_format: WireFormat = WireFormat.JSON,
connection_timeout: float = 10.0,
operation_timeout: float = 30.0,
task_timeout: float = 10.0,
shutdown_timeout: float = 5.0,
reconnect_policy: ReconnectPolicy = ReconnectPolicy(),
watcher_buffer_size: int = 256,
maximum_payload_size: int = 1048576,
maximum_outstanding_operations: int = 128,
allow_insecure: bool = False,
plaintext_container_network: ReviewedContainerNetwork | None = None,
)

Source · config.py

NameTypeRequiredDefaultConstraintsDescription
hoststryesmin_length=1, max_length=1024DNS name or IP literal without scheme, port, credentials, whitespace, or path, from 1 through 1024 characters.
integration_namestryesmin_length=2, max_length=128, pattern='^[A-Za-z0-9][A-Za-z0-9_-]{0,126}[A-Za-z0-9]$'Integration name of 2 through 128 allowed ASCII characters; starts and ends alphanumeric; ‘geolocation’ and ‘response’ are reserved case-insensitively.
terminal_idUUID | NonenoNoneOptional canonical connected-terminal UUID used for task source and addressed response routing.
mqtt_portintyesge=1, le=65535Explicit MQTT port, from 1 through 65,535.
ntp_hoststr | NonenoNonemin_length=1, max_length=1024Optional NTP host for the ECN-relative clock diagnostic, from 1 through 1024 characters. When unset the diagnostic measures host, so set this only for a separately provided endpoint.
ntp_portintno123ge=1, le=65535NTP port used by the clock diagnostic, from 1 through 65,535.
authBearerTokenAuth | MTLSAuth | NoAuthyesBearer-token, mutual-TLS, or no-authentication configuration.
tlsTLSConfignoTLSConfig()TLS settings; defaults to enabled peer-verified TLS.
wire_formatWireFormatnoWireFormat.JSONEntity and location payload encoding; defaults to JSON over MQTT v5.
connection_timeoutfloatno10.0gt=0, le=120Connect-stage timeout in seconds, greater than 0 through 120.
operation_timeoutfloatno30.0gt=0, le=300General operation and observed-update timeout in seconds, greater than 0 through 300.
task_timeoutfloatno10.0gt=0, le=3600Default task response timeout in seconds, greater than 0 through 3,600.
shutdown_timeoutfloatno5.0gt=0, le=60Whole-client cleanup timeout in seconds, greater than 0 through 60.
reconnect_policyReconnectPolicynoReconnectPolicy()Typed exponential reconnect, jitter, stable-reset, and retry-budget policy.
watcher_buffer_sizeintno256ge=1, le=100000Maximum buffered events per watcher, from 1 through 100,000.
maximum_payload_sizeintno1048576ge=1024, le=16777216Maximum accepted or emitted payload in bytes, from 1,024 through 16,777,216 bytes.
maximum_outstanding_operationsintno128ge=1, le=10000Maximum correlated task operations, from 1 through 10,000.
allow_insecureboolnoFalseWhether plaintext or unverified TLS is permitted for loopback mock endpoints; defaults to false.
plaintext_container_networkReviewedContainerNetwork | NonenoNoneExplicit attestation that plaintext MQTT is confined to one reviewed container network; requires TLS to be disabled and authentication kind to be ‘none’; defaults to null.

Version 0.2.0 · branch main