StatusCode

class tomcatmanager.models.StatusCode(value)

An enumeration of the various Tomcat Manager web application status codes

tomcatmanager uses the excellent requests library, which uses a custom LookupDict class to store HTTP status codes in a dictionary. After much debate on whether we should do it the requests way, or a more pythonic way, I chose to use a native Enum class instead.

New in version 2.0.0.

OK = 'OK'
FAIL = 'FAIL'
NOTFOUND = 'NOTFOUND'
classmethod parse(code: str)

Return one of the enums from a string sent by the Tomcat Manager web application.

Parameters

state (str) – the string value of the status code from the tomcat server

Returns

StatusCode instance

Return type

tomcatmanager.models.StatusCode

Raises

ValueError – if the string does not represent a known status code