epicsarchiver_mgmt.archiver.base
Base Archiver HTTP client module.
Attributes
Exceptions
Base class for all exceptions raised by the archiver HTTP client. |
|
Exception raised when there is a connection error with the archiver. |
|
Exception raised when the archiver returns an unexpected response. |
Classes
Base EPICS Archiver Appliance client. |
Functions
|
Generate the mgmt url from a hostname and a port number. |
Module Contents
- epicsarchiver_mgmt.archiver.base.LOG: logging.Logger[source]
- epicsarchiver_mgmt.archiver.base.mgmt_url(hostname: str, port: int) str[source]
Generate the mgmt url from a hostname and a port number.
- Parameters:
- Returns:
Completed url, for example “http://localhost:17665/mgmt/bpl/”
- Return type:
- exception epicsarchiver_mgmt.archiver.base.ArchiverError[source]
Bases:
epicsarchiver_mgmt.exceptions.BaseMgmtErrorBase class for all exceptions raised by the archiver HTTP client.
- exception epicsarchiver_mgmt.archiver.base.ArchiverConnectionError(base_url: str, message: str | None = None)[source]
Bases:
ArchiverErrorException raised when there is a connection error with the archiver.
- exception epicsarchiver_mgmt.archiver.base.ArchiverResponseError(base_url: str, url: str | None = None, response: str | None = None, message: str | None = None)[source]
Bases:
ArchiverErrorException raised when the archiver returns an unexpected response.
- class epicsarchiver_mgmt.archiver.base.BaseArchiverAppliance(hostname: str = 'localhost', port: int = 17665)[source]
Base EPICS Archiver Appliance client.
Hold a session to the Archiver Appliance web application.
- Parameters:
hostname – EPICS Archiver Appliance hostname [default: localhost]
port – EPICS Archiver Appliance management port [default: 17665]
- __repr__() str[source]
String representation of Archiver Appliance.
- Returns:
details including hostname of Archiver appliance.
- Return type:
- _request(method: str, url: str, params: dict[str, str | list[str]] | dict[str, str] | None = None, data: str | dict[str, str] | None = None, json_data: Any | None = None) requests.Response[source]
Send a request using the session.
- Parameters:
method – HTTP method
url – The URL to send the request to
params – Optional arguments
data – Optional data to be sent
json_data – Optional JSON data to be sent
- Returns:
requests.Responseobject- Raises:
ArchiverConnectionError – If there is a connection error.
ArchiverResponseError – If the response is not successful.
- _get(endpoint: str, params: dict[str, str | list[str]] | dict[str, str] | None = None) requests.Response[source]
Send a GET request to the given endpoint.
- Parameters:
endpoint – API endpoint (relative or absolute)
params – Optional arguments to be sent
- Returns:
requests.Responseobject
- _post(endpoint: str, params: dict[str, str | list[str]] | dict[str, str] | None = None, data: str | dict[str, str] | None = None, json_data: Any | None = None) requests.Response[source]
Send a POST request to the given endpoint.
- Parameters:
endpoint – API endpoint (relative or absolute)
params – Optional arguments to be sent
data – Optional data to be sent
json_data – Optional JSON data to be sent
- Returns:
requests.Responseobject