epicsarchiver_mgmt.archiver.mgmt

Archiver Mgmt operations module.

Attributes

LOG

OperationResult

OperationResultList

Classes

Storage

Represents the different storage levels of the archiver appliance.

PutInfoType

Represents the different types of put type info.

EpicsProto

Represents the different input protocols of the archiver appliance.

SamplingMethod

Represents the different sampling methods of the archiver appliance.

ArchDbrType

List of Dbr Types that the archiver uses.

ArchivePVRequest

Information to archive a PV.

ArchiverMgmt

Mgmt Operations EPICS Archiver Appliance client.

Module Contents

epicsarchiver_mgmt.archiver.mgmt.LOG: logging.Logger[source]
class epicsarchiver_mgmt.archiver.mgmt.Storage[source]

Bases: enum.StrEnum

Represents the different storage levels of the archiver appliance.

STS = 'STS'[source]
MTS = 'MTS'[source]
LTS = 'LTS'[source]
class epicsarchiver_mgmt.archiver.mgmt.PutInfoType(*args, **kwds)[source]

Bases: enum.Enum

Represents the different types of put type info.

Override[source]
CreateNew[source]
epicsarchiver_mgmt.archiver.mgmt.OperationResult[source]
epicsarchiver_mgmt.archiver.mgmt.OperationResultList[source]
class epicsarchiver_mgmt.archiver.mgmt.EpicsProto[source]

Bases: enum.StrEnum

Represents the different input protocols of the archiver appliance.

CA = 'CA'[source]
PVA = 'PVA'[source]
create_archive_request_pv_name(pv: str) str[source]

Return the PV name with the protocol.

Parameters:

pv (str) – The PV name.

Returns:

The PV name with the protocol.

Return type:

str

class epicsarchiver_mgmt.archiver.mgmt.SamplingMethod[source]

Bases: enum.StrEnum

Represents the different sampling methods of the archiver appliance.

SCAN = 'SCAN'[source]
MONITOR = 'MONITOR'[source]
class epicsarchiver_mgmt.archiver.mgmt.ArchDbrType(*args, **kwds)[source]

Bases: enum.Enum

List of Dbr Types that the archiver uses.

DBR_SCALAR_STRING[source]
DBR_SCALAR_SHORT[source]
DBR_SCALAR_FLOAT[source]
DBR_SCALAR_ENUM[source]
DBR_SCALAR_BYTE[source]
DBR_SCALAR_INT[source]
DBR_SCALAR_DOUBLE[source]
DBR_WAVEFORM_STRING[source]
DBR_WAVEFORM_SHORT[source]
DBR_WAVEFORM_FLOAT[source]
DBR_WAVEFORM_ENUM[source]
DBR_WAVEFORM_BYTE[source]
DBR_WAVEFORM_INT[source]
DBR_WAVEFORM_DOUBLE[source]
DBR_V4_GENERIC_BYTES[source]
class epicsarchiver_mgmt.archiver.mgmt.ArchivePVRequest[source]

Information to archive a PV.

pv: str[source]
samplingmethod: SamplingMethod | None = None[source]
samplingperiod: float | None = None[source]
controllingPV: str | None = None[source]
policy: str | None = None[source]
appliance: str | None = None[source]
as_dict() dict[str, str][source]

Return the object as a dictionary.

class epicsarchiver_mgmt.archiver.mgmt.ArchiverMgmt(hostname: str = 'localhost', port: int = 17665)[source]

Bases: epicsarchiver_mgmt.archiver.info.ArchiverMgmtInfo

Mgmt Operations EPICS Archiver Appliance client.

Hold a session to the Archiver Appliance web application and use the mgmt interface.

Parameters:
  • hostname – EPICS Archiver Appliance hostname [default: localhost]

  • port – EPICS Archiver Appliance management port [default: 17665]

archive_pv(pv: str, *, sampling_period: float | None = None, sampling_method: SamplingMethod | None = None, controlling_pv: str | None = None, policy: str | None = None, appliance: str | None = None, protocol: EpicsProto = EpicsProto.CA) OperationResultList[source]

Archive a PV.

Parameters:
  • pv (str) – PV name.

  • sampling_period (str | None, optional) – The sampling period, i.e. 1.0 is 1Hz. Defaults to None.

  • sampling_method (SamplingMethod | None, optional) – The sampling method, SCAN or MONITOR. Defaults to None.

  • controlling_pv (str | None, optional) – A pv to control when to archive this pv. Defaults to None.

  • policy (str | None, optional) – The policy, can be found at /mgmt/bpl/getPolicyList. Defaults to None.

  • appliance (str | None, optional) – Can specify a specific appliance. Defaults to None.

  • protocol (EpicsProto, optional) – Protocol to use. Defaults to EpicsProto.CA.

Returns:

_description_

Return type:

OperationResultList

archive_pv_requests(pv_requests: list[ArchivePVRequest]) OperationResultList[source]

Archive a list of PVs with the given parameters.

Parameters:

pv_requests (list[ArchivePVRequest]) – The pv requests.

Returns:

Result of the operation.

Return type:

OperationResultList

pause_pv(pv: str) OperationResult[source]

Pause the archiving of a PV(s).

Parameters:

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

Returns:

list of submitted PVs

resume_pv(pv: str) OperationResult[source]

Resume the archiving of a PV(s).

Parameters:

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

Returns:

list of submitted PVs

abort_pv(pv: str) OperationResult[source]

Abort any pending requests for archiving this PV.

Parameters:

pv – name of the pv.

Returns:

Status of action and description. Example: {“status”:”ok”,”desc”:”Aborted request for archiving PV PV1”}

Return type:

OperationResult

add_alias(pv: str, alias_name: str) OperationResult[source]

Add an alias to a pv.

Parameters:
  • pv – PV to add alias.

  • alias_name – name of alias to add to pv.

Returns:

Status of action and description.

Return type:

OperationResult

remove_alias(pv: str, alias_name: str) OperationResult[source]

Remove an alias to a pv.

Parameters:
  • pv – PV to remove alias.

  • alias_name – name of alias to remove from pv.

Returns:

Status of action and description.

Return type:

OperationResult

delete_pv(pv: str, delete_data: bool = False) OperationResult[source]

Stop archiving the specified PV.

The PV needs to be paused first.

Parameters:
  • pv – name of the pv.

  • delete_data – delete the data that has already been recorded. Default to False.

Returns:

list of submitted PVs

rename_pv(pv: str, newname: str) OperationResult[source]

Rename this pv to a new name.

The PV needs to be paused first.

Parameters:
  • pv (str) – name of the pv.

  • newname (str) – new name of the pv

Returns:

Status of action and description. Example:

{“status”:”ok”,”desc”:”Successfully renamed PV PV1 to PV2”}

Return type:

OperationResult

update_pv(pv: str, samplingperiod: float | None = None, samplingmethod: str | None = None) OperationResult[source]

Change the archival parameters for a PV.

Parameters:
  • pv – name of the pv.

  • samplingperiod – the new sampling period in seconds.

  • samplingmethod – the new sampling method [SCAN|MONITOR]

Returns:

list of submitted PV

rename_and_append(old: str, new: str, storage: Storage) OperationResult[source]

Appends the data for an older PV into a newer PV.

The older PV is deleted and an alias mapping the older PV name to the new PV is added.

Parameters:
  • old (str) – The name of the older pv. The data for this PV will be appended to the newer PV and then deleted.

  • new (str) – The name of the newer pv.

  • storage (Storage) – The name of the store to consolidate data before appending.

Returns:

Result of the operation

Return type:

OperationResultList

change_type(pv: str, new_type: ArchDbrType) OperationResult[source]

Change the type of a pv to a new type.

Parameters:
Returns:

OperationResult

put_pv_type_info(pv: str, type_info: epicsarchiver_mgmt.archiver.info.TypeInfo, put_info_type: PutInfoType) epicsarchiver_mgmt.archiver.info.TypeInfo[source]

Put the type info for a PV.

Parameters:
  • pv (str) – Name of the PV

  • type_info (InfoResult) – Type info

  • put_info_type (PutInfoType) – Whether override or create new

Returns:

The updated type info

Return type:

OperationResult

get_policy_list() dict[str, str][source]

Get the list of policies.

Returns:

dictionary of policies names and descriptions

property never_connected_pvs: epicsarchiver_mgmt.archiver.info.InfoResultList[source]

Get the never connected PVs of the archiver.

Returns:

List of never connected items.

Return type:

InfoResultList

property appliances_in_cluster: list[dict[str, str]][source]

Get the appliances in the cluster.

Returns:

List of appliances in the cluster.

Return type:

InfoResultList