epicsarchiver.common.base_archiver

Base Archiver Client module for get, post etc requests.

Attributes

LOG

Classes

BaseArchiverAppliance

Base EPICS Archiver Appliance client.

Functions

mgmt_url(→ str)

Generate the mgmt url from a hostname and a port number.

Module Contents

epicsarchiver.common.base_archiver.LOG: logging.Logger[source]
epicsarchiver.common.base_archiver.mgmt_url(hostname: str, port: int) str[source]

Generate the mgmt url from a hostname and a port number.

Parameters:
  • hostname (str) – fqdn of service

  • port (int) – Port number

Returns:

Completed url, for example “http://localhost:17665/mgmt/bpl/

Return type:

str

class epicsarchiver.common.base_archiver.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]

hostname = 'localhost'[source]
port = 17665[source]
mgmt_url = 'http://localhost:17665/mgmt/bpl/'[source]
_info: dict[str, str][source]
_data_url: str | None = None[source]
session[source]
__repr__() str[source]

String representation of Archiver Appliance.

Returns:

details including hostname of Archiver appliance.

Return type:

str

_request(method: str, *args: Any, **kwargs: Any) requests.Response[source]

Sends a request using the session.

Parameters:
  • method – HTTP method

  • *args – Optional arguments

  • **kwargs – Optional keyword arguments

Returns:

requests.Response object

_get(endpoint: str, **kwargs: Any) requests.Response[source]

Send a GET request to the given endpoint.

Parameters:
  • endpoint – API endpoint (relative or absolute)

  • **kwargs – Optional arguments to be sent

Returns:

requests.Response object

_post(endpoint: str, **kwargs: Any) requests.Response[source]

Send a POST request to the given endpoint.

Parameters:
  • endpoint – API endpoint (relative or absolute)

  • **kwargs – Optional arguments to be sent

Returns:

requests.Response object

property info: dict[str, str][source]

EPICS Archiver Appliance information.

property identity: str | None[source]

EPICS Archiver Appliance identity.

property version: str | None[source]

EPICS Archiver Appliance version.

_get_or_post(endpoint: str, pv: str) Any[source]

Send a GET or POST if pv is a comma separated list.

Parameters:
  • endpoint (str) – API endpoint

  • pv (str) – name of the pv. Can be a GLOB wildcards or a list of comma separated names.

Returns:

list of submitted PVs

Return type:

Any