epicsarchiver.mgmt.archiver_mgmt_operations

Archiver Mgmt operations module.

Attributes

LOG

TypeInfo

OperationResult

OperationResultList

Classes

Storage

Represents the different storage levels of the archiver appliance.

PutInfoType

Represents the different types of put type info.

ArchiverMgmtOperations

Mgmt Operations EPICS Archiver Appliance client.

Functions

check_result(→ bool)

Check a result returned by the Archiver Appliance.

Module Contents

epicsarchiver.mgmt.archiver_mgmt_operations.LOG: logging.Logger[source]
class epicsarchiver.mgmt.archiver_mgmt_operations.Storage[source]

Bases: str, enum.Enum

Represents the different storage levels of the archiver appliance.

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

Bases: enum.Enum

Represents the different types of put type info.

Override[source]
CreateNew[source]
epicsarchiver.mgmt.archiver_mgmt_operations.TypeInfo[source]
epicsarchiver.mgmt.archiver_mgmt_operations.OperationResult[source]
epicsarchiver.mgmt.archiver_mgmt_operations.OperationResultList[source]
class epicsarchiver.mgmt.archiver_mgmt_operations.ArchiverMgmtOperations(hostname: str = 'localhost', port: int = 17665)[source]

Bases: epicsarchiver.mgmt.archiver_mgmt_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]

Examples:

from epicsarchiver.archiver.mgmt import ArchiverMgmtOperations

archappl = ArchiverMgmtOperations("archiver-01.tn.esss.lu.se")
print(archappl.version)
archappl.archive_pv("PVNAME")
archive_pv(pv: str, **kwargs: Any) OperationResultList[source]

Archive a PV.

Parameters:
  • pv – name of the pv to be achived. Can be a comma separated list of names.

  • **kwargs – optional extra keyword arguments - samplingperiod - samplingmethod - controllingPV - policy - appliance

Returns:

list of submitted PVs

archive_pvs(pvs: OperationResultList) OperationResultList[source]

Archive a list of PVs.

Parameters:

pvs – list of PVs (as dict) to archive

Returns:

list of submitted PVs

archive_pvs_from_files(files: list[str], appliance: str | None = None) OperationResultList[source]

Archive PVs from a list of files.

Parameters:
  • files – list of files in CSV format with PVs to archive.

  • appliance – optional appliance to use to archive PVs (in a cluster)

Returns:

list of submitted PVs

pause_pv(pv: str) OperationResultList | 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) OperationResultList | 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) list[str][source]

Abort any pending requests for archiving this PV.

Parameters:

pv – name of the pv.

Returns:

list of submitted PVs

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

Add an alias to a pv.

Parameters:
  • pv – PV to add alias.

  • alias_name – name of alias to add to pv.

delete_pv(pv: str, delete_data: bool = False) list[str][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, samplingmethod: str | None = None) list[str][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

pause_rename_resume_pv(pv: str, new: str) None[source]

Pause, rename and resume a PV.

Parameters:
  • pv – name of the pv

  • new – new name of the pv

rename_pvs_from_files(files: list[str]) None[source]

Rename PVs from a list of files.

Each PV will be paused, renamed and resumed

Parameters:

files – list of files in CSV format with PVs to rename.

rename_and_append(old: str, new: str, storage: Storage) None[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.

change_type(pv: str, new_type: epicsarchiver.common.ArchDbrType) None[source]

Change the type of a pv to a new type.

Parameters:
put_pv_type_info(pv: str, type_info: TypeInfo, put_info_type: PutInfoType) 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

epicsarchiver.mgmt.archiver_mgmt_operations.check_result(result: OperationResult | OperationResultList, default_message: str | None = None) bool[source]

Check a result returned by the Archiver Appliance.

Parameters:
  • result (OperationResult | OperationResultList) – Input result type

  • default_message (str | None, optional) – Message for the user. Defaults to None.

Returns:

Return True if the status is ok

Return False otherwise and print the default_message or validation value

Return type:

bool