zabgrab.adapters.zabbix.transport¶
HTTP transport for the Zabbix JSON-RPC API.
Functions
|
Get the JSON-RPC endpoint for a server URL. |
Classes
|
Transport over HTTP(S) using aiohttp. |
|
Sends JSON-RPC request bodies and returns decoded responses. |
- zabgrab.adapters.zabbix.transport.api_endpoint(url)[source]¶
Get the JSON-RPC endpoint for a server URL.
- class zabgrab.adapters.zabbix.transport.Transport(*args, **kwargs)[source]¶
Bases:
ProtocolSends JSON-RPC request bodies and returns decoded responses.
- class zabgrab.adapters.zabbix.transport.HttpTransport(url, *, verify_ssl=True, timeout=30.0)[source]¶
Bases:
objectTransport over HTTP(S) using aiohttp.
Network problems are raised as
ConnectionFailedwith a hint.- Parameters:
- async post(body, headers)[source]¶
Send a request body and return the decoded response.
- Parameters:
- Returns:
Any – The decoded JSON response.
- Raises:
Redirected – If the endpoint redirects elsewhere.
ConnectionFailed – If the server can’t be reached or doesn’t respond like Zabbix.
- Return type: