poolcontrolpy.poolcontrolpy

Module Contents

Classes

Controller

Controller class representing one nodejs-poolController

_RequestsHandler

Handler class to manage http requests to the controller

Attributes

_LOGGER

RES_CONF

poolcontrolpy.poolcontrolpy._LOGGER
poolcontrolpy.poolcontrolpy.RES_CONF = /config
class poolcontrolpy.poolcontrolpy.Controller(session: aiohttp.ClientSession, host: str, port: int)[source]

Controller class representing one nodejs-poolController

property type(self)

Controller type

property model(self)

Controller model

property version(self)

Controller software version

async checkconnect(self) bool[source]

Check successful connection by inspecting returned controller version

Returns

True for successful connection

Return type

bool

async fetchconfig(self) bool[source]

Fetch the current controller configuration

Returns

True for successful operation

Return type

bool

class poolcontrolpy.poolcontrolpy._RequestsHandler(session: aiohttp.ClientSession, host: str, port)[source]

Handler class to manage http requests to the controller

async get(self, resource: str) str[source]

Method to get resource from Pool Controller API

Parameters

resource (str) – Resource to get with leading ‘/’

Returns

String representing resource body

Return type

str

Raises
  • ResourceTypeError – Error raised when ContentType is not application/json

  • HostError – Error raised when Host refuses connection

  • ResourceError – Error raised when Resource return status code >= 400